object CoinSelector extends CoinSelector

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CoinSelector
  2. CoinSelector
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def accumulate(walletUtxos: Vector[CoinSelectorUtxo], outputs: Vector[TransactionOutput], feeRate: FeeUnit): Vector[CoinSelectorUtxo]

    Greedily selects from walletUtxos in order, skipping outputs with values below their fees

    Greedily selects from walletUtxos in order, skipping outputs with values below their fees

    Definition Classes
    CoinSelector
  5. def accumulateLargest(walletUtxos: Vector[CoinSelectorUtxo], outputs: Vector[TransactionOutput], feeRate: FeeUnit): Vector[CoinSelectorUtxo]

    Greedily selects from walletUtxos starting with the largest outputs, skipping outputs with values below their fees.

    Greedily selects from walletUtxos starting with the largest outputs, skipping outputs with values below their fees. Better for high fee environments than accumulateSmallestViable.

    Definition Classes
    CoinSelector
  6. def accumulateSmallestViable(walletUtxos: Vector[CoinSelectorUtxo], outputs: Vector[TransactionOutput], feeRate: FeeUnit): Vector[CoinSelectorUtxo]

    Greedily selects from walletUtxos starting with the smallest outputs, skipping outputs with values below their fees.

    Greedily selects from walletUtxos starting with the smallest outputs, skipping outputs with values below their fees. Good for low fee environments to consolidate UTXOs.

    Has the potential privacy breach of connecting a ton of UTXOs to one address.

    Definition Classes
    CoinSelector
  7. def approximateUtxoSize(utxo: CoinSelectorUtxo): Long

    Cribbed from https://github.com/bitcoinjs/coinselect/blob/master/utils.js

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def calcEffectiveValue(utxo: CoinSelectorUtxo, feeRate: FeeUnit): CurrencyUnit
    Definition Classes
    CoinSelector
  10. def calculateSelectionWaste(utxos: Vector[CoinSelectorUtxo], changeCostOpt: Option[CurrencyUnit], target: CurrencyUnit, feeRate: FeeUnit, longTermFeeRate: FeeUnit): CurrencyUnit

    Compute the waste for this result given the cost of change and the opportunity cost of spending these inputs now vs in the future.

    Compute the waste for this result given the cost of change and the opportunity cost of spending these inputs now vs in the future. If change exists, waste = changeCost + inputs * (effective_feerate - long_term_feerate) If no change, waste = excess + inputs * (effective_feerate - long_term_feerate) where excess = totalEffectiveValue - target change_cost = effective_feerate * change_output_size + long_term_feerate * change_spend_size

    Copied from

    utxos

    The selected inputs

    changeCostOpt

    The cost of creating change and spending it in the future. None if there is no change.

    target

    The amount targeted by the coin selection algorithm.

    longTermFeeRate

    The expected average fee rate used over the long term

    returns

    The waste

    See also

    https://github.com/achow101/bitcoin/blob/4f5ad43b1e05cd7b403f87aae4c4d42e5aea810b/src/wallet/coinselection.cpp#L345

  11. def calculateUtxoFee(utxo: CoinSelectorUtxo, feeRate: FeeUnit): CurrencyUnit
    Definition Classes
    CoinSelector
  12. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. def randomSelection(walletUtxos: Vector[CoinSelectorUtxo], outputs: Vector[TransactionOutput], feeRate: FeeUnit): Vector[CoinSelectorUtxo]

    Randomly selects utxos until it has enough to fund the desired amount, should only be used for research purposes

    Randomly selects utxos until it has enough to fund the desired amount, should only be used for research purposes

    Definition Classes
    CoinSelector
  23. def selectByAlgo(coinSelectionAlgo: CoinSelectionAlgo, walletUtxos: Vector[CoinSelectorUtxo], outputs: Vector[TransactionOutput], feeRate: FeeUnit, longTermFeeRateOpt: Option[FeeUnit] = None): Vector[CoinSelectorUtxo]
  24. def selectByLeastWaste(walletUtxos: Vector[CoinSelectorUtxo], outputs: Vector[TransactionOutput], feeRate: FeeUnit, longTermFeeRate: FeeUnit): Vector[CoinSelectorUtxo]
  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from CoinSelector

Inherited from AnyRef

Inherited from Any

Ungrouped