From 36a1353f7590b973ab44af120b5aaf19d53a4b32 Mon Sep 17 00:00:00 2001 From: alekswaslet <1346150+alekswaslet@users.noreply.github.com> Date: Thu, 18 Jul 2024 17:36:13 +0200 Subject: [PATCH] getTotalStakeable only returns P-Chain amount --- package.json | 2 +- src/wallet/account/mcn.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7986d0d..b414ddf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "juneojs", - "version": "0.0.128", + "version": "0.0.129", "description": "Juneo JS Library", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/wallet/account/mcn.ts b/src/wallet/account/mcn.ts index 4b5df87..0a1f275 100644 --- a/src/wallet/account/mcn.ts +++ b/src/wallet/account/mcn.ts @@ -1,5 +1,5 @@ import { type TokenAsset } from '../../asset' -import { type Blockchain } from '../../chain' +import { PLATFORMVM_ID, type Blockchain } from '../../chain' import { type MCNProvider } from '../../juneo' import { AccountError, sortSpendings, type AssetValue } from '../../utils' import { @@ -88,7 +88,7 @@ export class MCNAccount { getTotalStakeableAmount (assetId: string): bigint { let totalAmount: bigint = BigInt(0) for (const [, account] of this.chainAccounts) { - if (account.type === AccountType.Utxo) { + if (account.chain.vm.id === PLATFORMVM_ID) { totalAmount += (account as UtxoAccount).getStakeableBalance(assetId).getValue() } }