> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spark.money/llms.txt
> Use this file to discover all available pages before exploring further.

# createHTLCReceiverSpendTx

> Create a signed transaction to spend an HTLC as the receiver.

Creates a receiver spend transaction for an HTLC using the preimage.

## Method Signature

```typescript theme={null}
async createHTLCReceiverSpendTx({
  htlcTx,
  hash,
  hashLockDestinationPubkey,
  sequenceLockDestinationPubkey,
  preimage,
  satsPerVbyteFee,
}: {
  htlcTx: string;
  hash: string;
  hashLockDestinationPubkey: string;
  sequenceLockDestinationPubkey: string;
  preimage: string;
  satsPerVbyteFee: number;
}): Promise<string>
```

## Parameters

<ResponseField name="htlcTx" type="string" required>
  The HTLC transaction hex
</ResponseField>

<ResponseField name="hash" type="string" required>
  The hash used in the HTLC
</ResponseField>

<ResponseField name="hashLockDestinationPubkey" type="string" required>
  Public key for the hash lock destination
</ResponseField>

<ResponseField name="sequenceLockDestinationPubkey" type="string" required>
  Public key for the sequence lock destination
</ResponseField>

<ResponseField name="preimage" type="string" required>
  The preimage to unlock the HTLC
</ResponseField>

<ResponseField name="satsPerVbyteFee" type="number" required>
  Fee rate in sats per vbyte
</ResponseField>

## Returns

<ResponseField name="txHex" type="string" required>
  The signed receiver spend transaction hex
</ResponseField>

## Example

```typescript theme={null}
const txHex = await wallet.createHTLCReceiverSpendTx({
  htlcTx: "02000000...",
  hash: "abc123...",
  hashLockDestinationPubkey: "02...",
  sequenceLockDestinationPubkey: "03...",
  preimage: "secret123...",
  satsPerVbyteFee: 10
});
console.log("Receiver spend tx:", txHex);
```
