mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-12-23 12:09:57 +00:00
.. | ||
src | ||
Cargo.toml | ||
README.md |
Monero RPC types.
What
This crate ports the types used in Monero's RPC interface, including:
- JSON types
- Binary (epee) types
- Mixed types
- Other commonly used RPC types
Modules
This crate's types are split in the following manner:
- This crate has 3 modules:
- The root module (
cuprate_rpc_types
) - [
req
] (request types) - [
resp
] (response types)
- The root module (
- Miscellaneous types are found in the root module, e.g. [
Status
] - The
req
andresp
modules perfectly mirror each-other, and are split into 3 modules:json
(JSON types from the/json_rpc
endpoint)bin
(Binary types from the binary endpoints)other
(Misc JSON types from other endpoints)
- Each type in
req
has a corresponding type inresp
and vice-versa with an identical name, e.g. [req::json::GetBlockCount
] and [resp::json::GetBlockCount
]
Documentation
The documentation for types within [req
] and [resp
] are omitted,
as they can be found in Monero's RPC documentation.
However, each type will document:
- The exact type definition location in
monerod
- The Monero RPC documentation link
Naming
The naming for types within [req
] and [resp
] follow the following scheme:
- Convert the endpoint or method name into
UpperCamelCase
- Remove any suffix extension
For example:
Endpoint/method | Crate location and name |
---|---|
get_block_count |
[req::json::GetBlockCount ] & [resp::json::GetBlockCount ] |
/get_blocks.bin |
req::bin::GetBlocks & resp::bin::GetBlocks |
/get_height |
req::other::GetHeight & resp::other::GetHeight |
TODO: fix doc links when types are ready.
Mixed types
Note that some types within [resp::other
] mix JSON & binary, i.e.,
the message overall is JSON, however some fields contain binary
values, for example:
{
"string": "",
"float": 30.0,
"integer": 30,
"binary": /* serialized binary */
}
TODO: list the specific types.