UNPKG

@lodestar/prover

Version:

A Typescript implementation of the Ethereum Consensus light client

19 lines 2.12 kB
import { Logger } from "@lodestar/logger"; import { JsonRpcBatchRequest, JsonRpcBatchResponse, JsonRpcErrorPayload, JsonRpcNotificationPayload, JsonRpcRequest, JsonRpcRequestOrBatch, JsonRpcRequestPayload, JsonRpcResponse, JsonRpcResponseOrBatch, JsonRpcResponseWithErrorPayload, JsonRpcResponseWithResultPayload } from "../types.js"; export declare function getResponseForRequest<P, R, E = unknown>(payload: JsonRpcRequest<P>, res?: R, error?: JsonRpcErrorPayload<E>): JsonRpcResponse<R, E>; export declare function getVerificationFailedMessage(method: string): string; export declare function isVerificationFailedError<P>(payload: JsonRpcResponseWithErrorPayload<P>): boolean; export declare function getErrorResponseForRequestWithFailedVerification<P, D = unknown>(payload: JsonRpcRequest<P>, message: string, data?: D): JsonRpcResponseWithErrorPayload<D>; export declare function isValidResponse<R, E>(response: JsonRpcResponseOrBatch<R, E> | undefined): response is JsonRpcResponseWithResultPayload<R> | JsonRpcResponseWithResultPayload<R>[]; export declare function isValidBatchResponse<R, E>(payload: JsonRpcBatchRequest, response: JsonRpcBatchResponse<R, E>): response is JsonRpcBatchResponse<R, E> | JsonRpcResponseWithResultPayload<R>[]; export declare function mergeBatchReqResp(payload: JsonRpcBatchRequest, response: JsonRpcBatchResponse): { request: JsonRpcRequest; response: JsonRpcResponse; }[]; export declare function isNotification<P>(payload: JsonRpcRequest<P>): payload is JsonRpcNotificationPayload<P>; export declare function isRequest<P>(payload: JsonRpcRequest<P>): payload is JsonRpcRequestPayload<P>; export declare function isBatchRequest<P>(payload: JsonRpcRequestOrBatch<P>): payload is JsonRpcBatchRequest<P>; export declare function isBatchResponse<R>(response: JsonRpcResponseOrBatch<R>): response is JsonRpcBatchResponse<R>; export declare function logRequest(payload: JsonRpcRequestOrBatch | undefined | null, logger: Logger): void; export declare function logResponse(response: JsonRpcResponseOrBatch | undefined, logger: Logger): void; //# sourceMappingURL=json_rpc.d.ts.map