aboutsummaryrefslogblamecommitdiffstats
path: root/app/scripts/lib/pending-balance-calculator.js
blob: 4f6e031383df4883e5633c18ce45956155872ec1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                        







                                       





                                         
const BN = require('ethereumjs-util').BN
const EthQuery = require('ethjs-query')

class PendingBalanceCalculator {

  constructor ({ getBalance, getPendingTransactions }) {
    this.getPendingTransactions = getPendingTransactions
    this.getBalance = getBalance
  }

  async getBalance() {
    const results = await Promise.all([
      this.getBalance(),
      this.getPendingTransactions(),
    ])

    const balance = results[0]
    const pending = results[1]

    return balance
  }

}

module.exports = PendingBalanceCalculator