Quickstart
2
3
4
Step 4: Deploy an Agent
const agent = await client.agents.deploy({
accountAddress: account.address,
name: 'my-first-agent',
metadataUri: 'ipfs://Qm...',
policy: {
spendLimit: '100 USDC/day',
allowedAssets: ['USDC', 'ETH'],
timeWindow: '00:00-23:59 UTC',
},
});
console.log('Agent ID:', agent.agentId);5
Step 5: Fund the Agent and Run
// Transfer 10 USDC to the agent's execution account
await client.accounts.fund({
agentId: agent.agentId,
asset: 'USDC',
amount: '10',
});
// Execute an action — policy is automatically enforced
const result = await agent.execute({
target: '0xContractAddress',
calldata: encodedCalldata,
});Next Steps
Last updated
