From 2e9e20748610d6c9b997613016f02eb00cc4b2b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Fri, 4 Feb 2022 19:41:09 +0000 Subject: [PATCH 1/2] fix: XMR sendCoins interface --- lib/plugins/wallet/monerod/monerod.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/plugins/wallet/monerod/monerod.js b/lib/plugins/wallet/monerod/monerod.js index 34c3d351..0d9573f5 100644 --- a/lib/plugins/wallet/monerod/monerod.js +++ b/lib/plugins/wallet/monerod/monerod.js @@ -99,11 +99,12 @@ function balance (account, cryptoCode) { return accountBalance(cryptoCode) } -function sendCoins (account, address, cryptoAtoms, cryptoCode) { +function sendCoins (account, tx, settings, operatorId, feeMultiplier) { + const { toAddress, cryptoAtoms, cryptoCode } = tx return checkCryptoCode(cryptoCode) .then(() => refreshWallet()) .then(() => fetch('transfer_split', { - destinations: [{ amount: cryptoAtoms, address }], + destinations: [{ amount: cryptoAtoms, address: toAddress }], account_index: 0, subaddr_indices: [], priority: 0, From 19c257f26213849a94e7e763784b4957faadc1c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Fri, 4 Feb 2022 19:46:49 +0000 Subject: [PATCH 2/2] fix: force balance to big number --- lib/wallet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wallet.js b/lib/wallet.js index 307b03a9..e04aac19 100644 --- a/lib/wallet.js +++ b/lib/wallet.js @@ -49,7 +49,7 @@ function _balance (settings, cryptoCode) { return fetchWallet(settings, cryptoCode) .then(r => r.wallet.balance(r.account, cryptoCode, settings, r.operatorId)) .then(balance => Promise.all([balance, getOpenBatchCryptoValue(cryptoCode)])) - .then(([balance, reservedBalance]) => ({ balance: balance.minus(reservedBalance), reservedBalance, timestamp: Date.now() })) + .then(([balance, reservedBalance]) => ({ balance: BN(balance).minus(reservedBalance), reservedBalance, timestamp: Date.now() })) .then(r => { lastBalance[cryptoCode] = r return r