import { CallOptions, ClientUnaryCall, requestCallback } from '@grpc/grpc-js'; import { common, gateway, peer } from '@hyperledger/fabric-protos'; import { ConnectOptions } from './gateway'; export declare const evaluateMethod = "/gateway.Gateway/Evaluate"; export declare const endorseMethod = "/gateway.Gateway/Endorse"; export declare const submitMethod = "/gateway.Gateway/Submit"; export declare const commitStatusMethod = "/gateway.Gateway/CommitStatus"; export declare const chaincodeEventsMethod = "/gateway.Gateway/ChaincodeEvents"; export declare const deliverMethod = "/protos.Deliver/Deliver"; export declare const deliverFilteredMethod = "/protos.Deliver/DeliverFiltered"; export declare const deliverWithPrivateDataMethod = "/protos.Deliver/DeliverWithPrivateData"; export interface GatewayClient { evaluate(request: gateway.EvaluateRequest, options?: CallOptions): Promise; endorse(request: gateway.EndorseRequest, options?: CallOptions): Promise; submit(request: gateway.SubmitRequest, options?: CallOptions): Promise; commitStatus(request: gateway.SignedCommitStatusRequest, options?: CallOptions): Promise; chaincodeEvents(request: gateway.SignedChaincodeEventsRequest, options?: CallOptions): CloseableAsyncIterable; blockEvents(request: common.Envelope, options?: CallOptions): CloseableAsyncIterable; filteredBlockEvents(request: common.Envelope, options?: CallOptions): CloseableAsyncIterable; blockAndPrivateDataEvents(request: common.Envelope, options?: CallOptions): CloseableAsyncIterable; } /** * An async iterable that can be closed when the consumer does not want to read any more elements, freeing up resources * that may be held by the iterable. * * This type implements the Disposable interface, allowing instances to be disposed of with ECMAScript explicit * resource management and the `using` keyword instead of calling {@link close} directly. * * @see [ECMAScript explicit resource management](https://github.com/tc39/proposal-explicit-resource-management) */ export interface CloseableAsyncIterable extends AsyncIterable, Disposable { /** * Close the iterable to free up resources when no more elements are required. */ close(): void; } /** * Subset of grpc-js ClientReadableStream used by GatewayClient to aid mocking. */ export interface ServerStreamResponse extends AsyncIterable { cancel(): void; } /** * Subset of grpc-js ClientDuplexStream used by GatewayClient to aid mocking. */ export interface DuplexStreamResponse extends ServerStreamResponse { write(chunk: RequestType): boolean; } /** * Subset of the grpc-js Client used by GatewayClient to aid mocking. */ export interface GatewayGrpcClient { makeUnaryRequest(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, argument: RequestType, options: CallOptions, callback: requestCallback): ClientUnaryCall; makeServerStreamRequest(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, argument: RequestType, options: CallOptions): ServerStreamResponse; makeBidiStreamRequest(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, options: CallOptions): DuplexStreamResponse; } type DefaultCallOptions = Pick; export declare function newGatewayClient(client: GatewayGrpcClient, defaultOptions: DefaultCallOptions): GatewayClient; export {}; //# sourceMappingURL=client.d.ts.map