Import
Signature
AVM client implementation for the Exact payment scheme (V2). Implements SchemeNetworkClient protocol. Returns the inner payload dict, which x402Client wraps into a full PaymentPayload. Creates atomic transaction groups for ASA payments:
  • Without fee abstraction: Single ASA transfer transaction
  • With fee abstraction: [Fee payer txn (unsigned), ASA transfer (signed)]

Constructor parameters

ClientAvmSigner
required
str | None
default:"None"
str | None
default:"None"

Attributes

Any
The scheme identifier (“exact”).

Examples

Methods

create_payment_payload

Create atomic transaction group for payment. If feePayer in requirements.extra:
  • Creates 2-txn group: [fee_payer_txn (unsigned), asa_transfer (signed)]
  • Fee payer covers all fees (pooled: minFee * 2)
  • Client signs only ASA transfer
Else
  • Creates single ASA transfer with normal fee
  • Client signs the transaction
Parameters
PaymentRequirements
required
Payment requirements from server.
Returns
dict[str, Any]
Inner payload dict (paymentGroup, paymentIndex). x402Client wraps this with x402_version, accepted, resource, extensions.
Raises
  • NetworkError: If the network is unsupported and no algod_url was given.
  • NetworkMismatchError: If algod is connected to a different network than requirements.network.

find_default_asset

Find default asset info for spend controls. Returns the shape of official x402 ExactDefaultAssetInfo: {asset, name, version, decimals, symbol}.
  • asset “0” on ANY Algorand network -> Algo (decimals 6)
  • USDC (31566704 on MainNet / 10458941 on TestNet) -> USD Coin (decimals 6)
  • anything else -> None
Parameters
str
required
Asset identifier (“0” for ALGO or ASA ID).
str
required
CAIP-2 or legacy V1 network identifier.
Returns
dict[str, Any] | None
Matching default asset dict or None.
Source: x402_algorand/exact/client.py