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
The transaction ID of the original deposit
The output index (auto-detected if not provided)
The Bitcoin address to send the refund to
The fee rate in sats per vbyte
Returns
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);