types amount.AlgoAmount
@algorandfoundation/algokit-utils / types/amount / AlgoAmount
Class: AlgoAmount¶
types/amount.AlgoAmount
Wrapper class to ensure safe, explicit conversion between µAlgos, Algos and numbers
Table of contents¶
Constructors¶
Properties¶
Accessors¶
Methods¶
Constructors¶
constructor¶
• new AlgoAmount(amount
): AlgoAmount
Parameters¶
Name | Type |
---|---|
amount |
{ algos : number } | { microAlgos : number } |
Returns¶
Defined in¶
Properties¶
amountInMicroAlgos¶
• Private
amountInMicroAlgos: number
Defined in¶
Accessors¶
algos¶
• get
algos(): number
Return the amount as a number in Algos
Returns¶
number
Defined in¶
microAlgos¶
• get
microAlgos(): number
Return the amount as a number in µAlgos
Returns¶
number
Defined in¶
Methods¶
toString¶
▸ toString(): string
Returns¶
string
Defined in¶
valueOf¶
▸ valueOf(): number
valueOf allows you to use AlgoAmount
in comparison operations such as <
and >=
etc.,
but it's not recommended to use this to convert to a number, it's much safer to explicitly call
the algos or microAlgos properties
Returns¶
number
Defined in¶
Algos¶
▸ Algos(amount
): AlgoAmount
Create a AlgoAmount
object representing the given number of Algos
Parameters¶
Name | Type |
---|---|
amount |
number |
Returns¶
Defined in¶
MicroAlgos¶
▸ MicroAlgos(amount
): AlgoAmount
Create a AlgoAmount
object representing the given number of µAlgos
Parameters¶
Name | Type |
---|---|
amount |
number |