nimiq-jsonrpc-client 0.2.2

JSON-RPC client implementation
Documentation

This crate implements multiple JSON-RPC clients. Currently available are: http and websocket. Only websocket supports PubSub.

Instead of using a [Client] implementation and calling [Client::send_request] directly, you can derive a proxy struct that implements methods for ergonomic RPC calling:

use async_trait::async_trait;

#[nimiq_jsonrpc_derive::proxy]
#[async_trait]
trait Foobar {
    type Error;
    async fn hello(&mut self, name: String) -> Result<String, Self::Error>;
}

TODO

  • Implement PubSub
  • Proper error handling