feat: add @hugen/plugin-x402-solana — Solana x402 payment support#284
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WalkthroughAdded a single entry to Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| "@elizaos/plugin-zytron": "github:zypher-network/plugin-zytron", | ||
| "@erdgecrawl/plugin-base-signals": "github:erdGeclaw/plugin-base-signals", | ||
| "@esscrypt/plugin-polkadot": "github:Esscrypt/plugin-polkadot", | ||
| "@hugen/plugin-x402-solana": "github:bartonguestier1725-collab/eliza-plugin-x402-solana", |
There was a problem hiding this comment.
Unit tests flagged in PR description — E2E verification preferred
The PR description highlights "38 unit tests" as its primary testing evidence. The project's contribution guidelines emphasize runtime E2E testing over mocked unit tests. The PR does mention E2E verification against a live x402 API, but it is framed as secondary. For registry acceptance, maintainers should confirm the plugin has been validated with real dynamic loading inside an ElizaOS runtime, not just standalone unit-test runs.
This does not block the index.json entry itself, but it is worth verifying before merging.
Context Used: Rule from dashboard - Runtime E2E testing only; no mocks or unit tests (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Thanks for the review. To clarify the testing situation: Unit tests (38): These cover security-critical paths — SSRF protection (IPv4, IPv6, IPv4-mapped IPv6 hex normalization), USDC-only payment policy, domain allowlist validation, redirect blocking, and input sanitization. They run without network access. E2E verification: I tested against a live x402 API server with a real Solana USDC payment on mainnet. The plugin successfully completed the full 402 → sign USDC transfer → retry → receive data flow. This was done as a standalone script using the compiled plugin, not inside a full ElizaOS runtime with dynamic loading. What I haven't done yet: Full integration test inside an ElizaOS runtime with the plugin loaded via the character config. I'm happy to set that up and report back if it would help the review. |
Adds Solana network support to x402 payments for ElizaOS agents.
The existing
plugin-x402covers EVM chains. This plugin handles the Solana side — agents can pay for x402-protected APIs using Solana USDC (SPL token on mainnet).Built on
@x402/svmand@x402/fetchfrom the Coinbase x402 SDK.What it does
fetch()to handle 402 → Solana USDC payment → retryTesting
npm test)@solana/kit)Links
Registry Update Checklist
Registry:
If not an eliza-plugins official repo, i.e. new plugin:
The plugin repo has:
elizaos-pluginsin the topics in the GitHub repo settings. If the plugin is related toAIorcrypto, please add those as topics as well.images/banner.jpgandimages/logo.jpgand they{ "name": "@hugen/plugin-x402-solana", "version": "0.1.0", "agentConfig": { "pluginType": "elizaos:plugin:1.0.0", "pluginParameters": { "SOLANA_PRIVATE_KEY": { "type": "string", "description": "Solana wallet private key (base58, hex, or JSON array format)" } } } }