Solana x402 Mock icon

Solana x402 Mock

Return HTTP 402 Payment Required for Solana SOL payments

Verify Payment

AI-generated

Overview

This node verifies Solana SOL payment transactions by checking the validity of a given transaction signature against expected payment criteria. It is useful in scenarios where you need to confirm that a payment has been made on the Solana blockchain before granting access to a resource or service. For example, it can be used to validate payments for premium content or services that require a specific amount of SOL to be paid within a certain time frame to prevent replay attacks.

Use Case Examples

  1. Verifying a Solana transaction signature to confirm a payment of 0.01 SOL was made.
  2. Ensuring a payment transaction is recent (e.g., within the last 300 seconds) to avoid replay attacks.

Properties

Name Meaning
Transaction Signature The Solana transaction signature to verify the payment.
Expected Amount (SOL) The expected payment amount in SOL to validate against the transaction.
Max Age (Seconds) The maximum age of the transaction in seconds to prevent replay attacks.

Output

JSON

  • json - The verification result of the payment transaction, including status and details.

Dependencies

  • Requires an API key credential for the Solana x402 server, including network, recipient address, and optional RPC URL.

Troubleshooting

  • Initialization failure of the x402 server due to incorrect or missing credentials. Ensure the API key credential is correctly configured with network, recipient address, and RPC URL if needed.
  • Verification errors due to invalid transaction signatures, mismatched expected amounts, or transactions older than the specified max age. Check input parameters for correctness.
  • Errors thrown during execution will provide messages indicating the cause, which can be used to adjust inputs or credentials accordingly.

Discussion