Skip to main content

Package

viem, zod, and @newton-xyz/policy-pack-shared are peer dependencies. Vendor SDKs, such as @morpho-org/blue-sdk-viem, are optional peer dependencies so applications only install the vault integrations they use.

Supported Chains

Calling createShield on an unsupported chain errors before sending a transaction.

createShield

Creates or attaches to a Shield for a curator and vault. A newly created Shield client normally requires setParams(...) and uploadSecrets(...) before it can evaluate the selected policy.

Parameters

Return Value

Calling createShield returns a Shield client object with these properties.

setParams

Configures a newly created Shield contract or reconfigures an existing one with serialized policy params. Uses the attestationExpiration value from Shield client creation.

Parameters

uploadSecrets

Uploads required API secrets used by the selected policy pack. Values are encrypted in the SDK and stored with Newton Gateway for policy evaluation.

Parameters

Shield Runtime

The Shield runtime turns a typed call into:
  1. Intent construction
  2. Newton AVS policy evaluation
  3. Policy attestation retrieval
  4. Onchain execution through the Shield contract
The Shield client uses typed vendor overlays for supported protocols and keeps sendCall(...) as the escape hatch for unwrapped vendors.

Morpho Module

The Morpho module exposes manager actions under shield.morpho.*. reallocate is positional in the published module:
The overlay wraps MetaMorpho manager and allocator actions such as setCurator, setIsAllocator, submitCap, acceptCap, setSupplyQueue, updateWithdrawQueue, and reallocate. End-user deposit, mint, withdraw, and redeem flows are not wrapped.

sendCall

For vendors or actions without a first-class module, use sendCall. This function requires you to encode calldata for the delegated contract call yourself. Pack-specific prepareQueryOptions tell the composite policy what must be evaluated for this call.
When using sendCall, the integration owns intent integrity for the target call. Use 'DIRECT' for the current curator path. The lower-level runtime also has an attestation mode path for deployments that support it.

Composite Manifest

shield.setParams(...) writes a versioned UTF-8 JSON manifest into NewtonPolicy.PolicyConfig.policyParams. The manifest is the shape operators read and the AVS validates:
For the full verifier path and introspectComposite(...), see Composite Policy Packs.

Policy Packs

Policy packs are developed in newt-foundation/newton-policy-packs and are available as subpath imports:
Each pack provides typed params and helper logic for freshness-bound policy inputs.

Errors

The SDK error hierarchy includes:

See Also