Add function to get token decimals by index
This commit is contained in:
parent
8236f057e4
commit
85e674385e
|
@ -169,6 +169,9 @@ export class MangoGroup {
|
|||
getTokenSymbol(tokenIndex: number): string {
|
||||
return TOKEN_MINTS.find((m) => m.address.toString() === this.tokens[tokenIndex].toString())?.name || '';
|
||||
}
|
||||
getTokenDecimals(tokenIndex: number): number {
|
||||
return tokenToDecimals[this.getTokenSymbol(tokenIndex)]
|
||||
}
|
||||
}
|
||||
|
||||
export class MarginAccount {
|
||||
|
|
Loading…
Reference in New Issue