Skip to content

Commit

Permalink
fix: 'noBroadcast' option not working in BTC transfer API
Browse files Browse the repository at this point in the history
  • Loading branch information
AricRedemption committed Mar 11, 2024
1 parent a3af2cd commit a3fe4db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/actions/btc/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export async function process(params: TransferParameters): Promise<{ txId: strin
feeRate = Number(feeRate)

if (params.options?.noBroadcast) {
return await wallet.send(params.toAddress, new Decimal(params.satoshis), feeRate)
const { psbt } = await wallet.getFeeAndPsbt(params.toAddress, new Decimal(params.satoshis), feeRate)
return { txHex: psbt.extractTransaction().toHex() }
}
const { psbt } = await wallet.getFeeAndPsbt(params.toAddress, new Decimal(params.satoshis), feeRate)
return { txHex: psbt.extractTransaction().toHex() }
return await wallet.send(params.toAddress, new Decimal(params.satoshis), feeRate)
}

0 comments on commit a3fe4db

Please sign in to comment.