From 4b604ba6981b81abd0ecf120d4dfc77181a809a1 Mon Sep 17 00:00:00 2001 From: Neal Date: Fri, 28 Jan 2022 20:16:56 -0500 Subject: [PATCH] fix: monero bn methods --- lib/plugins/wallet/monerod/monerod.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plugins/wallet/monerod/monerod.js b/lib/plugins/wallet/monerod/monerod.js index 37d46a77..afd395a7 100644 --- a/lib/plugins/wallet/monerod/monerod.js +++ b/lib/plugins/wallet/monerod/monerod.js @@ -92,7 +92,7 @@ function accountBalance (cryptoCode) { .then(() => refreshWallet()) .then(() => fetch('get_balance', { account_index: 0, address_indices: [0] })) .then(res => { - return BN(res.unlocked_balance).shift(unitScale).round() + return BN(res.unlocked_balance).shiftedBy(unitScale).round() }) .catch(err => handleError(err)) } @@ -177,7 +177,7 @@ function newFunding (account, cryptoCode) { fetch('create_address', { account_index: 0 }) ])) .then(([balanceRes, addressRes]) => ({ - fundingPendingBalance: BN(balanceRes.balance).sub(balanceRes.unlocked_balance), + fundingPendingBalance: BN(balanceRes.balance).minus(balanceRes.unlocked_balance), fundingConfirmedBalance: BN(balanceRes.unlocked_balance), fundingAddress: addressRes.address }))