{"_id":"@bridgenode/openclaw-plugin-x402","_rev":"2-5a125d5cef47c9eee469f55007a28ef1","name":"@bridgenode/openclaw-plugin-x402","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.3":{"name":"@bridgenode/openclaw-plugin-x402","version":"0.1.3","keywords":["openclaw","x402","solana","usdc","ai","inference","llm","payment","pay-per-request","mcp"],"license":"MIT-0","_id":"@bridgenode/openclaw-plugin-x402@0.1.3","maintainers":[{"name":"bridgenode","email":"eli.BNx@proton.me"}],"homepage":"https://github.com/bridgenode-ai/openclaw-plugin-x402#readme","bugs":{"url":"https://github.com/bridgenode-ai/openclaw-plugin-x402/issues"},"dist":{"shasum":"ef5310c06b6421463887698fb1f6b89bc777844f","tarball":"https://registry.npmjs.org/@bridgenode/openclaw-plugin-x402/-/openclaw-plugin-x402-0.1.3.tgz","fileCount":24,"integrity":"sha512-jbw9mCSUBox+8bpgU6aa15PKydG0Fjz7z/G2WuGISY2tBX6E67PkVUIYJ/0VSQPEh5yI6V8nXLQhp2CIeIZJaA==","signatures":[{"sig":"MEUCIGd/YYrrqBSzXZJQf5aUWBLQYs9VcYgyo+ZXFE1+LkcnAiEAw8O5RXjQGnqw7vYuVZvgoGKM7HJMLaPLkOSXphsxjf8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48091},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.22.3"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"796eda75fc819be3900cb0dc52c49c6aa2bbeab8","scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit -p tsconfig.json","plugin:build":"npm run build && openclaw plugins build --entry ./dist/index.js","prepublishOnly":"npm run plugin:validate","plugin:validate":"npm run plugin:build && openclaw plugins validate --entry ./dist/index.js"},"_npmUser":{"name":"bridgenode","email":"eli.BNx@proton.me"},"openclaw":{"build":{"openclawVersion":"2026.9.1"},"compat":{"pluginApi":">=2026.9.1"},"extensions":["./dist/index.js"]},"repository":{"url":"git+https://github.com/bridgenode-ai/openclaw-plugin-x402.git","type":"git"},"_npmVersion":"11.19.0","description":"OpenClaw tool plugin for pay-per-request LLM inference via x402 on Solana USDC — no API keys, no accounts, gas sponsored","directories":{},"_nodeVersion":"24.20.0","dependencies":{"bs58":"^6.0.0","typebox":"^1.3.27","@x402/svm":"^2.25.0","@x402/core":"^2.25.0","@solana/kit":"^8.0.0","@x402/fetch":"^2.25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^5.0.0","openclaw":"^2026.9.1","typescript":"^7.0.2","@types/node":"^26.0.0"},"peerDependencies":{"openclaw":">=2026.9.1"},"_npmOperationalInternal":{"tmp":"tmp/openclaw-plugin-x402_0.1.3_1788898345477_0.43246671923370084","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@bridgenode/openclaw-plugin-x402","version":"0.1.4","description":"OpenClaw tool plugin for pay-per-request LLM inference via x402 on Solana USDC — no API keys, no accounts, gas sponsored","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["openclaw","x402","solana","usdc","ai","inference","llm","payment","pay-per-request","mcp"],"license":"MIT-0","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/bridgenode-ai/openclaw-plugin-x402.git"},"engines":{"node":">=22.22.3"},"dependencies":{"@solana/kit":"^8.0.0","@x402/core":"^2.25.0","@x402/fetch":"^2.25.0","@x402/svm":"^2.25.0","bs58":"^6.0.0","typebox":"^1.3.27"},"peerDependencies":{"openclaw":">=2026.9.1"},"devDependencies":{"@types/node":"^26.0.0","openclaw":"^2026.9.1","typescript":"^7.0.2","vitest":"^5.0.0"},"scripts":{"build":"tsc -p tsconfig.json","plugin:build":"npm run build && openclaw plugins build --entry ./dist/index.js","plugin:validate":"npm run plugin:build && openclaw plugins validate --entry ./dist/index.js","typecheck":"tsc --noEmit -p tsconfig.json","test":"vitest run","prepublishOnly":"npm run plugin:validate"},"openclaw":{"extensions":["./dist/index.js"],"compat":{"pluginApi":">=2026.9.1"},"build":{"openclawVersion":"2026.9.1"}},"gitHead":"3c002f72fea5a3c9c24dd65ee3479796d22adf03","_id":"@bridgenode/openclaw-plugin-x402@0.1.4","bugs":{"url":"https://github.com/bridgenode-ai/openclaw-plugin-x402/issues"},"homepage":"https://github.com/bridgenode-ai/openclaw-plugin-x402#readme","_nodeVersion":"24.20.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-VHRQHmNQsS+wb7vZ9lMYqJGFNEsEgbW4W1Rz2y/X/ouYZiG1f6XgRrSLMSSToaHYvo/g/T6oJnvkUvxsyBzFVg==","shasum":"1f7f2ffba52b76a3c17aa280556ff162a6af9228","tarball":"https://registry.npmjs.org/@bridgenode/openclaw-plugin-x402/-/openclaw-plugin-x402-0.1.4.tgz","fileCount":24,"unpackedSize":48091,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCfb61S6ntxxSsDeQBucZz1Ma5ovyY7m8HuSujW+YM9KwIgCnKXLl6BylRTUZD9isirT3GCUTgiEymX3+4fDcrdfYg="}]},"_npmUser":{"name":"bridgenode","email":"eli.BNx@proton.me"},"directories":{},"maintainers":[{"name":"bridgenode","email":"eli.BNx@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/openclaw-plugin-x402_0.1.4_1788947250067_0.9099446035401075"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-08T20:12:25.200Z","modified":"2026-09-09T09:47:30.354Z","0.1.3":"2026-09-08T20:12:25.637Z","0.1.4":"2026-09-09T09:47:30.204Z"},"bugs":{"url":"https://github.com/bridgenode-ai/openclaw-plugin-x402/issues"},"license":"MIT-0","homepage":"https://github.com/bridgenode-ai/openclaw-plugin-x402#readme","keywords":["openclaw","x402","solana","usdc","ai","inference","llm","payment","pay-per-request","mcp"],"repository":{"type":"git","url":"git+https://github.com/bridgenode-ai/openclaw-plugin-x402.git"},"description":"OpenClaw tool plugin for pay-per-request LLM inference via x402 on Solana USDC — no API keys, no accounts, gas sponsored","maintainers":[{"name":"bridgenode","email":"eli.BNx@proton.me"}],"readme":"# @bridgenode/openclaw-plugin-x402\n\nOpenClaw tool plugin for **pay-per-request LLM inference** via [x402] on Solana\nUSDC. OpenAI-compatible chat completions — **no API keys, no accounts**; the\nagent pays from its own Solana USDC wallet and BridgeNode sponsors gas fees.\n\nLicensed **MIT-0** (no attribution required). Built for agents, by\n[BridgeNode](https://bridgenode.cc).\n\n## Tools\n\n| Tool | Payment | Purpose |\n|---|---|---|\n| `list_models` | free | Live model list with per-token prices and context limits |\n| `get_price_estimate` | free | USD cost estimate before paying (exact scheme) |\n| `chat_completions` | x402 | Pay-per-request chat completion (402 → sign → retry) |\n\n## Requirements\n\n- Node 22.22.3+, Node 24.15+, or Node 25.9+\n- OpenClaw `>= 2026.5.17`\n\n## Install\n\nFrom a checkout:\n\n```bash\nopenclaw plugins install ./openclaw-plugin-x402\n```\n\nFrom ClawHub (once published):\n\n```bash\nopenclaw plugins install clawhub:bridgenode-ai/openclaw-plugin-x402\n```\n\nThen configure the wallet in the plugin entry (Gateway config) or via\nenvironment variables:\n\n```bash\nexport SOLANA_PRIVATE_KEY=<base58 agent wallet key>   # required\nexport BRIDGENODE_MAX_USDC_PER_TX=1                    # optional, default $1\nexport BRIDGENODE_BASE_URL=https://bridgenode.cc/v1    # optional (origin-pinned)\n```\n\nThe wallet needs a USDC ATA on Solana mainnet (the first transfer creates it\nautomatically). BridgeNode pays transaction fees.\n\n## Security model (fail-closed)\n\n- **Payment pins:** only Solana-mainnet USDC (`EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`)\n  paid to the configured BridgeNode wallet (`BRIDGENODE_PAY_TO`, default\n  `BHMDv3ri3LBEZjEzJgDZeUiguVX7LmsCstTXbM3dL8rN`) is ever signed. Any other\n  network, asset, or recipient → nothing is signed.\n- **Origin pin:** `BRIDGENODE_BASE_URL` must be HTTPS on exactly\n  `bridgenode.cc`; validated before any fetch is created.\n- **Spend cap:** `BRIDGENODE_MAX_USDC_PER_TX` defaults to `1` USDC per\n  transaction; exactly `\"0\"` disables it; malformed values fail closed.\n- **Replay-safe:** a payment failure is terminal — retrying the same request\n  never double-charges or re-runs for free (same signature → same transaction).\n\n## Key handling\n\nThe agent wallet private key is the only secret this plugin uses. It is read\n**only** from the plugin configuration (use a SecretRef) or from the process\nenvironment (`SOLANA_PRIVATE_KEY`). It is never hard-coded in source, never\nlogged, and never transmitted anywhere: only the signed Solana transaction\nleaves the host, and BridgeNode never sees the key. Treat it like any signing\nkey — keep it out of shell history and chat logs, and rotate it freely; the\nplugin only ever signs Solana-mainnet USDC to the pinned BridgeNode wallet,\nbounded by the spend cap.\n\n## Compatibility\n\nThe plugin declares `pluginApi >= 2026.5.17` and is built with OpenClaw\n`2026.9.1` (see `openclaw.compat` / `openclaw.build` in `package.json`).\nConfirm your OpenClaw build satisfies the range before enabling the plugin\n(`openclaw plugins validate` reports mismatches). New OpenClaw releases may\nchange the plugin SDK — re-validate and bump after host upgrades.\n\n## Development\n\n```bash\nnpm install\nnpm run plugin:validate   # build + generate manifest + validate\nnpm test                  # pure-logic unit tests\n```\n\nCI runs `build`, `plugins build --check`, `plugins validate`, and `npm test`\non every push.\n\n## Related\n\n- BridgeNode service: https://bridgenode.cc/v1/models\n- ElizaOS plugin: [`@bridgenode/plugin-x402`](https://github.com/bridgenode-ai/elizaos-plugin-x402)\n- x402 protocol: https://docs.x402.org\n\n[x402]: https://docs.x402.org\n","readmeFilename":"README.md"}