{"id":46867864,"url":"https://github.com/azeth-protocol/sdk","last_synced_at":"2026-03-24T21:00:51.434Z","repository":{"id":342638598,"uuid":"1171710287","full_name":"azeth-protocol/sdk","owner":"azeth-protocol","description":"TypeScript SDK for Azeth — smart accounts, x402 payments, reputation, and service discovery","archived":false,"fork":false,"pushed_at":"2026-03-06T19:25:52.000Z","size":184,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-06T20:35:17.091Z","etag":null,"topics":["account-abstraction","ai-agents","base","blockchain","claude","erc-4337","erc-8004","ethereum","machine-economy","payments","reputation","sdk","service-discovery","smart-accounts","typescript","usdc","viem","x402","xmtp"],"latest_commit_sha":null,"homepage":"https://azeth.ai","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azeth-protocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-03T14:25:24.000Z","updated_at":"2026-03-06T19:25:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/azeth-protocol/sdk","commit_stats":null,"previous_names":["azeth-protocol/sdk"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/azeth-protocol/sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azeth-protocol%2Fsdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azeth-protocol%2Fsdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azeth-protocol%2Fsdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azeth-protocol%2Fsdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azeth-protocol","download_url":"https://codeload.github.com/azeth-protocol/sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azeth-protocol%2Fsdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30905699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-24T08:58:18.477Z","status":"ssl_error","status_checked_at":"2026-03-24T08:57:59.595Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["account-abstraction","ai-agents","base","blockchain","claude","erc-4337","erc-8004","ethereum","machine-economy","payments","reputation","sdk","service-discovery","smart-accounts","typescript","usdc","viem","x402","xmtp"],"created_at":"2026-03-10T19:00:20.186Z","updated_at":"2026-03-24T21:00:51.427Z","avatar_url":"https://github.com/azeth-protocol.png","language":"TypeScript","funding_links":[],"categories":["🛠️ SDKs \u0026 Client Libraries"],"sub_categories":["JavaScript/TypeScript"],"readme":"# @azeth/sdk\n\nTypeScript 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.\n\n## Installation\n\n```bash\nnpm install @azeth/sdk\n# or\npnpm add @azeth/sdk\n```\n\n## Quick Start\n\n```typescript\nimport { AzethKit } from '@azeth/sdk';\nimport { TOKENS } from '@azeth/common';\n\nconst kit = await AzethKit.create({\n  privateKey: process.env.AZETH_PRIVATE_KEY as `0x${string}`,\n  chain: 'baseSepolia',\n});\n\ntry {\n  // Deploy a smart account (gas is auto-sponsored, no ETH needed)\n  await kit.createAccount({\n    name: 'MyAgent',\n    entityType: 'agent',\n    description: 'A demo agent',\n    capabilities: ['general'],\n  });\n\n  // Check balances across all accounts with USD values\n  const balances = await kit.getAllBalances();\n  console.log('Total:', balances.grandTotalUSDFormatted);\n\n  // Transfer USDC\n  await kit.transfer({\n    to: '0xRecipient...' as `0x${string}`,\n    amount: 1_000_000n, // 1 USDC\n    token: TOKENS.baseSepolia.USDC,\n  });\n\n  // Pay for an x402 service\n  const { response } = await kit.fetch402('https://api.example.com/data');\n  const data = await response.json();\n\n  // Discover best service and pay in one call\n  const result = await kit.smartFetch402('price-feed');\n  console.log('Served by:', result.service.name);\n} finally {\n  await kit.destroy();\n}\n```\n\nOnly `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](#configuration) below.\n\n## Key Features\n\n- **Smart Accounts** -- Deploy ERC-4337 smart accounts with guardian guardrails (spending limits, whitelists, timelocks) via `createAccount()`\n- **x402 Payments** -- Auto-detect and pay for HTTP 402 services with `fetch402()` and `smartFetch402()`\n- **Reputation** -- Submit and query payment-weighted reputation via `submitOpinion()` and `getWeightedReputation()`\n- **Service Discovery** -- Find services by capability and reputation via `discoverServices()`, with on-chain fallback\n- **Payment Agreements** -- Create and manage recurring on-chain payments via `createPaymentAgreement()`\n- **Messaging** -- Send and receive E2E encrypted messages via XMTP with `sendMessage()` and `onMessage()`\n- **Auth** -- ERC-8128 machine-native HTTP signatures via `getSignedFetch()`\n- **Budget Manager** -- Client-side reputation-aware spending tiers on top of on-chain guardian limits\n- **Event System** -- Lifecycle hooks for payments, transfers, and deposits\n\n## API Overview\n\n### Account\n\n| Method | Description |\n|---|---|\n| `AzethKit.create(config)` | Create an SDK instance |\n| `kit.createAccount(params)` | Deploy smart account + registry entry |\n| `kit.getBalance(account?)` | ETH/USDC/WETH balances |\n| `kit.getAllBalances()` | All accounts with USD values |\n| `kit.transfer(params)` | Send ETH or ERC-20 via UserOp |\n| `kit.deposit(params)` | Fund smart account from EOA |\n| `kit.getHistory(params?)` | Transaction history |\n| `kit.setTokenWhitelist(token, allowed)` | Guardian token whitelist |\n| `kit.setProtocolWhitelist(protocol, allowed)` | Guardian protocol whitelist |\n\n### Payments\n\n| Method | Description |\n|---|---|\n| `kit.fetch402(url, options?)` | Pay for x402 services |\n| `kit.smartFetch402(capability, options?)` | Discover + pay + rate in one call |\n| `kit.createPaymentAgreement(params)` | Recurring on-chain payments |\n| `kit.executeAgreement(id)` | Execute a due agreement |\n| `kit.cancelAgreement(id)` | Cancel an agreement |\n| `kit.getAgreementData(id)` | Full agreement status |\n\n### Registry and Reputation\n\n| Method | Description |\n|---|---|\n| `kit.publishService(params)` | Register on trust registry |\n| `kit.discoverServices(params)` | Search by capability/reputation |\n| `kit.updateServiceMetadata(key, value)` | Update registry metadata |\n| `kit.submitOpinion(opinion)` | Submit reputation opinion |\n| `kit.getWeightedReputation(agentId)` | Payment-weighted reputation |\n| `kit.getNetPaid(counterparty)` | Net payment delta |\n\n### Messaging and Auth\n\n| Method | Description |\n|---|---|\n| `kit.sendMessage(params)` | Send XMTP encrypted message |\n| `kit.onMessage(handler)` | Listen for messages |\n| `kit.canReach(address)` | Check XMTP reachability |\n| `kit.getSignedFetch()` | ERC-8128 authenticated fetch |\n\n### Lifecycle\n\n| Method | Description |\n|---|---|\n| `kit.on(event, listener)` | Subscribe to events |\n| `kit.destroy()` | Clean up and zero keys |\n\n## Error Handling\n\nAll errors are `AzethError` with typed codes:\n\n```typescript\nimport { AzethError } from '@azeth/common';\n\ntry {\n  await kit.transfer({ to: '0x...', amount: 1_000_000n });\n} catch (err) {\n  if (err instanceof AzethError) {\n    // err.code: 'INSUFFICIENT_BALANCE' | 'GUARDIAN_REJECTED' | 'BUDGET_EXCEEDED' | ...\n    console.error(err.code, err.message);\n  }\n}\n```\n\n## Configuration\n\nThe minimal config is just `privateKey` + `chain`. Everything else has smart defaults:\n\n```typescript\nconst kit = await AzethKit.create({\n  privateKey: '0x...',              // Required\n  chain: 'baseSepolia',             // Required\n  // All below are optional:\n  serverUrl: 'https://api.azeth.ai', // Default — handles gasless relay + bundler proxy\n  bundlerUrl: undefined,             // Falls back to server bundler proxy\n  paymasterUrl: undefined,           // Falls back to server paymaster\n  rpcUrl: undefined,                 // Falls back to public RPC for the chain\n});\n```\n\nFor production with your own infrastructure:\n\n```typescript\nconst kit = await AzethKit.create({\n  privateKey: '0x...',\n  chain: 'base',\n  bundlerUrl: `https://api.pimlico.io/v2/8453/rpc?apikey=${PIMLICO_KEY}`,\n  paymasterUrl: `https://api.pimlico.io/v2/8453/rpc?apikey=${PIMLICO_KEY}`,\n});\n```\n\n## Full Documentation\n\nSee [docs/sdk.md](../../docs/sdk.md) for the comprehensive API reference with all method signatures, parameter types, return types, and detailed descriptions.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazeth-protocol%2Fsdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazeth-protocol%2Fsdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazeth-protocol%2Fsdk/lists"}