Class BatchSession
Handles participation in a batch settlement for a specific intent. Events are followed in the order the operator drives them — tree nodes, tree signing, nonce aggregation, finalization — and forfeits are only signed once the commitment transaction is shown to carry the outputs the intent asked for.
public class BatchSession
- Inheritance
-
BatchSession
- Inherited Members
Constructors
BatchSession(IClientTransport, IWalletProvider, ArkTransactionBuilder, Network, ArkIntent, ArkCoin[], BatchStartedEvent, ILogger?, BatchExpiryPolicy?)
Handles participation in a batch settlement for a specific intent. Events are followed in the order the operator drives them — tree nodes, tree signing, nonce aggregation, finalization — and forfeits are only signed once the commitment transaction is shown to carry the outputs the intent asked for.
public BatchSession(IClientTransport clientTransport, IWalletProvider walletProvider, TransactionHelpers.ArkTransactionBuilder arkTransactionBuilder, Network network, ArkIntent arkIntent, ArkCoin[] ins, BatchStartedEvent batchStartedEvent, ILogger? logger = null, BatchExpiryPolicy? batchExpiryPolicy = null)
Parameters
clientTransportIClientTransportwalletProviderIWalletProviderarkTransactionBuilderTransactionHelpers.ArkTransactionBuildernetworkNetworkarkIntentArkIntentinsArkCoin[]batchStartedEventBatchStartedEventloggerILoggerbatchExpiryPolicyBatchExpiryPolicy
Properties
IsComplete
Whether the batch session has completed (successfully or with failure)
public bool IsComplete { get; }
Property Value
Methods
InitializeAsync(CancellationToken)
Initialize the batch session (call this before processing events)
public Task InitializeAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Remarks
Bounds the operator-declared batch expiry before deriving the sweep tap tree from it — the one place that value is checked, since later tree validation only proves the tree matches whatever expiry was supplied. Call this before confirming registration, so a rejected batch is never confirmed.
Exceptions
- InvalidBatchExpiryException
The operator declared a batch expiry outside the bounds of BatchExpiryPolicy.
ProcessEventAsync(BatchEvent, CancellationToken)
Process a single event from the event stream
public Task<bool> ProcessEventAsync(BatchEvent eventResponse, CancellationToken cancellationToken = default)
Parameters
eventResponseBatchEventcancellationTokenCancellationToken