{"_id":"@bolthub/pay","_rev":"13-5778c82a4f7d949aec542e06d912d5ef","name":"@bolthub/pay","dist-tags":{"latest":"0.8.1"},"versions":{"0.1.0":{"name":"@bolthub/pay","version":"0.1.0","keywords":["l402","x402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","_id":"@bolthub/pay@0.1.0","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"dist":{"shasum":"689f1ba2d4acc5be3dff908a0a1c599683f4c11b","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.1.0.tgz","fileCount":26,"integrity":"sha512-zRPX7UzqtCIVG7PRi8jYc9tZVlc+mazLmtxqz2JXW1yzym2Hb7R9AzWRi44qFrbDSf2yASVptJmtVZ6rQB55NQ==","signatures":[{"sig":"MEYCIQCH7jCaK4YN+vk5PdyjjW83UrlT5e7IZtEbKePBETEE0AIhAJbuJCyH6ttgo+JLoc4UTGCT4PRk++UltFe0s75bYWXI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":228385},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"d369cd3c790ab4723f6a2b8e21a492f86a4681b3","scripts":{"demo":"bun run examples/two-rails-demo.ts","test":"bun test","build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"repository":{"url":"git+https://github.com/signaltech-org/bolthub-sdk.git","type":"git","directory":"packages/pay"},"_npmVersion":"10.9.8","description":"Charge for an MCP tool or HTTP endpoint in a few lines — rail-agnostic (L402 today, x402 next) payments for AI-agent tool calls","directories":{},"_nodeVersion":"22.23.0","_hasShrinkwrap":false,"devDependencies":{"zod":"^3","@types/node":"^25.5.0","@modelcontextprotocol/sdk":"^1.27.1"},"_npmOperationalInternal":{"tmp":"tmp/pay_0.1.0_1782956790462_0.5086867849350962","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@bolthub/pay","version":"0.2.0","keywords":["l402","x402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","_id":"@bolthub/pay@0.2.0","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"dist":{"shasum":"69622b95aa70924630aad7c8ed5d901627c70cfe","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.2.0.tgz","fileCount":30,"integrity":"sha512-VRpb2He6KrFjQNYXWvnpq2qqCMRuyQzznGrz6iamaK+fSgzIFoCH4VzMXWNcfriMoFbMFmJhgv2PooDlcIwpJg==","signatures":[{"sig":"MEQCIAEeWAC/WKVR373Uya4FeFlBAtGilrE5VhbktVpRysAbAiAs7mLilFKqCvqMNy+Lho9MMotd4NeEAWxDPQxgraGzcw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":275962},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"1339e8eb9a90ac59bfc65e51f3bece5ce972e211","scripts":{"demo":"bun run examples/two-rails-demo.ts","test":"bun test","build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"repository":{"url":"git+https://github.com/signaltech-org/bolthub-sdk.git","type":"git","directory":"packages/pay"},"_npmVersion":"10.9.8","description":"Charge for an MCP tool or HTTP endpoint in a few lines — rail-agnostic (L402 today, x402 next) payments for AI-agent tool calls","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"zod":"^3","@types/node":"^25.5.0","@modelcontextprotocol/sdk":"^1.27.1"},"_npmOperationalInternal":{"tmp":"tmp/pay_0.2.0_1782962282398_0.8140045935909224","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@bolthub/pay","version":"0.3.0","keywords":["l402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","_id":"@bolthub/pay@0.3.0","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"dist":{"shasum":"51cdbe853579c5d366fe6f01c514022e3fe98c06","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.3.0.tgz","fileCount":22,"integrity":"sha512-QN4w8VQ7tpZfFx/OoLIzY9+oFd/CnKSbS+1isuFZV+uXr9hqt1IC/CVnsUDYGpGsQWsczdYmXuTh8cExlaGWuA==","signatures":[{"sig":"MEUCIF3Hqz6zZHLjwMMxGVZ1x+lgGZbWGLd36Q48vs96tJsEAiEAoxFjzqpXvTkCSxHItQQ6w1osuunsYIzlsGNmvANOXF8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":184909},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"2bb26d41c3b9cb570dc0e3feb0d377d4c6f41358","scripts":{"test":"bun test","build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"repository":{"url":"git+https://github.com/signaltech-org/bolthub-sdk.git","type":"git","directory":"packages/pay"},"_npmVersion":"10.9.8","description":"Charge for an MCP tool or HTTP endpoint in a few lines. Lightning-only (L402) micropayments for AI-agent tool calls","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"zod":"^3","@types/node":"^25.5.0","@modelcontextprotocol/sdk":"^1.27.1"},"_npmOperationalInternal":{"tmp":"tmp/pay_0.3.0_1783331325422_0.8309973744694823","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@bolthub/pay","version":"0.4.0","keywords":["l402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","_id":"@bolthub/pay@0.4.0","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"dist":{"shasum":"dfe1963f530a396f24ddb7d67b9dbec5ede6d5ea","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.4.0.tgz","fileCount":51,"integrity":"sha512-xhspsOU/H6FVefYeCE0Oj7i0+Z6CRhD47IG2ErodJcOdGLb0zO1YacuGIub4aSC0g8MM3sFLVzKU7R/Brm/Qdw==","signatures":[{"sig":"MEYCIQCvkUjT00jzIaMhstL2sHuyGe5rLgJql4MaOZmsGp+newIhAONqPYnzQ6F27WNDaCDV3LFPmQwzKMiRcMCbYLXgjrEG","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1408245},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","browser":"./dist/index.browser.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"5e93e01f5f7e9325ded1dd60ba51f726e5a7c9bf","scripts":{"test":"bun test","build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun build src/index.browser.ts --outfile dist/index.browser.mjs --target browser --format esm --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"repository":{"url":"git+https://github.com/signaltech-org/bolthub-sdk.git","type":"git","directory":"packages/pay"},"_npmVersion":"10.9.8","description":"The bolthub payments SDK: charge for an MCP tool or HTTP endpoint — and pay for them — in a few lines. Lightning-only (L402) micropayments for AI-agent tool calls","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"zod":"^3","macaroon":"^3.0.4","@types/node":"^25.5.0","@modelcontextprotocol/sdk":"^1.27.1"},"_npmOperationalInternal":{"tmp":"tmp/pay_0.4.0_1783385111823_0.566086961694521","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@bolthub/pay","version":"0.4.1","keywords":["l402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","_id":"@bolthub/pay@0.4.1","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"dist":{"shasum":"5e35f6d18635983157754325e8da66c020b6cfe2","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.4.1.tgz","fileCount":53,"integrity":"sha512-0OrLvmRcpVm2yOkFQBiJb7+5RMA07ATqnuyvW2iWU7Xe726471565ckzy5DsLAToHnUr9nKGxEqlimkGyXgsiQ==","signatures":[{"sig":"MEUCIQDIg99yLJxO4X348JFs0Xx1gl3drrNV6tgkk52/FYW5wgIgK1N38GNr6XY6bwobpDfa75+9C32zh9Yu2YovkH+voEw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.4.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1457055},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","browser":"./dist/index.browser.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"1b6cc4c6de45ae5a6ae3aade5418f660ffc53072","scripts":{"test":"bun test","build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun build src/index.browser.ts --outfile dist/index.browser.mjs --target browser --format esm --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"repository":{"url":"git+https://github.com/signaltech-org/bolthub-sdk.git","type":"git","directory":"packages/pay"},"_npmVersion":"10.9.8","description":"The bolthub payments SDK: charge for an MCP tool or HTTP endpoint — and pay for them — in a few lines. Lightning-only (L402) micropayments for AI-agent tool calls","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"zod":"^3","macaroon":"^3.0.4","@types/node":"^25.5.0","@modelcontextprotocol/sdk":"^1.27.1"},"_npmOperationalInternal":{"tmp":"tmp/pay_0.4.1_1783574316571_0.7726985702660905","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@bolthub/pay","version":"0.5.0","keywords":["l402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","_id":"@bolthub/pay@0.5.0","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"dist":{"shasum":"52bd76f9056e89843fa558185c83d04f0463b1bb","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.5.0.tgz","fileCount":65,"integrity":"sha512-pa7JsjS4inVQJiFb75x7383luztP2JyrmVweBvvyYKJI3/1feSxSyV+kPQE0o7KjJVKyQuU3WkRrLMV6mh14HA==","signatures":[{"sig":"MEUCIQC4bExMJFUK60dWa1wG3MpCtvuNC4tVNLH/p11XP6gOIAIgVrF8RoDylrfT+cd8h1hiw48brGQJCOU/M6gxIIMUiKY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1709407},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","browser":"./dist/index.browser.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"3e5a40c798a0a240b961b47382b7b3a1b07a7c69","scripts":{"test":"bun test","build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun build src/index.browser.ts --outfile dist/index.browser.mjs --target browser --format esm --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"repository":{"url":"git+https://github.com/signaltech-org/bolthub-sdk.git","type":"git","directory":"packages/pay"},"_npmVersion":"10.9.8","description":"The bolthub payments SDK: charge for an MCP tool or HTTP endpoint — and pay for them — in a few lines. Lightning-only (L402) micropayments for AI-agent tool calls","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"zod":"^3","macaroon":"^3.0.4","@types/node":"^25.5.0","@modelcontextprotocol/sdk":"^1.27.1"},"_npmOperationalInternal":{"tmp":"tmp/pay_0.5.0_1783645035513_0.06313919402713863","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@bolthub/pay","version":"0.5.1","keywords":["l402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","_id":"@bolthub/pay@0.5.1","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"dist":{"shasum":"fa8375758d3e54ecc4167d337e6404ed634ad16b","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.5.1.tgz","fileCount":65,"integrity":"sha512-5SBSFcpL6LuXeeT8jM4zHfuH4ZmYvBGLwuxjGDGPieV6A2yqe4VuVe3c4fzkKiHaw/v3jkysUzO3fap4HKXymQ==","signatures":[{"sig":"MEQCIFfeBaj/8vmzrmZSosAei5MxIaCaEod6GKEqm8Ef4ZBnAiBhjT1wHENKpLDaYlafAXpkT/8DElwjnVdSU5IByi5CWw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.5.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1722333},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","browser":"./dist/index.browser.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"62aee2b325239f8cb5c73eac7b0f827c47590667","scripts":{"test":"bun test","build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun build src/index.browser.ts --outfile dist/index.browser.mjs --target browser --format esm --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"repository":{"url":"git+https://github.com/signaltech-org/bolthub-sdk.git","type":"git","directory":"packages/pay"},"_npmVersion":"10.9.8","description":"The bolthub payments SDK: charge for an MCP tool or HTTP endpoint — and pay for them — in a few lines. Lightning-only (L402) micropayments for AI-agent tool calls","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"zod":"^3","macaroon":"^3.0.4","@types/node":"^25.5.0","@modelcontextprotocol/sdk":"^1.27.1"},"_npmOperationalInternal":{"tmp":"tmp/pay_0.5.1_1783664999808_0.37465945436396364","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@bolthub/pay","version":"0.6.0","keywords":["l402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","_id":"@bolthub/pay@0.6.0","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"dist":{"shasum":"e9917b29ad888ce8ddc5269881d1e560fac52d77","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.6.0.tgz","fileCount":65,"integrity":"sha512-MPI4MSYW1TCsOLWLvIyhJTTShC5XrVC5mSB+6s1a653ShKzcQaqTO8L0yqCxcajv2Xh2FF8BkPtRcYnH8Y4Qfw==","signatures":[{"sig":"MEUCIQDuS1EBIHkioywMwZkW+mD1PFrr7e+f502dvHrk32S6sAIgHiFTB4lXT1DofrSXlOxZXp0RG2tJKgVzohSdvgYie/Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.6.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1679835},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","browser":"./dist/index.browser.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"4be6b64a48c9ab3a12b1a60edeb60e38020d237b","scripts":{"test":"bun test","build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun build src/index.browser.ts --outfile dist/index.browser.mjs --target browser --format esm --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"repository":{"url":"git+https://github.com/signaltech-org/bolthub-sdk.git","type":"git","directory":"packages/pay"},"_npmVersion":"10.9.8","description":"The bolthub payments SDK: charge for an MCP tool or HTTP endpoint — and pay for them — in a few lines. Lightning-only (L402) micropayments for AI-agent tool calls","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"zod":"^3","macaroon":"^3.0.4","@types/node":"^25.5.0","@modelcontextprotocol/sdk":"^1.27.1"},"_npmOperationalInternal":{"tmp":"tmp/pay_0.6.0_1783671602819_0.6220515370372974","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@bolthub/pay","version":"0.7.0","keywords":["l402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","_id":"@bolthub/pay@0.7.0","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"dist":{"shasum":"16b1badc623675f79d1d714c5302492ec3059865","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.7.0.tgz","fileCount":65,"integrity":"sha512-0YsO45dEmzjbbnXUS2twmelZaXdm2ZRPXh6swhhYbRDUP7Qc56xky+H13iJBB42LkHQSaiYjNhxxohbKat+fpA==","signatures":[{"sig":"MEUCIEYWmH0idf4hOXxMJ9yA1QovLemEeOsrY3io/fksqQ+cAiEA9fxSjwoZRKBLj9uN99jybQrukfpAM4g37MnrIAC593E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.7.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1740969},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","browser":"./dist/index.browser.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"c69a1f4c4dfb4e1d26b57805ca428a2e58a5cc90","scripts":{"test":"bun test","build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun build src/index.browser.ts --outfile dist/index.browser.mjs --target browser --format esm --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"repository":{"url":"git+https://github.com/signaltech-org/bolthub-sdk.git","type":"git","directory":"packages/pay"},"_npmVersion":"10.9.8","description":"The bolthub payments SDK: charge for an MCP tool or HTTP endpoint — and pay for them — in a few lines. Lightning-only (L402) micropayments for AI-agent tool calls","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"zod":"^3","macaroon":"^3.0.4","@types/node":"^25.5.0","@modelcontextprotocol/sdk":"^1.27.1"},"_npmOperationalInternal":{"tmp":"tmp/pay_0.7.0_1783682942015_0.086648004756257","host":"s3://npm-registry-packages-npm-production"}},"0.7.1":{"name":"@bolthub/pay","version":"0.7.1","keywords":["l402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","_id":"@bolthub/pay@0.7.1","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"dist":{"shasum":"3bbc3d3019657d7519dae6e20b562565f67c60f0","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.7.1.tgz","fileCount":65,"integrity":"sha512-B6HQPx1iTLiiYehB0QwMmP9QWaokUO4wUp3Z9sVfZynwXVHkxErCzBNcYI6OFJ7IYjWoa+LZ4Y6bUggUYGY6WA==","signatures":[{"sig":"MEQCIAc3SzAcUcpVm9UqkbyAjN5gpXSfxCBHTh02qwjO6wswAiBVY668JO3/MBSDMc9CF31W81px7X9qRJHG843TI+cuzA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.7.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1755671},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","browser":"./dist/index.browser.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"be74fb95d2cc07a1aa07b58a55451c75e747e282","scripts":{"test":"bun test","build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun build src/index.browser.ts --outfile dist/index.browser.mjs --target browser --format esm --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"repository":{"url":"git+https://github.com/signaltech-org/bolthub-sdk.git","type":"git","directory":"packages/pay"},"_npmVersion":"10.9.8","description":"The bolthub payments SDK: charge for an MCP tool or HTTP endpoint — and pay for them — in a few lines. Lightning-only (L402) micropayments for AI-agent tool calls","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"zod":"^3","macaroon":"^3.0.4","@types/node":"^25.5.0","@modelcontextprotocol/sdk":"^1.27.1"},"_npmOperationalInternal":{"tmp":"tmp/pay_0.7.1_1784116384576_0.40097467456783464","host":"s3://npm-registry-packages-npm-production"}},"0.7.2":{"name":"@bolthub/pay","version":"0.7.2","keywords":["l402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","_id":"@bolthub/pay@0.7.2","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"dist":{"shasum":"d36038194d7a7df4bbec564dc1453a3df95d52a5","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.7.2.tgz","fileCount":65,"integrity":"sha512-r/nUdFZe61mHlf0B67lIzUSAv3JiYKCZu9C1CZgeYQztDeTpKc+1Lnwhgkg6ug70nJztptGqHogwGrdtiohmYQ==","signatures":[{"sig":"MEQCIBRfl4kWgFayuv3O8Mt0GSy63MpImTNo514GA3BMo8O5AiAv5gqn9Bw6fmspnd1sJZGkIX/RRo15lwK6XhKHY0HsLw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.7.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1761531},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","browser":"./dist/index.browser.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"b009040a407c1363c48e197dfdf65579dc12d7fa","scripts":{"test":"bun test","build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun build src/index.browser.ts --outfile dist/index.browser.mjs --target browser --format esm --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"repository":{"url":"git+https://github.com/signaltech-org/bolthub-sdk.git","type":"git","directory":"packages/pay"},"_npmVersion":"10.9.8","description":"The bolthub payments SDK: charge for an MCP tool or HTTP endpoint — and pay for them — in a few lines. Lightning-only (L402) micropayments for AI-agent tool calls","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"zod":"^3","macaroon":"^3.0.4","@types/node":"^25.5.0","@modelcontextprotocol/sdk":"^1.27.1"},"_npmOperationalInternal":{"tmp":"tmp/pay_0.7.2_1784610914966_0.4435022552391479","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"name":"@bolthub/pay","version":"0.8.0","keywords":["l402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","_id":"@bolthub/pay@0.8.0","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"dist":{"shasum":"9cfdd1eb2df3d4eeba1044223125f12248ff5aca","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.8.0.tgz","fileCount":65,"integrity":"sha512-+px2DAD2WBVeGFeMz2q+TwhUtrOBtPxQm0tPwe+/wjaKR8V8ZO48bEwjJh9YulEhvRiKNPBdXvQJowQFZG7Tyg==","signatures":[{"sig":"MEYCIQC19UNj6L+PGqUYnSYGcoju6rGVkD23030bDt95UwDMbAIhAImac5dBx8j3vSaAXiHxjwoKlHzrpKCDCAWorbwA/KVY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.8.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1778648},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","browser":"./dist/index.browser.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"95714c4669f41fcde930a44d7884993ec9dfeb3c","scripts":{"test":"bun test","build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun build src/index.browser.ts --outfile dist/index.browser.mjs --target browser --format esm --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"repository":{"url":"git+https://github.com/signaltech-org/bolthub-sdk.git","type":"git","directory":"packages/pay"},"_npmVersion":"10.9.8","description":"The bolthub payments SDK: charge for an MCP tool or HTTP endpoint — and pay for them — in a few lines. Lightning-only (L402) micropayments for AI-agent tool calls","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"zod":"^3","macaroon":"^3.0.4","@types/node":"^25.5.0","@modelcontextprotocol/sdk":"^1.27.1"},"_npmOperationalInternal":{"tmp":"tmp/pay_0.8.0_1784805172497_0.541218465217306","host":"s3://npm-registry-packages-npm-production"}},"0.8.1":{"name":"@bolthub/pay","version":"0.8.1","description":"The bolthub payments SDK: charge for an MCP tool or HTTP endpoint — and pay for them — in a few lines. Lightning-only (L402) micropayments for AI-agent tool calls","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","browser":"./dist/index.browser.mjs","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"build":"rm -rf dist tsconfig.build.tsbuildinfo && bun build src/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp dist/index.js dist/index.mjs && bun build src/index.ts --outdir dist --target node --format cjs --sourcemap=inline && bun build src/index.browser.ts --outfile dist/index.browser.mjs --target browser --format esm --sourcemap=inline && bun x tsc --emitDeclarationOnly --outDir dist --declaration --project tsconfig.build.json","prepublishOnly":"bun run build","typecheck":"tsc --noEmit","test":"bun test"},"keywords":["l402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/signaltech-org/bolthub-sdk.git","directory":"packages/pay"},"homepage":"https://docs.bolthub.ai","bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"devDependencies":{"@modelcontextprotocol/sdk":"^1.27.1","@types/node":"^25.5.0","macaroon":"^3.0.4","zod":"^3"},"_id":"@bolthub/pay@0.8.1","gitHead":"0ed257e29c6ba76e754cdac8f149157f13b07a56","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-RgPgj5J9a7emSp5+7IP/Pt6fnVupnegxV9YN78gmwarhMioNHSwdsUjYb8CQFV8O6/dXViDY+rPyPrjJy/jsrg==","shasum":"99427360a6656c94123723785f7ccfe934b1042b","tarball":"https://registry.npmjs.org/@bolthub/pay/-/pay-0.8.1.tgz","fileCount":67,"unpackedSize":1866423,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bolthub%2fpay@0.8.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDcWkjQ3vFv8QmKyuzLsibaYWHGaG5Fv44V4s+4KJgehQIgMHgq5sX2L7q5JOo3BiQCSj9j26WiTOTwxkBMNjhuTO4="}]},"_npmUser":{"name":"bolthub.ai","email":"contact@bolthub.ai"},"directories":{},"maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pay_0.8.1_1784945019744_0.06264949194505465"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-02T01:46:30.327Z","modified":"2026-07-25T02:03:40.274Z","0.1.0":"2026-07-02T01:46:30.597Z","0.2.0":"2026-07-02T03:18:02.530Z","0.3.0":"2026-07-06T09:48:45.556Z","0.4.0":"2026-07-07T00:45:12.008Z","0.4.1":"2026-07-09T05:18:36.734Z","0.5.0":"2026-07-10T00:57:15.726Z","0.5.1":"2026-07-10T06:29:59.986Z","0.6.0":"2026-07-10T08:20:03.008Z","0.7.0":"2026-07-10T11:29:02.182Z","0.7.1":"2026-07-15T11:53:04.750Z","0.7.2":"2026-07-21T05:15:15.153Z","0.8.0":"2026-07-23T11:12:52.664Z","0.8.1":"2026-07-25T02:03:39.922Z"},"bugs":{"url":"https://github.com/signaltech-org/bolthub-sdk/issues"},"license":"MIT","homepage":"https://docs.bolthub.ai","keywords":["l402","lightning","bitcoin","mcp","ai-agent","paywall","payments","micropayments","model-context-protocol"],"repository":{"type":"git","url":"git+https://github.com/signaltech-org/bolthub-sdk.git","directory":"packages/pay"},"description":"The bolthub payments SDK: charge for an MCP tool or HTTP endpoint — and pay for them — in a few lines. Lightning-only (L402) micropayments for AI-agent tool calls","maintainers":[{"name":"bolthub.ai","email":"contact@bolthub.ai"}],"readme":"# @bolthub/pay\n\nThe bolthub payments SDK — both sides of the sale, zero runtime dependencies.\nCharge for an MCP tool (or HTTP endpoint) in a few lines, and pay for them\nautomatically. Lightning-only: settles over the **L402** rail. Implements the\n[bolthub Tool Payment Profile](./docs/tool-payment-profile-v0.md); absorbed\n`@bolthub/agent` (the HTTP L402 client + wallet adapters) in 0.4.0.\n\n> **Status:** the package follows SemVer from `0.1.0`; the wire format it\n> speaks (TPP `0.1`) is a draft and may evolve before 1.0. Breaking wire\n> changes bump the minor version while the package is 0.x.\n\nThe agent↔tool protocol standardises *what a tool does* but has no slot for\n*what it costs*. `@bolthub/pay` fills that slot: a paid tool answers an unpaid\ncall with a `payment_required` challenge, and runs only once the buyer pays the\nLightning invoice and returns a valid proof.\n\n## Install\n\n```bash\nbun add @bolthub/pay\n```\n\n## Make one MCP tool chargeable\n\n```ts\nimport { createPaywall, l402Rail } from \"@bolthub/pay\";\n\n// A rail needs a signing secret (≥32 bytes) and something that makes invoices.\n// Wrap your wallet (LND / NWC / LNbits / Phoenixd) or a bolthub facilitator.\nconst pay = createPaywall({\n  rails: [\n    l402Rail({\n      secret: process.env.PAY_SECRET!,\n      invoiceProvider: {\n        async createInvoice(amountSat, memo) {\n          const { invoice, paymentHash } = await myWallet.makeInvoice(amountSat, memo);\n          return { invoice, paymentHash };\n        },\n      },\n    }),\n  ],\n});\n\n// Register it. `resource` defaults to the tool name; a proof is accepted only\n// for the resource it was minted against.\npay.tool(\n  server,\n  \"get_satellite_image\",\n  \"Recent high-res satellite imagery for a lat/lon and date.\",\n  schema,\n  { price: { amount: 2000 } }, // 2000 sat per call\n  async (args) => ({ content: [{ type: \"text\", text: await fetchImage(args) }] }),\n);\n```\n\nOr wrap a handler directly (equivalent), if you prefer to call `server.tool` yourself:\n\n```ts\nserver.tool(\n  \"get_satellite_image\",\n  schema,\n  pay(\n    { price: { amount: 2000 }, resource: \"get_satellite_image\" },\n    async (args) => ({ content: [{ type: \"text\", text: await fetchImage(args) }] }),\n  ),\n);\n```\n\n## What a buyer sees\n\n1. **Unpaid call** → an error result whose `_meta[\"ai.bolthub/payment\"]` holds the\n   challenge:\n\n   ```jsonc\n   {\n     \"status\": \"payment_required\",\n     \"price\": { \"amount\": 2000, \"asset\": \"sat\" },\n     \"resource\": \"get_satellite_image\",\n     \"offers\": [\n       { \"scheme\": \"l402\", \"amount\": 2000, \"asset\": \"sat\",\n         \"token\": \"…\", \"invoice\": \"lnbc20n1p…\" }\n     ],\n     \"expiresAt\": 1751400000000\n   }\n   ```\n\n2. The buyer pays an offer, then **re-calls the tool** with the proof in the\n   request `_meta`:\n\n   ```jsonc\n   { \"ai.bolthub/payment\": { \"scheme\": \"l402\", \"proof\": \"<token>:<preimageHex>\" } }\n   ```\n\n3. The proof verifies → your handler runs.\n\nA payment-blind client just sees a normal tool error (`\"Payment required: 2000\nsat …\"`) and moves on; nothing breaks.\n\n## Advertise the price (optional, for cost-aware agents)\n\n```ts\nconst ad = pay.advertise({ amount: 2000 }); // → { version, price, model, rails }\n// attach to the tool's _meta[\"ai.bolthub/payment\"] so an agent can budget first\n```\n\n## Buyer side: pay for tools automatically\n\n`ToolClient` is the seller wrapper's counterpart. It calls a tool, and if it\ngets a `payment_required` challenge it pays the L402 offer and retries, staying\nwithin a budget you set. (Known as `PayingClient` before 0.3.0; that name\nremains as a deprecated alias.)\n\n```ts\nimport { ToolClient, l402Payer } from \"@bolthub/pay\";\n\nconst client = new ToolClient({\n  payers: [l402Payer({ wallet: myLightningWallet })], // pays L402 invoices\n  maxTotal: { sat: 10_000 },                          // per-asset budget\n  onPaid: (i) => console.log(`paid ${i.amount} ${i.asset} via ${i.scheme}`),\n});\n\n// callTool handles challenge → pay → retry transparently:\nconst result = await client.callTool(mcpClient, \"get_satellite_image\", { lat, lon });\n```\n\n`l402Payer`'s wallet is the same `WalletAdapter` the built-in adapters\nimplement, so `LndWallet`, `PhoenixdWallet`, `NwcWallet`, etc. drop straight in.\n\n## Buyer side: pay for HTTP APIs (L402)\n\nFor paywalled **HTTP** endpoints (a gateway answering `402 Payment Required`\nwith a `WWW-Authenticate: L402` challenge), use `L402Client` — merged in from\n`@bolthub/agent` in 0.4.0. It pays the embedded Lightning invoice and retries\nwith the proof, caching session tokens between calls:\n\n```ts\nimport { L402Client, LndWallet } from \"@bolthub/pay\";\n\nconst client = new L402Client({\n  wallet: new LndWallet({ host, macaroon }),\n  budgetSats: 10_000,\n  maxPerRequestSats: 100,\n});\nconst resp = await client.get(\"https://acme.gw.bolthub.ai/v1/weather\", {\n  params: { city: \"berlin\" },\n});\n```\n\nWallet adapters: `LndWallet`, `LnbitsWallet`, `PhoenixdWallet`, `NwcWallet`\n(pass any NWC connection, e.g. `@getalby/sdk`'s `NWCClient`), and `WebLnWallet`\nfor the browser build. `walletFromEnv()` builds one from the standard env vars\n(`LND_REST_HOST`/`LND_MACAROON`, `LNBITS_URL`/`LNBITS_ADMIN_KEY`,\n`PHOENIXD_URL`/`PHOENIXD_PASSWORD`, `NWC_URI`). `attenuate()` narrows an L402\nmacaroon offline to delegate a restricted credential to a sub-agent.\n\n### Streaming endpoints (SSE)\n\nFor a paid endpoint that answers with a live `text/event-stream` body, pass\n`streaming: true` (0.8.0+): `timeoutMs` then bounds only the time to response\nheaders on each leg of the L402 flow, never the body read, so the stream can\nrun indefinitely. Stop it by aborting a `signal` you pass in:\n\n```ts\nconst ctrl = new AbortController();\nconst resp = await client.get(\"https://acme.gw.bolthub.ai/v1/live-feed\", {\n  streaming: true,\n  signal: ctrl.signal,\n});\nconst reader = resp.body!.getReader();\n// read events as they arrive; ctrl.abort() closes the stream cleanly\n```\n\n### Prepaid credit, receipts, and free retries\n\n`L402Client` adds three agent-native behaviors on top of pay-and-retry:\n\n- **Prepaid credit.** `buyCredit(url, sats)` pays once for a face-value sats\n  budget spendable across ALL of that provider's `per_request` endpoints;\n  subsequent calls to the provider draw the budget with no further payment\n  until it is spent. `batchFetch(urls, { creditSats })` groups URLs by\n  provider and buys one credit per provider. (Replaces the per-endpoint\n  bundles retired in 0.6.0 — `buyBundle` now throws.)\n\n  ```ts\n  await client.buyCredit(\"https://acme.gw.bolthub.ai/v1/data\", 500);\n  for (let i = 0; i < 100; i++) await client.get(\"https://acme.gw.bolthub.ai/v1/data\");\n  ```\n\n- **Free retries on origin failure.** When the origin is unreachable or answers\n  5xx/408/429 after you have paid, your proof stays spendable and the client\n  re-sends for free. On by default (`retryOnUpstreamFailure`).\n\n- **Verifiable receipts.** Point the client at a receipt store and every paid\n  call records a preimage-backed receipt you can export and verify offline.\n  Redacted exports keep the expense record but strip the preimage.\n\n  ```ts\n  import { L402Client, FileReceiptStore } from \"@bolthub/pay\";\n\n  const client = new L402Client({ wallet, receiptStore: new FileReceiptStore() });\n  // ... paid calls ...\n  const csv = client.exportReceipts({ format: \"csv\", redact: true });\n  ```\n\n## One budget across both buyer paths\n\n`Budget` is the shared per-asset pool. Hand the same instance to a\n`ToolClient` (MCP-wire payments) and an `L402Client` (HTTP-402 payments) and\ntogether they can never spend past `maxTotal` — reservations are synchronous,\nso even concurrent calls across the two paths can't jointly overspend:\n\n```ts\nimport { Budget, ToolClient, L402Client, l402Payer } from \"@bolthub/pay\";\n\nconst budget = new Budget({ maxTotal: { sat: 10_000 }, maxPerCall: { sat: 500 } });\nconst tools = new ToolClient({ payers: [l402Payer({ wallet })], budget });\nconst http = new L402Client({ wallet, budget });\n```\n\n## Verify tenant webhooks\n\nIf you subscribe to bolthub webhooks (`invoice.settled`, `billing.*`, and\nfriends), `verifyWebhook` checks the delivery signature and returns the parsed\nevent. It enforces a replay window (default 5 minutes) and uses a\nconstant-time compare. Every failure throws `WebhookVerificationError` with a\ntyped `code` such as `signature_mismatch` or `timestamp_out_of_tolerance`.\n\n```ts\nimport { verifyWebhook, WebhookVerificationError } from \"@bolthub/pay\";\n\n// Express: use express.raw() so req.body is the raw bytes.\napp.post(\"/webhooks/bolthub\", express.raw({ type: \"application/json\" }), (req, res) => {\n  try {\n    const event = verifyWebhook({\n      secret: process.env.BOLTHUB_WEBHOOK_SECRET!,\n      payload: req.body,\n      signature: req.header(\"x-webhook-signature\")!,\n      timestamp: req.header(\"x-webhook-timestamp\")!,\n    });\n    if (event.event === \"invoice.settled\") {\n      // event.data is the invoice payload\n    }\n    res.sendStatus(200);\n  } catch (err) {\n    if (err instanceof WebhookVerificationError) return res.sendStatus(400);\n    throw err;\n  }\n});\n```\n\nThe signature covers the raw request body, so capture it before any JSON\nparser runs. Node-only: this export is not in the browser build.\n\n## Adding a rail\n\nThe paywall core is rail-agnostic. Implement [`PaymentRail`](./src/types.ts)\n(`assets`, `createOffer(price, resource)`, and `verify(proof, ctx)`) and pass it\nin `rails`. The core never sees rail-specific bytes, so a new rail is purely\nadditive.\n\n## Security\n\n- Tokens are HMAC-signed, scoped to a `resource`, and time-limited (default 15 min).\n- Signature and preimage checks are constant-time.\n- The wrapper **fails closed**: no `resource`, or any unverifiable proof, means no service.\n- A proof minted for one tool can never unlock another (`resource` mismatch is rejected).\n\nSee the [spec](./docs/tool-payment-profile-v0.md) for the wire format\nand the HTTP transport profile.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}