@hyperledger/fabric-gateway
    Preparing search index...

    Interface ChaincodeEventsRequest

    Delivers events emitted by transaction functions in a specific chaincode.

    interface ChaincodeEventsRequest {
        getBytes(): Uint8Array;
        getDigest(): Uint8Array;
        getEvents(
            options?: CallOptions,
        ): Promise<CloseableAsyncIterable<ChaincodeEvent>>;
    }

    Hierarchy (View Summary)

    Index

    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 chaincode events emitted by transaction functions of a specific chaincode.

      Parameters

      Returns Promise<CloseableAsyncIterable<ChaincodeEvent>>

      Chaincode events. The iterator should be closed after use to complete the eventing session.

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

      const events = await request.getEvents();
      try {
      for await (const event of events) {
      // Process event
      }
      } finally {
      events.close();
      }