package sonet

  1. Overview
  2. Docs
val code_error_parse : int
val code_error_invalid_req : int
val code_error_not_found : int
val code_error_invalid_params : int
val code_error_internal_error : int
type req_error =
  1. | Request_json_conv_error of Json_conv.error
  2. | Request_invalid_params
val string_of_req_error : req_error -> string
type resp_error =
  1. | Response_json_conv_error of Json_conv.error
  2. | Response_no_result_or_error
  3. | Response_both_result_and_error
val string_of_resp_error : resp_error -> string
exception Invalid_id of Json.t
exception Invalid_request of req_error
exception Invalid_response of resp_error
exception Unknown_request of string
type rpc_request = {
  1. request_id : Json.t option;
  2. method_name : string;
  3. params : Json.t;
}
type rpc_error = int * string * Json.t option
type rpc_response_payload =
  1. | Result of Json.t
  2. | Error of rpc_error
type rpc_response = {
  1. response_id : Json.t;
  2. response : rpc_response_payload;
}
val response_make_error : Json.t -> int -> string -> Json.t option -> rpc_response
val response_make_success : Json.t -> Json.t -> rpc_response
val request_of_json : Json.t -> rpc_request
val request_to_json : rpc_request -> Json.t
val response_of_json : Json.t -> rpc_response
val response_to_json : rpc_response -> Json.t
val request_of_string : string -> rpc_request
val request_to_string : rpc_request -> string
val response_of_string : string -> rpc_response
val response_to_string : rpc_response -> string
type rpc_type =
  1. | Non_JSONRPC
  2. | Request of Json.t * rpc_request
  3. | Notification of rpc_request
  4. | Response of rpc_response
val rpc_type_of_json : Json.t -> rpc_type
val is_jsonrpc_value : Json.t -> bool