import { RPCErrorCode, RPC_VERSION } from './consts'; type JsonRpcId = number | string; type PartialBy = Omit & Partial>; type RPCError = { code: RPCErrorCode | number; data: string; message: string; }; type RPCServerResponse = { id: JsonRpcId; jsonrpc: typeof RPC_VERSION; result: Result; error: RPCError; }; type RPCErrorResponse = PartialBy, 'result'>; type RPCSuccessResponse = PartialBy, 'error'>; type RPCRequest = { id?: JsonRpcId; method: string; params?: Object; jsonrpc: typeof RPC_VERSION; }; type RPCResponse = RPCSuccessResponse | RPCErrorResponse; export type { RPCRequest, RPCResponse, RPCErrorResponse, RPCSuccessResponse };