sui_json_rpc_api/
extended.rs1use jsonrpsee::core::RpcResult;
5use jsonrpsee::proc_macros::rpc;
6
7use sui_json_rpc_types::{
8 CheckpointedObjectID, EpochInfo, EpochPage, QueryObjectsPage, SuiObjectResponseQuery,
9};
10use sui_open_rpc_macros::open_rpc;
11use sui_types::sui_serde::BigInt;
12
13#[open_rpc(namespace = "suix", tag = "Extended API")]
14#[rpc(server, client, namespace = "suix")]
15pub trait ExtendedApi {
16 #[method(name = "getEpochs")]
18 async fn get_epochs(
19 &self,
20 cursor: Option<BigInt<u64>>,
22 limit: Option<usize>,
24 descending_order: Option<bool>,
26 ) -> RpcResult<EpochPage>;
27
28 #[method(name = "getCurrentEpoch")]
30 async fn get_current_epoch(&self) -> RpcResult<EpochInfo>;
31
32 #[method(name = "queryObjects")]
34 async fn query_objects(
35 &self,
36 query: SuiObjectResponseQuery,
38 cursor: Option<CheckpointedObjectID>,
40 limit: Option<usize>,
42 ) -> RpcResult<QueryObjectsPage>;
43
44 #[method(name = "getTotalTransactions")]
45 async fn get_total_transactions(&self) -> RpcResult<BigInt<u64>>;
46}