Skip to main content
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

depositTxId
string
required
The transaction ID of the original deposit
destinationAddress
string
required
The Bitcoin address to send the refund to
feeSats
number
required
The fee to pay for the refund transaction (minimum 300 sats)

Returns

txHex
string
required
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);