Table of Contents

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

availableCoins List<ArkCoin>

All spendable coins.

targetAmount Money

Amount to cover.

dustThreshold Money

Minimum value for a change output.

currentSubDustOutputs int

Number of existing sub-dust outputs in the transaction.

maxOpReturnOutputs int

Maximum OP_RETURN outputs allowed per transaction.

maxInputWeightWu long?

Maximum total weight (in weight units) that all selected inputs may contribute, or null for no limit. Callers compute this as serverInfo.MaxTxWeight − baseTxWu − outputsWu so that the full transaction stays under the Arkade server's max_tx_weight. Implementations throw TooManyInputsException when the target cannot be covered within the budget.

Returns

IReadOnlyCollection<ArkCoin>

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

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

Returns

IReadOnlyCollection<ArkCoin>