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.stablestake.Debt")]
pub struct Debt {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub borrowed: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub interest_paid: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub interest_stacked: ::prost::alloc::string::String,
#[prost(uint64, tag = "5")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub borrow_time: u64,
#[prost(uint64, tag = "6")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub last_interest_calc_time: u64,
#[prost(uint64, tag = "7")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub last_interest_calc_block: u64,
}
#[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.stablestake.LegacyParams")]
pub struct LegacyParams {
#[prost(string, tag = "1")]
pub deposit_denom: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub redemption_rate: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub epoch_length: i64,
#[prost(string, tag = "4")]
pub interest_rate: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub interest_rate_max: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub interest_rate_min: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub interest_rate_increase: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub interest_rate_decrease: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub health_gain_factor: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub total_value: ::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.stablestake.Params")]
pub struct Params {
#[prost(string, tag = "1")]
pub deposit_denom: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub redemption_rate: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub epoch_length: i64,
#[prost(string, tag = "4")]
pub interest_rate: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub interest_rate_max: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub interest_rate_min: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub interest_rate_increase: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub interest_rate_decrease: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub health_gain_factor: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub total_value: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub max_leverage_ratio: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub max_withdraw_ratio: ::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.stablestake.BalanceBorrowed")]
pub struct BalanceBorrowed {
#[prost(string, tag = "1")]
pub usd_amount: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub percentage: ::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.stablestake.InterestBlock")]
pub struct InterestBlock {
#[prost(string, tag = "1")]
pub interest_rate: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub block_time: i64,
#[prost(uint64, tag = "3")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub block_height: u64,
}
#[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.stablestake.LegacyInterestBlock")]
pub struct LegacyInterestBlock {
#[prost(string, tag = "1")]
pub interest_rate: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub block_time: 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.stablestake.GenesisState")]
pub struct GenesisState {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
#[prost(message, repeated, tag = "2")]
pub debt_list: ::prost::alloc::vec::Vec<Debt>,
#[prost(message, repeated, tag = "3")]
pub interest_list: ::prost::alloc::vec::Vec<InterestBlock>,
}
#[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.stablestake.AmmPool")]
pub struct AmmPool {
#[prost(uint64, tag = "1")]
#[serde(alias = "ID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub id: u64,
#[prost(message, repeated, tag = "2")]
pub total_liabilities: ::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.stablestake.QueryParamsRequest")]
#[proto_query(
path = "/elys.stablestake.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.stablestake.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.stablestake.QueryAmmPoolRequest")]
#[proto_query(
path = "/elys.stablestake.Query/AmmPool",
response_type = QueryAmmPoolResponse
)]
pub struct QueryAmmPoolRequest {
#[prost(uint64, tag = "1")]
#[serde(alias = "ID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub id: u64,
}
#[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.stablestake.QueryAmmPoolResponse")]
pub struct QueryAmmPoolResponse {
#[prost(message, optional, tag = "1")]
pub amm_pool: ::core::option::Option<AmmPool>,
}
#[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.stablestake.QueryAllAmmPoolsRequest")]
#[proto_query(
path = "/elys.stablestake.Query/AllAmmPools",
response_type = QueryAllAmmPoolsResponse
)]
pub struct QueryAllAmmPoolsRequest {}
#[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.stablestake.QueryAllAmmPoolsResponse")]
pub struct QueryAllAmmPoolsResponse {
#[prost(message, repeated, tag = "1")]
pub amm_pools: ::prost::alloc::vec::Vec<AmmPool>,
}
#[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.stablestake.QueryBorrowRatioRequest")]
#[proto_query(
path = "/elys.stablestake.Query/BorrowRatio",
response_type = QueryBorrowRatioResponse
)]
pub struct QueryBorrowRatioRequest {}
#[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.stablestake.QueryBorrowRatioResponse")]
pub struct QueryBorrowRatioResponse {
#[prost(string, tag = "1")]
pub total_deposit: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub total_borrow: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub borrow_ratio: ::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.stablestake.MsgBond")]
pub struct MsgBond {
#[prost(string, tag = "1")]
pub creator: ::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.stablestake.MsgBondResponse")]
pub struct MsgBondResponse {}
#[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.stablestake.MsgUnbond")]
pub struct MsgUnbond {
#[prost(string, tag = "1")]
pub creator: ::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.stablestake.MsgUnbondResponse")]
pub struct MsgUnbondResponse {}
#[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.stablestake.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.stablestake.MsgUpdateParamsResponse")]
pub struct MsgUpdateParamsResponse {}
pub struct StablestakeQuerier<'a, Q: cosmwasm_std::CustomQuery> {
querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>,
}
impl<'a, Q: cosmwasm_std::CustomQuery> StablestakeQuerier<'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 borrow_ratio(&self) -> Result<QueryBorrowRatioResponse, cosmwasm_std::StdError> {
QueryBorrowRatioRequest {}.query(self.querier)
}
pub fn amm_pool(&self, id: u64) -> Result<QueryAmmPoolResponse, cosmwasm_std::StdError> {
QueryAmmPoolRequest { id }.query(self.querier)
}
pub fn all_amm_pools(&self) -> Result<QueryAllAmmPoolsResponse, cosmwasm_std::StdError> {
QueryAllAmmPoolsRequest {}.query(self.querier)
}
}