fix: balance fetching

This commit is contained in:
Kyle Fang
2024-06-18 10:08:19 +00:00
parent cf95cb62c9
commit 89e7bff91e
3 changed files with 4 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
{
"version": "2.1.1-beta.1",
"version": "2.1.2",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
@@ -13,7 +13,7 @@
"scripts": {
"start": "dts watch",
"build": "dts build",
"prepublishOnly": "pnpm run build",
"prepare": "pnpm run build",
"test": "dts test",
"lint": "dts lint",
"size": "size-limit",

View File

@@ -85,7 +85,7 @@ export async function fetchBalanceForAccount(
return [a.id, BigInt(response.stx.balance) * BigInt(100)];
}
const fungibleToken =
response.fungible_tokens[a.underlyingToken.split('::')[0]]?.balance;
response.fungible_tokens[a.underlyingToken]?.balance;
if (fungibleToken == null) {
return [a.id, BigInt(0)];
}

View File

@@ -1,7 +1,7 @@
import { configs } from '../src/config';
import { AlexSDK, Currency } from '../src';
const tokenAlex = 'token-alex' as Currency;
const tokenAlex = 'age000-governance-token' as Currency;
const tokenDiko = 'token-wdiko' as Currency;
describe('AlexSDK', () => {