import { CallOptions } from '@grpc/grpc-js'; import { common, peer } from '@hyperledger/fabric-protos'; import { CloseableAsyncIterable, GatewayClient } from './client'; import { Signable } from './signable'; import { SigningIdentity } from './signingidentity'; /** * Delivers block events. */ export interface BlockEventsRequest extends Signable { /** * Get block events. * @param options - gRPC [CallOptions](https://grpc.github.io/grpc/node/grpc.Client.html#~CallOptions). * @returns Block protocol buffer messages. The iterator should be closed after use to complete the eventing * session. * @throws {@link GatewayError} * Thrown by the iterator if the gRPC service invocation fails. * @example * ```typescript * const blocks = await request.getEvents(); * try { * for async (const block of blocks) { * // Process block * } * } finally { * blocks.close(); * } * ``` */ getEvents(options?: CallOptions): Promise>; } /** * Delivers filtered block events. */ export interface FilteredBlockEventsRequest extends Signable { /** * Get filtered block events. * @param options - gRPC [CallOptions](https://grpc.github.io/grpc/node/grpc.Client.html#~CallOptions). * @returns Filtered block protocol buffer messages. The iterator should be closed after use to complete the * eventing session. * @throws {@link GatewayError} * Thrown by the iterator if the gRPC service invocation fails. * @example * ```typescript * const blocks = await request.getEvents(); * try { * for async (const block of blocks) { * // Process block * } * } finally { * blocks.close(); * } * ``` */ getEvents(options?: CallOptions): Promise>; } /** * Delivers block and private data events. */ export interface BlockAndPrivateDataEventsRequest extends Signable { /** * Get block and private data events. * @param options - gRPC [CallOptions](https://grpc.github.io/grpc/node/grpc.Client.html#~CallOptions). * @returns Block and private data protocol buffer messages. The iterator should be closed after use to complete * the eventing session. * @throws {@link GatewayError} * Thrown by the iterator if the gRPC service invocation fails. * @example * ```typescript * const events = await network.getBlockAndPrivateEventsData(); * try { * for await (const event of events) { * // Process block and private data event * } * } finally { * events.close(); * } * ``` */ getEvents(options?: CallOptions): Promise>; } export interface BlockEventsRequestOptions { client: GatewayClient; signingIdentity: SigningIdentity; request: common.Envelope; } type SignableBlockEventsRequestOptions = Pick; declare class SignableBlockEventsRequest implements Signable { #private; constructor(options: Readonly); getBytes(): Uint8Array; getDigest(): Uint8Array; setSignature(signature: Uint8Array): void; protected getSignedRequest(): Promise; } export declare class BlockEventsRequestImpl extends SignableBlockEventsRequest implements BlockEventsRequest { #private; constructor(options: Readonly); getEvents(options?: Readonly): Promise>; } export declare class FilteredBlockEventsRequestImpl extends SignableBlockEventsRequest implements FilteredBlockEventsRequest { #private; constructor(options: Readonly); getEvents(options?: Readonly): Promise>; } export declare class BlockAndPrivateDataEventsRequestImpl extends SignableBlockEventsRequest implements BlockAndPrivateDataEventsRequest { #private; constructor(options: Readonly); getEvents(options?: Readonly): Promise>; } export {}; //# sourceMappingURL=blockeventsrequest.d.ts.map