models.amount | Algorand Developer Portal

models.amount

Attributes

ALGORAND_MIN_TX_FEE

Classes

AlgoAmount Wrapper class to ensure safe, explicit conversion between µAlgo, Algo and numbers.

Functions

algo(→ AlgoAmount) Create an AlgoAmount object representing the given number of Algo.
micro_algo(→ AlgoAmount) Create an AlgoAmount object representing the given number of µAlgo.
--- ---
transaction_fees(→ AlgoAmount) Calculate the total transaction fees for a given number of transactions.

Module Contents

class algokit_utils.models.amount.AlgoAmount(*, micro_algo: int)

class algokit_utils.models.amount.AlgoAmount(*, algo: int | decimal.Decimal)

Wrapper class to ensure safe, explicit conversion between µAlgo, Algo and numbers.

amount = AlgoAmount(algo=1)

amount = AlgoAmount.from_algo(1)

amount = AlgoAmount(micro_algo=1_000_000)

amount = AlgoAmount.from_micro_algo(1_000_000)

property micro*algo *: int_

Return the amount as a number in µAlgo.

property algo : decimal.Decimal_

Return the amount as a number in Algo.

static from_algo(amount: int | decimal.Decimal) → AlgoAmount

Create an AlgoAmount object representing the given number of Algo.

amount = AlgoAmount.from_algo(1)

static from_micro_algo(amount: int) → AlgoAmount

Create an AlgoAmount object representing the given number of µAlgo.

amount = AlgoAmount.from_micro_algo(1_000_000)

algokit_utils.models.amount.algo(algo: int) → AlgoAmount

Create an AlgoAmount object representing the given number of Algo.

algokit_utils.models.amount.micro_algo(micro_algo: int) → AlgoAmount

Create an AlgoAmount object representing the given number of µAlgo.

algokit_utils.models.amount.ALGORAND_MIN_TX_FEE

algokit_utils.models.amount.transaction_fees(number_of_transactions: int) → AlgoAmount

Calculate the total transaction fees for a given number of transactions.