iota_json_rpc_api/
extended.rs1use iota_json_rpc_types::{
6 AddressMetrics, EpochInfo, EpochMetricsPage, EpochPage, MoveCallMetrics, NetworkMetrics,
7 ParticipationMetrics,
8};
9use iota_open_rpc_macros::open_rpc;
10use iota_types::iota_serde::BigInt;
11use jsonrpsee::{core::RpcResult, proc_macros::rpc};
12
13#[open_rpc(namespace = "iotax", tag = "Extended API")]
16#[rpc(server, client, namespace = "iotax")]
17pub trait ExtendedApi {
18 #[rustfmt::skip]
20 #[method(name = "getEpochs")]
21 async fn get_epochs(
22 &self,
23 cursor: Option<BigInt<u64>>,
25 limit: Option<usize>,
27 descending_order: Option<bool>,
29 ) -> RpcResult<EpochPage>;
30
31 #[method(name = "getEpochMetrics")]
34 async fn get_epoch_metrics(
35 &self,
36 cursor: Option<BigInt<u64>>,
38 limit: Option<usize>,
40 descending_order: Option<bool>,
42 ) -> RpcResult<EpochMetricsPage>;
43
44 #[method(name = "getCurrentEpoch")]
46 async fn get_current_epoch(&self) -> RpcResult<EpochInfo>;
47
48 #[method(name = "getNetworkMetrics")]
50 async fn get_network_metrics(&self) -> RpcResult<NetworkMetrics>;
51
52 #[method(name = "getMoveCallMetrics")]
54 async fn get_move_call_metrics(&self) -> RpcResult<MoveCallMetrics>;
55
56 #[method(name = "getLatestAddressMetrics")]
58 async fn get_latest_address_metrics(&self) -> RpcResult<AddressMetrics>;
59
60 #[method(name = "getCheckpointAddressMetrics")]
62 async fn get_checkpoint_address_metrics(&self, checkpoint: u64) -> RpcResult<AddressMetrics>;
63
64 #[method(name = "getAllEpochAddressMetrics")]
66 async fn get_all_epoch_address_metrics(
67 &self,
68 descending_order: Option<bool>,
69 ) -> RpcResult<Vec<AddressMetrics>>;
70
71 #[method(name = "getTotalTransactions")]
74 async fn get_total_transactions(&self) -> RpcResult<BigInt<u64>>;
75
76 #[method(name = "getParticipationMetrics")]
81 async fn get_participation_metrics(&self) -> RpcResult<ParticipationMetrics>;
82}