WalletServiceCLIwavecli exit

GetExitPlan

GetExitPlan previews unilateral-exit readiness for one VTXO. The response includes CPFP fee input requirements and, when funding is needed, a backing-wallet address callers can fund before forced unroll.

Endpoints

gRPCrpc GetExitPlan(GetExitPlanRequest) returns (GetExitPlanResponse)
RESTPOST/v1/wallet/exit-plan

Examples

wavecli exit plan --outpoint 4b2e9f1a7c3d5e6f8091a2b3c4d5e6f70819a2b3c4d5e6f708192a3b4c5d6e7f:0

RequestGetExitPlanRequest

GetExitPlanRequest lists the VTXO outpoints to preview for unilateral exit via WalletService.GetExitPlan.

FieldTypeDescription
outpointsrepeated string

outpoints are the VTXO outpoints to preview, each "txid:index".

conf_targetuint32

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

ResponseGetExitPlanResponse

GetExitPlanResponse returns one ExitPlanEntry per requested outpoint, plus the batch-level fee estimate and aggregate funding verdict.

FieldTypeDescription
plansrepeated ExitPlanEntry

plans holds one entry per requested outpoint, in request order. Entries are evaluated against a running wallet allocation: each feasible exit reserves its fee inputs before the next entry is planned, so a per-entry verdict reflects the wallet left after the earlier entries in the batch notionally start.

fee_rate_sat_per_vbyteint64

fee_rate_sat_per_vbyte is the shared chain fee estimate used for all entries.

can_startbool

can_start is the AND over every entry that has no per-outpoint error. Because entries draw from a shared wallet via the running allocation above, it is true only when every requested exit can be funded simultaneously, not merely one at a time.

total_funding_shortfall_satint64

total_funding_shortfall_sat is the summed shortfall across entries under simultaneous funding, so it already accounts for fee inputs two outpoints would otherwise both claim.

total_recommended_funding_satint64

total_recommended_funding_sat is the summed recommended funding across entries.

ExitPlanEntrymessage

ExitPlanEntry is the per-outpoint unilateral-exit readiness preview: the backing-wallet fee requirements and, when an unroll job already exists, its current state.

FieldTypeDescription
outpointstring

outpoint is the previewed VTXO outpoint, formatted as "txid:index".

funding_addressstring

funding_address is empty when can_start is true (no shortfall, so no address is allocated).

required_confirmationsuint32

required_confirmations is the number of confirmations a backing-wallet UTXO must have before it can fund the unroll CPFP.

required_fee_utxo_countuint32

required_fee_utxo_count is the number of distinct confirmed wallet UTXOs the exit needs to fund CPFP fees, one per unroll ancestry path.

usable_fee_utxo_countuint32

usable_fee_utxo_count is the number of confirmed wallet UTXOs large enough to each fund a CPFP child on their own.

recommended_utxo_amount_satint64

recommended_utxo_amount_sat is the suggested value in satoshis for each fee-funding UTXO the caller provisions.

recommended_total_funding_satint64

recommended_total_funding_sat is the suggested total backing-wallet funding in satoshis: recommended_utxo_amount_sat times the required fee UTXO count.

funding_shortfall_satint64

funding_shortfall_sat is the additional backing-wallet funding in satoshis needed before this exit can start. Zero when can_start is true.

can_startbool

can_start is true when the backing wallet already has the fee inputs and balance to fund this exit's forced unroll.

exit_job_foundbool

exit_job_found is true when an unroll job already exists for this outpoint, in which case exit_status, sweep_txid, and last_error describe it.

exit_statusExitJobStatus

exit_status is the current phase of the existing unroll job, when exit_job_found is true.

sweep_txidstring

sweep_txid is the hex-encoded txid of the existing job's sweep transaction, set once it has been broadcast.

last_errorstring

last_error is the failure reason of the existing unroll job, when it is in a failed state.

errorstring

error is a per-outpoint failure (e.g. VTXO not found) so one bad outpoint does not fail the whole batch. Empty on success.

infeasibility_reasonExitInfeasibilityReason

infeasibility_reason explains why can_start is false. It may be a structural block - a dust or uneconomical VTXO the wallet can never make exitable (funding_shortfall_sat is zero) - or a funding shortfall the wallet could cover (wallet underfunded or too few fee inputs, also reflected in funding_shortfall_sat). It is EXIT_INFEASIBILITY_REASON_UNSPECIFIED when can_start is true.

ExitJobStatusenum

ExitJobStatus collapses the underlying unroll job phases to a short wallet-facing string set.

NameNumberDescription
EXIT_JOB_STATUS_UNSPECIFIED0

EXIT_JOB_STATUS_UNSPECIFIED - the proto zero value; no job phase has been reported.

EXIT_JOB_STATUS_PENDING1

EXIT_JOB_STATUS_PENDING - job created but recovery transactions not yet materialized.

EXIT_JOB_STATUS_MATERIALIZING2

EXIT_JOB_STATUS_MATERIALIZING - recovery transactions are being broadcast and confirmed on-chain.

EXIT_JOB_STATUS_CSV_PENDING3

EXIT_JOB_STATUS_CSV_PENDING - recovery transactions confirmed, waiting for the CSV delay to expire.

EXIT_JOB_STATUS_SWEEPING4

EXIT_JOB_STATUS_SWEEPING - CSV delay expired, sweep transaction is being broadcast/confirmed.

EXIT_JOB_STATUS_COMPLETED5

EXIT_JOB_STATUS_COMPLETED - terminal: the sweep confirmed and the funds are in the on-chain wallet.

EXIT_JOB_STATUS_FAILED6

EXIT_JOB_STATUS_FAILED - terminal: an unrecoverable error occurred.

ExitInfeasibilityReasonenum

ExitInfeasibilityReason enumerates why a unilateral exit was judged infeasible. It mirrors the daemon's unroll feasibility verdict so a caller can distinguish a dust/uneconomical block (no amount of wallet funding fixes it) from a plain funding shortfall.

NameNumberDescription
EXIT_INFEASIBILITY_REASON_UNSPECIFIED0

EXIT_INFEASIBILITY_REASON_UNSPECIFIED - the proto zero value; the exit is feasible, or the block is a plain funding shortfall reported via funding_shortfall_sat instead.

EXIT_INFEASIBILITY_REASON_SWEEP_BELOW_DUST1

EXIT_INFEASIBILITY_REASON_SWEEP_BELOW_DUST - the swept output, after deducting the sweep fee from the VTXO value, would fall at or below the dust limit, so the sweep could never relay. The exit is impossible regardless of wallet funding.

EXIT_INFEASIBILITY_REASON_UNECONOMICAL2

EXIT_INFEASIBILITY_REASON_UNECONOMICAL - the total on-chain cost to recover the VTXO exceeds the configured fraction of its value. The exit could technically complete but burns more than it returns.

EXIT_INFEASIBILITY_REASON_WALLET_UNDERFUNDED3

EXIT_INFEASIBILITY_REASON_WALLET_UNDERFUNDED - the confirmed on-chain wallet balance is too small to cover the CPFP fees. Funding the wallet and retrying resolves it (also reported via funding_shortfall_sat).

EXIT_INFEASIBILITY_REASON_WALLET_TOO_FEW_INPUTS4

EXIT_INFEASIBILITY_REASON_WALLET_TOO_FEW_INPUTS - the wallet has fewer usable confirmed UTXOs than the VTXO has independent ancestry paths, so it lacks distinct CPFP fee inputs.