algokit_utils.models.amount
algokit_utils.models.amount
Section titled “algokit_utils.models.amount”Attributes
Section titled “Attributes”ALGORAND_MIN_TX_FEE |
|---|
Classes
Section titled “Classes”AlgoAmount | Wrapper class to ensure safe, explicit conversion between µAlgo, Algo and numbers. |
|---|
Functions
Section titled “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
Section titled “Module Contents”class AlgoAmount(*, micro_algo: int)
Section titled “class AlgoAmount(*, micro_algo: int)”class AlgoAmount(*, algo: int | decimal.Decimal)
Section titled “class 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)
property micro_algo : int
Section titled “property micro_algo : int”Return the amount as a number in µAlgo.
- Returns: The amount in µAlgo.
property algo : decimal.Decimal
Section titled “property algo : decimal.Decimal”Return the amount as a number in Algo.
- Returns: The amount in Algo.
static from_algo(amount: int | decimal.Decimal) → AlgoAmount
Section titled “static from_algo(amount: int | decimal.Decimal) → AlgoAmount”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)
static from_micro_algo(amount: int) → AlgoAmount
Section titled “static from_micro_algo(amount: int) → AlgoAmount”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)
algo(algo: int) → AlgoAmount
Section titled “algo(algo: int) → AlgoAmount”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.
micro_algo(micro_algo: int) → AlgoAmount
Section titled “micro_algo(micro_algo: int) → AlgoAmount”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.
ALGORAND_MIN_TX_FEE
Section titled “ALGORAND_MIN_TX_FEE”transaction_fees(number_of_transactions: int) → AlgoAmount
Section titled “transaction_fees(number_of_transactions: int) → AlgoAmount”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.