Skip to content

models.amount

ALGORAND_MIN_TX_FEE
AlgoAmountWrapper class to ensure safe, explicit conversion between µAlgo, Algo and numbers.
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.

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

Section titled “class algokit_utils.models.amount.AlgoAmount(*, micro_algo: int)”

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

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

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

  • Example:
    amount = AlgoAmount(algo=1)
    amount = AlgoAmount.from_algo(1)
    amount = AlgoAmount(micro_algo=1_000_000)
    amount = AlgoAmount.from_micro_algo(1_000_000)

Return the amount as a number in µAlgo.

  • Returns: The amount in µAlgo.

Return the amount as a number in Algo.

  • Returns: The amount in Algo.

Create an AlgoAmount object representing the given number of Algo.

  • Parameters: amount – The amount in Algo.
  • Returns: An AlgoAmount instance.
  • Example:
    amount = AlgoAmount.from_algo(1)

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

  • Parameters: amount – The amount in µAlgo.
  • Returns: An AlgoAmount instance.
  • Example:
    amount = AlgoAmount.from_micro_algo(1_000_000)

Create an AlgoAmount object representing the given number of Algo.

  • Parameters: algo – The number of Algo to create an AlgoAmount object for.
  • Returns: An AlgoAmount object representing the given number of Algo.

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

  • Parameters: micro_algo – The number of µAlgo to create an AlgoAmount object for.
  • Returns: An AlgoAmount object representing the given number of µAlgo.

algokit_utils.models.amount.ALGORAND_MIN_TX_FEE

Section titled “algokit_utils.models.amount.ALGORAND_MIN_TX_FEE”

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

  • Parameters: number_of_transactions – The number of transactions to calculate the fees for.
  • Returns: The total transaction fees.