|
|
@ -7,6 +7,7 @@ |
|
|
|
const db = require('../db/mysql-db-wrapper') |
|
|
|
const util = require('../util') |
|
|
|
const rpcLatestBlock = require('../bitcoind-rpc/latest-block') |
|
|
|
const rpcFees = require('../bitcoind-rpc/fees') |
|
|
|
const addrService = require('../bitcoin/addresses-service') |
|
|
|
const HdAccountInfo = require('./hd-account-info') |
|
|
|
const AddressInfo = require('./address-info') |
|
|
@ -31,6 +32,7 @@ class WalletInfo { |
|
|
|
} |
|
|
|
|
|
|
|
this.info = { |
|
|
|
fees: {}, |
|
|
|
latestBlock: { |
|
|
|
height: rpcLatestBlock.height, |
|
|
|
hash: rpcLatestBlock.hash, |
|
|
@ -159,6 +161,14 @@ class WalletInfo { |
|
|
|
this.nTx = nbTxs |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Loads tinfo about the fee rates |
|
|
|
* @returns {Promise} |
|
|
|
*/ |
|
|
|
async loadFeesInfo() { |
|
|
|
this.info.fees = await rpcFees.getFees() |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Loads the list of unspent outputs for this wallet |
|
|
|
* @returns {Promise} |
|
|
@ -295,6 +305,7 @@ class WalletInfo { |
|
|
|
final_balance: this.wallet.finalBalance |
|
|
|
}, |
|
|
|
info: { |
|
|
|
fees: this.info.fees, |
|
|
|
latest_block: this.info.latestBlock |
|
|
|
}, |
|
|
|
addresses: this.addresses.map(a => a.toPojo()), |
|
|
|