Class SpendingService
public class SpendingService : ISpendingService
- Inheritance
-
SpendingService
- Implements
- Inherited Members
Constructors
SpendingService(IVtxoStorage, IContractStorage, IWalletProvider, ICoinService, IContractService, IClientTransport, ICoinSelector, ISafetyService, IIntentStorage, ILogger<SpendingService>, IVirtualTxStorage?)
public SpendingService(IVtxoStorage vtxoStorage, IContractStorage contractStorage, IWalletProvider walletProvider, ICoinService coinService, IContractService paymentService, IClientTransport transport, ICoinSelector coinSelector, ISafetyService safetyService, IIntentStorage intentStorage, ILogger<SpendingService> logger, IVirtualTxStorage? virtualTxStorage = null)
Parameters
vtxoStorageIVtxoStoragecontractStorageIContractStoragewalletProviderIWalletProvidercoinServiceICoinServicepaymentServiceIContractServicetransportIClientTransportcoinSelectorICoinSelectorsafetyServiceISafetyServiceintentStorageIIntentStorageloggerILogger<SpendingService>virtualTxStorageIVirtualTxStorage
SpendingService(IVtxoStorage, IContractStorage, IWalletProvider, ICoinService, IContractService, IClientTransport, ICoinSelector, ISafetyService, IIntentStorage, IVirtualTxStorage?)
public SpendingService(IVtxoStorage vtxoStorage, IContractStorage contractStorage, IWalletProvider walletProvider, ICoinService coinService, IContractService paymentService, IClientTransport transport, ICoinSelector coinSelector, ISafetyService safetyService, IIntentStorage intentStorage, IVirtualTxStorage? virtualTxStorage = null)
Parameters
vtxoStorageIVtxoStoragecontractStorageIContractStoragewalletProviderIWalletProvidercoinServiceICoinServicepaymentServiceIContractServicetransportIClientTransportcoinSelectorICoinSelectorsafetyServiceISafetyServiceintentStorageIIntentStoragevirtualTxStorageIVirtualTxStorage
SpendingService(IVtxoStorage, IContractStorage, ICoinService, IWalletProvider, IContractService, IClientTransport, ICoinSelector, ISafetyService, IIntentStorage, IEnumerable<IEventHandler<PostCoinsSpendActionEvent>>, ILogger<SpendingService>?, IVirtualTxStorage?, IEnumerable<ISpendExtensionPacketProvider>?, IEnumerable<ISpendSubmitHandler>?)
public SpendingService(IVtxoStorage vtxoStorage, IContractStorage contractStorage, ICoinService coinService, IWalletProvider walletProvider, IContractService paymentService, IClientTransport transport, ICoinSelector coinSelector, ISafetyService safetyService, IIntentStorage intentStorage, IEnumerable<IEventHandler<PostCoinsSpendActionEvent>> postSpendEventHandlers, ILogger<SpendingService>? logger = null, IVirtualTxStorage? virtualTxStorage = null, IEnumerable<ISpendExtensionPacketProvider>? extensionPacketProviders = null, IEnumerable<ISpendSubmitHandler>? submitHandlers = null)
Parameters
vtxoStorageIVtxoStoragecontractStorageIContractStoragecoinServiceICoinServicewalletProviderIWalletProviderpaymentServiceIContractServicetransportIClientTransportcoinSelectorICoinSelectorsafetyServiceISafetyServiceintentStorageIIntentStoragepostSpendEventHandlersIEnumerable<IEventHandler<PostCoinsSpendActionEvent>>loggerILogger<SpendingService>virtualTxStorageIVirtualTxStorageextensionPacketProvidersIEnumerable<ISpendExtensionPacketProvider>submitHandlersIEnumerable<ISpendSubmitHandler>
Methods
GetAvailableCoins(string, CancellationToken)
Returns all spendable coins for the wallet (unspent, unlocked, and within timelock bounds).
public 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).
public 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.
public Task<uint256> Spend(string walletId, ArkTxOut[] outputs, CancellationToken cancellationToken = default, IReadOnlyList<IExtensionPacket>? extensionPackets = null)
Parameters
walletIdstringoutputsArkTxOut[]cancellationTokenCancellationTokenextensionPacketsIReadOnlyList<IExtensionPacket>
Returns
- Task<uint256>