Skip to main content
Creates a sender spend transaction for an HTLC after the timelock expires.

Method Signature

async createHTLCSenderSpendTx({
  htlcTx,
  hash,
  hashLockDestinationPubkey,
  sequenceLockDestinationPubkey,
  satsPerVbyteFee,
}: {
  htlcTx: string;
  hash: string;
  hashLockDestinationPubkey: string;
  sequenceLockDestinationPubkey: string;
  satsPerVbyteFee: number;
}): Promise<string>

Parameters

htlcTx
string
required
The HTLC transaction hex
hash
string
required
The hash used in the HTLC
hashLockDestinationPubkey
string
required
Public key for the hash lock destination
sequenceLockDestinationPubkey
string
required
Public key for the sequence lock destination
satsPerVbyteFee
number
required
Fee rate in sats per vbyte

Returns

txHex
string
required
The signed sender spend transaction hex

Example

const txHex = await wallet.createHTLCSenderSpendTx({
  htlcTx: "02000000...",
  hash: "abc123...",
  hashLockDestinationPubkey: "02...",
  sequenceLockDestinationPubkey: "03...",
  satsPerVbyteFee: 10
});
console.log("Sender spend tx:", txHex);