Optionalconfig: Partial<WasteOptimizationConfig>Protected ReadonlyDUST_Protected ReadonlyINPUT_Protected ReadonlyOUTPUT_Protected ReadonlyTRANSACTION_Add a custom algorithm
Benchmark algorithms against test data
ProtectedcalculateCalculate change amount
ProtectedcalculateProtectedcheckCheck if options are valid and return failure result if not
Configure the waste optimized selector
ProtectedcreateEstimate transaction fee
ProtectedestimateEstimate transaction size in vBytes
ProtectedfilterFilter UTXOs with protection and confirmation checks
ProtectedfilterGet current configuration
Get optimal algorithm recommendation for given UTXOs and options
Get performance statistics
ProtectedisCheck if amount is dust
OptionaldustThreshold: numberRemove an algorithm
Select using adaptive algorithm selection
ProtectedsortProtectedsortProtectedsumProtectedvalidate
Waste-Optimized UTXO Selection Algorithm - Multi-algorithm optimization with waste scoring
The Waste-Optimized selector is a meta-algorithm that runs multiple UTXO selection algorithms in parallel and chooses the result with the lowest "waste" score. This approach combines the strengths of different algorithms to find the most efficient UTXO selection for any given scenario.
Remarks
The algorithm works by executing multiple selection strategies simultaneously:
Each result is scored using a comprehensive waste metric that considers:
The selector uses configurable weighting factors to balance these costs based on use case. Advanced features include timeout protection, detailed error categorization, and comprehensive performance tracking.
Key features:
Performance characteristics:
Example