Skip to content

Commit

Permalink
Fix for sending DOGE. Works fine with DOGE & DASH
Browse files Browse the repository at this point in the history
  • Loading branch information
RealGoodProgrammer committed Nov 10, 2023
1 parent 24488a2 commit 2f7fa9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib/bitcoin/btc-base-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/lib/bitcoin/doge-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 2f7fa9f

Please sign in to comment.