Skip to main content
Refunds a static deposit and broadcasts the transaction to the Bitcoin network.

Method Signature

async refundAndBroadcastStaticDeposit({
  depositTransactionId,
  outputIndex,
  destinationAddress,
  satsPerVbyteFee,
}: {
  depositTransactionId: string;
  outputIndex?: number;
  destinationAddress: string;
  satsPerVbyteFee?: number;
}): Promise<string>

Parameters

depositTransactionId
string
required
The transaction ID of the original deposit
outputIndex
number
The output index (auto-detected if not provided)
destinationAddress
string
required
The Bitcoin address to send the refund to
satsPerVbyteFee
number
The fee rate in sats per vbyte

Returns

txid
string
required
The transaction ID of the broadcast refund transaction

Example

const txid = await wallet.refundAndBroadcastStaticDeposit({
  depositTransactionId: "abc123...",
  destinationAddress: "bcrt1p...",
  satsPerVbyteFee: 10
});
console.log("Refund broadcast, txid:", txid);