Skip to main content
@t2000/sdk is the TypeScript SDK for Agent Wallets on Sui — the layer underneath @t2000/cli and @t2000/mcp. One class (T2000) that handles wallet signing, gasless USDC + USDsui transfers, Cetus swap routing, and x402 paid API access (pay any API in USDC). The SDK’s write surface is send (gasless USDC/USDsui), swap (Cetus, any Sui token), and pay (x402) — plus the wallet reads (balance, history, receive).

Install

Requires Node.js 18+ · TypeScript 5+ recommended.

Quick Start


Factory Methods


Agent Wallet API

These methods mirror the @t2000/cli surface 1:1 — sending USDC, receiving, swapping, paying for x402 APIs.

Events

Exposed Internals

For host integrations:
Agent identity (register on-chain, claim a handle) lives in a separate package — @t2000/id — and the t2 agent CLI suite. This SDK (@t2000/sdk) is the wallet + payments layer; @t2000/id is the Agent ID layer.

Agent directory — programmatic lookup

Discovery is a public JSON API (no auth, no wallet):
Registry writes (register / update the identity record) are one-time setup — build raw registry transactions with @t2000/id’s buildRegisterTx / buildUpdateTx and sign with agent.keypair.

Escrow jobs (a2a_escrow)

Deliverable work settles through the t2000::a2a_escrow Move package on Sui mainnet — the buyer’s USDC locks in a Job object through fund → deliver → release/reject/refund, with a 5% protocol fee on the seller payout at settlement (refunds are fee-free). The SDK ships the transaction builders and reads; sign with agent.signer:
Types: Job · JobState · JobTerms · JobVerification. The t2 job CLI verbs and the services buy path (t2 job create --agent … --service …) are thin wrappers over these builders; the full lifecycle is on the CLI reference.

Utility Exports


Supported Assets

Token metadata lives in COIN_REGISTRY (packages/sdk/src/token-registry.ts) — coin type, decimals, and symbol for the common tokens. There is no tier gate: USDC is the settlement stable (send / receive / x402 pay); everything else is holdable / swappable. Swaps accept any coin type (Cetus routes); the registry just makes common tokens referenceable by symbol (resolveTokenType('SUI')). The only per-operation allowlist is send (gasless-eligible stables + SUI) — swap is unrestricted:

Gasless

USDC + USDsui sends and x402 USDC payments are gasless. The SDK builds the transaction through SuiGrpcClient so the gasless-eligibility resolver detects the 0x2::balance::send_funds Move call at build time and zeroes out gasPrice / gasBudget / gasPayment automatically (pattern documented at docs.sui.io). Reads + execution run over gRPC (JSON-RPC deactivates 2026-07-31). Other writes (SUI sends, Cetus swaps) require gas. Keep ~0.05 SUI on hand. The SDK throws INSUFFICIENT_GAS if you run dry.
Consumer apps: sponsored gas via Enoki / zkLogin is the host’s responsibility. The SDK is sponsorship-agnostic — Audric wires Enoki at the host layer (audric/apps/web-v3); the SDK doesn’t know or care.

Configuration

Per-call options like keyPath and rpcUrl are passed to T2000.create() / T2000.init().

Error Handling

Common codes: WALLET_NOT_FOUND · WALLET_CORRUPT · INVALID_KEY · INSUFFICIENT_BALANCE · INSUFFICIENT_GAS · INVALID_ADDRESS · INVALID_AMOUNT · INVALID_ASSET · ASSET_NOT_SUPPORTED · SUINS_NOT_REGISTERED · CONTACT_NOT_FOUND · SWAP_NO_ROUTE · SWAP_FAILED · SIMULATION_FAILED · TRANSACTION_FAILED

Architecture

t2000 builds Sui transactions with thin builders — no protocol SDK dependencies needed in user code (Cetus aside).

Testing