diff --git a/src/lib/bitcoin/btc-base-api.js b/src/lib/bitcoin/btc-base-api.js index 4567c63dc..b7a6f483a 100644 --- a/src/lib/bitcoin/btc-base-api.js +++ b/src/lib/bitcoin/btc-base-api.js @@ -91,7 +91,7 @@ export default class BtcBaseApi { unspent.txHex = await this.getTransactionHex(unspent.txid) } - const hex = this._buildTransaction(address, amount, unspents, fee) + const hex = await this.buildTransaction(address, amount, unspents, fee) let txid = bitcoin.crypto.sha256(Buffer.from(hex, 'hex')) txid = bitcoin.crypto.sha256(Buffer.from(txid)) @@ -150,7 +150,7 @@ export default class BtcBaseApi { * @param {number} fee transaction fee in primary units (BTC, DOGE, DASH, etc) * @returns {string} */ - _buildTransaction(address, amount, unspents, fee) { + buildTransaction(address, amount, unspents, fee) { amount = new BigNumber(amount).times(this.multiplier).toNumber() amount = Math.floor(amount) diff --git a/src/lib/bitcoin/doge-api.js b/src/lib/bitcoin/doge-api.js index 60f36c8da..a2d50c11e 100644 --- a/src/lib/bitcoin/doge-api.js +++ b/src/lib/bitcoin/doge-api.js @@ -42,7 +42,7 @@ export default class DogeApi extends BtcBaseApi { } /** @override */ - async _buildTransaction(address, amount, unspents, fee) { + async buildTransaction(address, amount, unspents, fee) { const localAmount = convertToSmallestUnit(amount, this.multiplier) const heldFee = convertToSmallestUnit(fee, this.multiplier)