Skip to main content

selectLargestFirst

export function selectLargestFirst(props: {allowSelectingUninvolvedAssets??: boolean}): <SC extends SpendingCredential = SpendingCredential>(
  utxos: TxInput<SC>[],
  amount: Value
) => [TxInput<SC>[], TxInput<SC>[]]

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

Arguments​

1. props​

props: {allowSelectingUninvolvedAssets??: boolean}

Returns​

<SC extends SpendingCredential = SpendingCredential>(
  utxos: TxInput<SC>[],
  amount: Value
) => [TxInput<SC>[], TxInput<SC>[]]