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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@blockchainhq-xyz/n8n-nodes-pocket-client

v1.0.2

Published

n8n node for making USDC payments via x402 protocol

Readme

@blockchainhq-xyz/n8n-nodes-pocket-client

n8n community node for making USDC payments in response to HTTP 402 errors. Client-side implementation of x402 protocol.

npm version License: MIT

What It Does

  • Parse 402 payment requirements
  • Make USDC payments automatically
  • Return transaction signatures
  • Integrate with any 402-enabled API

Installation

In n8n (Recommended)

  1. Go to Settings > Community Nodes
  2. Click Install
  3. Enter: @blockchainhq-xyz/n8n-nodes-pocket-client
  4. Click Install

Manual Installation (For Development)

Note: This installs from source code, not npm.

# 1. Clone the server node repository
git clone https://github.com/blockchain-hq/x402-pocket-node-client.git
cd x402-pocket-node-client

# 2. Install dependencies
npm install

# 3. Link the server SDK
npm link x402-client-sdk
# If SDK not published yet, link local SDK first:
# cd /path/to/x402-server-sdk && npm link
# cd /path/to/n8n-nodes-solana-x402 && npm link x402-server-sdk

# 4. Build the node
npm run build

# 5. Set custom extensions path
# If running both server and client nodes, set path to parent folder:
export N8N_CUSTOM_EXTENSIONS="$HOME/x402-n8n-nodes"
# Make it permanent:
echo 'export N8N_CUSTOM_EXTENSIONS="$HOME/x402-n8n-nodes"' >> ~/.zshrc

# Note: Your folder structure should be:
# ~/x402-n8n-nodes/
#   ├── n8n-nodes-solana-x402/         (this server node)
#   └── n8n-nodes-pocket-client/  (client node, if needed)

# 6. Start n8n
n8n start

# 7. In n8n, search for: "Pocket node client"

Operations

1. Parse 402 Response

Extracts payment details from 402 response.

Input: 402 response body Output: Payment details (amount, recipient)

2. Make Payment

Sends USDC to specified address.

Input:

  • Recipient address
  • Amount (USDC)
  • Payment ID (optional)

Output: Transaction signature

3. Parse and Pay

Parse and pay in one step (recommended!)

Input: 402 response body Output: Transaction signature

Credentials

Pocket node client API:

  • Network: Devnet or Mainnet
  • Wallet Private Key: Base58 encoded
  • RPC URL: (optional)

Get Private Key:

solana address -k ~/wallet.json
cat ~/wallet.json

Example Workflow

Works with Mock Server node for testing:

Solana x402 (Mock Server) → Returns 402
    ↓
Pocket node client → Parse and Pay
    ↓
Solana x402 (Mock Server) → Verify Payment
    ↓
Get Content

Or with real API:

HTTP Request → Get 402 from real API
    ↓
Pocket node client → Parse and Pay (sends USDC)
    ↓
HTTP Request → Retry with X-Payment signature
    ↓
Get Content

Use Cases

| Use Case | Description | |----------|-------------| | Testing with Mock | Use with Solana x402 Mock Server node | | Auto-pay APIs | Automatic payment on 402 | | Content Access | Pay for premium content | | Subscription | Automated renewal | | Pay-per-use | Pay as you go |

Perfect combo: Use with the Solana x402 Mock Server node to test complete payment flows in n8n without building APIs!

Wallet Setup

Devnet (Testing):

# Generate wallet
solana-keygen new -o ~/devnet-wallet.json

# Get SOL (for transaction fees)
solana airdrop 2 YOUR_ADDRESS --url devnet

# Get private key
cat ~/devnet-wallet.json

Mainnet (Production):

  • Use existing wallet
  • Ensure sufficient USDC balance (and SOL for transaction fees)
  • Keep private key secure

Full Payment Flow

1. Request API
2. Get 402 response
3. Use "Parse and Pay"
4. Get signature
5. Retry request with X-Payment header
6. Access granted

Security

Best Practices:

  • Never commit private keys
  • Use environment variables
  • Start with small amounts on devnet
  • Test thoroughly before mainnet

Troubleshooting

| Issue | Fix | |-------|-----| | Node not visible | Restart n8n, clear cache | | Invalid private key | Use base58 format | | Insufficient balance | Get more USDC (and SOL for fees) | | Transaction failed | Check network and balance |

Networks

Devnet:

  • Free testing
  • Get SOL via airdrop (for transaction fees)
  • Get USDC from faucets or swaps
  • Same as mainnet

Mainnet:

  • Real USDC
  • Purchase from exchange
  • Production ready

Resources

Requirements

  • n8n: v0.220.0+
  • Node.js: v18+
  • USDC balance for payments (and SOL for transaction fees)

License

MIT

Contributing

Issues and PRs welcome!

Support


Star if useful!