Rpc_encodings.JSONRPC
Encodings for the JSON-RPC standard. See https://www.jsonrpc.org/specification.
Ids in the JSON-RPC specification can be either a string, a number or NULL (which is represented by the option type). Note that MetaMask uses ids that only fit in 64 bits, which is not supported by Data_encoding.
val id_repr_encoding : id_repr Mavryk_base.TzPervasives.Data_encoding.t
type id = id_repr option
type request = {
method_ : string;
parameters : Mavryk_base.TzPervasives.Data_encoding.json option;
`params` is optional.
*)id : id;
`id` is optional.
*)}
JSON-RPC Request object:
{ "jsonrpc" : "2.0",
"method": <string>,
"params": <array | object>, //optional
"id": <string | number | NULL> //optional
}
val request_encoding : request Mavryk_base.TzPervasives.Data_encoding.t
JSON-RPC Error representation.
{ "code" : <number>,
"message": <string>,
"data": <any value>
}
val error_encoding :
'a Mavryk_base.TzPervasives.Data_encoding.t ->
'a error Mavryk_base.TzPervasives.Data_encoding.t
type value =
(Mavryk_base.TzPervasives.Data_encoding.json,
Mavryk_base.TzPervasives.Data_encoding.json error)
Stdlib.result
JSON-RPC Response object:
{ "jsonrpc": "2.0",
"result": <any>,
"error": <error object>,
"id": <id>
}
Note that `result` and `error` cannot appear at the same time, hence the choice of using the result type as representation.
val response_encoding : response Mavryk_base.TzPervasives.Data_encoding.t