CoinSelection

Static class with common coin selection algorithms.

Static methods

selectLargestFirst

Selects UTxOs from a list by iterating through the tokens in the given Value and picking the UTxOs containing the largest corresponding amount first.

Returns two lists. The first list contains the selected UTxOs, the second list contains the remaining UTxOs.

helios.CoinSelection.selectLargestFirst(
    utxos: helios.UTxO[],
    amount: helios.Value
)

selectSmallestFirst

Selects UTxOs from a list by iterating through the tokens in the given Value and picking the UTxOs containing the smallest corresponding amount first. This method can be used to eliminate dust UTxOs from a wallet.

Returns two lists. The first list contains the selected UTxOs, the second list contains the remaining UTxOs.

helios.CoinSelection.selectSmallestFirst(
    utxos: helios.UTxO[],
    amount: helios.Value
)