Class DefaultCoinSelector
- Namespace
- NArk.Core.CoinSelector
- Assembly
- NArk.Core.dll
public class DefaultCoinSelector : ICoinSelector
- Inheritance
-
DefaultCoinSelector
- Implements
- Inherited Members
Methods
SelectCoins(List<ArkCoin>, Money, Money, int, int, long?)
Selects coins to minimize sub-dust change. Prefers exact matches or combinations that avoid subdust change.
public IReadOnlyCollection<ArkCoin> SelectCoins(List<ArkCoin> availableCoins, Money targetAmount, Money dustThreshold, int currentSubDustOutputs, int maxOpReturnOutputs = 1, long? maxInputWeightWu = null)
Parameters
availableCoinsList<ArkCoin>Available coins sorted by value descending
targetAmountMoneyTarget amount to send
dustThresholdMoneyDust threshold from operator terms
currentSubDustOutputsintWhether the user explicitly uses subdust change
maxOpReturnOutputsintMaximum OP_RETURN outputs allowed per transaction
maxInputWeightWulong?Maximum total input weight budget in weight units, or null for no limit
Returns
- IReadOnlyCollection<ArkCoin>
Selected coins or null if impossible
SelectCoins(List<ArkCoin>, Money, IReadOnlyList<AssetRequirement>, Money, int, int, long?)
Asset-aware coin selection. First selects coins carrying required assets, then fills remaining BTC from plain coins using the standard selection logic.
public IReadOnlyCollection<ArkCoin> SelectCoins(List<ArkCoin> availableCoins, Money targetBtcAmount, IReadOnlyList<AssetRequirement> assetRequirements, Money dustThreshold, int currentSubDustOutputs, int maxOpReturnOutputs = 1, long? maxInputWeightWu = null)
Parameters
availableCoinsList<ArkCoin>targetBtcAmountMoneyassetRequirementsIReadOnlyList<AssetRequirement>dustThresholdMoneycurrentSubDustOutputsintmaxOpReturnOutputsintmaxInputWeightWulong?