The SDK exports two convenience objects: USDC for contract addresses and CHAIN_ID for network identifiers. These cover the four chains Mandate supports. Use them instead of hardcoding addresses and chain IDs in your agent code.
Your runtime key prefix determines which chains your agent can use.
Key prefix
Environment
Chains
mndt_test_*
Testnet
Ethereum Sepolia, Base Sepolia
mndt_live_*
Production
Ethereum Mainnet, Base Mainnet
Test keys only work with testnet chains. Live keys only work with mainnet chains. If you pass a testnet chain ID with a live key, the API returns a 422 error.
Use test keys during development. They connect to the same policy engine and return the same validation responses, but all transactions go to Sepolia testnets where tokens have no real value.
Copy
Ask AI
import { MandateClient, USDC, CHAIN_ID } from '@mandate.md/sdk';const client = new MandateClient({ runtimeKey: process.env.MANDATE_RUNTIME_KEY!, // mndt_test_* for testnet});const result = await client.validate({ action: 'transfer', amount: '5', to: '0xRecipientAddress', token: 'USDC', chain: String(CHAIN_ID.BASE_SEPOLIA), reason: 'Test payment for development',});