derive-rs 0.1.16

Rust SDK for Derive.xyz
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{models::*, types::ClientError, ws_client::WsClient};
pub struct AccountNamespace<'a> {
    pub ws_client: &'a WsClient,
}
impl<'a> AccountNamespace<'a> {
    pub fn new(ws_client: &'a WsClient) -> Self {
        Self { ws_client }
    }
    pub async fn get_account(
        &self,
        params: GetAccountRequest,
    ) -> Result<PrivateGetAccountResponse, ClientError> {
        let params_json = serde_json::to_value(&params)?;
        self.ws_client.send_rpc("private/get_account", params_json).await
    }
}