Import
Signature
Facilitator-side signer (FacilitatorAvmSigner) backed by private keys and algod. Signs fee payer transactions, simulates groups, sends them, and waits for confirmation. It also implements ClientAvmSigner (address / sign_transactions), so one object can serve both roles in tests and demos. algod selection:
  • algod_client (or algod_url/algod_token) given: that node is used for every call. The first call for a network checks that the node’s genesis hash matches it and raises NetworkMismatchError otherwise.
  • nothing given: the algod URL configured for the network in NETWORK_CONFIGS (MainNet / TestNet defaults, or a network added with register_network).
Example

Constructor parameters

str | Sequence[str]
required
algod.AlgodClient | None
default:"None"
str | None
default:"None"
str | None
default:"None"

Methods

from_private_key

Create a signer from one base64 private key. Parameters
str
required
algod.AlgodClient | None
default:"None"
str | None
default:"None"
str | None
default:"None"

from_mnemonic

Create a signer from a 25-word Algorand mnemonic. Parameters
str
required
algod.AlgodClient | None
default:"None"
str | None
default:"None"
str | None
default:"None"

sign_transactions

Sign the transactions at indexes_to_sign with the key of each sender. Parameters
list[bytes]
required
list[int]
required

get_addresses

All managed fee payer addresses.

sign_transaction

Sign one unsigned transaction with fee_payer’s key. Parameters
bytes
required
str
required
str
required
Raises
  • SigningError: If fee_payer is not managed by this signer.

sign_group

Sign the transactions at indexes_to_sign with fee_payer’s key. Parameters
list[bytes]
required
str
required
list[int]
required
str
required
Raises
  • SigningError: If fee_payer is not managed by this signer.

simulate_group

Simulate the group with algod (unsigned transactions allowed). Parameters
list[bytes]
required
str
required
Raises
  • SimulationError: If algod reports the group would fail.
  • NetworkMismatchError: If algod is on a different network.

send_group

Submit a fully signed group; returns the ID of its first transaction. Parameters
list[bytes]
required
str
required

confirm_transaction

Wait up to rounds rounds for txid to be in a block. Parameters
str
required
str
required
int
default:"4"
Raises
  • algosdk.error.ConfirmationTimeoutError: If not confirmed in time.
  • algosdk.error.TransactionRejectedError: If the pool rejected it.

algod_for

The algod client used for network (CAIP-2 or V1 name). Parameters
str
required
Raises
  • NetworkError: If no algod is configured for the network.
  • NetworkMismatchError: If the configured algod is on another network.
Source: x402_algorand/signer.py