@arkade-os/sdk Documentation - v0.3.11
    Preparing search index...

    Namespace Batch

    Batch namespace provides utilities for joining and processing batch session. The batch settlement process involves multiple events, this namespace provides abstractions and types to handle them.

    // use wallet handler or create a custom one
    const handler = wallet.createBatchHandler(intentId, inputs, musig2session);

    const abortController = new AbortController();
    // Get event stream from Ark provider
    const eventStream = arkProvider.getEventStream(
    abortController.signal,
    ['your-topic-1', 'your-topic-2']
    );

    // Join the batch and process events
    try {
    const commitmentTxid = await Batch.join(eventStream, handler);
    console.log('Batch completed with commitment:', commitmentTxid);
    } catch (error) {
    console.error('Batch processing failed:', error);
    } finally {
    abortController.abort();
    }

    Interfaces

    Handler

    Type Aliases

    JoinOptions

    Functions

    join