{"_id":"@agentx402-ai/core","_rev":"8-d004a08f1b57b6588a6382bde898f355","name":"@agentx402-ai/core","dist-tags":{"latest":"0.4.1"},"versions":{"0.1.0":{"name":"@agentx402-ai/core","version":"0.1.0","keywords":["agentx402","x402","eip-3009","eip-712","viem","sdk-core"],"author":{"name":"The AgentKV Authors","email":"contact@agentx402.ai"},"license":"MIT","_id":"@agentx402-ai/core@0.1.0","maintainers":[{"name":"agentx402-admin","email":"contact@agentx402.ai"}],"homepage":"https://github.com/agentx402-ai/agentkv#readme","bugs":{"url":"https://github.com/agentx402-ai/agentkv/issues"},"dist":{"shasum":"cd91cf903b73cf9e22c3e470af533a476bd735d3","tarball":"https://registry.npmjs.org/@agentx402-ai/core/-/core-0.1.0.tgz","fileCount":9,"integrity":"sha512-mB7R3S/YT7K26iLBnRJmGMhC0TQS7FTNQqcGd4f5zmfDy6wp2KDeM+I4QbKV8a32TLuaH/lpyATkQtAYs6O5BQ==","signatures":[{"sig":"MEQCIAe3YGvJF+VoEQSutlwS8gW/3+1lVgTsNo1nRwTwI6RWAiADUAdpN0HKVTkkkCZ6HtuD7lIzy8zaUfQ7U8rDQMGU/Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":92547},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"2626bba0334538f9bdb6cef5aa62663a4dbeb31c","scripts":{"test":"tsc --noEmit && vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"agentx402-admin","email":"contact@agentx402.ai"},"deprecated":"Superseded by 0.1.1 - identical code, plus provenance attestations and the correct repository link.","repository":{"url":"git+https://github.com/agentx402-ai/agentkv.git","type":"git","directory":"core"},"_npmVersion":"11.16.0","description":"Shared auth/pay/usage/error/retry plumbing extracted from @agentkv/client, for reuse across agentx402 service SDKs","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"viem":"^2.21.0","@x402/evm":"^2.16.0","@x402/core":"^2.16.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^4.1.0","typescript":"^5.6.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.1.0_1783545191140_0.04934391298755214","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@agentx402-ai/core","version":"0.1.1","keywords":["agentx402","x402","eip-3009","eip-712","viem","sdk-core"],"author":{"name":"The AgentKV Authors","email":"contact@agentx402.ai"},"license":"MIT","_id":"@agentx402-ai/core@0.1.1","maintainers":[{"name":"agentx402-admin","email":"contact@agentx402.ai"}],"homepage":"https://github.com/agentx402-ai/core#readme","bugs":{"url":"https://github.com/agentx402-ai/core/issues"},"dist":{"shasum":"034a55137364d719fa21b441ead740ffe536b397","tarball":"https://registry.npmjs.org/@agentx402-ai/core/-/core-0.1.1.tgz","fileCount":9,"integrity":"sha512-9+zD2LGLpjOrCI8xZ87vmjTIGrAcusDdZqJpP3vSb9CT3CRlGvwClyCb/w2RXAv9HQLovLBcP3OVHsizPEw+ug==","signatures":[{"sig":"MEQCIAbsMDN6AXYGh5V/rBnR+BRcl8BCMU2++o1od+YQR1TNAiBKA75ebvVdI1EWUILgVjv6hY3tjCN4xe7oRS+Gg4+w6A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agentx402-ai%2fcore@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":92690},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"6580694ff4bb02b609c9ab15337efdd584c3abe6","scripts":{"lint":"biome ci .","test":"tsc --noEmit && vitest run","build":"tsup","format":"biome check --write .","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5395e73a-5898-42a6-982c-a08d51c129dd"}},"overrides":{"ws":"^8.21.0"},"repository":{"url":"git+https://github.com/agentx402-ai/core.git","type":"git"},"_npmVersion":"11.16.0","description":"Shared auth/pay/usage/error/retry plumbing for agentx402 service SDKs (x402 + EIP-712 + EIP-3009 over viem).","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","dependencies":{"viem":"^2.21.0","@x402/evm":"^2.16.0","@x402/core":"^2.16.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^4.1.0","typescript":"^5.6.0","@types/node":"^20.0.0","@biomejs/biome":"^2.5.1","@vitest/coverage-v8":"^4.1.9"},"_npmOperationalInternal":{"tmp":"tmp/core_0.1.1_1785043279656_0.21135951749098814","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@agentx402-ai/core","version":"0.2.0","keywords":["agentx402","x402","eip-3009","eip-712","viem","sdk-core"],"author":{"name":"The AgentKV Authors","email":"contact@agentx402.ai"},"license":"MIT","_id":"@agentx402-ai/core@0.2.0","maintainers":[{"name":"agentx402-admin","email":"contact@agentx402.ai"}],"homepage":"https://github.com/agentx402-ai/core#readme","bugs":{"url":"https://github.com/agentx402-ai/core/issues"},"dist":{"shasum":"de3bc0c894abb683c86432bef9e421a978cba11e","tarball":"https://registry.npmjs.org/@agentx402-ai/core/-/core-0.2.0.tgz","fileCount":11,"integrity":"sha512-RFOpDN79R4nGJxuXZLpD2g4Lq3kY+qOGHOVPqzt/cMNfCDfvEp8pAAtwFbrGbi3N6g7mnP1MkHrkwvpmcLmvkw==","signatures":[{"sig":"MEQCIH0+jaI3z3YLQXa8cOx9hY7Fmvh4R68ttV8fYaBzZFWtAiAoH6GwmKKARumzneNFDz3ayp6PBLl02zoDr7IKcH1Akg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agentx402-ai%2fcore@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":173656},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.3"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"c5b48c527dc16079a65f575e1b0bfdb40e841abb","scripts":{"lint":"biome ci .","test":"tsc --noEmit && vitest run","build":"tsup","smoke":"node test/dist-smoke.mjs","format":"biome check --write .","prepack":"npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5395e73a-5898-42a6-982c-a08d51c129dd"}},"overrides":{"esbuild":"^0.28.1"},"repository":{"url":"git+https://github.com/agentx402-ai/core.git","type":"git"},"_npmVersion":"11.16.0","description":"Shared auth/pay/usage/error/retry plumbing for agentx402 service SDKs (x402 + EIP-712 + EIP-3009 over viem).","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","dependencies":{"viem":"^2.21.0","@x402/evm":"^2.16.0","@x402/core":"^2.16.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^4.1.0","typescript":"^5.6.0","@types/node":"^20.0.0","@biomejs/biome":"^2.5.6","@vitest/coverage-v8":"^4.1.9"},"_npmOperationalInternal":{"tmp":"tmp/core_0.2.0_1785302438627_0.4755267702010748","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@agentx402-ai/core","version":"0.3.0","keywords":["agentx402","x402","eip-3009","eip-712","viem","sdk-core"],"author":{"name":"The AgentKV Authors","email":"contact@agentx402.ai"},"license":"MIT","_id":"@agentx402-ai/core@0.3.0","maintainers":[{"name":"agentx402-admin","email":"contact@agentx402.ai"}],"homepage":"https://github.com/agentx402-ai/core#readme","bugs":{"url":"https://github.com/agentx402-ai/core/issues"},"dist":{"shasum":"af8793572cc621281c4ae8f027c00affe6360b50","tarball":"https://registry.npmjs.org/@agentx402-ai/core/-/core-0.3.0.tgz","fileCount":11,"integrity":"sha512-LmA+V1dG0FcTBjfBnTCrN7glbn/QL4tqPZLqE6/I+07LmrzOEuHUfv6tnE1N4x0mqhOl8r3JdMDTwA9JPg59dg==","signatures":[{"sig":"MEYCIQDNQfeAw6CeF9omdkIFCN7r8LLKFpIdb4S1V9ccCpOFxAIhAKamNdaDPFGhuDCrxAj6vjW026Yu+sNhy6w+0ECvdGtI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agentx402-ai%2fcore@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":215903},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.3"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"1b3240c5a9bb8f8fd677661253daf9b9b9cfb3f6","scripts":{"lint":"biome ci .","test":"tsc --noEmit && vitest run","build":"tsup","smoke":"node test/dist-smoke.mjs","format":"biome check --write .","prepack":"npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5395e73a-5898-42a6-982c-a08d51c129dd"}},"overrides":{"esbuild":"^0.28.1"},"repository":{"url":"git+https://github.com/agentx402-ai/core.git","type":"git"},"_npmVersion":"11.16.0","description":"Shared auth/pay/usage/error/retry plumbing for agentx402 service SDKs (x402 + EIP-712 + EIP-3009 over viem).","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","dependencies":{"viem":"^2.21.0","@x402/evm":"^2.16.0","@x402/core":"^2.16.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^4.1.0","typescript":"^5.6.0","@types/node":"^20.0.0","@biomejs/biome":"^2.5.6","@vitest/coverage-v8":"^4.1.9"},"_npmOperationalInternal":{"tmp":"tmp/core_0.3.0_1785468713903_0.425981176246065","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@agentx402-ai/core","version":"0.4.0","keywords":["agentx402","x402","eip-3009","eip-712","viem","sdk-core"],"author":{"name":"The AgentKV Authors","email":"contact@agentx402.ai"},"license":"MIT","_id":"@agentx402-ai/core@0.4.0","maintainers":[{"name":"agentx402-admin","email":"contact@agentx402.ai"}],"homepage":"https://github.com/agentx402-ai/core#readme","bugs":{"url":"https://github.com/agentx402-ai/core/issues"},"dist":{"shasum":"ca803119eb66527182a307fe94a4bbaae9b5599c","tarball":"https://registry.npmjs.org/@agentx402-ai/core/-/core-0.4.0.tgz","fileCount":11,"integrity":"sha512-b0Tmr3Rj/9MF+3PthMXG3ldsEXb4R1UW03q6yDhpWtAhdxMmGHtmb+LzwZEEigQAamdxS1bTjFeQmhX3M0MAxQ==","signatures":[{"sig":"MEQCIDVx1tEh3djNp0XCmv11MqNa756XTrGrNzeGomdCjNmiAiAMc5M5y9pYo8LnIbUvzqp+5Eh3a5Q91YPn9UwoTKaGaw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agentx402-ai%2fcore@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":218844},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.3"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"679bef6757602326d10bd6019cf6cb17d14cd420","scripts":{"lint":"biome ci .","test":"tsc --noEmit && vitest run","build":"tsup","smoke":"node test/dist-smoke.mjs","format":"biome check --write .","prepack":"npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5395e73a-5898-42a6-982c-a08d51c129dd"}},"overrides":{"esbuild":"^0.28.1"},"repository":{"url":"git+https://github.com/agentx402-ai/core.git","type":"git"},"_npmVersion":"11.16.0","description":"Shared auth/pay/usage/error/retry plumbing for agentx402 service SDKs (x402 + EIP-712 + EIP-3009 over viem).","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","dependencies":{"viem":"^2.21.0","@x402/evm":"^2.16.0","@x402/core":"^2.16.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^4.1.0","typescript":"^5.6.0","@types/node":"^20.0.0","@biomejs/biome":"^2.5.6","@vitest/coverage-v8":"^4.1.9"},"_npmOperationalInternal":{"tmp":"tmp/core_0.4.0_1785673837268_0.8361404483082477","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@agentx402-ai/core","version":"0.4.1","description":"Shared auth/pay/usage/error/retry plumbing for agentx402 service SDKs (x402 + EIP-712 + EIP-3009 over viem).","license":"MIT","author":{"name":"The AgentKV Authors","email":"contact@agentx402.ai"},"homepage":"https://github.com/agentx402-ai/core#readme","repository":{"type":"git","url":"git+https://github.com/agentx402-ai/core.git"},"bugs":{"url":"https://github.com/agentx402-ai/core/issues"},"keywords":["agentx402","x402","eip-3009","eip-712","viem","sdk-core"],"type":"module","sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","prepack":"npm run build","smoke":"node test/dist-smoke.mjs","test":"tsc --noEmit && vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"biome ci .","format":"biome check --write ."},"dependencies":{"@x402/core":"^2.23.0","@x402/evm":"^2.23.0","viem":"^2.21.0"},"devDependencies":{"@biomejs/biome":"^2.5.6","@types/node":"^20.0.0","@vitest/coverage-v8":"^4.1.11","tsup":"^8.3.0","typescript":"^5.6.0","vitest":"^4.1.11"},"overrides":{"esbuild":"^0.28.1","nanoid":"^3.3.18"},"engines":{"node":">=20.3"},"gitHead":"b7c320483b86438031a30799063f6b09143f5ff1","_id":"@agentx402-ai/core@0.4.1","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-pvWfwd0Gl2PJeRJ/nRj8fctKSfP/16MQQvCwMsBWndUfFmRdQiathu/h95ZBkLvSt+MWLMxqNvYUURgWCKjF1g==","shasum":"8276b18e4cebf09e872e67b6c28c9418a5a41d9d","tarball":"https://registry.npmjs.org/@agentx402-ai/core/-/core-0.4.1.tgz","fileCount":11,"unpackedSize":220379,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agentx402-ai%2fcore@0.4.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDODkFZad2VEAJT6/r0T3ToKLXn01y119Fk7xAS7WVqwAiBPVyAEYDRLKtsaZ5EM1+rhj3+PEH++0DkQi9KkOt67kw=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5395e73a-5898-42a6-982c-a08d51c129dd"}},"directories":{},"maintainers":[{"name":"agentx402-admin","email":"contact@agentx402.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_0.4.1_1787429263672_0.24184138726871507"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-08T21:13:10.981Z","modified":"2026-08-22T20:07:44.169Z","0.1.0":"2026-07-08T21:13:11.272Z","0.1.1":"2026-07-26T05:21:19.807Z","0.2.0":"2026-07-29T05:20:38.752Z","0.3.0":"2026-07-31T03:31:54.056Z","0.4.0":"2026-08-02T12:30:37.430Z","0.4.1":"2026-08-22T20:07:43.806Z"},"bugs":{"url":"https://github.com/agentx402-ai/core/issues"},"author":{"name":"The AgentKV Authors","email":"contact@agentx402.ai"},"license":"MIT","homepage":"https://github.com/agentx402-ai/core#readme","keywords":["agentx402","x402","eip-3009","eip-712","viem","sdk-core"],"repository":{"type":"git","url":"git+https://github.com/agentx402-ai/core.git"},"description":"Shared auth/pay/usage/error/retry plumbing for agentx402 service SDKs (x402 + EIP-712 + EIP-3009 over viem).","maintainers":[{"name":"agentx402-admin","email":"contact@agentx402.ai"}],"readme":"# @agentx402-ai/core\n\nShared x402/EIP-712 platform SDK plumbing — auth, payment, usage, error, and retry handling —\nextracted from `@agentkv/client` for reuse across future `agentx402` service SDKs.\n\n## Money-path API\n\n`buildPaymentHeader(account, paymentRequiredHeader, opts)` signs a USDC **EIP-3009\n`transferWithAuthorization`** — a bearer instrument — from an untrusted server-supplied\n`PAYMENT-REQUIRED` challenge. It is **safe-by-default**:\n\n- **`opts.expectedNetwork` is required.** The challenge is pinned to your configured CAIP-2\n  network and its canonical USDC contract *before anything is signed*; a mismatch throws\n  `network_mismatch` / `asset_mismatch`. Without the pin, a compromised server could hand a\n  Base-configured client an Arbitrum challenge and drain the same EOA's Arbitrum USDC.\n  `{ allowUnpinnedNetwork: true }` is the explicit, dangerous escape hatch.\n- **`opts.maxAmountAtomic`** (bigint) caps the signed amount; an over-ceiling challenge throws\n  `SpendCapError` before signing. Strongly recommended — the amount is otherwise\n  server-dictated.\n- **`opts.expectedPayTo`** pins the recipient (`payto_mismatch` on drift).\n- The signed validity window is clamped to `MAX_AUTH_WINDOW_SEC` (3600s) unconditionally.\n- The window and identity timestamps derive from the **local clock**: a fast clock extends a\n  bearer authorization's real-world validity by exactly the skew, a slow one produces\n  already-expired authorizations and server-rejected timestamps. Keep the host clock\n  NTP-synced; a server-side timestamp rejection usually means local skew.\n\n### Nonce & idempotency contract (no-double-charge)\n\nAn EIP-3009 authorization is deduped server-side by its nonce, and ops by their\n`Idempotency-Key`. To make a retry of an already-charged request safe:\n\n- Sign the payment header **once**, outside any retry loop, with\n  `opts.nonce: nonceFromIdempotencyKey(key)` pinned to the op's idempotency key — and re-send\n  the identical header on every attempt. A fresh nonce per attempt double-charges when a\n  charged response is lost.\n- Send the **same `Idempotency-Key` header on every attempt** (`fetchWithRetry`'s\n  `opts.idempotencyKey` injects it for you).\n- Unbound `nonceFromIdempotencyKey(key)` derives from the key string alone, so keys must be\n  globally unique per logical payment. Pass the optional\n  `{ from, chainId, verifyingContract }` binding to domain-separate the nonce per\n  payer/chain/token instead.\n\n### Retry layer\n\n`fetchWithRetry(url, build, maxRetries, opts)` retries **transient failures only** (thrown\nfetch, 5xx, 429, 408; honors `Retry-After`). A caller abort — via `opts.signal` or a `signal`\ninside the `RequestInit` that `build()` returns — surfaces immediately, even mid-backoff, and\na `build()` throw (e.g. a signing refusal) propagates without retry. Terminal transport\nfailures are wrapped as `AgentXError` code `network_error` with the original as `cause`.\n\n## Error handling\n\nEvery error this package throws on its documented paths is an `AgentXError` carrying a\nmachine-readable **`err.code`** (`invalid_challenge`, `network_mismatch`, `asset_mismatch`,\n`payto_mismatch`, `unpinned_network`, `unsupported_network`, `domain_mismatch`,\n`invalid_amount`, `spend_cap_exceeded`, `network_error`, `aborted`). **`err.code` is the\nstable dispatch contract** — prefer it for exit codes and machine handling.\n\n`instanceof AgentXError` / `instanceof SpendCapError` also work across module-format\nboundaries: the package ships dual esm+cjs builds (two runtime class objects from one\ninstall), and a process-global `Symbol.for` brand keeps `instanceof` true across them, and\nacross duplicated installs of compatible versions. It still fails across **incompatible\nmajors** (each major brands its own contract) — `err.code` never does.\n\n`@agentkv/client` re-exports `AgentXError` as `AgentKVError`; both names are the same class\nobject.\n\n## Key handling\n\nAccount keys (`ak_…`) and wallet private keys are bearer capabilities. Never log, print, or\npersist them; `buildBearerHeaders` puts the raw key on the wire over TLS only.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}