Skip to main content
Each virtual output expires with its batch. Renewal swaps outputs that are about to expire for fresh ones in a batch swap, so you keep the right to a unilateral exit. Recovery reclaims outputs that expired or that the operator swept. The wallet’s VtxoManager does both.

Automatic Renewal

Wallet.create starts a VtxoManager for the wallet. While your app runs, the manager:
  • Checks the wallet’s outputs every minute.
  • Renews outputs that expire within the threshold (vtxoThreshold, default 3 days).
  • Settles recoverable outputs and confirmed boarding deposits in the same batch swap.
  • Checks again each time the wallet receives an output.
Renewal stops when your app stops, or when you call wallet.dispose() (Shut Down the Wallet). Set vtxoThreshold to at least the longest time between two runs of your app. For a wallet that can stay offline longer, use delegation.
Get the manager from wallet.getVtxoManager(). Don’t call new VtxoManager(...): each new manager starts its own automatic renewal, which competes with the wallet’s for the same outputs, and wallet.dispose() doesn’t stop it.
SDK 0.5 removes renewalConfig, which SDK 0.4 deprecates. Use settlementConfig instead.

Manual Renewal

To renew outputs yourself, create the wallet with settlementConfig: false. This turns off automatic renewal, recovery, and boarding settlement. Your app must then renew outputs before they expire:
  • With automatic renewal off, getExpiringVtxos() returns an empty array unless you pass a threshold. The list also contains recoverable and subdust outputs.
  • renewVtxos renews the outputs that expire within the threshold, and any recoverable ones. It throws No VTXOs available to renew when there are none, and Renewal already in progress while another renewal runs on the same manager.

Recovery

Recovery settles outputs that expired or that the operator swept, and subdust amounts, back to your wallet:
recoverVtxos throws No recoverable VTXOs found when there is nothing to recover.