Creates a receiver spend transaction for an HTLC using the preimage.
Method Signature
async createHTLCReceiverSpendTx({
htlcTx,
hash,
hashLockDestinationPubkey,
sequenceLockDestinationPubkey,
preimage,
satsPerVbyteFee,
}: {
htlcTx: string;
hash: string;
hashLockDestinationPubkey: string;
sequenceLockDestinationPubkey: string;
preimage: string;
satsPerVbyteFee: number;
}): Promise<string>
Parameters
The hash used in the HTLC
hashLockDestinationPubkey
Public key for the hash lock destination
sequenceLockDestinationPubkey
Public key for the sequence lock destination
The preimage to unlock the HTLC
Fee rate in sats per vbyte
Returns
The signed receiver spend transaction hex
Example
const txHex = await wallet.createHTLCReceiverSpendTx({
htlcTx: "02000000...",
hash: "abc123...",
hashLockDestinationPubkey: "02...",
sequenceLockDestinationPubkey: "03...",
preimage: "secret123...",
satsPerVbyteFee: 10
});
console.log("Receiver spend tx:", txHex);