#[api]
Expand description
Define the API of the JSON-RPC server you want to talk to.
All methods of this trait must be async
. Additionally, the trait cannot have other items such as const
or type
declarations.
You can define the JSON-RPC version through the version
attribute. For now, all this does is sent the correct version property in the JSON-RPC request.
ยงExample
#[jsonrpc_client::api]
pub trait Math {
async fn subtract(&self, subtrahend: i64, minuend: i64) -> i64;
}