diff --git a/client/ts/src/global.ts b/client/ts/src/global.ts index 2de617d3f..3f5947027 100644 --- a/client/ts/src/global.ts +++ b/client/ts/src/global.ts @@ -107,6 +107,20 @@ export class Global { return toNum(deposit.balanceAtoms) / 10 ** decimals; } + getGlobalBalanceTokensWithDecimals( + trader: PublicKey, + decimals: number, + ): number { + const deposit: GlobalDeposit | undefined = this.data.globalDeposits.find( + (seat) => seat.trader.equals(trader), + ); + if (!deposit) { + return 0; + } else { + return toNum(deposit.balanceAtoms) / 10 ** decimals; + } + } + tokenMint(): PublicKey { return this.data.mint; } diff --git a/client/ts/src/index.ts b/client/ts/src/index.ts index 446ad8383..2781efb33 100644 --- a/client/ts/src/index.ts +++ b/client/ts/src/index.ts @@ -1,5 +1,6 @@ export * from './client'; export * from './market'; +export * from './global'; export * from './types'; export * as manifest from './manifest'; export * as utils from './utils'; diff --git a/package.json b/package.json index 4a76b8a22..6d5898c7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cks-systems/manifest-sdk", - "version": "0.1.67", + "version": "0.1.68", "files": [ "dist/", "README.md",