sui_jsonrpc/api/
extended.rs

1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4use jsonrpsee::proc_macros::rpc;
5
6use crate::msgs::{
7    CheckpointedObjectId,
8    EpochInfo,
9    EpochPage,
10    QueryObjectsPage,
11    SuiObjectResponseQuery,
12};
13use crate::serde::BigInt;
14
15#[rpc(client, namespace = "suix")]
16pub trait ExtendedApi {
17    /// Return a list of epoch info
18    #[method(name = "getEpochs")]
19    async fn get_epochs(
20        &self,
21        cursor: Option<BigInt<u64>>,
22        limit: Option<usize>,
23        descending_order: Option<bool>,
24    ) -> RpcResult<EpochPage>;
25
26    /// Return current epoch info
27    #[method(name = "getCurrentEpoch")]
28    async fn get_current_epoch(&self) -> RpcResult<EpochInfo>;
29
30    /// Return the list of queried objects. Note that this is an enhanced full node only api.
31    #[method(name = "queryObjects")]
32    async fn query_objects(
33        &self,
34        query: SuiObjectResponseQuery,
35        cursor: Option<CheckpointedObjectId>,
36        limit: Option<usize>,
37    ) -> RpcResult<QueryObjectsPage>;
38
39    #[method(name = "getTotalTransactions")]
40    async fn get_total_transactions(&self) -> RpcResult<BigInt<u64>>;
41}