Table of Contents

Interface ISpendingService

Namespace
NArk.Core.Services
Assembly
NArk.Core.dll

Service for creating and submitting Ark off-chain spend transactions.

public interface ISpendingService

Methods

GetAvailableCoins(string, CancellationToken)

Returns all spendable coins for the wallet (unspent, unlocked, and within timelock bounds).

Task<IReadOnlySet<ArkCoin>> GetAvailableCoins(string walletId, CancellationToken cancellationToken = default)

Parameters

walletId string
cancellationToken CancellationToken

Returns

Task<IReadOnlySet<ArkCoin>>

Spend(string, ArkCoin[], ArkTxOut[], CancellationToken, IReadOnlyList<IExtensionPacket>?)

Spends specific coins to the given outputs. Returns the Ark transaction ID. extensionPackets are merged into the spend's single Extension OP_RETURN alongside the asset packet and any registered providers (e.g. an Arkade offer packet on a funding deposit).

Task<uint256> Spend(string walletId, ArkCoin[] inputs, ArkTxOut[] outputs, CancellationToken cancellationToken = default, IReadOnlyList<IExtensionPacket>? extensionPackets = null)

Parameters

walletId string
inputs ArkCoin[]
outputs ArkTxOut[]
cancellationToken CancellationToken
extensionPackets IReadOnlyList<IExtensionPacket>

Returns

Task<uint256>

Spend(string, ArkTxOut[], CancellationToken, IReadOnlyList<IExtensionPacket>?)

Spends to the given outputs using automatic coin selection. Returns the Ark transaction ID. See the coin-specific overload for extensionPackets.

Task<uint256> Spend(string walletId, ArkTxOut[] outputs, CancellationToken cancellationToken = default, IReadOnlyList<IExtensionPacket>? extensionPackets = null)

Parameters

walletId string
outputs ArkTxOut[]
cancellationToken CancellationToken
extensionPackets IReadOnlyList<IExtensionPacket>

Returns

Task<uint256>