Add function to get token decimals by index

This commit is contained in:
Riordan Panayides 2021-05-22 13:54:53 +01:00
parent 8236f057e4
commit 85e674385e
1 changed files with 3 additions and 0 deletions

View File

@ -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 {