use elys_std_deriv::CosmwasmExt;
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.DexRewardsTracker")]
pub struct DexRewardsTracker {
#[prost(int64, tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub num_blocks: i64,
#[prost(string, tag = "2")]
pub amount: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.ElysStaked")]
pub struct ElysStaked {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub amount: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.IncentiveInfo")]
pub struct IncentiveInfo {
#[prost(string, tag = "1")]
pub eden_amount_per_year: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub blocks_distributed: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.LegacyParams")]
pub struct LegacyParams {
#[prost(message, optional, tag = "1")]
pub stake_incentives: ::core::option::Option<IncentiveInfo>,
#[prost(string, tag = "2")]
pub eden_commit_val: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub edenb_commit_val: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub max_eden_reward_apr_stakers: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub eden_boost_apr: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub dex_rewards_stakers: ::core::option::Option<DexRewardsTracker>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.Params")]
pub struct Params {
#[prost(message, optional, tag = "1")]
pub stake_incentives: ::core::option::Option<IncentiveInfo>,
#[prost(string, tag = "2")]
pub eden_commit_val: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub edenb_commit_val: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub max_eden_reward_apr_stakers: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub eden_boost_apr: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
#[serde(alias = "provider_vesting_epochIDentifier")]
pub provider_vesting_epoch_identifier: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub provider_staking_rewards_portion: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.GenesisState")]
pub struct GenesisState {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
#[prost(message, repeated, tag = "2")]
pub staking_snapshots: ::prost::alloc::vec::Vec<ElysStaked>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.QueryParamsRequest")]
#[proto_query(path = "/elys.estaking.Query/Params", response_type = QueryParamsResponse)]
pub struct QueryParamsRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.QueryParamsResponse")]
pub struct QueryParamsResponse {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.QueryRewardsRequest")]
#[proto_query(
path = "/elys.estaking.Query/Rewards",
response_type = QueryRewardsResponse
)]
pub struct QueryRewardsRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.DelegationDelegatorReward")]
pub struct DelegationDelegatorReward {
#[prost(string, tag = "1")]
pub validator_address: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub reward: ::prost::alloc::vec::Vec<super::super::cosmos::base::v1beta1::Coin>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.QueryRewardsResponse")]
pub struct QueryRewardsResponse {
#[prost(message, repeated, tag = "1")]
pub rewards: ::prost::alloc::vec::Vec<DelegationDelegatorReward>,
#[prost(message, repeated, tag = "2")]
pub total: ::prost::alloc::vec::Vec<super::super::cosmos::base::v1beta1::Coin>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.QueryInvariantRequest")]
#[proto_query(
path = "/elys.estaking.Query/Invariant",
response_type = QueryInvariantResponse
)]
pub struct QueryInvariantRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.QueryInvariantResponse")]
pub struct QueryInvariantResponse {
#[prost(string, tag = "1")]
pub total_bonded: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub bonded_validator_tokens_sum: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.MsgUpdateParams")]
pub struct MsgUpdateParams {
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub params: ::core::option::Option<Params>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.MsgUpdateParamsResponse")]
pub struct MsgUpdateParamsResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.MsgWithdrawReward")]
pub struct MsgWithdrawReward {
#[prost(string, tag = "1")]
pub delegator_address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub validator_address: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.MsgWithdrawRewardResponse")]
pub struct MsgWithdrawRewardResponse {
#[prost(message, repeated, tag = "1")]
pub amount: ::prost::alloc::vec::Vec<super::super::cosmos::base::v1beta1::Coin>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.MsgWithdrawElysStakingRewards")]
pub struct MsgWithdrawElysStakingRewards {
#[prost(string, tag = "1")]
pub delegator_address: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.MsgWithdrawElysStakingRewardsResponse")]
pub struct MsgWithdrawElysStakingRewardsResponse {
#[prost(message, repeated, tag = "1")]
pub amount: ::prost::alloc::vec::Vec<super::super::cosmos::base::v1beta1::Coin>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.MsgWithdrawAllRewards")]
pub struct MsgWithdrawAllRewards {
#[prost(string, tag = "1")]
pub delegator_address: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.estaking.MsgWithdrawAllRewardsResponse")]
pub struct MsgWithdrawAllRewardsResponse {
#[prost(message, repeated, tag = "1")]
pub amount: ::prost::alloc::vec::Vec<super::super::cosmos::base::v1beta1::Coin>,
}
pub struct EstakingQuerier<'a, Q: cosmwasm_std::CustomQuery> {
querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>,
}
impl<'a, Q: cosmwasm_std::CustomQuery> EstakingQuerier<'a, Q> {
pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self {
Self { querier }
}
pub fn params(&self) -> Result<QueryParamsResponse, cosmwasm_std::StdError> {
QueryParamsRequest {}.query(self.querier)
}
pub fn rewards(
&self,
address: ::prost::alloc::string::String,
) -> Result<QueryRewardsResponse, cosmwasm_std::StdError> {
QueryRewardsRequest { address }.query(self.querier)
}
pub fn invariant(&self) -> Result<QueryInvariantResponse, cosmwasm_std::StdError> {
QueryInvariantRequest {}.query(self.querier)
}
}