UNPKG

lisk-framework

Version:

Lisk blockchain application platform

17 lines (16 loc) 1.19 kB
import { JSONRPCErrorObject, ID, NotificationRequest, JSONRPCResult, ResponseObjectWithResult, ResponseObjectWithError, RequestObject } from './types'; export declare const VERSION = "2.0"; export declare function validateJSONRPCRequest(data: unknown): asserts data is RequestObject; export declare const validateJSONRPCNotification: (data: Record<string, unknown>) => void; export declare const notificationRequest: (method: string, params?: Record<string, unknown>) => NotificationRequest; export declare const successResponse: (id: ID, result: JSONRPCResult) => ResponseObjectWithResult; export declare const errorResponse: (id: ID, error: JSONRPCErrorObject) => ResponseObjectWithError; export declare const invalidRequest: (msg?: string) => JSONRPCErrorObject; export declare const methodNotFound: () => JSONRPCErrorObject; export declare const invalidParams: () => JSONRPCErrorObject; export declare const internalError: (data?: JSONRPCResult) => JSONRPCErrorObject; export declare const parseError: () => JSONRPCErrorObject; export declare class JSONRPCError extends Error { response: ResponseObjectWithError; constructor(message: string, error: ResponseObjectWithError); }