SweepWallet

SweepWallet previews or broadcasts a normal backing-wallet sweep to a caller-supplied Bitcoin address. This sweeps wallet-managed funds left after CPFP/change/unroll proceeds and does not sweep boarding outputs.

Endpoints

gRPCrpc SweepWallet(SweepWalletRequest) returns (SweepWalletResponse)
RESTPOST/v1/wallet/sweep-wallet

Examples

wavecli wallet-sweep --destination bcrt1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh

RequestSweepWalletRequest

SweepWalletRequest describes a backing-wallet sweep to preview or broadcast via WalletService.SweepWallet.

FieldTypeDescription
destination_addressstring

destination_address is the Bitcoin address that receives the backing wallet funds after fees.

broadcastbool

broadcast controls whether the sweep is only previewed or also signed and published.

fee_rate_sat_per_vbyteint64

fee_rate_sat_per_vbyte overrides chain fee estimation when positive.

conf_targetuint32

conf_target selects the fee-estimation target in blocks when fee_rate_sat_per_vbyte is unset. Zero uses the daemon's default unroll confirmation target.

ResponseSweepWalletResponse

SweepWalletResponse is the preview or broadcast result of WalletService.SweepWallet.

FieldTypeDescription
inputsrepeated WalletSweepInput

inputs are the confirmed backing-wallet UTXOs selected for the sweep.

total_input_satint64

total_input_sat is the gross value in satoshis of every selected input.

estimated_fee_satint64

estimated_fee_sat is the absolute miner fee in satoshis for the aggregate sweep transaction at the resolved fee rate.

net_amount_satint64

net_amount_sat is total_input_sat minus estimated_fee_sat: the amount in satoshis paid to the destination address.

fee_rate_sat_per_vbyteint64

fee_rate_sat_per_vbyte is the (capped) fee rate used to build the sweep transaction.

can_broadcastbool

can_broadcast is true when the preview cleared the dust floor and the sweep can be published.

txidstring

txid is the hex-encoded sweep transaction id, set only when the sweep was broadcast.

failure_reasonstring

failure_reason is populated when the sweep cannot broadcast (no confirmed inputs, dust after fees) or the broadcast failed after preview.

WalletSweepInputmessage

WalletSweepInput is one backing-wallet UTXO selected for a sweep.

FieldTypeDescription
outpointstring

outpoint is the selected backing-wallet UTXO, formatted as "txid:index".

amount_satint64

amount_sat is the value of the selected UTXO in satoshis.