mirror of
https://github.com/alexgo-io/alex-sdk.git
synced 2026-01-12 14:25:02 +08:00
fix: balance fetching
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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)];
|
||||
}
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user