Skip to main content

rpc_request

Macro rpc_request 

Source
macro_rules! rpc_request {
    ($method:expr_2021, $params:expr_2021, $id:expr_2021) => { ... };
    ($method:expr_2021, $id:expr_2021) => { ... };
    ($method:expr_2021) => { ... };
}
Expand description

Create a JSON-RPC request

ยงUsage:

// Request with method, params and ID
rpc_request!("add", [5, 3], 1)

// Request with method and ID (no params)
rpc_request!("ping", 2)

// Request with method only (notification - no ID)
rpc_request!("log")