{"_id":"@arbiterlabs/sdk","name":"@arbiterlabs/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@arbiterlabs/sdk","version":"0.1.0","description":"Paying client for Arbiter — judgment for autonomous agents, settled over x402 on Algorand.","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"engines":{"node":">=22"},"scripts":{"build":"node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","prepublishOnly":"npm run build"},"dependencies":{"@x402/avm":"^2.21.0","@x402/core":"^2.21.0","@x402/fetch":"^2.21.0"},"devDependencies":{"@types/node":"^24.7.0","typescript":"^5.9.3"},"license":"MIT","author":{"name":"Godwin Tairo"},"homepage":"https://github.com/godwin105/arbiter_AI/tree/main/clients/sdk#readme","bugs":{"url":"https://github.com/godwin105/arbiter_AI/issues"},"repository":{"type":"git","url":"git+https://github.com/godwin105/arbiter_AI.git","directory":"clients/sdk"},"keywords":["x402","algorand","usdc","ai-agent","agent-security","transaction-simulation","wallet-security","micropayments","agent-safety"],"publishConfig":{"access":"public"},"gitHead":"bed166b71dc8d3740765220e321bafc62ae52aa5","_id":"@arbiterlabs/sdk@0.1.0","_nodeVersion":"24.13.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-fqpw0BdhF00Zx4/F5RjlBH6vLoxVlcFAcD+Qql467lZphh6WdUlwoESVshV9fZh2hE9MLRceCKa6s0g+ptuM3Q==","shasum":"4401094562cb39a6649e4f83c72bf91b6db4a5f2","tarball":"https://registry.npmjs.org/@arbiterlabs/sdk/-/sdk-0.1.0.tgz","fileCount":12,"unpackedSize":31258,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGLGWD/drOPY03suHi31v3BlCBejlFbFnB8Of7z0hJP9AiBqFDFqdaJzHDIrW+fl9lpsmBWbrd6GfYXQYuNkAEuQyw=="}]},"_npmUser":{"name":"atmo105","email":"godwintairo105@gmail.com"},"directories":{},"maintainers":[{"name":"atmo105","email":"godwintairo105@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1785941005469_0.18332732528578388"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-05T14:43:25.259Z","0.1.0":"2026-08-05T14:43:25.610Z","modified":"2026-08-05T14:43:25.829Z"},"maintainers":[{"name":"atmo105","email":"godwintairo105@gmail.com"}],"description":"Paying client for Arbiter — judgment for autonomous agents, settled over x402 on Algorand.","homepage":"https://github.com/godwin105/arbiter_AI/tree/main/clients/sdk#readme","keywords":["x402","algorand","usdc","ai-agent","agent-security","transaction-simulation","wallet-security","micropayments","agent-safety"],"repository":{"type":"git","url":"git+https://github.com/godwin105/arbiter_AI.git","directory":"clients/sdk"},"author":{"name":"Godwin Tairo"},"bugs":{"url":"https://github.com/godwin105/arbiter_AI/issues"},"license":"MIT","readme":"# @arbiterlabs/sdk\n\nAsk whether an action is safe before your agent takes it.\n\nAn AI agent about to sign a transaction cannot tell a legitimate one from a\ntransaction that quietly hands away its wallet. This client asks\n[Arbiter](https://arbiter-hs23.onrender.com) and gets back allow, warn, block or escalate — with reasons —\nin a few hundred milliseconds.\n\n```bash\nnpm install @arbiterlabs/sdk\n```\n\n```ts\nimport { ArbiterClient } from \"@arbiterlabs/sdk\";\n\nconst arbiter = new ArbiterClient({\n  baseUrl: \"https://arbiter-hs23.onrender.com\",\n  privateKey: process.env.ALGO_KEY,   // base64 64-byte Algorand key\n  maxTotalSpendUsd: 10,\n});\n\nconst verdict = await arbiter.judgeTransaction({ transaction, signer });\n\nif (verdict.decision !== \"allow\") {\n  console.warn(verdict.findings.map((f) => f.title));\n  return;                              // do not sign\n}\n```\n\nAlgorand and EVM chains share one method:\n\n```ts\nawait arbiter.judgeTransaction({\n  chain: \"evm\",\n  chainId: 1,\n  transaction: { to: token, data: approveCalldata },\n});\n```\n\n## Spend limits are part of the client\n\nAn agent stuck in a retry loop against a paid endpoint is a wallet-draining bug,\nso the caps are enforced in the payment selector — before anything is signed —\nrather than left to you to remember.\n\n```ts\nnew ArbiterClient({\n  maxPricePerCallUsd: 0.05,   // refuse any single call above this\n  maxTotalSpendUsd: 10,       // lifetime cap for this client\n});\n```\n\nExceeding either throws `ArbiterBudgetError`, catchable distinctly from a\nnetwork or payment failure.\n\n## The verdict\n\nEvery route returns the same shape, so you integrate once.\n\n```ts\n{\n  decision: \"block\",     // allow | warn | block | escalate\n  risk: 100,             // 0-100\n  confidence: 1,         // 0-1\n  findings: [{ code, severity, title, detail, source }],\n  evidence: { /* the decoded transaction, the account record */ },\n  meta: { latencyMs: 359, degraded: false },\n}\n```\n\n`escalate` means not enough evidence was gathered to decide. **It is not\napproval** — treat it as \"ask a human\". `meta.degraded: true` means an upstream\nwas unreachable and the verdict is partial; the decode rules that catch critical\nseverities still ran.\n\n## Paying\n\nCalls are settled per request in USDC on Algorand over [x402](https://x402.org).\nThere is no API key and no account — payment is the authentication.\n\nYour payer account needs USDC **and must be opted in to the USDC asset**. On\nAlgorand a transfer to an account that has not opted in is rejected outright, so\nan un-opted-in payer cannot pay at all. Fees are sponsored by the facilitator,\nso the payer does not need ALGO.\n\n| Route | Price |\n|---|---|\n| Transaction verdict | $0.002 |\n| Counterparty verdict | $0.01 |\n| Human judgment | $0.25 |\n\nFull documentation: https://arbiter-hs23.onrender.com/docs\n\n## Licence\n\nMIT\n","readmeFilename":"README.md","_rev":"1-db355c36672c41625403d9f9b6090afd"}