npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@blockchainhq-xyz/n8n-nodes-solana-x402

v1.0.1

Published

n8n node for Solana x402 payment protocol - Return HTTP 402 Payment Required

Readme

n8n-nodes-solana-x402

Mock server node for testing x402 payment flows in n8n. Test payment logic without creating actual APIs!

npm version License: MIT

🎯 What It Does

This is a mock server node that simulates a payment-required API server directly in n8n:

  • ✅ Return HTTP 402 Payment Required (without building an API)
  • ✅ Verify SOL payments on-chain
  • ✅ Test payment flows in n8n
  • ✅ No separate API server needed
  • ✅ Perfect for development and prototyping

Why Mock? Test your payment logic end-to-end in n8n without deploying actual APIs. Great for learning, testing, and prototyping!

📦 Installation

In n8n (Recommended)

  1. Go to Settings > Community Nodes
  2. Click Install
  3. Enter: n8n-nodes-solana-x402
  4. Click Install

Manual Installation

# 1. Install the package
npm install x402-server-sdk

# 2. Link for development
npm link

# 3. Set custom extensions path
export N8N_CUSTOM_EXTENSIONS="$HOME/x402-n8n-nodes"

# 4. Start n8n
n8n start

# 5. In n8n, search for: "Solana x402"
# The node will appear with a Solana icon

🚀 Operations

1. Return 402 Payment Required

Returns 402 response requiring SOL payment.

Input:

  • Amount (SOL): e.g., 0.01
  • Resource ID: optional

Output:

{
  "statusCode": 402,
  "body": {
    "paymentOptions": [{
      "amount": "0.01",
      "recipient": "YOUR_WALLET",
      "token": "native"
    }]
  }
}

2. Verify Payment

Verifies SOL payment on-chain.

Input:

  • Transaction Signature
  • Expected Amount (SOL)
  • Max Age (seconds)

Output:

{
  "valid": true,
  "signature": "5VERv8...",
  "amount": 0.01,
  "from": "PAYER_ADDRESS",
  "to": "YOUR_WALLET"
}

🔐 Credentials

Solana x402 API:

  • Network: Devnet or Mainnet
  • Recipient Address: Your wallet
  • RPC URL: (optional)

📋 Mock Server Workflow

Test payment flows without building an API:

Manual Trigger → Solana x402 (Mock Server)
                  Return 402 with requirements
    ↓
Solana x402 Client → Parse and Pay
                      (makes real payment on devnet)
    ↓
Solana x402 (Mock Server) → Verify Payment
                             (checks real transaction)
    ↓
IF Valid → Return Mock Content ✅
    ↓
IF Invalid → Return 403 Error

This simulates: Client requesting paid content → Server requiring payment → Client paying → Server verifying → Access granted

No real API needed! Perfect for testing, learning, and prototyping.

🎓 Use Cases

| Use Case | Description | |----------|-------------| | Learning x402 | Understand payment protocol without APIs | | Testing Payment Flows | Validate payment logic in n8n | | Prototyping | Quick proof-of-concept for paid features | | Development | Test before building real API | | Demo | Show payment flows to stakeholders |

Real-world deployment: Use the x402 Server SDK in your actual Node.js/Express API. This mock node is for testing!

🔒 Security

Always:

  • Set Max Age (recommended: 300s)
  • Store used signatures in database
  • Use environment variables for wallet
  • Enable rate limiting

Example:

Max Age: 300  // 5 minutes

🌐 Networks

Devnet (Testing):

solana airdrop 2 YOUR_ADDRESS --url devnet

Mainnet (Production):

  • Use real wallet
  • Test on devnet first

🐛 Troubleshooting

| Issue | Fix | |-------|-----| | Node not visible | Restart n8n, clear browser cache | | Transaction not found | Wait, check network | | Amount mismatch | Verify exact amount | | Transaction too old | Increase Max Age |

📚 Resources

🎯 Requirements

  • n8n: v0.220.0+
  • Node.js: v18+

📄 License

MIT

💬 Support


⭐ Star if useful!