use iota_json_rpc_types::{DelegatedStake, DelegatedTimelockedStake, IotaCommittee, ValidatorApys};
use iota_open_rpc_macros::open_rpc;
use iota_types::{
base_types::{IotaAddress, ObjectID},
iota_serde::BigInt,
iota_system_state::iota_system_state_summary::IotaSystemStateSummary,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
#[open_rpc(namespace = "iotax", tag = "Governance Read API")]
#[rpc(server, client, namespace = "iotax")]
pub trait GovernanceReadApi {
#[method(name = "getStakesByIds")]
async fn get_stakes_by_ids(
&self,
staked_iota_ids: Vec<ObjectID>,
) -> RpcResult<Vec<DelegatedStake>>;
#[method(name = "getStakes")]
async fn get_stakes(&self, owner: IotaAddress) -> RpcResult<Vec<DelegatedStake>>;
#[method(name = "getTimelockedStakesByIds")]
async fn get_timelocked_stakes_by_ids(
&self,
timelocked_staked_iota_ids: Vec<ObjectID>,
) -> RpcResult<Vec<DelegatedTimelockedStake>>;
#[method(name = "getTimelockedStakes")]
async fn get_timelocked_stakes(
&self,
owner: IotaAddress,
) -> RpcResult<Vec<DelegatedTimelockedStake>>;
#[method(name = "getCommitteeInfo")]
async fn get_committee_info(
&self,
epoch: Option<BigInt<u64>>,
) -> RpcResult<IotaCommittee>;
#[method(name = "getLatestIotaSystemState")]
async fn get_latest_iota_system_state(&self) -> RpcResult<IotaSystemStateSummary>;
#[method(name = "getReferenceGasPrice")]
async fn get_reference_gas_price(&self) -> RpcResult<BigInt<u64>>;
#[method(name = "getValidatorsApy")]
async fn get_validators_apy(&self) -> RpcResult<ValidatorApys>;
}