use iota_json_rpc_types::{
AddressMetrics, EpochInfo, EpochMetricsPage, EpochPage, MoveCallMetrics, NetworkMetrics,
};
use iota_open_rpc_macros::open_rpc;
use iota_types::iota_serde::BigInt;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
#[open_rpc(namespace = "iotax", tag = "Extended API")]
#[rpc(server, client, namespace = "iotax")]
pub trait ExtendedApi {
#[rustfmt::skip]
#[method(name = "getEpochs")]
async fn get_epochs(
&self,
cursor: Option<BigInt<u64>>,
limit: Option<usize>,
descending_order: Option<bool>,
) -> RpcResult<EpochPage>;
#[method(name = "getEpochMetrics")]
async fn get_epoch_metrics(
&self,
cursor: Option<BigInt<u64>>,
limit: Option<usize>,
descending_order: Option<bool>,
) -> RpcResult<EpochMetricsPage>;
#[method(name = "getCurrentEpoch")]
async fn get_current_epoch(&self) -> RpcResult<EpochInfo>;
#[method(name = "getNetworkMetrics")]
async fn get_network_metrics(&self) -> RpcResult<NetworkMetrics>;
#[method(name = "getMoveCallMetrics")]
async fn get_move_call_metrics(&self) -> RpcResult<MoveCallMetrics>;
#[method(name = "getLatestAddressMetrics")]
async fn get_latest_address_metrics(&self) -> RpcResult<AddressMetrics>;
#[method(name = "getCheckpointAddressMetrics")]
async fn get_checkpoint_address_metrics(&self, checkpoint: u64) -> RpcResult<AddressMetrics>;
#[method(name = "getAllEpochAddressMetrics")]
async fn get_all_epoch_address_metrics(
&self,
descending_order: Option<bool>,
) -> RpcResult<Vec<AddressMetrics>>;
#[method(name = "getTotalTransactions")]
async fn get_total_transactions(&self) -> RpcResult<BigInt<u64>>;
}