Import
Signature
AVM facilitator implementation for the Exact payment scheme (V2). Verifies and settles ASA payments on Algorand networks.

Constructor parameters

FacilitatorAvmSigner
required

Attributes

Any
The scheme identifier (“exact”).
Any
The CAIP family pattern (“algorand:*”).

Examples

Methods

get_extra

Get mechanism-specific extra data for the supported kinds endpoint. For AVM, this includes a randomly selected fee payer address. Random selection distributes load across multiple signers. Parameters
Network
required
Network identifier (used for validation only).
Returns
dict[str, Any] | None
Extra data with feePayer address, or None if no signers.

get_signers

Get facilitator wallet addresses. Parameters
Network
required
Network identifier.
Returns
list[str]
List of facilitator fee payer addresses.

verify

Verify ASA payment payload. Validates per Algorand exact scheme spec:
  1. Check paymentGroup contains 16 or fewer elements
  2. Decode all transactions from the paymentGroup
  3. Locate payment transaction (paymentIndex):
    • Check aamt (asset amount) == requirements.amount
    • Check arcv (asset receiver) matches requirements.payTo
  4. If feePayer in requirements:
    • Locate fee payer transaction
    • Check type is “pay”
    • Check close, rekey, amt are omitted/zero
    • Check fee is reasonable
    • Sign the transaction
  5. Simulate group to verify it would succeed
Security checks:
  • No unbalanced rekey operations (sandwich rekey+rekey-back allowed)
  • No close-to operations allowed
  • keyreg transactions blocked
  • Facilitator signers cannot transfer their own funds
Parameters
PaymentPayload
required
Payment payload from client.
PaymentRequirements
required
Payment requirements.
Any
default:"None"
Any
default:"()"
Any
default:"{}"
Returns
VerifyResponse
VerifyResponse with is_valid and payer.

settle

Settle ASA payment on-chain.
  • Re-verifies payment
  • Signs fee payer transaction
  • Sends transaction group to network
  • Waits for confirmation (instant finality)
Parameters
PaymentPayload
required
Verified payment payload.
PaymentRequirements
required
Payment requirements.
Any
default:"None"
Any
default:"()"
Any
default:"{}"
Returns
SettleResponse
SettleResponse with success, transaction, and payer.
Source: x402_algorand/exact/facilitator.py