Refunds a deposit made to a static deposit address back to a specified Bitcoin address for the SparkWallet. The minimum fee is 300 satoshis.
Method Signature
async refundStaticDeposit(
depositTxId: string,
destinationAddress: string,
feeSats: number
): Promise<string>
Parameters
The transaction ID of the original deposit
The Bitcoin address to send the refund to
The fee to pay for the refund transaction (minimum 300 sats)
Returns
The refund transaction as a hex string that needs to be broadcast
Example
const txHex = await wallet.refundStaticDeposit(
"deposit-tx-id",
"bcrt1p...",
300
);
console.log("Refund transaction:", txHex);