Delivers block events.

interface BlockEventsRequest {
    getBytes(): Uint8Array;
    getDigest(): Uint8Array;
    getEvents(options?): Promise<CloseableAsyncIterable<Block>>;
}

Hierarchy (view full)

Methods

  • Get the serialized bytes of the signable object. Serialized bytes can be used to recreate the object using methods on Gateway.

    Returns Uint8Array

  • Get the digest of the signable object. This is used to generate a digital signature.

    Returns Uint8Array

  • Get block events.

    Parameters

    • Optional options: CallOptions

      gRPC call

    Returns Promise<CloseableAsyncIterable<Block>>

    Block protocol buffer messages. The iterator should be closed after use to complete the eventing session.

    Throws

    GatewayError Thrown by the iterator if the gRPC service invocation fails.

    Example

    const blocks = await request.getEvents();
    try {
    for async (const block of blocks) {
    // Process block
    }
    } finally {
    blocks.close();
    }