Creates an Asset class setting the index and Algorand client.
Note that clients would not usually call this constructor themselves.
the Algorand sdk client to use for extracting asset details.
the ID of the asset.
The Algorand sdk client to use for extracting asset details.
The number of decimal places that the Asset supports.
The ID of the asset.
The name of the Asset if there is one. This may be empty.
The ratio between a base unit and the unit of the asset. This is used to convert between an integer and floating point representation of the asset without loss of precision.
The name of a unit of the asset if there is one. This may be empty.
A cache of the asset index to Asset to reduce the time for looking up basic details about the asset.
Creates the actual transaction for the account to opt-in to holding the asset.
Address of the account to opt in to the asset.
Algorand suggested parameters for transactions.
A transaction to opt-in into asset.
Returns the amount of holding of this asset the account has.
Note that this function may return null if the account has not opted in for this asset.
The account to check the current holding.
The amount of this asset the account is holding, or None if the account is not opted into the asset.
The account information to extract the asset holding from.
The amount of asset or null if the account is not opted into the asset.
Checks if the account is already able to hold this asset, that is it has already opted in.
This functions should be called to check if the opt-in transaction needs to be created. See prepareOptInTx.
The account to check if the asset is opted in on.
True if the account is already opted in, false otherwise.
This creates a transaction that will allow the account to "opt in" to the asset.
In Algorand, every account has to explicitly opt-in for an asset before receiving it.
Needed if you want to receive an asset from a swap or to manage liquidity tokens.
Account to opt in to this asset.
Transaction for opting in to this asset.
Generated using TypeDoc
Describes the basic data and the utility functions for an Algorand Standard Asset.
Typically you don't create instances of this class manually. Use PactClient.fetchAsset instead. Also, when instantiating the pool e.g. by using PactClient.fetchPoolById the missing pool assets are fetched automatically.