Solana x402 Client icon

Solana x402 Client

Make SOL payments in response to HTTP 402 errors

Make Payment

AI-generated

Overview

This node enables making SOL payments on the Solana blockchain, particularly useful for handling HTTP 402 Payment Required errors by parsing payment requirements and executing payments. It supports operations to parse payment details from a 402 response, make a payment to a specified Solana address, or combine both parsing and payment in one step. Practical use cases include automating payment workflows in applications that require Solana-based transactions triggered by 402 responses.

Use Case Examples

  1. Automatically parse payment requirements from a 402 HTTP response and make the required SOL payment to unlock a service.
  2. Manually send a specified amount of SOL to a recipient address with an optional payment ID for tracking.
  3. Parse payment details from a 402 response to display payment info before making the payment.

Properties

Name Meaning
Recipient Address Solana address to send payment to, required for making a payment.
Amount (SOL) Amount of SOL to send in the payment, must be at least 0.000001 SOL, required for making a payment.
Payment ID Optional identifier for the payment, useful for tracking or referencing the payment.

Output

JSON

  • parsed - Indicates if the payment requirements were successfully parsed from a 402 response.
  • paymentDetails - Details of the payment requirements parsed from the 402 response.
  • success - Indicates if the payment was successfully executed.
  • signature - Transaction signature of the executed payment on the Solana blockchain.
  • amount - Amount of SOL sent in the payment.
  • recipient - Recipient Solana address of the payment.
  • timestamp - Timestamp when the payment transaction was executed.
  • explorerUrl - URL to view the transaction details on the Solana blockchain explorer.
  • error - Error message if the operation failed and continueOnFail is enabled.

Dependencies

  • solanaX402ClientApi credential for network and private key access
  • x402-client-sdk for payment processing
  • @solana/web3.js for Solana blockchain interaction
  • bs58 for decoding base58 encoded private keys

Troubleshooting

  • Invalid private key format error: Ensure the private key is base58 encoded as required by the node.
  • Payment failures: Verify the recipient address is correct and the amount is within allowed limits.
  • Parsing errors: Confirm the 402 response body is correctly formatted JSON with valid payment requirements.
  • Network or RPC URL issues: Check the Solana network and RPC URL settings in the credentials are correct and accessible.

Links

  • Solana Explorer - View transaction details on the Solana blockchain explorer.
  • Solana Documentation - Official documentation for Solana blockchain development.
  • x402 Client SDK - SDK used for parsing payment requirements and executing payments on Solana.

Discussion