/** * A JSON-RPC 2.0 request * * @see {@link https://www.jsonrpc.org/specification#request_object} */ export declare class JsonRpcRequest { /** * A string specifying the version of the JSON-RPC protocol. MUST be exactly "2.0". */ readonly jsonrpc: string; /** * An identifier established by the Client that MUST contain a string, number, or * NULL value if included. If it is not included it is assumed to be a notification. * The value SHOULD normally not be Null and numbers SHOULD NOT contain fractional * parts. The Server MUST reply with the same value in the Response object if included. * This member is used to correlate the context between the two objects. */ readonly id?: string; /** * A string containing the name of the method to be invoked. * Method names that begin with the word rpc followed by a period character * (U+002E or ASCII 46) are reserved for rpc-internal methods and extensions and * MUST NOT be used for anything else. */ readonly method: string; /** * A structured value that holds the parameter values to be used during the * invocation of the method.This member MAY be omitted. */ readonly params?: { [key: string]: any; }; /** * Create a JSON-RPC request * * @param method The name of the method to call * @param params Values for the methods parameters (i.e. arguments) * @param id The request id. If `false`, then the request is a * notification (i.e. no response expected). If * `undefined` then a new id will be generated. */ constructor(method: string, params?: { [key: string]: any; } | any[], id?: string | false); static create(source: unknown): JsonRpcRequest; /** * Hydrate a Javascript object into an instance * * @param obj A plain object representing a request */ static hydrate(obj: { [key: string]: unknown; }): JsonRpcRequest; /** * Parse a JSON into an instance * * @param json The JSON representation of the request */ static parse(json: string): JsonRpcRequest; }