Skip to main content
Newton VaultKit sits beside the vault SDK you already use. Your app prepares the same manager action it would normally send to a vault, then routes execution through a Shield that requires a Newton attestation. This guide shows the common VaultKit setup and the typed Morpho path most curators should start with: defineComposite(...), createShield(...), grant the clone its manager role, then call shield.morpho.reallocate(...). For Morpho-specific curator guidance, including Base Sepolia setup and MetaMorpho role requirements, see Morpho. For Euler-specific typed overlays, see Euler and Euler Earn. For lower-level examples, see Examples.

Prerequisites

  • Node 22 or newer
  • pnpm 10 or newer, or the package manager your app already uses
  • A funded curator EOA or Safe-controlled signer on the target chain
  • A Newton Gateway API key from the dashboard
  • The vault protocol SDKs your integration uses

Install Packages

VaultKit integrations use a core SDK package, a shared policy-pack helper package, one or more individual policy packs, and optionally a vendor SDK.

Core Packages

Install these for every VaultKit integration:

Individual Policy Packs

Install each policy pack your Shield should enforce. For the Vaults.fyi example in this guide:
For the currently documented vault policy packs:

Vendor SDKs

Install vendor SDKs only when your app uses them directly. The typed Morpho overlay uses Morpho’s published SDK under the hood, so Morpho integrations install the Morpho peer dependency:
If you use shield.sendCall(...) and encode calldata yourself, you do not need a vendor SDK. Prefer typed vendor overlays when VaultKit ships one for your protocol.

1. Create Viem Clients

VaultKit reads chain state through a publicClient and submits transactions through a walletClient.
For a Safe multisig owner, use the Safe-aware signer path your application already supports. Shield ownership is independent of the transaction transport.

2. Build a Policy Pack

Policy packs define the typed params, secrets, and per-call wasmArgs used during Newton operator evaluation. For composite policies, wrap the modules you want to enforce:

3. Create or Attach to a Shield

createShield is idempotent. It predicts the deterministic Shield address from the curator, vault, and version. If a clone exists with compatible configuration, the SDK attaches to it; otherwise it deploys a new clone through ShieldFactory. If you expect an existing clone, pass the known address and expected params:
If the onchain policy address or params differ from expectedParams, the SDK throws a typed configuration error instead of silently using the wrong Shield.

4. Configure Policy Params and Secrets

setParams writes typed policy params onchain through the Shield’s bound Newton policy. uploadSecrets encrypts API secrets in the SDK and stores them with Newton Gateway so operators can evaluate policies without exposing credentials onchain.

5. Grant the Shield Its Roles

execute and executeDirect are gated by Shield’s approved-delegate map. The initial owner is approved at clone initialization, but any hot key or Safe module that will submit actions through the Shield must be explicitly approved:
The Shield clone also needs the vendor-side manager role required by the action. For MetaMorpho reallocate, grant the clone allocator authority, or make it the curator:

6. Execute a Morpho Action

For Morpho, use the typed overlay. It builds the MetaMorpho calldata through Morpho’s SDK, lets the composite pack derive wasmArgs, requests the Newton attestation, and submits executeDirect.
The SDK builds the exact Intent, signs it with the curator wallet, asks Newton operators to evaluate the configured policy, and submits the attested call through the Shield. If the policy denies the action, the SDK raises a typed policy error and the vault call is not forwarded. Use shield.sendCall(...) only for vendors or actions without a typed overlay. With sendCall, your integration owns the target, calldata, function signature, and any pack-specific per-call inputs.

7. Handle Policy Errors

See Errors for retry guidance.

Next Steps

Concepts

Learn how Intent, wasmArgs, policy packs, and vendor modules fit together.

Examples

Copy patterns for idempotent deploys, generic calls, retries, and read-only inspection.

Reference

Review the SDK API surface.