Read methods
Setup
The Newton protocol integrates with viem. Install and import the Newton SDK, then extend a PublicClient.
Note: Many policy-related SDK methods accept an optional policyContractAddress. Pass it to scope reads to a specific policy.
Policy
getPolicyCid
SignaturegetMetadataCid
SignaturesupportsInterface
Signatureowner
Signaturefactory
Signatureentrypoint
SignaturegetSchemaCid
SignaturepolicyData
SignatureclientToPolicyId
SignaturegetPolicyId
SignaturegetPolicyConfig
SignatureprecomputePolicyId
SignatureTasks
waitForTaskResponded
SignaturegetTaskStatus
SignaturegetTaskResponseHash
SignatureWrite methods
Setup
Extend a WalletClient with Newton wallet actions.
Note: policyContractAddress is optional overall, but required for policy write functions.
Tasks
submitEvaluationRequest
Signature- Choose
timeoutcarefully (too short → failures; too long → locks resources). intentmust match the evaluator’s expected schema.- Providing both
quorumNumberandquorumThresholdPercentageoverrides policy defaults. wasmArgsis raw data; ensure correct encoding for the WASM module.
Policy
initialize
Signature- Call once only; re-initialization may revert or corrupt state.
- Ensure
policyUriandschemaUriare correct and immutable.
renounceOwnership
Signature- Permanent; no owner afterward.
- Owner-restricted functions become unusable.
transferOwnership
Signature- Validate
newOwnercarefully. - If
newOwneris a contract, ensure it correctly handles ownership.