{"_id":"@agent-fuel/sdk","_rev":"6-79023f415c02152d839fb95f74b106e2","name":"@agent-fuel/sdk","dist-tags":{"latest":"0.3.2"},"versions":{"0.1.0":{"name":"@agent-fuel/sdk","version":"0.1.0","keywords":["solana","x402","ai-agent","credit-vault","reputation","anchor"],"license":"Apache-2.0","_id":"@agent-fuel/sdk@0.1.0","maintainers":[{"name":"frankolien","email":"Frankolien123@gmail.com"}],"homepage":"https://github.com/frankolien/agent_fuel/tree/main/clients/sdk#readme","bugs":{"url":"https://github.com/frankolien/agent_fuel/issues"},"dist":{"shasum":"88883f9af95c2bd635d86a7829cfb4d2f52924e8","tarball":"https://registry.npmjs.org/@agent-fuel/sdk/-/sdk-0.1.0.tgz","fileCount":21,"integrity":"sha512-mXSCYVhR/T+Wcwm2ApWITUO9gNfP9meDh2cA0ekSlymfYgRdCVM4wBAj3zmg6s74Nq90hEkAyC61KAGMSR+z6A==","signatures":[{"sig":"MEUCICpJDjTwgxhhfnANwTtXtCsKf+4OWOh/3mvKW/hn7MrRAiEA7LN5E0TCQt7vA2N2glMW4+oNNiIi/s2hltTTg3CvAX0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-fuel%2fsdk@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":865906},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./idl/reputation":{"types":"./dist/idl/reputation.d.ts","import":"./dist/idl/reputation.js","require":"./dist/idl/reputation.cjs"},"./idl/credit-vault":{"types":"./dist/idl/credit-vault.d.ts","import":"./dist/idl/credit-vault.js","require":"./dist/idl/credit-vault.cjs"}},"gitHead":"4aaa836b475bfc1ed6d694a676988a36508e251d","scripts":{"dev":"tsup --watch","lint":"eslint . --max-warnings=0","build":"tsup","smoke":"node scripts/smoke.mjs","format":"prettier --write .","typecheck":"tsc --noEmit","vendor-idl":"node scripts/vendor-idl.mjs","prepublishOnly":"npm run typecheck && npm run lint && npm run build"},"_npmUser":{"name":"frankolien","email":"Frankolien123@gmail.com"},"repository":{"url":"git+https://github.com/frankolien/agent_fuel.git","type":"git","directory":"clients/sdk"},"_npmVersion":"10.8.2","description":"TypeScript SDK for Agent Fuel — credit vault + reputation primitives for AI agents on Solana.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"ws":"^8.21.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","eslint":"^9.14.0","prettier":"^3.3.3","@types/ws":"^8.18.1","typescript":"^5.6.3","@types/node":"^25.9.1","@types/bn.js":"^5.2.0","@solana/web3.js":"^1.95.4","@coral-xyz/anchor":"^0.31.0","@typescript-eslint/parser":"^8.13.0","@typescript-eslint/eslint-plugin":"^8.13.0"},"peerDependencies":{"@solana/web3.js":"^1.95.0","@coral-xyz/anchor":"^0.31.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1779852070907_0.8610291601201716","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@agent-fuel/sdk","version":"0.1.1","keywords":["solana","x402","ai-agent","credit-vault","reputation","anchor"],"license":"Apache-2.0","_id":"@agent-fuel/sdk@0.1.1","maintainers":[{"name":"frankolien","email":"Frankolien123@gmail.com"}],"homepage":"https://github.com/frankolien/agent_fuel/tree/main/clients/sdk#readme","bugs":{"url":"https://github.com/frankolien/agent_fuel/issues"},"dist":{"shasum":"21b1bb897078a4a758f54fada77c2b409172777b","tarball":"https://registry.npmjs.org/@agent-fuel/sdk/-/sdk-0.1.1.tgz","fileCount":21,"integrity":"sha512-USPWQkgUoLCFPvZYmSADKhWrGZQt8j0s69ieVVh0RExrrjzddza3ky1dPtczAYmyvsYYLPq+yM0AaxDL1yYHnQ==","signatures":[{"sig":"MEUCIC8HZspy9GUVkVHYwr0FM6XAlNEdCPc5l/2lZgUTqZsNAiEA1nGFmsHEurO9b7ltHk7Owk2R4TYENo4vPDMx9YBUl8E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-fuel%2fsdk@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":941169},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./idl/reputation":{"types":"./dist/idl/reputation.d.ts","import":"./dist/idl/reputation.js","require":"./dist/idl/reputation.cjs"},"./idl/credit-vault":{"types":"./dist/idl/credit-vault.d.ts","import":"./dist/idl/credit-vault.js","require":"./dist/idl/credit-vault.cjs"}},"gitHead":"57788f988e0255ba507ef5b0a6e9f1e7e9ad7730","scripts":{"dev":"tsup --watch","lint":"eslint . --max-warnings=0","build":"tsup","smoke":"node scripts/smoke.mjs","format":"prettier --write .","typecheck":"tsc --noEmit","vendor-idl":"node scripts/vendor-idl.mjs","devnet:topup":"node scripts/topup.mjs","prepublishOnly":"npm run typecheck && npm run lint && npm run build","devnet:bootstrap":"node scripts/devnet-bootstrap.mjs","devnet:update-policy":"node scripts/update-policy.mjs"},"_npmUser":{"name":"frankolien","email":"Frankolien123@gmail.com"},"repository":{"url":"git+https://github.com/frankolien/agent_fuel.git","type":"git","directory":"clients/sdk"},"_npmVersion":"10.8.2","description":"TypeScript SDK for Agent Fuel — credit vault + reputation primitives for AI agents on Solana.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"ws":"^8.21.0","@coral-xyz/anchor":"^0.31.0","@solana/spl-token":"^0.4.14"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","eslint":"^9.14.0","prettier":"^3.3.3","@types/ws":"^8.18.1","typescript":"^5.6.3","@types/node":"^25.9.1","@types/bn.js":"^5.2.0","@typescript-eslint/parser":"^8.13.0","@typescript-eslint/eslint-plugin":"^8.13.0"},"peerDependencies":{"@solana/web3.js":"^1.95.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.1_1780025886326_0.1939055150392146","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@agent-fuel/sdk","version":"0.2.0","keywords":["solana","x402","ai-agent","credit-vault","reputation","anchor"],"license":"Apache-2.0","_id":"@agent-fuel/sdk@0.2.0","maintainers":[{"name":"frankolien","email":"Frankolien123@gmail.com"}],"homepage":"https://github.com/frankolien/agent_fuel/tree/main/clients/sdk#readme","bugs":{"url":"https://github.com/frankolien/agent_fuel/issues"},"dist":{"shasum":"5e50ffff2d9b7e27cd6b2389606c3ba22f4b204b","tarball":"https://registry.npmjs.org/@agent-fuel/sdk/-/sdk-0.2.0.tgz","fileCount":21,"integrity":"sha512-dY7XJu5sL3VHOTm7lexAd4+sWcV78kAkp7xLAqgezYd9vFB3qGexJyxlkedy1ZrQ0UFJw7h/FUL7xJFrWgat7Q==","signatures":[{"sig":"MEYCIQDEDeW65zS3LUrX+mIjj2dCyf5JEdJpm/dzs9TQ28XNdgIhAPE0SryQ/ylHcmPfnAp3miIvevKSlt0t/pvhmODVxORR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-fuel%2fsdk@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1150117},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./idl/reputation":{"types":"./dist/idl/reputation.d.ts","import":"./dist/idl/reputation.js","require":"./dist/idl/reputation.cjs"},"./idl/credit-vault":{"types":"./dist/idl/credit-vault.d.ts","import":"./dist/idl/credit-vault.js","require":"./dist/idl/credit-vault.cjs"}},"gitHead":"f57b9b1df5d774b793235af9c4d47b359410ed7b","scripts":{"dev":"tsup --watch","lint":"eslint . --max-warnings=0","build":"tsup","smoke":"node scripts/smoke.mjs","format":"prettier --write .","typecheck":"tsc --noEmit","vendor-idl":"node scripts/vendor-idl.mjs","devnet:topup":"node scripts/topup.mjs","prepublishOnly":"npm run typecheck && npm run lint && npm run build","devnet:bootstrap":"node scripts/devnet-bootstrap.mjs","devnet:update-policy":"node scripts/update-policy.mjs"},"_npmUser":{"name":"frankolien","email":"Frankolien123@gmail.com"},"repository":{"url":"git+https://github.com/frankolien/agent_fuel.git","type":"git","directory":"clients/sdk"},"_npmVersion":"10.8.2","description":"TypeScript SDK for Agent Fuel — credit vault + reputation primitives for AI agents on Solana.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"ws":"^8.21.0","@coral-xyz/anchor":"^0.31.0","@solana/spl-token":"^0.4.14"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","eslint":"^9.14.0","prettier":"^3.3.3","@types/ws":"^8.18.1","typescript":"^5.6.3","@types/node":"^25.9.1","@types/bn.js":"^5.2.0","@typescript-eslint/parser":"^8.13.0","@typescript-eslint/eslint-plugin":"^8.13.0"},"peerDependencies":{"@solana/web3.js":"^1.95.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.2.0_1780262448483_0.0390929125026398","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@agent-fuel/sdk","version":"0.3.0","keywords":["solana","x402","ai-agent","credit-vault","reputation","anchor"],"license":"Apache-2.0","_id":"@agent-fuel/sdk@0.3.0","maintainers":[{"name":"frankolien","email":"Frankolien123@gmail.com"}],"homepage":"https://github.com/frankolien/agent_fuel/tree/main/clients/sdk#readme","bugs":{"url":"https://github.com/frankolien/agent_fuel/issues"},"bin":{"agent-fuel":"dist/cli.cjs"},"dist":{"shasum":"cba5a961103dd148ce50f21cbbc872f118c09efb","tarball":"https://registry.npmjs.org/@agent-fuel/sdk/-/sdk-0.3.0.tgz","fileCount":25,"integrity":"sha512-/ei/Uln50szXodmmXe1DTqeUnHlzzGe937zqgXHb+qiqaPVHQAEiP8Rt7DdLuyWjASu6aWeOZiT0sFfIVeQv/g==","signatures":[{"sig":"MEUCIQDzOkEoUMGiYnziOrRoLqEXjCvDzAkU39Q2JjooL/AXMgIgAwFPS0IocmV/V5xytGrSYT28dxSvsT16T9NauoKEN+4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-fuel%2fsdk@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1835672},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./idl/reputation":{"types":"./dist/idl/reputation.d.ts","import":"./dist/idl/reputation.js","require":"./dist/idl/reputation.cjs"},"./idl/credit-vault":{"types":"./dist/idl/credit-vault.d.ts","import":"./dist/idl/credit-vault.js","require":"./dist/idl/credit-vault.cjs"}},"gitHead":"7900773cc03ba36290670abaece8302934c516b2","scripts":{"dev":"tsup --watch","lint":"eslint . --max-warnings=0","build":"tsup","smoke":"node scripts/smoke.mjs","format":"prettier --write .","typecheck":"tsc --noEmit","vendor-idl":"node scripts/vendor-idl.mjs","devnet:topup":"node scripts/topup.mjs","prepublishOnly":"npm run typecheck && npm run lint && npm run build","devnet:bootstrap":"node scripts/devnet-bootstrap.mjs","devnet:update-policy":"node scripts/update-policy.mjs"},"_npmUser":{"name":"frankolien","email":"Frankolien123@gmail.com"},"repository":{"url":"git+https://github.com/frankolien/agent_fuel.git","type":"git","directory":"clients/sdk"},"_npmVersion":"10.8.2","description":"TypeScript SDK for Agent Fuel — credit vault + reputation primitives for AI agents on Solana.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"ws":"^8.21.0","commander":"^12.1.0","@coral-xyz/anchor":"^0.31.0","@solana/spl-token":"^0.4.14"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","eslint":"^9.14.0","prettier":"^3.3.3","@types/ws":"^8.18.1","typescript":"^5.6.3","@types/node":"^25.9.1","@types/bn.js":"^5.2.0","@typescript-eslint/parser":"^8.13.0","@typescript-eslint/eslint-plugin":"^8.13.0"},"peerDependencies":{"@solana/web3.js":"^1.95.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.3.0_1780263382547_0.5210377484753363","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@agent-fuel/sdk","version":"0.3.1","keywords":["solana","x402","ai-agent","credit-vault","reputation","anchor"],"license":"Apache-2.0","_id":"@agent-fuel/sdk@0.3.1","maintainers":[{"name":"frankolien","email":"Frankolien123@gmail.com"}],"homepage":"https://github.com/frankolien/agent_fuel/tree/main/clients/sdk#readme","bugs":{"url":"https://github.com/frankolien/agent_fuel/issues"},"bin":{"agent-fuel":"dist/cli.cjs"},"dist":{"shasum":"8eedbb15b1ad20c84158285cf46722ca90be2a1f","tarball":"https://registry.npmjs.org/@agent-fuel/sdk/-/sdk-0.3.1.tgz","fileCount":25,"integrity":"sha512-FlvDwvtvtSdijpN8CgQvFVFub5D5hAcvAWutJdGUbnO2bAvMgnonno48ddkjM72EikLJoMZjLBKj236H4PZBXQ==","signatures":[{"sig":"MEUCIQCHdSXYDTwY0bMsOakdO9lwLk+tFyMs9sx+aQGGTircIAIgUkzngJDkpISjGMVmaNY3c3eut9eNV9P/n6SSiwk1EbE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-fuel%2fsdk@0.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1843960},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./idl/reputation":{"types":"./dist/idl/reputation.d.ts","import":"./dist/idl/reputation.js","require":"./dist/idl/reputation.cjs"},"./idl/credit-vault":{"types":"./dist/idl/credit-vault.d.ts","import":"./dist/idl/credit-vault.js","require":"./dist/idl/credit-vault.cjs"}},"gitHead":"ee74b1956e2ab499395b26403b951fb2e99c8962","scripts":{"dev":"tsup --watch","lint":"eslint . --max-warnings=0","build":"tsup","smoke":"node scripts/smoke.mjs","format":"prettier --write .","typecheck":"tsc --noEmit","vendor-idl":"node scripts/vendor-idl.mjs","devnet:topup":"node scripts/topup.mjs","prepublishOnly":"npm run typecheck && npm run lint && npm run build","devnet:bootstrap":"node scripts/devnet-bootstrap.mjs","devnet:update-policy":"node scripts/update-policy.mjs"},"_npmUser":{"name":"frankolien","email":"Frankolien123@gmail.com"},"repository":{"url":"git+https://github.com/frankolien/agent_fuel.git","type":"git","directory":"clients/sdk"},"_npmVersion":"10.8.2","description":"TypeScript SDK for Agent Fuel — credit vault + reputation primitives for AI agents on Solana.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"ws":"^8.21.0","commander":"^12.1.0","@coral-xyz/anchor":"^0.31.0","@solana/spl-token":"^0.4.14"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","eslint":"^9.14.0","prettier":"^3.3.3","@types/ws":"^8.18.1","typescript":"^5.6.3","@types/node":"^25.9.1","@types/bn.js":"^5.2.0","@typescript-eslint/parser":"^8.13.0","@typescript-eslint/eslint-plugin":"^8.13.0"},"peerDependencies":{"@solana/web3.js":"^1.95.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.3.1_1780267675248_0.9769754072806685","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@agent-fuel/sdk","version":"0.3.2","description":"TypeScript SDK for Agent Fuel — credit vault + reputation primitives for AI agents on Solana.","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/frankolien/agent_fuel.git","directory":"clients/sdk"},"homepage":"https://github.com/frankolien/agent_fuel/tree/main/clients/sdk#readme","bugs":{"url":"https://github.com/frankolien/agent_fuel/issues"},"keywords":["solana","x402","ai-agent","credit-vault","reputation","anchor"],"publishConfig":{"access":"public","provenance":true},"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","bin":{"agent-fuel":"dist/cli.cjs"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./idl/reputation":{"types":"./dist/idl/reputation.d.ts","import":"./dist/idl/reputation.js","require":"./dist/idl/reputation.cjs"},"./idl/credit-vault":{"types":"./dist/idl/credit-vault.d.ts","import":"./dist/idl/credit-vault.js","require":"./dist/idl/credit-vault.cjs"}},"sideEffects":false,"scripts":{"vendor-idl":"node scripts/vendor-idl.mjs","build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","lint":"eslint . --max-warnings=0","format":"prettier --write .","smoke":"node scripts/smoke.mjs","devnet:bootstrap":"node scripts/devnet-bootstrap.mjs","devnet:topup":"node scripts/topup.mjs","devnet:update-policy":"node scripts/update-policy.mjs","prepublishOnly":"npm run typecheck && npm run lint && npm run build"},"engines":{"node":">=18.18"},"peerDependencies":{"@solana/web3.js":"^1.95.0"},"devDependencies":{"@types/bn.js":"^5.2.0","@types/node":"^25.9.1","@types/ws":"^8.18.1","@typescript-eslint/eslint-plugin":"^8.13.0","@typescript-eslint/parser":"^8.13.0","eslint":"^9.14.0","prettier":"^3.3.3","tsup":"^8.3.5","typescript":"^5.6.3"},"dependencies":{"@coral-xyz/anchor":"^0.31.0","@solana/spl-token":"^0.4.14","commander":"^12.1.0","ws":"^8.21.0"},"_id":"@agent-fuel/sdk@0.3.2","gitHead":"51cbf845ed4dc422b3e764b43ae3d9c811dd222f","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Vz9QYV6hQUhqpZISp0uMP02Sl1VmU/g6vT6DvJNl0aVrjEAvCsse9awIW75i+1GJj+720aGbqxmJ+hia9Bm/cg==","shasum":"9f258002e9e94d91ecce81fa79c4fc9f6d465ca9","tarball":"https://registry.npmjs.org/@agent-fuel/sdk/-/sdk-0.3.2.tgz","fileCount":25,"unpackedSize":1849097,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-fuel%2fsdk@0.3.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBlwO0o/Ku7Le8qKS7do42C0Sexl7T/kAq1gwwC9LkUMAiEA9Te9eE049x5xmMmGlWyGetKtdjzSDYuQnl5VSuz3fwM="}]},"_npmUser":{"name":"frankolien","email":"Frankolien123@gmail.com"},"directories":{},"maintainers":[{"name":"frankolien","email":"Frankolien123@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.3.2_1780268456806_0.5370080814254992"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-27T03:21:10.610Z","modified":"2026-05-31T23:00:57.299Z","0.1.0":"2026-05-27T03:21:11.143Z","0.1.1":"2026-05-29T03:38:06.485Z","0.2.0":"2026-05-31T21:20:48.672Z","0.3.0":"2026-05-31T21:36:22.726Z","0.3.1":"2026-05-31T22:47:55.438Z","0.3.2":"2026-05-31T23:00:56.993Z"},"bugs":{"url":"https://github.com/frankolien/agent_fuel/issues"},"license":"Apache-2.0","homepage":"https://github.com/frankolien/agent_fuel/tree/main/clients/sdk#readme","keywords":["solana","x402","ai-agent","credit-vault","reputation","anchor"],"repository":{"type":"git","url":"git+https://github.com/frankolien/agent_fuel.git","directory":"clients/sdk"},"description":"TypeScript SDK for Agent Fuel — credit vault + reputation primitives for AI agents on Solana.","maintainers":[{"name":"frankolien","email":"Frankolien123@gmail.com"}],"readme":"# @agent-fuel/sdk\n\nTypeScript SDK for [Agent Fuel](https://github.com/TODO/agent_fuel) — credit vault + reputation primitives for AI agents on Solana.\n\n> **Status:** `0.3.0`. Full read/write/stream surface live, plus the `agent-fuel` CLI. Published to npm with provenance.\n\n## CLI\n\nInstalling the package also installs an `agent-fuel` binary. Read commands work with zero setup over `npx`:\n\n```bash\nnpx @agent-fuel/sdk vault   <OWNER_PUBKEY> <AGENT_PUBKEY>\nnpx @agent-fuel/sdk score   <AGENT_PUBKEY>\nnpx @agent-fuel/sdk policy  <OWNER_PUBKEY> <AGENT_PUBKEY>\nnpx @agent-fuel/sdk service <AUTHORITY_PUBKEY>\n```\n\nAction commands take a `solana-keygen`-style keypair JSON:\n\n```bash\nagent-fuel pay \\\n  --keypair         ~/.config/solana/agent.json \\\n  --service-keypair ~/.config/solana/svc-pyth.json \\\n  --owner           <OWNER_PUBKEY> \\\n  --amount          0.5\n\nagent-fuel request-spend \\\n  --keypair ~/.config/solana/agent.json \\\n  --owner   <OWNER_PUBKEY> \\\n  --service <SERVICE_PUBKEY> \\\n  --amount  30\n\nagent-fuel register-service \\\n  --sponsor         ~/.config/solana/id.json \\\n  --service-keypair ~/.config/solana/svc-pyth.json \\\n  --name            \"Pyth BTC Feed\" \\\n  --category        DataFeed\n```\n\nPlus `agent-fuel keygen [--out path]` to generate a fresh keypair (pubkey to stdout, secret to stderr — redirect with `2>` to save). Global flags: `--cluster devnet|mainnet-beta|testnet|localnet`, `--rpc <url>`, `--api-base <url>`, `--json` for machine-readable output.\n\n## The six functions\n\n| Function | Returns | What it does |\n| --- | --- | --- |\n| `fuel.spend({ service, amountUsdc })` | `{ signature }` | Pays a service from the agent's vault. Local six-check policy guardrail, then a single signed transaction. Idempotently creates the service's USDC ATA if needed. |\n| `fuel.getScore(agent?)` | `ReputationLookup` | Public reputation snapshot via REST. Score is `null` for unscored agents. |\n| `fuel.getVaultBalance(ref?)` | `CreditVaultAccount` | On-chain credit vault state with a derived `balance` field. Defaults to the agent's own vault when `owner` was passed to the constructor. |\n| `fuel.getPolicy(ref?)` | `SpendPolicyAccount` | On-chain spend policy: per-tx / hourly / lifetime caps, whitelist, freeze flag. |\n| `fuel.checkService(serviceAuthority)` | `ServiceRegistryAccount` | Service registry lookup by the registering wallet's pubkey. |\n| `fuel.onEvent(callback, options?)` | `Subscription` | WebSocket stream of events for an agent. Auto-reconnect with backoff. |\n\nPlus one fetch wrapper for the x402 protocol — see [Paying with x402](#paying-with-x402) below.\n\n## Install\n\n```bash\nnpm install @agent-fuel/sdk @solana/web3.js @coral-xyz/anchor\n```\n\n`@solana/web3.js` and `@coral-xyz/anchor` are peer dependencies; pin them yourself so your bot and the SDK share the same RPC client.\n\n## Usage\n\n```ts\nimport { Keypair, PublicKey } from \"@solana/web3.js\";\nimport { AgentFuel } from \"@agent-fuel/sdk\";\n\nconst agent = Keypair.generate(); // load yours from a keystore\n\nconst fuel = new AgentFuel({\n  agent,\n  owner: new PublicKey(\"...\"),      // the wallet that funded your vault\n  cluster: \"devnet\",\n  rpc: \"https://api.devnet.solana.com\",\n  apiBase: \"https://api.agentfuel.online\", // your Agent Fuel backend\n});\n```\n\n`owner` is optional. When you pass it, the agent-side methods (`getVaultBalance`, `getPolicy`, `spend`) default to your own vault — call them with no args. Pass `owner` per call only when inspecting someone else's vault. Calling a method that needs the owner without configuring one anywhere throws `OwnerNotConfiguredError`.\n\n## Read methods\n\n```ts\n// Public reputation snapshot (REST, no auth). Omit the arg to read your own.\nconst score = await fuel.getScore();\nconst otherScore = await fuel.getScore(otherAgentPubkey);\n\n// On-chain credit vault state. With `owner` set on the constructor, no args\n// reads your own vault. Pass a ref to inspect someone else's.\nconst vault = await fuel.getVaultBalance();\nconsole.log(vault.balance, vault.frozen);\nconst otherVault = await fuel.getVaultBalance({ owner: otherOwner, agent: otherAgent });\n\n// Same shape for the policy.\nconst policy = await fuel.getPolicy();\n\n// Service registry lookup by the service's authority pubkey.\nconst service = await fuel.checkService(serviceAuthorityPubkey);\n```\n\nAll methods throw `AccountNotFoundError` when the target doesn't exist on-chain (or returns 404 from the backend), and `HttpError` for non-2xx REST responses. Field names mirror the on-chain layout in `snake_case` so they line up with the backend's REST responses.\n\n## Paying a service\n\n```ts\nconst { signature } = await fuel.spend({\n  service: serviceAuthorityPubkey,\n  amountUsdc: 250_000,              // micro-USDC (0.25 USDC)\n});\n```\n\n`spend()` fetches the current vault + policy and applies the same six-check ladder the on-chain program enforces ([programs/credit_vault/src/policy.rs](../../programs/credit_vault/src/policy.rs#L11)) before submitting. Each policy failure surfaces as a typed error so the caller can branch on it without parsing strings:\n\n| Error | When |\n| --- | --- |\n| `VaultFrozenError` | `vault.frozen === true` |\n| `ZeroAmountError` | `amountUsdc <= 0` |\n| `NotWhitelistedError` | Whitelist is set and `service` isn't in it |\n| `PerTxLimitExceededError` | `amountUsdc > policy.per_tx_limit_usdc` |\n| `HourlyLimitExceededError` | Rolling 9 000-slot window would exceed `policy.hourly_limit_usdc` |\n| `LifetimeLimitExceededError` | `vault.total_spent + amountUsdc > policy.lifetime_limit_usdc` |\n\nAll six inherit from `SpendPolicyError` for a single catch-all. The same exceptions are thrown for chain-side failures too — if the on-chain `VaultError` lands between the pre-flight and the transaction (concurrent spend, window roll-over), the SDK maps the Anchor error code back to the matching typed error so your `try/catch` doesn't have to branch on where the rejection came from.\n\nThe service's USDC associated token account is created on-demand — the SDK prepends an idempotent ATA-create instruction before every `spend`, so callers don't need to pre-flight whether the service has ever received USDC. The agent pays the rent (~0.002 SOL).\n\n## Live events\n\n```ts\nconst sub = fuel.onEvent(\n  (frame) => {\n    // frame.event_name is one of: Spent, Claimed, ScoreComputed, Deposited, ...\n    console.log(frame.event_name, frame.payload);\n  },\n  { onStatus: (s) => console.log(\"ws:\", s) },\n);\n\n// later\nsub.close();\n```\n\n`onEvent()` opens a WebSocket to `/ws/agents/:pk` on the configured `apiBase`, parses each JSON frame into a typed `LiveEventFrame`, and fires `callback` for every event the backend broadcasts for that agent. Connection status flows through `onStatus`: `connecting → open → reconnecting → open → … → closed`. Reconnect uses exponential backoff (1 s → 2 s → 4 s → …, capped at 30 s) and the subscription survives transient network failures until you call `sub.close()`.\n\nBy default it subscribes to your own `agent`. Pass `{ agent }` to watch a different agent.\n\nRuntime note: the SDK prefers `globalThis.WebSocket` (browsers, Node 22+) and falls back to the `ws` package for older Node, resolved lazily so browser bundlers don't pull `ws` in.\n\n## Paying with x402\n\n`paymentRequired(fuel, options?)` returns a `fetch`-shaped function that transparently handles HTTP 402:\n\n```ts\nimport { paymentRequired } from \"@agent-fuel/sdk\";\n\nconst fetchWithPayments = paymentRequired(fuel, {\n  onPaymentRequired: (req) => console.log(\"paying\", req.amountUsdc, \"to\", req.recipient),\n  onPaid: (sig) => console.log(\"signature:\", sig),\n});\n\nconst res = await fetchWithPayments(\"https://data.example/feed\");\nconst body = await res.json();\n```\n\nFlow:\n\n1. The wrapped request runs.\n2. If the response is `402`, the SDK parses the `X-Payment-Required` header (JSON; or the response body as a fallback) for `recipient` and `amountUsdc` — `payTo`/`maxAmountRequired` are accepted as aliases for x402-spec servers.\n3. `fuel.spend()` is called with those values. All six policy guardrails apply; any failure throws the matching `SpendPolicyError` and the request is *not* retried.\n4. The original request is retried once with `X-Payment: <signature>`.\n\nA second `402` propagates to the caller (no infinite loop). Malformed payment payloads throw `PaymentParseError`.\n\nThere's a runnable example under [`examples/x402-quickstart/`](./examples/x402-quickstart/) with both a dry-run mode (no Solana, 5-second smoke) and a real-devnet mode.\n\n## Program IDs\n\nRe-exported from the vendored IDLs (see [`src/idl/`](src/idl/)):\n\n```ts\nimport { PROGRAM_IDS } from \"@agent-fuel/sdk\";\n\nPROGRAM_IDS.reputation; // PublicKey\nPROGRAM_IDS.creditVault; // PublicKey\n```\n\n## IDL access\n\nRaw IDLs are exposed under sub-paths for downstream tooling (e.g. Anchor's `Program` constructor):\n\n```ts\nimport reputationIdl from \"@agent-fuel/sdk/idl/reputation\";\nimport creditVaultIdl from \"@agent-fuel/sdk/idl/credit-vault\";\n```\n\n## Development\n\n```bash\nnpm install\nnpm run typecheck\nnpm run lint\nnpm run build        # emits dist/ (ESM + CJS + .d.ts) via tsup\n```\n\n### Bootstrapping a devnet sandbox\n\n`npm run devnet:bootstrap` provisions a complete devnet environment in one command: deploys a test USDC mint, mints initial supply to the owner, registers a service, initializes an agent profile, creates + funds a vault, and verifies the whole graph by reading it back through the SDK.\n\n```bash\nnpm run build           # bootstrap imports from dist/\nnpm run devnet:bootstrap\n```\n\nDefaults to the Solana CLI keypair at `~/.config/solana/id.json` as the owner-agent identity (needs ~0.05 SOL on devnet — `solana airdrop 1 --url devnet` if low). Generates the service + mint keypairs under `~/.config/agent-fuel/`, idempotently — reruns after a partial failure are safe.\n\nThe script writes a `devnet-config.json` manifest with every pubkey + path, and prints the exact env-var block to copy into the [x402-quickstart](./examples/x402-quickstart/) example for a real end-to-end `spend()` against devnet.\n\n### Refreshing the IDLs\n\nThe IDLs under `src/idl/` are committed copies — the SDK build, CI, and downstream consumers never depend on `anchor build`. When the Anchor programs change, re-vendor manually and commit:\n\n```bash\n# at repo root\nanchor build\n# in clients/sdk/\nnpm run vendor-idl\ngit add src/idl/\n```\n\n### Releasing\n\nReleases are tag-driven. The [`SDK Release`](../../.github/workflows/sdk-release.yml) workflow publishes to npm with provenance on any `sdk-v*` tag push, and refuses to publish if the tag, `package.json` version, and `CHANGELOG.md` don't all agree.\n\n```bash\n# 1. bump version in package.json + add a `## [x.y.z]` section to CHANGELOG.md\n# 2. commit\ngit commit -am \"release(sdk): v0.1.1\"\n# 3. tag + push\ngit tag sdk-v0.1.1\ngit push --follow-tags\n# 4. (after publish lands) bump the pin in clients/web/package.json\n```\n\nThe workflow needs the repo secret `NPM_TOKEN` (an automation token with publish rights to the `@agent-fuel` scope). Provenance attestation is handled by GitHub OIDC — no extra config needed beyond the `id-token: write` permission already in the workflow.\n","readmeFilename":"README.md"}