Constructors
constructor
- new TokenAmount(amount: BN, decimals: number): helpers.TokenAmount
-
Parameters
-
amount: BN
-
decimals: number
Properties
decimals
decimals: number
uiAmount
uiAmount: string
uiAmountFloat
uiAmountFloat: number
Methods
isZero
- isZero(): boolean
-
Returns boolean
Static
tokenAccount
- tokenAccount(tokenAccount: TokenAccountInfo, decimals: number): helpers.TokenAmount
-
Parameters
-
tokenAccount: TokenAccountInfo
-
decimals: number
Static
Private
tokenAmount
- tokenAmount(lamports: BN, decimals: number): number
-
Parameters
-
lamports: BN
-
decimals: number
Returns number
Static
tokenPrice
- tokenPrice(marketValue: number, price: number, decimals: number): helpers.TokenAmount
-
Parameters
-
marketValue: number
-
price: number
-
decimals: number
Static
tokens
- tokens(tokenAmount: string, decimals: number): helpers.TokenAmount
-
Parameters
-
tokenAmount: string
-
decimals: number
Static
Private
tokensToLamports
- tokensToLamports(uiAmount: string, decimals: number): BN
-
Parameters
-
uiAmount: string
-
decimals: number
Returns BN
Raw amount of token lamports