Skip to main content

circles_rpc/methods/
network.rs

1use crate::client::RpcClient;
2use crate::error::Result;
3use circles_types::NetworkSnapshot;
4
5/// Methods for fetching network snapshots (`circles_getNetworkSnapshot`).
6#[derive(Clone, Debug)]
7pub struct NetworkMethods {
8    client: RpcClient,
9}
10
11impl NetworkMethods {
12    /// Create a new accessor for network snapshot RPCs.
13    pub fn new(client: RpcClient) -> Self {
14        Self { client }
15    }
16
17    /// circles_getNetworkSnapshot
18    pub async fn snapshot(&self) -> Result<NetworkSnapshot> {
19        self.client.call("circles_getNetworkSnapshot", ()).await
20    }
21}