Interface ICoinSelector
- Namespace
- NArk.Core.CoinSelector
- Assembly
- NArk.Core.dll
Selects coins from a set of available coins to meet a target amount. Implement this to customize VTXO selection strategy (e.g., minimize fees, maximize privacy).
public interface ICoinSelector
Methods
SelectCoins(List<ArkCoin>, Money, Money, int, int, long?)
Selects coins to cover the target amount.
IReadOnlyCollection<ArkCoin> SelectCoins(List<ArkCoin> availableCoins, Money targetAmount, Money dustThreshold, int currentSubDustOutputs, int maxOpReturnOutputs = 1, long? maxInputWeightWu = null)
Parameters
availableCoinsList<ArkCoin>All spendable coins.
targetAmountMoneyAmount to cover.
dustThresholdMoneyMinimum value for a change output.
currentSubDustOutputsintNumber of existing sub-dust outputs in the transaction.
maxOpReturnOutputsintMaximum OP_RETURN outputs allowed per transaction.
maxInputWeightWulong?Maximum total weight (in weight units) that all selected inputs may contribute, or
nullfor no limit. Callers compute this asserverInfo.MaxTxWeight − baseTxWu − outputsWuso that the full transaction stays under the Arkade server'smax_tx_weight. Implementations throw TooManyInputsException when the target cannot be covered within the budget.
Returns
SelectCoins(List<ArkCoin>, Money, IReadOnlyList<AssetRequirement>, Money, int, int, long?)
Asset-aware coin selection: selects coins carrying the required assets first,
then fills the remaining BTC target. See the BTC-only overload for parameter
semantics, including maxInputWeightWu.
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?