iota_json_rpc_api/
extended.rs1use iota_json_rpc_types::{
6 AddressMetrics, EpochInfo, EpochMetrics, EpochMetricsPage, EpochPage, MoveCallMetrics,
7 NetworkMetrics, Page, 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 #[schemars(with = "Page<EpochInfo, String>")]
22 async fn get_epochs(
23 &self,
24 #[schemars(with = "Option<String>")]
26 cursor: Option<BigInt<u64>>,
27 limit: Option<usize>,
29 descending_order: Option<bool>,
31 ) -> RpcResult<EpochPage>;
32
33 #[method(name = "getEpochMetrics")]
36 #[schemars(with = "Page<EpochMetrics, String>")]
37 async fn get_epoch_metrics(
38 &self,
39 #[schemars(with = "Option<String>")]
41 cursor: Option<BigInt<u64>>,
42 limit: Option<usize>,
44 descending_order: Option<bool>,
46 ) -> RpcResult<EpochMetricsPage>;
47
48 #[method(name = "getCurrentEpoch")]
50 async fn get_current_epoch(&self) -> RpcResult<EpochInfo>;
51
52 #[method(name = "getNetworkMetrics")]
54 async fn get_network_metrics(&self) -> RpcResult<NetworkMetrics>;
55
56 #[method(name = "getMoveCallMetrics")]
58 async fn get_move_call_metrics(&self) -> RpcResult<MoveCallMetrics>;
59
60 #[method(name = "getLatestAddressMetrics")]
62 async fn get_latest_address_metrics(&self) -> RpcResult<AddressMetrics>;
63
64 #[method(name = "getCheckpointAddressMetrics")]
66 async fn get_checkpoint_address_metrics(&self, checkpoint: u64) -> RpcResult<AddressMetrics>;
67
68 #[method(name = "getAllEpochAddressMetrics")]
70 async fn get_all_epoch_address_metrics(
71 &self,
72 descending_order: Option<bool>,
73 ) -> RpcResult<Vec<AddressMetrics>>;
74
75 #[method(name = "getTotalTransactions")]
78 #[schemars(with = "String")]
79 async fn get_total_transactions(&self) -> RpcResult<BigInt<u64>>;
80
81 #[method(name = "getParticipationMetrics")]
86 async fn get_participation_metrics(&self) -> RpcResult<ParticipationMetrics>;
87}