Skip to content

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 0x hex 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 decimals

The string parser is forgiving: "10 USDC", "10USDC", and "10 usdc" all work.

Supported tokens (default registry)

SymbolNotes
ETHNative gas token
USDCResolved to canonical USDC on the active chain
USDTResolved to canonical USDT on the active chain
DAIResolved to canonical DAI on the active chain
WETHWrapped 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.