This coin selection algorithm follows a Highest Value First (HVF) function, taking into consideration things like fee estimation. Inspiration taken from Lucid Evolution: https://github.com/Anastasia-Labs/lucid-evolution/blob/main/packages/lucid/src/tx-builder/internal/CompleteTxBuilder.ts#L789

  • Parameters

    • inputs: TransactionUnspentOutput[]
    • collectedAssets: Value
    • OptionalpreliminaryFee: number
    • OptionalexternalAssets: Value
    • OptionalcoinsPerUtxoByte: number

    Returns SelectionResult