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, 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