use milkyway_std_derive::CosmwasmExt;
/// Pool defines the structure of a restaking pool
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.pools.v1.Pool")]
pub struct Pool {
    /// ID is the auto-generated unique identifier for the pool
    #[prost(uint32, tag = "1")]
    #[serde(alias = "ID")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub id: u32,
    /// Denom represents the denomination of the tokens that are staked in the pool
    #[prost(string, tag = "2")]
    pub denom: ::prost::alloc::string::String,
    /// Address represents the address of the account that is associated with this
    /// pool. This will be used to store tokens that users delegate to this pool.
    #[prost(string, tag = "3")]
    pub address: ::prost::alloc::string::String,
    /// Tokens define the delegated tokens.
    #[prost(string, tag = "4")]
    pub tokens: ::prost::alloc::string::String,
    /// DelegatorShares defines total shares issued to a pool's delegators.
    #[prost(string, tag = "5")]
    pub delegator_shares: ::prost::alloc::string::String,
}
/// Params defines the parameters for the pools module.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.pools.v1.Params")]
pub struct Params {
    /// AllowedServicesIDs defines the list of service IDs that the module allows
    /// to join by pools.
    #[prost(uint32, repeated, packed = "false", tag = "1")]
    #[serde(alias = "allowed_servicesIDs")]
    #[serde(
        serialize_with = "crate::serde::as_str_vec::serialize",
        deserialize_with = "crate::serde::as_str_vec::deserialize"
    )]
    pub allowed_services_ids: ::prost::alloc::vec::Vec<u32>,
}
/// GenesisState defines the pools module's genesis state.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.pools.v1.GenesisState")]
pub struct GenesisState {
    /// Params defines the parameters of the module.
    #[prost(message, optional, tag = "1")]
    pub params: ::core::option::Option<Params>,
    /// NextPoolID represents the id to be used when creating the next pool.
    #[prost(uint32, tag = "2")]
    #[serde(alias = "next_poolID")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub next_pool_id: u32,
    /// Pools defines the list of pools.
    #[prost(message, repeated, tag = "3")]
    pub pools: ::prost::alloc::vec::Vec<Pool>,
}
/// QueryPoolByIdRequest is the request type for the Query/PoolById RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.pools.v1.QueryPoolByIdRequest")]
#[proto_query(
    path = "/milkyway.pools.v1.Query/PoolByID",
    response_type = QueryPoolResponse
)]
pub struct QueryPoolByIdRequest {
    /// PoolID is the ID of the pool to query
    #[prost(uint32, tag = "1")]
    #[serde(alias = "poolID")]
    #[serde(
        serialize_with = "crate::serde::as_str::serialize",
        deserialize_with = "crate::serde::as_str::deserialize"
    )]
    pub pool_id: u32,
}
/// QueryPoolByDenomRequest is the request type for the Query/PollByDenom RPC
/// method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.pools.v1.QueryPoolByDenomRequest")]
#[proto_query(
    path = "/milkyway.pools.v1.Query/PoolByDenom",
    response_type = QueryPoolResponse
)]
pub struct QueryPoolByDenomRequest {
    /// Denom is the denom for which the pool is to be queried
    #[prost(string, tag = "1")]
    pub denom: ::prost::alloc::string::String,
}
/// QueryPoolResponse is the response type for the Query/PoolById and
/// Query/PoolByDenom RPC methods.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.pools.v1.QueryPoolResponse")]
pub struct QueryPoolResponse {
    /// Pool is the queried pool
    #[prost(message, optional, tag = "1")]
    pub pool: ::core::option::Option<Pool>,
}
/// QueryPoolsRequest is the request type for the Query/Pools RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.pools.v1.QueryPoolsRequest")]
#[proto_query(
    path = "/milkyway.pools.v1.Query/Pools",
    response_type = QueryPoolsResponse
)]
pub struct QueryPoolsRequest {
    #[prost(message, optional, tag = "1")]
    pub pagination:
        ::core::option::Option<super::super::super::cosmos::base::query::v1beta1::PageRequest>,
}
/// QueryPoolsResponse is the response type for the Query/Pools RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    ::serde::Serialize,
    ::serde::Deserialize,
    ::schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/milkyway.pools.v1.QueryPoolsResponse")]
pub struct QueryPoolsResponse {
    /// Pools is the list of pool
    #[prost(message, repeated, tag = "1")]
    pub pools: ::prost::alloc::vec::Vec<Pool>,
    /// Pagination defines the pagination response
    #[prost(message, optional, tag = "2")]
    pub pagination:
        ::core::option::Option<super::super::super::cosmos::base::query::v1beta1::PageResponse>,
}
pub struct PoolsQuerier<'a, Q: cosmwasm_std::CustomQuery> {
    querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>,
}
impl<'a, Q: cosmwasm_std::CustomQuery> PoolsQuerier<'a, Q> {
    pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self {
        Self { querier }
    }
    pub fn pool_by_id(&self, pool_id: u32) -> Result<QueryPoolResponse, cosmwasm_std::StdError> {
        QueryPoolByIdRequest { pool_id }.query(self.querier)
    }
    pub fn pool_by_denom(
        &self,
        denom: ::prost::alloc::string::String,
    ) -> Result<QueryPoolResponse, cosmwasm_std::StdError> {
        QueryPoolByDenomRequest { denom }.query(self.querier)
    }
    pub fn pools(
        &self,
        pagination: ::core::option::Option<
            super::super::super::cosmos::base::query::v1beta1::PageRequest,
        >,
    ) -> Result<QueryPoolsResponse, cosmwasm_std::StdError> {
        QueryPoolsRequest { pagination }.query(self.querier)
    }
}
