Helios API/ API Reference/ Namespaces/

CoinSelection

Collection of common coin selection algorithms.

Index

Functions

selectExtremumFirst

selectExtremumFirst(utxos, amount, largestFirst): [TxInput[], TxInput[]]

Parameters

NameType
utxosTxInput[]
amountValue
largestFirstboolean

Returns

[TxInput[], TxInput[]]

  • [picked, not picked that can be used as spares]

selectLargestFirst

selectLargestFirst(utxos, amount): [TxInput[], TxInput[]]

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

Parameters

NameType
utxosTxInput[]
amountValue

Returns

[TxInput[], TxInput[]]

selectSmallestFirst

selectSmallestFirst(utxos, amount): [TxInput[], TxInput[]]

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.

Parameters

NameType
utxosTxInput[]
amountValue

Returns

[TxInput[], TxInput[]]