Solana x402 Client icon

Solana x402 Client

Make SOL payments in response to HTTP 402 errors

Parse and Pay

AI-generated

Overview

This node, named Solana x402 Client, facilitates handling HTTP 402 payment-required responses by enabling users to parse payment requirements from such responses and make SOL (Solana cryptocurrency) payments accordingly. It supports three operations: parsing the 402 response to extract payment details, making a SOL payment to a specified recipient, and a combined operation that parses the 402 response and immediately makes the payment. This node is useful in scenarios where automated payment handling is needed in response to 402 errors, such as in paywall or metered access systems that require SOL payments.

Use Case Examples

  1. Automatically parse a 402 response from a web service to extract payment details.
  2. Make a SOL payment to a recipient address with a specified amount and optional payment ID.
  3. Parse a 402 response and immediately execute the required SOL payment in one step.

Properties

Name Meaning
402 Response Body The JSON body of the HTTP 402 response containing payment requirements to be parsed.

Output

JSON

  • parsed - Indicates that the payment requirements were successfully parsed from the 402 response.
  • paymentDetails - The detailed payment requirements extracted from the 402 response.
  • success - Indicates that the SOL payment was successfully made.
  • signature - The transaction signature of the SOL payment on the Solana blockchain.
  • amount - The amount of SOL sent in the payment.
  • recipient - The Solana address that received the payment.
  • timestamp - The timestamp when the payment transaction was executed.
  • explorerUrl - A URL to view the transaction details on the Solana blockchain explorer.
  • error - Error message if the operation failed and continueOnFail is enabled.

Dependencies

  • Requires an API key credential for Solana network access, including network type and optionally an RPC URL.
  • Requires a private key in base58 format for signing transactions on the Solana blockchain.

Troubleshooting

  • Invalid private key format error: Ensure the private key is base58 encoded as required.
  • Payment failures: Verify recipient address, amount, and network settings are correct.
  • Parsing errors: Confirm the 402 response body JSON is correctly formatted and contains valid payment requirements.

Links

Discussion