@quillai-network/mandate-verification-sdk
v0.1.0
Published
A complete SDK for building, signing, verifying, and validating Mandates in the ERC-8004 agent ecosystem
Readme
Mandate Verification SDK
Lightweight TypeScript SDK for submitting mandate validation requests through QuillAI Validation Router. The package currently exposes a single entry point:
ValidationClient– pins proof data to Pinata and calls the Validation Registry contract.
Installation
npm install @quillai-network/mandate-verification-sdk ethersThe published artifact targets modern ESM runtimes (Node.js ≥ 18) and ships compiled JS plus type definitions.
Quick start
import { ValidationClient } from '@quillai-network/mandate-verification-sdk';
import { swapV1 } from '@quillai-network/primitives';
const validationClient = new ValidationClient({
pinataJwt: process.env.PINATA_JWT!,
pinataGateway: 'https://gateway.pinata.cloud',
privateKey: process.env.PRIVATE_KEY!,
rpcUrl: process.env.SEPOLIA_RPC!,
chain: 'ethereum-sepolia',
});
const proof = await validationClient.uploadProof({
agentId: '1475',
timestamp: Date.now(),
result: 'Swap executed successfully.',
executionId: 'execution_123',
txHash: '0xabc...',
actionDetails: swapV1({
chainId: 11155111,
tokenIn: '0x...',
tokenOut: '0x...',
amountIn: '1000000000000000000',
minOut: '950000000000000000',
recipient: '0x...',
deadline: '0',
}),
mandate: mandateJson,
});
const { requestUri, hashBytes, transactionHash } =
await validationClient.requestValidation(proof.cid);
console.log({ requestUri, hashBytes, transactionHash });Chain defaults include the validator address and agent ID for Ethereum Sepolia. Override validatorAddress, agentId, or validationContractAddress in the config when targeting a different deployment. You can also supply a custom requestHashSeed to requestValidation if the hash must be computed externally.
Development
npm install
npm test # runs the simple ValidationClient integration smoke test
npm run buildnpm run build compiles sources to dist/ and emits declaration files. npm publish automatically runs clean/test/build via prepublishOnly.
License
MIT © QuillAI-Network
