object CoinSelector extends CoinSelector
- Alphabetic
- By Inheritance
- CoinSelector
- CoinSelector
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- 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
- 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
- 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
- def approximateUtxoSize(utxo: CoinSelectorUtxo): Long
Cribbed from https://github.com/bitcoinjs/coinselect/blob/master/utils.js
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def calcEffectiveValue(utxo: CoinSelectorUtxo, feeRate: FeeUnit): CurrencyUnit
- Definition Classes
- CoinSelector
- 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
- def calculateUtxoFee(utxo: CoinSelectorUtxo, feeRate: FeeUnit): CurrencyUnit
- Definition Classes
- CoinSelector
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- 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
- def selectByAlgo(coinSelectionAlgo: CoinSelectionAlgo, walletUtxos: Vector[CoinSelectorUtxo], outputs: Vector[TransactionOutput], feeRate: FeeUnit, longTermFeeRateOpt: Option[FeeUnit] = None): Vector[CoinSelectorUtxo]
- def selectByLeastWaste(walletUtxos: Vector[CoinSelectorUtxo], outputs: Vector[TransactionOutput], feeRate: FeeUnit, longTermFeeRate: FeeUnit): Vector[CoinSelectorUtxo]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()