SPLTokenProgram.amountToUiAmount constructor
SPLTokenProgram.amountToUiAmount({
- required SPLTokenAmountToUiAmountLayout layout,
- required SolAddress mint,
- SolAddress programId = SPLTokenProgramConst.tokenProgramId,
Convert an Amount of tokens to a UiAmount string
, using the given
mint. In this version of the program, the mint can only specify the
number of decimals.
Implementation
factory SPLTokenProgram.amountToUiAmount(
{required SPLTokenAmountToUiAmountLayout layout,
/// The mint to calculate for
required SolAddress mint,
SolAddress programId = SPLTokenProgramConst.tokenProgramId}) {
return SPLTokenProgram(
layout: layout, keys: [mint.toReadOnly()], programId: programId);
}