use std::future::Future;
use tangle_subxt::tangle_testnet_runtime::api::runtime_types::tangle_primitives::services::{Service, ServiceBlueprint};
use tangle_subxt::tangle_testnet_runtime::api::runtime_types::sp_arithmetic::per_things::Percent;
use tangle_subxt::tangle_testnet_runtime::api::runtime_types::pallet_multi_asset_delegation::types::operator::OperatorMetadata;
use tangle_subxt::tangle_testnet_runtime::api::assets::events::burned::Balance;
use tangle_subxt::tangle_testnet_runtime::api::assets::events::accounts_destroyed::AssetId;
use tangle_subxt::tangle_testnet_runtime::api::runtime_types::tangle_testnet_runtime::{MaxDelegations, MaxDelegatorBlueprints, MaxOperatorBlueprints, MaxUnstakeRequests, MaxWithdrawRequests};
use tangle_subxt::tangle_testnet_runtime::api::system::storage::types::number::Number;
use tangle_subxt::tangle_testnet_runtime::api::runtime_types::pallet_multi_asset_delegation::types::delegator::DelegatorMetadata;
#[allow(clippy::type_complexity)]
pub trait ServicesContext {
type Config: subxt::Config;
fn current_blueprint(
&self,
client: &subxt::OnlineClient<Self::Config>,
) -> impl Future<Output = color_eyre::Result<ServiceBlueprint, subxt::Error>>;
fn current_blueprint_owner(
&self,
client: &subxt::OnlineClient<Self::Config>,
) -> impl Future<Output = color_eyre::Result<subxt::utils::AccountId32, subxt::Error>>;
fn current_service_operators(
&self,
client: &subxt::OnlineClient<Self::Config>,
) -> impl Future<Output = color_eyre::Result<Vec<(subxt::utils::AccountId32, Percent)>, subxt::Error>>;
#[allow(clippy::type_complexity)]
fn operators_metadata(
&self,
client: &subxt::OnlineClient<Self::Config>,
operators: Vec<subxt::utils::AccountId32>,
) -> impl Future<
Output = color_eyre::Result<
Vec<(
subxt::utils::AccountId32,
OperatorMetadata<
subxt::utils::AccountId32,
Balance,
AssetId,
MaxDelegations,
MaxOperatorBlueprints,
>,
)>,
subxt::Error,
>,
>;
fn operator_metadata(
&self,
client: &subxt::OnlineClient<Self::Config>,
operator: subxt::utils::AccountId32,
) -> impl Future<
Output = color_eyre::Result<
Option<
OperatorMetadata<
subxt::utils::AccountId32,
Balance,
AssetId,
MaxDelegations,
MaxOperatorBlueprints,
>,
>,
subxt::Error,
>,
>;
fn service_instance(
&self,
client: &subxt::OnlineClient<Self::Config>,
) -> impl Future<
Output = color_eyre::Result<
Service<subxt::utils::AccountId32, Number, AssetId>,
subxt::Error,
>,
>;
#[allow(clippy::type_complexity)]
fn operator_delegations(
&self,
client: &subxt::OnlineClient<Self::Config>,
operators: Vec<subxt::utils::AccountId32>,
) -> impl Future<
Output = color_eyre::Result<
Vec<(
subxt::utils::AccountId32, // operator
Option<
DelegatorMetadata<
subxt::utils::AccountId32,
AssetId,
Balance,
MaxWithdrawRequests,
MaxDelegations,
MaxUnstakeRequests,
MaxDelegatorBlueprints,
>,
>,
)>,
subxt::Error,
>,
>;
fn operator_delegation(
&self,
client: &subxt::OnlineClient<Self::Config>,
operator: subxt::utils::AccountId32,
) -> impl Future<
Output = color_eyre::Result<
Option<
DelegatorMetadata<
subxt::utils::AccountId32,
AssetId,
Balance,
MaxWithdrawRequests,
MaxDelegations,
MaxUnstakeRequests,
MaxDelegatorBlueprints,
>,
>,
subxt::Error,
>,
>;
}