TypeScript SDK for Azeth — smart accounts, x402 payments, reputation, and service discovery
sdk is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on account-abstraction, ai-agents, base, blockchain. It currently has 2 GitHub stars and 0 forks, and sits alongside related tools like mcp-server, common, cli, provider, agent-starter, agent-commerce-demo.
TypeScript SDK for the Azeth trust infrastructure. Provides AzethKit -- a single class for machine participants to interact with the Azeth protocol: smart accounts, x402 payments, reputation, messaging, and service discovery.
npm install @azeth/sdk
# or
pnpm add @azeth/sdk
import { AzethKit } from '@azeth/sdk';
import { TOKENS } from '@azeth/common';
const kit = await AzethKit.create({
privateKey: process.env.AZETH_PRIVATE_KEY as `0x${string}`,
chain: 'baseSepolia',
});
try {
// Deploy a smart account (gas is auto-sponsored, no ETH needed)
await kit.createAccount({
name: 'MyAgent',
entityType: 'agent',
description: 'A demo agent',
capabilities: ['general'],
});
// Check balances across all accounts with USD values
const balances = await kit.getAllBalances();
console.log('Total:', balances.grandTotalUSDFormatted);
// Transfer USDC
await kit.transfer({
to: '0xRecipient...' as `0x${string}`,
amount: 1_000_000n, // 1 USDC
token: TOKENS.baseSepolia.USDC,
});
// Pay for an x402 service
const { response } = await kit.fetch402('https://api.example.com/data');
const data = await response.json();
// Discover best service and pay in one call
const result = await kit.smartFetch402('price-feed');
console.log('Served by:', result.service.name);
} finally {
await kit.destroy();
}
Only privateKey and chain are required. Gas sponsorship, bundler, and server URL are handled automatically via the Azeth server at api.azeth.ai. For production or custom infrastructure, see Configuration below.
createAccount()fetch402() and smartFetch402()submitOpinion() and getWeightedReputation()discoverServices(), with on-chain fallbackcreatePaymentAgreement()sendMessage() and onMessage()getSignedFetch()| Method | Description |
|---|---|
AzethKit.create(config) |
Create an SDK instance |
kit.createAccount(params) |
Deploy smart account + registry entry |
kit.getBalance(account?) |
ETH/USDC/WETH balances |
kit.getAllBalances() |
All accounts with USD values |
kit.transfer(params) |
Send ETH or ERC-20 via UserOp |
kit.deposit(params) |
Fund smart account from EOA |
kit.getHistory(params?) |
Transaction history |
kit.setTokenWhitelist(token, allowed) |
Guardian token whitelist |
kit.setProtocolWhitelist(protocol, allowed) |
Guardian protocol whitelist |
| Method | Description |
|---|---|
kit.fetch402(url, options?) |
Pay for x402 services |
kit.smartFetch402(capability, options?) |
Discover + pay + rate in one call |
kit.createPaymentAgreement(params) |
Recurring on-chain payments |
kit.executeAgreement(id) |
Execute a due agreement |
kit.cancelAgreement(id) |
Cancel an agreement |
kit.getAgreementData(id) |
Full agreement status |
| Method | Description |
|---|---|
kit.publishService(params) |
Register on trust registry |
kit.discoverServices(params) |
Search by capability/reputation |
kit.updateServiceMetadata(key, value) |
Update registry metadata |
kit.submitOpinion(opinion) |
Submit reputation opinion |
kit.getWeightedReputation(agentId) |
Payment-weighted reputation |
kit.getNetPaid(counterparty) |
Net payment delta |
| Method | Description |
|---|---|
kit.sendMessage(params) |
Send XMTP encrypted message |
kit.onMessage(handler) |
Listen for messages |
kit.canReach(address) |
Check XMTP reachability |
kit.getSignedFetch() |
ERC-8128 authenticated fetch |
| Method | Description |
|---|---|
kit.on(event, listener) |
Subscribe to events |
kit.destroy() |
Clean up and zero keys |
All errors are AzethError with typed codes:
import { AzethError } from '@azeth/common';
try {
await kit.transfer({ to: '0x...', amount: 1_000_000n });
} catch (err) {
if (err instanceof AzethError) {
// err.code: 'INSUFFICIENT_BALANCE' | 'GUARDIAN_REJECTED' | 'BUDGET_EXCEEDED' | ...
console.error(err.code, err.message);
}
}
The minimal config is just privateKey + chain. Everything else has smart defaults:
const kit = await AzethKit.create({
privateKey: '0x...', // Required
chain: 'baseSepolia', // Required
// All below are optional:
serverUrl: 'https://api.azeth.ai', // Default — handles gasless relay + bundler proxy
bundlerUrl: undefined, // Falls back to server bundler proxy
paymasterUrl: undefined, // Falls back to server paymaster
rpcUrl: undefined, // Falls back to public RPC for the chain
});
For production with your own infrastructure:
const kit = await AzethKit.create({
privateKey: '0x...',
chain: 'base',
bundlerUrl: `https://api.pimlico.io/v2/8453/rpc?apikey=${PIMLICO_KEY}`,
paymasterUrl: `https://api.pimlico.io/v2/8453/rpc?apikey=${PIMLICO_KEY}`,
});
See docs/sdk.md for the comprehensive API reference with all method signatures, parameter types, return types, and detailed descriptions.
MIT
MCP server for Azeth — smart accounts, payments, reputation, and discovery tools for AI agents
Shared types, constants, ABIs, and errors for Azeth — trust infrastructure for the machine economy
CLI for Azeth — register, discover, pay, and manage machine participants
x402 service provider tooling for Azeth — gate Hono endpoints behind x402 payments
Build an AI agent with a wallet in 5 minutes — smart accounts, x402 payments, reputation, and service discovery
Watch two AI agents discover, negotiate, and pay each other — a complete machine economy demo
The AI agent with a wallet — spends USDC autonomously to get real work done. Apache-2.0, TypeScript.
Daydreams is a set of tools for building agents for commerce
A decentralized micro-settlement protocol enabling autonomous AI agents to pay publishers for premium content via Circle Programmable Wallets and x402 nanopayments.
The best way to monetize AI applications & MCP, using x402, CDP Smart Wallets & Paymaster
Command-line wallet and HTTP client for the Tempo blockchain, with built-in Machine Payments Protocol support.
Autonomous AI Agent Swarm framework with x402 self-executing wallets. Empowers LLM-driven agents to trade, bridge, and manage crypto treasuries without human intervention. The ultimate Agentic DeFi toolkit for 2026.