Table of Contents

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

availableCoins List<ArkCoin>

Available coins sorted by value descending

targetAmount Money

Target amount to send

dustThreshold Money

Dust threshold from operator terms

currentSubDustOutputs int

Whether the user explicitly uses subdust change

maxOpReturnOutputs int

Maximum OP_RETURN outputs allowed per transaction

maxInputWeightWu long?

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

availableCoins List<ArkCoin>
targetBtcAmount Money
assetRequirements IReadOnlyList<AssetRequirement>
dustThreshold Money
currentSubDustOutputs int
maxOpReturnOutputs int
maxInputWeightWu long?

Returns

IReadOnlyCollection<ArkCoin>