Interface ISpendingService
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
walletIdstringcancellationTokenCancellationToken
Returns
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
walletIdstringinputsArkCoin[]outputsArkTxOut[]cancellationTokenCancellationTokenextensionPacketsIReadOnlyList<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
walletIdstringoutputsArkTxOut[]cancellationTokenCancellationTokenextensionPacketsIReadOnlyList<IExtensionPacket>
Returns
- Task<uint256>