Module algoappdev.transactions

Utilities for building and inspecting transactions.

Functions

def fund_from_genesis(algod_client: algosdk.v2client.algod.AlgodClient, kmd_client: algosdk.kmd.KMDClient, amount: int) ‑> Tuple[AccountMeta, str]

Create a new account and fund it from the account that received the gensis funds.

Expects an unencrypted wallet "unencrypted-default-wallet" whose first key is the address of the account with the genesis funds.

Args

algod_client
client to send node commands to
kmd_client
client to use in signing the transaction
amount
the quantity of microAlgos to fund

Returns

the funded account info, and funding transaction id

def get_confirmed_transaction(client: algosdk.v2client.algod.AlgodClient, transaction_id: int, timeout_blocks: int) ‑> Dict[~KT, ~VT]

See get_confirmed_transactions(), but for a single transaction id.

def get_confirmed_transactions(client: algosdk.v2client.algod.AlgodClient, transaction_ids: List[int], timeout_blocks: int) ‑> Dict[~KT, ~VT]

Wait for the network to confirm some transactions and return their info.

Args

client
the client
transaction_ids
list of transactions for which to retreive info
timeout_blocks
wait for this many blocks to confirm the transactions

Returns

list of transaction info for confirmed transactions

def group_txns(*txns: algosdk.future.transaction.Transaction) ‑> List[algosdk.future.transaction.Transaction]

Group multiple transactions so that they can be submitted together as an atomic unit, and access one-another's data.

Args

txns
the transactions to group

Returns

list of transactions, with the group member set

def pad_lease_bytes(lease: bytes) ‑> bytes

Given a string of bytes to use as a lease, right pad with 0s to get the correct number of bytes.