use cfg_types::pools::PoolNav;
use pallet_pool_system::{
tranches::{TrancheIndex, TrancheLoc, TrancheSolution},
EpochSolution,
};
use parity_scale_codec::Codec;
use sp_api::decl_runtime_apis;
use sp_runtime::traits::Get;
use sp_std::vec::Vec;
decl_runtime_apis! {
pub trait PoolsApi<PoolId, TrancheId, Balance, Currency, BalanceRatio, MaxTranches>
where
PoolId: Codec,
TrancheId: Codec,
Balance: Codec,
Currency: Codec,
BalanceRatio: Codec,
MaxTranches: Codec + Get<u32>,
{
fn currency(pool_id: PoolId) -> Option<Currency>;
fn inspect_epoch_solution(pool_id: PoolId, solution: Vec<TrancheSolution>) -> Option<EpochSolution<Balance, MaxTranches>>;
fn tranche_token_price(pool_id: PoolId, tranche: TrancheLoc<TrancheId>) -> Option<BalanceRatio>;
fn tranche_token_prices(pool_id: PoolId) -> Option<Vec<BalanceRatio>>;
fn tranche_ids(pool_id: PoolId) -> Option<Vec<TrancheId>>;
fn tranche_id(pool_id: PoolId, tranche_index: TrancheIndex) -> Option<TrancheId>;
fn tranche_currency(pool_id: PoolId, tranche_loc: TrancheLoc<TrancheId>) -> Option<Currency>;
fn nav(pool_id: PoolId) -> Option<PoolNav<Balance>>;
}
}