Import
Signature
A default implementation of AvmSigner for convenience. Wraps an Algorand account private key and an optional AlgodClient connection to handle signing and submitting single transactions or atomic transaction groups.

Constructor parameters

str
required
Base64-encoded 32-byte Algorand private key.
AlgodClient | None
default:"None"
Connected algod client used for group simulation, transmission, and confirmation. Default is None.

Attributes

str
The corresponding Algorand public address.
algosdk.v2client.algod.AlgodClient or None
Client used for on-chain interactions.

Examples

Methods

get_addresses

Return the list of public addresses managed by this signer. Returns
list of str
Single-element list containing self.address.
Example

sign_transactions

Sign selected transactions in a list. Parameters
list[bytes]
required
List of raw msgpack-encoded unsigned transaction bytes.
list[int]
required
0-based indices in unsigned_txns to sign.
Returns
list of bytes or None
List of the same length as unsigned_txns, containing raw signed transaction bytes at designated indexes and None elsewhere.
Example

sign_transaction

Sign a single raw transaction. Parameters
bytes
required
Raw msgpack-encoded unsigned transaction bytes.
Any
required
Whether this signer acts as fee payer for the transaction.
str
required
Target network identifier (unused during raw local signing).
Returns
bytes
Raw msgpack-encoded signed transaction bytes.
Example

sign_group

Sign specified transactions within an atomic transaction group. Parameters
list[bytes]
required
List of raw transaction bytes representing the atomic group.
Any
required
Whether this signer acts as fee payer for the group.
list[int]
required
Indices within group_bytes to be signed by this signer.
str
required
Target network identifier.
Returns
list of bytes
New list where transactions at indexes have been replaced with their signed counterparts.
Example

simulate_group

Simulate execution of an atomic transaction group against algod. Decodes the transactions, constructs a SimulateRequest with allow_empty_signatures=True, and calls algod_client.simulate_transactions. Parameters
list[bytes]
required
List of raw msgpack-encoded transaction bytes in the group.
str
required
Target network identifier.
Returns
dict
Raw simulation response dictionary from the algod node.
Raises
  • AlgodClientRequiredError: (a RuntimeError) If self.algod_client is None.
  • PaymentVerificationError: (a RuntimeError) If simulation fails with a failure message from algod.
Example

send_group

Broadcast a signed atomic transaction group to the network. Notes Broadcasts the atomic transaction group to the Algorand blockchain. Once confirmed, the on-chain state transition (transfers, fees, note payloads) becomes irreversible. Parameters
list[bytes]
required
List of signed raw transaction bytes.
str
required
Target network identifier.
Returns
str
First transaction ID (txid) of the submitted atomic group.
Raises
  • AlgodClientRequiredError: (a RuntimeError) If self.algod_client is None.
Example

confirm_transaction

Wait for an on-chain transaction to be confirmed by algod. Parameters
str
required
Transaction ID to wait for.
str
required
Target network identifier.
int
default:"4"
Number of rounds to wait before raising an error.
Returns
dict
Confirmed transaction information dictionary from algod.
Raises
  • AlgodClientRequiredError: (a RuntimeError) If self.algod_client is None.
Example

See also

  • PaymentGate: Accepts a signer to sign fee-payer and settlement transactions.
Source: ai_economy_sdk/signer.py