Import
Definition
Payment requirements specified by an x402 server. Defines the scheme, CAIP-2 network, asset ID (0 for ALGO), amount in base units, recipient address, timeout, and optional extra metadata such as fee payer and token decimals.

Properties

string
required
Payment scheme identifier. x402-avm-js builds payments for "exact".
string
required
CAIP-2 network id, for example algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73k for MainNet.
string
required
Asset id as a string: "0" for native ALGO, otherwise the ASA id (for example "31566704" for USDC on MainNet).
string
required
Amount in the asset’s base units (microALGO for ALGO), as a string.
string
required
Algorand address (58 characters) that receives the payment.
number
required
Maximum time, in seconds, the server allows for the payment.
object
Optional scheme metadata sent by the server.

Example

Source: src/index.ts