From 71df67a62995d9da6e9c8bb25c56dd9d95d9d607 Mon Sep 17 00:00:00 2001 From: ahmedhanafy725 Date: Sun, 18 Jun 2023 16:39:27 +0300 Subject: [PATCH 1/4] Fix dashboard balance fields --- packages/dashboard/src/portal/lib/balance.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/dashboard/src/portal/lib/balance.ts b/packages/dashboard/src/portal/lib/balance.ts index beb36b29ee..bb5450d0af 100644 --- a/packages/dashboard/src/portal/lib/balance.ts +++ b/packages/dashboard/src/portal/lib/balance.ts @@ -11,7 +11,7 @@ export async function getBalance( system: { account: (arg0: string) => { data: { - feeFrozen: { toJSON: () => number }; + frozen: { toJSON: () => number }; free: { toJSON: () => number }; reserved: { toJSON: () => number }; }; @@ -25,8 +25,8 @@ export async function getBalance( return { free: Math.floor((res.data.free.toJSON() / 1e7) * 1000) / 1000, - transferable: Math.floor(((res.data.free.toJSON() - res.data.feeFrozen.toJSON()) / 1e7) * 1000) / 1000, - reserved: res.data.feeFrozen.toJSON() / 1e7, + transferable: Math.floor(((res.data.free.toJSON() - res.data.frozen.toJSON()) / 1e7) * 1000) / 1000, + reserved: res.data.frozen.toJSON() / 1e7, }; } From 0574ff20a3c4926957645c7736dbe7692106bba9 Mon Sep 17 00:00:00 2001 From: ahmedhanafy725 Date: Sun, 18 Jun 2023 16:40:02 +0300 Subject: [PATCH 2/4] Fix tfchain balance fields --- packages/tfchain_client/src/balances.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/tfchain_client/src/balances.ts b/packages/tfchain_client/src/balances.ts index 8a10a04431..8b5163b8ad 100644 --- a/packages/tfchain_client/src/balances.ts +++ b/packages/tfchain_client/src/balances.ts @@ -4,8 +4,7 @@ import { checkConnection } from "./utils"; interface Balance { free: number; reserved: number; - miscFrozen: number; - feeFrozen: number; + frozen: number; } export interface QueryBalancesGetOptions { @@ -23,8 +22,7 @@ class QueryBalances { const balance: Balance = { free: res["data"].free.toJSON(), reserved: res["data"].reserved.toJSON(), - miscFrozen: res["data"].miscFrozen.toJSON(), - feeFrozen: res["data"].feeFrozen.toJSON(), + frozen: res["data"].frozen.toJSON(), }; return balance; } From 640442eadc4849fd371fa851a6ad7e6a403b5fa7 Mon Sep 17 00:00:00 2001 From: ahmedhanafy725 Date: Mon, 19 Jun 2023 11:55:48 +0300 Subject: [PATCH 3/4] Fix locked balance in playground --- packages/playground/src/utils/grid.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playground/src/utils/grid.ts b/packages/playground/src/utils/grid.ts index 1e827b9472..e358a88ebc 100644 --- a/packages/playground/src/utils/grid.ts +++ b/packages/playground/src/utils/grid.ts @@ -54,7 +54,7 @@ export async function loadBalance(grid: GridClient): Promise { const balance = await grid.balance.getMyBalance(); return { free: +balance.free, - locked: +balance.feeFrozen, + locked: +balance.frozen, }; } From 057ae8d3b6417ce0bd0e91b36ecff729269fe127 Mon Sep 17 00:00:00 2001 From: ahmedhanafy725 Date: Tue, 20 Jun 2023 16:14:41 +0300 Subject: [PATCH 4/4] Fix the balance types in weblets --- packages/weblets/src/stores/balance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/weblets/src/stores/balance.ts b/packages/weblets/src/stores/balance.ts index 553d1816dc..123f646de2 100644 --- a/packages/weblets/src/stores/balance.ts +++ b/packages/weblets/src/stores/balance.ts @@ -53,7 +53,7 @@ function createBalanceStore() { getBalance(profile) .then(balance => { fullStore.setBalance(balance.free); - fullStore.setLockedBalance(balance.feeFrozen); + fullStore.setLockedBalance(balance.frozen); }) .catch(err => { console.log("Balance Error", err);