{"_id":"@bkka0kon/arc-agent-sdk","name":"@bkka0kon/arc-agent-sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@bkka0kon/arc-agent-sdk","version":"0.1.0","description":"TypeScript SDK for the Arc Agent x402 marketplace on Arc Testnet. 11 typed methods, transparent USDC payment via Circle CLI or a custom signer.","license":"MIT","author":{"name":"bkka0kon"},"repository":{"type":"git","url":"git+https://github.com/bkka0kon/arc-agent.git"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","watch":"tsc --watch","example:safe-swap":"tsx examples/safe-swap-bot.ts"},"devDependencies":{"@types/node":"^25.9.1","tsx":"^4.19.2","typescript":"^5.6.3"},"engines":{"node":">=20"},"keywords":["x402","arc","circle","usdc","agent","marketplace","defi"],"_id":"@bkka0kon/arc-agent-sdk@0.1.0","gitHead":"bcb1d40e5f3eda625e857cbce32b34517efa43e9","bugs":{"url":"https://github.com/bkka0kon/arc-agent/issues"},"homepage":"https://github.com/bkka0kon/arc-agent#readme","_nodeVersion":"22.22.3","_npmVersion":"10.8.1","dist":{"integrity":"sha512-RcxPZch3W02qI2IosTUTphLe9x3tZiQOCKKbOkAWumXfIMqy5pVAo3N1tOnLpKQqKvsC6GZyZ5BX4t5ddfyBYg==","shasum":"b18d4c8fcc5ec3902c13ad3a80805f3a6dab0886","tarball":"https://registry.npmjs.org/@bkka0kon/arc-agent-sdk/-/arc-agent-sdk-0.1.0.tgz","fileCount":4,"unpackedSize":19647,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA3GPTxM4ERK/o7alXyRfyRt4JiDjzhUZNxGEV+uRoKbAiEA42ksJ/elOgx5K2P2YyzvEMrwRwVvO5eWRRyWONFYn6w="}]},"_npmUser":{"name":"bkka0kon","email":"cuongqtn19931@gmail.com"},"directories":{},"maintainers":[{"name":"bkka0kon","email":"cuongqtn19931@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/arc-agent-sdk_0.1.0_1780386010046_0.7509675484752629"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-02T07:40:09.903Z","0.1.0":"2026-06-02T07:40:10.195Z","modified":"2026-06-02T07:40:10.707Z"},"maintainers":[{"name":"bkka0kon","email":"cuongqtn19931@gmail.com"}],"description":"TypeScript SDK for the Arc Agent x402 marketplace on Arc Testnet. 11 typed methods, transparent USDC payment via Circle CLI or a custom signer.","homepage":"https://github.com/bkka0kon/arc-agent#readme","keywords":["x402","arc","circle","usdc","agent","marketplace","defi"],"repository":{"type":"git","url":"git+https://github.com/bkka0kon/arc-agent.git"},"author":{"name":"bkka0kon"},"bugs":{"url":"https://github.com/bkka0kon/arc-agent/issues"},"license":"MIT","readme":"# `@bkka0kon/arc-agent-sdk`\n\nTypeScript SDK for the Arc Agent x402 marketplace on Arc Testnet.\n**11 typed methods.** Transparent USDC payment via Circle CLI or your own signer.\n\n## Install\n\n```bash\nnpm i @bkka0kon/arc-agent-sdk\n```\n\n## Quick start\n\n```ts\nimport { ArcAgent } from \"@bkka0kon/arc-agent-sdk\";\n\nconst arc = new ArcAgent({\n  // Three signer modes — see below.\n  signer: \"circle-cli\",\n  agentWallet: process.env.AGENT_WALLET_ADDRESS!,\n});\n\nconst sec = await arc.tokenSecurity(\"0x3600000000000000000000000000000000000000\");\nif (sec.score < 50) {\n  console.log(\"Token unsafe:\", sec.verdict, sec.flags);\n  return;\n}\n\nconst arb = await arc.dexArbScan({ base: \"ETH\", quote: \"USD\", size: 1000 });\nconsole.log(`Best buy on ${arb.best_buy.venue}, spread ${arb.spread.bps} bps`);\n\nconst decision = await arc.llmDefiReason({\n  q: \"Should I swap 1000 USDC to ETH right now?\",\n  ctx: { security: sec, arb },\n});\nconsole.log(decision.actions);\n```\n\n## Signer modes\n\n### 1. `circle-cli` (default — easiest)\n\nShells out to `circle services pay`. Requires:\n- Circle CLI installed: `npm i -g @circle-fin/cli`\n- Logged in: `circle wallet login`\n- Gateway balance funded: `circle gateway deposit --amount 1.00 --asset USDC --chain ARC-TESTNET`\n\n```ts\nnew ArcAgent({ signer: \"circle-cli\", agentWallet: \"0xabc…\" });\n```\n\n### 2. `dry-run` (no USDC needed)\n\nReturns a mock body instead of paying. Use for unit tests + CI.\n\n```ts\nnew ArcAgent({ signer: \"dry-run\" });\n```\n\n### 3. Custom signer (bring your own wallet)\n\n```ts\nnew ArcAgent({\n  signer: {\n    async sign(quote, url) {\n      // Build + sign the X-PAYMENT header yourself.\n      // viem / ethers / Privy / Turnkey — your choice.\n      return paymentHeaderString;\n    },\n  },\n});\n```\n\n## All 11 methods\n\n| Method | Endpoint | Price |\n|---|---|---|\n| `tokenPrice(token)` | `/v1/price/:token` | $0.001 |\n| `pools({token, limit, ...})` | `/v1/pools` | $0.002 |\n| `tvl(protocol)` | `/v1/tvl/:protocol` | $0.001 |\n| `balance(address)` | `/v1/balance/:address` | $0.0005 |\n| `gasEstimate()` | `/v1/gas/estimate` | $0.0005 |\n| `contractSource(address)` | `/v1/contract/source/:address` | $0.002 |\n| `sentimentFearGreed()` | `/v1/sentiment/fear-greed` | $0.001 |\n| `webSearch(q)` | `/v1/web/search` | $0.003 |\n| `tokenSecurity(address)` | `/v1/token/security/:address` | $0.010 |\n| `dexArbScan({base, quote, size})` | `/v1/dex/arb-scan` | $0.003 |\n| `llmDefiReason({q, ctx})` | `/v1/llm/defi-reason` | $0.015 |\n\nEvery response is parsed JSON. Receipts (tx hash, payer) are attached\nunder `_paid` when payment was made.\n\n## Safety knobs\n\n```ts\nnew ArcAgent({\n  maxAmount: \"5000\",   // hard cap per call in atomic USDC = $0.005\n  timeoutMs: 30_000,   // per-call timeout\n  host: \"https://my-fork.vercel.app\",  // self-hosted catalog\n});\n```\n\nA quote that exceeds `maxAmount` throws `ArcAgentError` BEFORE paying.\n\n## Build the SDK from source\n\n```bash\nnpm install\nnpm run build\n```\n\nRun the example:\n\n```bash\nexport AGENT_WALLET_ADDRESS=0x...\nnpm run example:safe-swap -- 0xTOKEN_ADDRESS\n```\n\n## License\n\nMIT.\n","readmeFilename":"README.md","_rev":"1-e045b25b2cb354ddb7a11f52d835fc84"}