{"_id":"@agenticpay/eliza-plugin","name":"@agenticpay/eliza-plugin","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@agenticpay/eliza-plugin","version":"0.0.1","description":"Pay-per-call x402 USDC micropayments for Eliza agents on Solana","license":"MIT","homepage":"https://github.com/krystiangw/agenticpay#readme","repository":{"type":"git","url":"git+https://github.com/krystiangw/agenticpay.git","directory":"packages/eliza-plugin"},"keywords":["elizaos","eliza-plugin","x402","solana","usdc","ai-agents","payments","agentic-payments","stablecoin"],"publishConfig":{"access":"public"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"peerDependencies":{"@elizaos/core":">=1.7.0 <3.0.0"},"peerDependenciesMeta":{"@elizaos/core":{"optional":true}},"dependencies":{"@solana/kit":"^5.5.0","@x402/core":"^2.11.0","@x402/fetch":"^2.11.0","@x402/svm":"^2.11.0"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_id":"@agenticpay/eliza-plugin@0.0.1","bugs":{"url":"https://github.com/krystiangw/agenticpay/issues"},"_integrity":"sha512-yDUpHdlE+FLqOfxN6LuEgZnrFcO3piG1tS8EP+e/321jDjCR726zH1QlyPT5DFSYJzm9dy5avrGloZm9KKBJSA==","_resolved":"/private/var/folders/zl/hb0m_q654zzbwftqwkbhhkd40000gp/T/945256b1dcde3d1b027866ec51f0a1fa/agenticpay-eliza-plugin-0.0.1.tgz","_from":"file:agenticpay-eliza-plugin-0.0.1.tgz","_nodeVersion":"25.7.0","_npmVersion":"11.10.1","dist":{"integrity":"sha512-yDUpHdlE+FLqOfxN6LuEgZnrFcO3piG1tS8EP+e/321jDjCR726zH1QlyPT5DFSYJzm9dy5avrGloZm9KKBJSA==","shasum":"afa817a257eefdaddb1ef553c0a0601dc5f65f92","tarball":"https://registry.npmjs.org/@agenticpay/eliza-plugin/-/eliza-plugin-0.0.1.tgz","fileCount":11,"unpackedSize":19394,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCpwxn6KPCm5PEz2xdkyj+cs1C3d6taQgRv2BBb1SYG4AIgXcXrlwl+GkVVRJCPvbmJG5G8u/SVuldIa/4fvZXKJCU="}]},"_npmUser":{"name":"agenticpay","email":"gwizdala.kr@gmail.com"},"directories":{},"maintainers":[{"name":"agenticpay","email":"gwizdala.kr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eliza-plugin_0.0.1_1777632800780_0.42451118929108844"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-01T10:53:20.703Z","0.0.1":"2026-05-01T10:53:20.912Z","modified":"2026-05-01T10:53:21.087Z"},"maintainers":[{"name":"agenticpay","email":"gwizdala.kr@gmail.com"}],"description":"Pay-per-call x402 USDC micropayments for Eliza agents on Solana","homepage":"https://github.com/krystiangw/agenticpay#readme","keywords":["elizaos","eliza-plugin","x402","solana","usdc","ai-agents","payments","agentic-payments","stablecoin"],"repository":{"type":"git","url":"git+https://github.com/krystiangw/agenticpay.git","directory":"packages/eliza-plugin"},"bugs":{"url":"https://github.com/krystiangw/agenticpay/issues"},"license":"MIT","readme":"# @agenticpay/eliza-plugin\n\nPay-per-call x402 USDC micropayments for [Eliza](https://elizaos.ai) agents on Solana.\n\nWrap any paywalled HTTP endpoint (your own MCP server, third-party paid API)\nas a native Eliza Action. The agent decides when to call it; the plugin signs\nand settles the USDC payment on Solana; the result lands back in the\nconversation. Sub-cent fees, sub-second finality.\n\n## Install\n\n```bash\npnpm add @agenticpay/eliza-plugin\n# peer dep — should already be in your Eliza project\npnpm add @elizaos/core\n```\n\n## Usage\n\n```ts\nimport { createAgenticpayPlugin } from \"@agenticpay/eliza-plugin\";\n\nexport const agentpay = createAgenticpayPlugin({\n  network: \"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1\", // devnet\n  rpcUrl: \"https://api.devnet.solana.com\",\n  // 64-byte JSON array (format `solana-keygen new` writes), exposed via\n  // runtime setting or process.env.\n  keypairBytesEnvVar: \"AGENT_SOLANA_KEYPAIR_BYTES\",\n  paidActions: [\n    {\n      name: \"REVERSE_STRING\",\n      description: \"Reverse a string. Costs 0.001 USDC.\",\n      similes: [\"reverse this\", \"flip the text\"],\n      url: \"http://localhost:4021/tools/reverse\",\n      extractInput: (msg) => ({ text: msg.content.text ?? \"\" }),\n      formatOutput: (body) =>\n        `Reversed: ${(body as { result: string }).result}`,\n    },\n    {\n      name: \"WORD_COUNT\",\n      description: \"Count words in a string. Costs 0.0005 USDC.\",\n      url: \"http://localhost:4021/tools/word-count\",\n      extractInput: (msg) => ({ text: msg.content.text ?? \"\" }),\n      formatOutput: (body) =>\n        `Words: ${(body as { count: number }).count}`,\n    },\n  ],\n});\n\n// Register in your character / runtime config.\n```\n\n## How it works\n\n1. At plugin `init` time we hydrate an `x402Client` from the agent's Solana\n   keypair (loaded from `keypairBytesEnvVar` or `keypairBytes`).\n2. Every `paidAction` becomes a native Eliza `Action`. When the model calls\n   it, the plugin's wrapped `fetch`:\n   - issues the request,\n   - on `HTTP 402` reads the payment requirements,\n   - signs a USDC payload using the agent's keypair,\n   - retries with the `X-PAYMENT` header,\n   - returns the response after the facilitator settles on-chain (~1.5–2 s on\n     devnet).\n3. The agent's reply is built by your `formatOutput(jsonBody)` callback, so\n   the model never sees the payment plumbing.\n\n## Pointing at the hosted facilitator\n\nThe endpoints you wrap are typically backed by `@agenticpay/mcp-server` or\nany other x402-compatible server. Either self-host a facilitator with\n`@agenticpay/facilitator`, or point at the public devnet one:\n\n```\nFACILITATOR_URL=https://agentpay-facilitator-e9b20a5fee6a.herokuapp.com\n```\n\n## Funding the agent\n\nThe agent only needs USDC — the facilitator's fee_payer pays the SOL gas.\nFor devnet:\n\n- SOL: https://faucet.solana.com\n- USDC: https://faucet.circle.com (Solana Devnet)\n\nCheck balance with `@agenticpay/cli`:\n\n```bash\nnpx -p @agenticpay/cli agentpay balance --wallet ./agent-wallet.json --cluster devnet\n```\n\n## Status\n\nPre-alpha. Devnet validated end-to-end via the [agenticpay monorepo](https://github.com/krystiangw/agenticpay).\nMainnet support requires a mainnet-capable facilitator (Coinbase CDP or\nself-hosted with mainnet RPC + funded fee_payer).\n\nMIT licensed.\n","readmeFilename":"README.md","_rev":"1-df94eb0c0d0d0044c5708011c69f987a"}