fix: monero bn methods

This commit is contained in:
Neal 2022-01-28 20:16:56 -05:00
parent f2cac6bf26
commit 4b604ba698

View file

@ -92,7 +92,7 @@ function accountBalance (cryptoCode) {
.then(() => refreshWallet()) .then(() => refreshWallet())
.then(() => fetch('get_balance', { account_index: 0, address_indices: [0] })) .then(() => fetch('get_balance', { account_index: 0, address_indices: [0] }))
.then(res => { .then(res => {
return BN(res.unlocked_balance).shift(unitScale).round() return BN(res.unlocked_balance).shiftedBy(unitScale).round()
}) })
.catch(err => handleError(err)) .catch(err => handleError(err))
} }
@ -177,7 +177,7 @@ function newFunding (account, cryptoCode) {
fetch('create_address', { account_index: 0 }) fetch('create_address', { account_index: 0 })
])) ]))
.then(([balanceRes, addressRes]) => ({ .then(([balanceRes, addressRes]) => ({
fundingPendingBalance: BN(balanceRes.balance).sub(balanceRes.unlocked_balance), fundingPendingBalance: BN(balanceRes.balance).minus(balanceRes.unlocked_balance),
fundingConfirmedBalance: BN(balanceRes.unlocked_balance), fundingConfirmedBalance: BN(balanceRes.unlocked_balance),
fundingAddress: addressRes.address fundingAddress: addressRes.address
})) }))