Skip to content

Commit

Permalink
Merge pull request #553 from Adamant-im/fix/sending_doge_from_the_chat
Browse files Browse the repository at this point in the history
Fix for sending DOGE. Works fine with DOGE & DASH
  • Loading branch information
bludnic authored Nov 10, 2023
2 parents 24488a2 + 2f7fa9f commit 488bd25
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 488bd25

Please sign in to comment.