Renew VTXOs before they expire to keep your liquidity available. This settles all VTXOs (including recoverable ones) back to your wallet with a fresh expiration time.
// Renew all VTXOs to prevent expirationconst txid = await manager.renewVtxos()console.log('Renewed:', txid)// Override threshold percentage (e.g., renew when 5% of time remains)const urgentlyExpiring = await manager.getExpiringVtxos(5)
Set up automatic renewal checks in your application to ensure VTXOs never expire. A good practice is to check daily and renew when the threshold is reached.
Implement automatic renewal checks in your application:
Copy
Ask AI
// Check for expiring VTXOs dailysetInterval(async () => { const expiring = await manager.getExpiringVtxos() if (expiring.length > 0) { await manager.renewVtxos() }}, 24 * 60 * 60 * 1000) // Once per day
Recovery Monitoring
Periodically check for recoverable funds:
Copy
Ask AI
// Check for recoverable VTXOs weeklysetInterval(async () => { const balance = await manager.getRecoverableBalance() if (balance.recoverable > 0n) { await manager.recoverVtxos() }}, 7 * 24 * 60 * 60 * 1000) // Once per week
Threshold Configuration
The threshold specifies the remaining portion of a VTXO’s lifetime at which renewal should be triggered. Adjust the threshold percentage based on your needs:
10% (default): Good balance between proactive renewal and transaction costs
5%: More aggressive, suitable for high-value or frequently active wallets
20%: More relaxed, suitable for infrequently used wallets