fix: add mem pool transactions balance to funding page pending balance
This commit is contained in:
parent
873980869b
commit
2c9a8705db
1 changed files with 13 additions and 5 deletions
|
|
@ -178,11 +178,19 @@ function newFunding (account, cryptoCode, settings, operatorId) {
|
|||
balanceRes,
|
||||
fetch('create_address', { account_index: 0 })
|
||||
]))
|
||||
.then(([balanceRes, addressRes]) => ({
|
||||
fundingPendingBalance: BN(balanceRes.balance).minus(balanceRes.unlocked_balance),
|
||||
.then(([balanceRes, addressRes]) => Promise.all([
|
||||
balanceRes,
|
||||
addressRes,
|
||||
fetch('get_transfers', { pool: true, account_index: 0 })
|
||||
]))
|
||||
.then(([balanceRes, addressRes, transferRes]) => {
|
||||
const memPoolBalance = _.reduce((acc, value) => acc.plus(value.amount), BN(0), transferRes.pool)
|
||||
return {
|
||||
fundingPendingBalance: BN(balanceRes.balance).minus(balanceRes.unlocked_balance).plus(memPoolBalance),
|
||||
fundingConfirmedBalance: BN(balanceRes.unlocked_balance),
|
||||
fundingAddress: addressRes.address
|
||||
}))
|
||||
}
|
||||
})
|
||||
.catch(err => handleError(err))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue