SPL token amount with UI formatting.

1.0.0

interface TokenAmount {
    amount: string;
    decimals: number;
    uiAmount: null | number;
    uiAmountString: string;
}

Properties

amount: string

Raw amount as a string (avoids floating-point loss).

decimals: number

Token decimals.

uiAmount: null | number

UI-friendly amount (null if zero).

uiAmountString: string

UI-friendly amount as string.