Skip to content

AlgoAmount

Defined in: src/amount.ts:2

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

new AlgoAmount(amount): AlgoAmount

Defined in: src/amount.ts:35

Create a new AlgoAmount instance.

An object specifying the amount in Algo or µALGO. Use the key ‘algo’ for Algo amounts and ‘microAlgo’ for µALGO.

{ algos: number | bigint; } | { algo: number | bigint; } | { microAlgos: number | bigint; } | { microAlgo: number | bigint; }

AlgoAmount

A new instance of AlgoAmount representing the specified amount.

const amount = new AlgoAmount({ algo: 5 });

get algo(): number

Defined in: src/amount.ts:21

Return the amount as a number in Algo

number


get algos(): number

Defined in: src/amount.ts:16

Return the amount as a number in Algo

number


get microAlgo(): bigint

Defined in: src/amount.ts:11

Return the amount as a number in µAlgo

bigint


get microAlgos(): bigint

Defined in: src/amount.ts:6

Return the amount as a number in µAlgo

bigint

toString(): string

Defined in: src/amount.ts:48

string


valueOf(): number

Defined in: src/amount.ts:56

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

number


static Algo(amount): AlgoAmount

Defined in: src/amount.ts:66

Create a AlgoAmount object representing the given number of Algo

number | bigint

AlgoAmount


static Algos(amount): AlgoAmount

Defined in: src/amount.ts:61

Create a AlgoAmount object representing the given number of Algo

number | bigint

AlgoAmount


static MicroAlgo(amount): AlgoAmount

Defined in: src/amount.ts:76

Create a AlgoAmount object representing the given number of µAlgo

number | bigint

AlgoAmount


static MicroAlgos(amount): AlgoAmount

Defined in: src/amount.ts:71

Create a AlgoAmount object representing the given number of µAlgo

number | bigint

AlgoAmount