Tokens and ENS
AGENSAI accepts ENS names everywhere a recipient is expected, and accepts symbolic token amounts everywhere a value is expected.
ENS resolution
Anywhere the SDK takes a to address, you can pass:
- An ENS name (
treasury.acme.eth,my-agent.agensai.eth) - A
0xhex address
ENS resolution happens automatically against the chain's resolver. Subnames issued by AGENSAI resolve immediately on issuance — no propagation delay.
Token amounts
Anywhere the SDK takes a value, you can pass:
agent.execute({ to: "bob.eth", amount: "10 USDC" });
agent.execute({ to: "bob.eth", amount: "0.05 ETH" });
agent.execute({ to: "bob.eth", value: 50_000_000n }); // raw units, USDC has 6 decimals
agent.execute({ to: "bob.eth", value: 50_000_000_000_000_000n }); // raw units, ETH has 18 decimalsThe string parser is forgiving: "10 USDC", "10USDC", and "10 usdc" all work.
Supported tokens (default registry)
| Symbol | Notes |
|---|---|
ETH | Native gas token |
USDC | Resolved to canonical USDC on the active chain |
USDT | Resolved to canonical USDT on the active chain |
DAI | Resolved to canonical DAI on the active chain |
WETH | Wrapped Ether |
For any other token, pass the contract address (or ENS name pointing at the contract) directly.
Custom registry
import { createAgent } from "@agensai/sdk";
await createAgent({
name: "my-agent",
// ...
tokenRegistry: {
XYZ: "0xabcd...",
},
});Custom entries override the default registry.