Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kevzzsk committed Jul 29, 2024
1 parent c485765 commit 5dec07b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/sdk/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export function createTransaction(
if (type === "p2sh") {
return bitcoin.payments.p2sh({
redeem: bitcoin.payments.p2wpkh({ pubkey: key, network: networkObj }),
network: networkObj
network: networkObj,
...paymentOptions
})
}
if (type === "p2wsh") {
Expand All @@ -52,11 +53,12 @@ export function createTransaction(
redeem: bitcoin.payments.p2wpkh({ pubkey: key, network: networkObj }),
network: networkObj
}),
network: networkObj
network: networkObj,
...paymentOptions
})
}

return bitcoin.payments[type]({ pubkey: key, network: networkObj })
return bitcoin.payments[type]({ pubkey: key, network: networkObj, ...paymentOptions })
}

export function getDerivationPath(formatType: AddressFormats, account = 0, addressIndex = 0) {
Expand Down Expand Up @@ -190,10 +192,10 @@ export const isP2PKH = (script: Buffer, network: Network): IsBitcoinPaymentRespo
}
}
export const isP2WSH = (script: Buffer, network: Network): IsBitcoinPaymentResponse => {
const p2wpkh = isPaymentFactory(bitcoin.payments.p2wsh, network)(script)
const p2wsh = isPaymentFactory(bitcoin.payments.p2wsh, network)(script)
return {
type: "p2wsh",
payload: p2wpkh
payload: p2wsh
}
}
export const isP2WPKH = (script: Buffer, network: Network): IsBitcoinPaymentResponse => {
Expand Down

0 comments on commit 5dec07b

Please sign in to comment.