diff --git a/packages/neutron-std/src/types/NEUTRON_COMMIT b/packages/neutron-std/src/types/NEUTRON_COMMIT index 88d050b..72d857e 100644 --- a/packages/neutron-std/src/types/NEUTRON_COMMIT +++ b/packages/neutron-std/src/types/NEUTRON_COMMIT @@ -1 +1 @@ -main \ No newline at end of file +chore/ics-v6 \ No newline at end of file diff --git a/packages/neutron-std/src/types/connect/abci/mod.rs b/packages/neutron-std/src/types/connect/abci/mod.rs new file mode 100644 index 0000000..7083bd8 --- /dev/null +++ b/packages/neutron-std/src/types/connect/abci/mod.rs @@ -0,0 +1 @@ +pub mod v2; diff --git a/packages/neutron-std/src/types/slinky/abci/v1.rs b/packages/neutron-std/src/types/connect/abci/v2.rs similarity index 91% rename from packages/neutron-std/src/types/slinky/abci/v1.rs rename to packages/neutron-std/src/types/connect/abci/v2.rs index cdf80f5..f0d295b 100644 --- a/packages/neutron-std/src/types/slinky/abci/v1.rs +++ b/packages/neutron-std/src/types/connect/abci/v2.rs @@ -11,7 +11,7 @@ use neutron_std_derive::CosmwasmExt; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.abci.v1.OracleVoteExtension")] +#[proto_message(type_url = "/connect.abci.v2.OracleVoteExtension")] pub struct OracleVoteExtension { /// Prices defines a map of id(CurrencyPair) -> price.Bytes() . i.e. 1 -> /// 0x123.. (bytes). Notice the `id` function is determined by the diff --git a/packages/neutron-std/src/types/slinky/marketmap/mod.rs b/packages/neutron-std/src/types/connect/marketmap/mod.rs similarity index 57% rename from packages/neutron-std/src/types/slinky/marketmap/mod.rs rename to packages/neutron-std/src/types/connect/marketmap/mod.rs index a8429e3..dc7e178 100644 --- a/packages/neutron-std/src/types/slinky/marketmap/mod.rs +++ b/packages/neutron-std/src/types/connect/marketmap/mod.rs @@ -1,2 +1,2 @@ pub mod module; -pub mod v1; +pub mod v2; diff --git a/packages/neutron-std/src/types/connect/marketmap/module/mod.rs b/packages/neutron-std/src/types/connect/marketmap/module/mod.rs new file mode 100644 index 0000000..7083bd8 --- /dev/null +++ b/packages/neutron-std/src/types/connect/marketmap/module/mod.rs @@ -0,0 +1 @@ +pub mod v2; diff --git a/packages/neutron-std/src/types/slinky/marketmap/module/v1.rs b/packages/neutron-std/src/types/connect/marketmap/module/v2.rs similarity index 92% rename from packages/neutron-std/src/types/slinky/marketmap/module/v1.rs rename to packages/neutron-std/src/types/connect/marketmap/module/v2.rs index c6f0e95..075cebc 100644 --- a/packages/neutron-std/src/types/slinky/marketmap/module/v1.rs +++ b/packages/neutron-std/src/types/connect/marketmap/module/v2.rs @@ -11,7 +11,7 @@ use neutron_std_derive::CosmwasmExt; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.module.v1.Module")] +#[proto_message(type_url = "/connect.marketmap.module.v2.Module")] pub struct Module { /// Authority defines the custom module authority. If not set, defaults to the /// governance module. diff --git a/packages/neutron-std/src/types/slinky/marketmap/v1.rs b/packages/neutron-std/src/types/connect/marketmap/v2.rs similarity index 82% rename from packages/neutron-std/src/types/slinky/marketmap/v1.rs rename to packages/neutron-std/src/types/connect/marketmap/v2.rs index 3664e92..bdfccc9 100644 --- a/packages/neutron-std/src/types/slinky/marketmap/v1.rs +++ b/packages/neutron-std/src/types/connect/marketmap/v2.rs @@ -11,7 +11,7 @@ use neutron_std_derive::CosmwasmExt; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.Market")] +#[proto_message(type_url = "/connect.marketmap.v2.Market")] pub struct Market { /// Ticker represents a price feed for a given asset pair i.e. BTC/USD. The /// price feed is scaled to a number of decimal places and has a minimum number @@ -36,11 +36,11 @@ pub struct Market { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.Ticker")] +#[proto_message(type_url = "/connect.marketmap.v2.Ticker")] pub struct Ticker { /// CurrencyPair is the currency pair for this ticker. #[prost(message, optional, tag = "1")] - pub currency_pair: ::core::option::Option, + pub currency_pair: ::core::option::Option, /// Decimals is the number of decimal places for the ticker. The number of /// decimal places is used to convert the price to a human-readable format. #[prost(uint64, tag = "2")] @@ -77,7 +77,7 @@ pub struct Ticker { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.ProviderConfig")] +#[proto_message(type_url = "/connect.marketmap.v2.ProviderConfig")] pub struct ProviderConfig { /// Name corresponds to the name of the provider for which the configuration is /// being set. @@ -93,7 +93,7 @@ pub struct ProviderConfig { /// using: OffChainTicker = BTC/USDT NormalizeByPair = USDT/USD This field is /// optional and nullable. #[prost(message, optional, tag = "3")] - pub normalize_by_pair: ::core::option::Option, + pub normalize_by_pair: ::core::option::Option, /// Invert is a boolean indicating if the BASE and QUOTE of the market should /// be inverted. i.e. BASE -> QUOTE, QUOTE -> BASE #[prost(bool, tag = "4")] @@ -115,7 +115,7 @@ pub struct ProviderConfig { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MarketMap")] +#[proto_message(type_url = "/connect.marketmap.v2.MarketMap")] pub struct MarketMap { /// Markets is the full list of tickers and their associated configurations /// to be stored on-chain. @@ -134,7 +134,7 @@ pub struct MarketMap { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.Params")] +#[proto_message(type_url = "/connect.marketmap.v2.Params")] pub struct Params { /// MarketAuthorities is the list of authority accounts that are able to /// control updating the marketmap. @@ -157,7 +157,7 @@ pub struct Params { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.GenesisState")] +#[proto_message(type_url = "/connect.marketmap.v2.GenesisState")] pub struct GenesisState { /// MarketMap defines the global set of market configurations for all providers /// and markets. @@ -189,9 +189,9 @@ pub struct GenesisState { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MarketMapRequest")] +#[proto_message(type_url = "/connect.marketmap.v2.MarketMapRequest")] #[proto_query( - path = "/slinky.marketmap.v1.Query/MarketMap", + path = "/connect.marketmap.v2.Query/MarketMap", response_type = MarketMapResponse )] pub struct MarketMapRequest {} @@ -207,7 +207,7 @@ pub struct MarketMapRequest {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MarketMapResponse")] +#[proto_message(type_url = "/connect.marketmap.v2.MarketMapResponse")] pub struct MarketMapResponse { /// MarketMap defines the global set of market configurations for all providers /// and markets. @@ -240,16 +240,16 @@ pub struct MarketMapResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MarketRequest")] +#[proto_message(type_url = "/connect.marketmap.v2.MarketRequest")] #[proto_query( - path = "/slinky.marketmap.v1.Query/Market", + path = "/connect.marketmap.v2.Query/Market", response_type = MarketResponse )] pub struct MarketRequest { /// CurrencyPair is the currency pair associated with the market being /// requested. #[prost(message, optional, tag = "1")] - pub currency_pair: ::core::option::Option, + pub currency_pair: ::core::option::Option, } /// MarketResponse is the query response for the Market query. #[allow(clippy::derive_partial_eq_without_eq)] @@ -263,7 +263,7 @@ pub struct MarketRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MarketResponse")] +#[proto_message(type_url = "/connect.marketmap.v2.MarketResponse")] pub struct MarketResponse { /// Market is the configuration of a single market to be price-fetched for. #[prost(message, optional, tag = "1")] @@ -281,9 +281,9 @@ pub struct MarketResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.ParamsRequest")] +#[proto_message(type_url = "/connect.marketmap.v2.ParamsRequest")] #[proto_query( - path = "/slinky.marketmap.v1.Query/Params", + path = "/connect.marketmap.v2.Query/Params", response_type = ParamsResponse )] pub struct ParamsRequest {} @@ -299,7 +299,7 @@ pub struct ParamsRequest {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.ParamsResponse")] +#[proto_message(type_url = "/connect.marketmap.v2.ParamsResponse")] pub struct ParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, @@ -317,9 +317,9 @@ pub struct ParamsResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.LastUpdatedRequest")] +#[proto_message(type_url = "/connect.marketmap.v2.LastUpdatedRequest")] #[proto_query( - path = "/slinky.marketmap.v1.Query/LastUpdated", + path = "/connect.marketmap.v2.Query/LastUpdated", response_type = LastUpdatedResponse )] pub struct LastUpdatedRequest {} @@ -336,7 +336,7 @@ pub struct LastUpdatedRequest {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.LastUpdatedResponse")] +#[proto_message(type_url = "/connect.marketmap.v2.LastUpdatedResponse")] pub struct LastUpdatedResponse { #[prost(uint64, tag = "1")] #[serde( @@ -345,6 +345,51 @@ pub struct LastUpdatedResponse { )] pub last_updated: u64, } +/// MsgUpsertMarkets defines a message carrying a payload for performing market +/// upserts (update or create if does not exist) in the x/marketmap 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 = "/connect.marketmap.v2.MsgUpsertMarkets")] +pub struct MsgUpsertMarkets { + /// Authority is the signer of this transaction. This authority must be + /// authorized by the module to execute the message. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// CreateMarkets is the list of all markets to be created for the given + /// transaction. + #[prost(message, repeated, tag = "2")] + pub markets: ::prost::alloc::vec::Vec, +} +/// MsgUpsertMarketsResponse is the response from the UpsertMarkets API in the +/// x/marketmap 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 = "/connect.marketmap.v2.MsgUpsertMarketsResponse")] +pub struct MsgUpsertMarketsResponse { + /// UpdatedMarkets is a map between the ticker and whether the market was + /// updated. + /// Deprecated: This field will be empty in all responses. + #[prost(map = "string, bool", tag = "1")] + pub market_updates: ::std::collections::HashMap<::prost::alloc::string::String, bool>, +} /// MsgCreateMarkets defines a message carrying a payload for creating markets in /// the x/marketmap module. #[allow(clippy::derive_partial_eq_without_eq)] @@ -358,7 +403,7 @@ pub struct LastUpdatedResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MsgCreateMarkets")] +#[proto_message(type_url = "/connect.marketmap.v2.MsgCreateMarkets")] pub struct MsgCreateMarkets { /// Authority is the signer of this transaction. This authority must be /// authorized by the module to execute the message. @@ -381,7 +426,7 @@ pub struct MsgCreateMarkets { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MsgCreateMarketsResponse")] +#[proto_message(type_url = "/connect.marketmap.v2.MsgCreateMarketsResponse")] pub struct MsgCreateMarketsResponse {} /// MsgUpdateMarkets defines a message carrying a payload for updating the /// x/marketmap module. @@ -396,7 +441,7 @@ pub struct MsgCreateMarketsResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MsgUpdateMarkets")] +#[proto_message(type_url = "/connect.marketmap.v2.MsgUpdateMarkets")] pub struct MsgUpdateMarkets { /// Authority is the signer of this transaction. This authority must be /// authorized by the module to execute the message. @@ -419,7 +464,7 @@ pub struct MsgUpdateMarkets { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MsgUpdateMarketsResponse")] +#[proto_message(type_url = "/connect.marketmap.v2.MsgUpdateMarketsResponse")] pub struct MsgUpdateMarketsResponse {} /// MsgParams defines the Msg/Params request type. It contains the /// new parameters for the x/marketmap module. @@ -434,7 +479,7 @@ pub struct MsgUpdateMarketsResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MsgParams")] +#[proto_message(type_url = "/connect.marketmap.v2.MsgParams")] pub struct MsgParams { /// Params defines the new parameters for the x/marketmap module. #[prost(message, optional, tag = "1")] @@ -456,7 +501,7 @@ pub struct MsgParams { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MsgParamsResponse")] +#[proto_message(type_url = "/connect.marketmap.v2.MsgParamsResponse")] pub struct MsgParamsResponse {} /// MsgRemoveMarketAuthorities defines the Msg/RemoveMarketAuthoritiesResponse /// request type. It contains the new addresses to remove from the list of @@ -472,7 +517,7 @@ pub struct MsgParamsResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MsgRemoveMarketAuthorities")] +#[proto_message(type_url = "/connect.marketmap.v2.MsgRemoveMarketAuthorities")] pub struct MsgRemoveMarketAuthorities { /// RemoveAddresses is the list of addresses to remove. #[prost(string, repeated, tag = "1")] @@ -495,7 +540,7 @@ pub struct MsgRemoveMarketAuthorities { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse")] +#[proto_message(type_url = "/connect.marketmap.v2.MsgRemoveMarketAuthoritiesResponse")] pub struct MsgRemoveMarketAuthoritiesResponse {} pub struct MarketmapQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, @@ -509,7 +554,7 @@ impl<'a, Q: cosmwasm_std::CustomQuery> MarketmapQuerier<'a, Q> { } pub fn market( &self, - currency_pair: ::core::option::Option, + currency_pair: ::core::option::Option, ) -> Result { MarketRequest { currency_pair }.query(self.querier) } diff --git a/packages/neutron-std/src/types/slinky/mod.rs b/packages/neutron-std/src/types/connect/mod.rs similarity index 62% rename from packages/neutron-std/src/types/slinky/mod.rs rename to packages/neutron-std/src/types/connect/mod.rs index a4651ea..43e6628 100644 --- a/packages/neutron-std/src/types/slinky/mod.rs +++ b/packages/neutron-std/src/types/connect/mod.rs @@ -1,8 +1,5 @@ pub mod abci; -pub mod alerts; -pub mod incentives; pub mod marketmap; pub mod oracle; pub mod service; -pub mod sla; pub mod types; diff --git a/packages/neutron-std/src/types/slinky/incentives/mod.rs b/packages/neutron-std/src/types/connect/oracle/mod.rs similarity index 57% rename from packages/neutron-std/src/types/slinky/incentives/mod.rs rename to packages/neutron-std/src/types/connect/oracle/mod.rs index a8429e3..dc7e178 100644 --- a/packages/neutron-std/src/types/slinky/incentives/mod.rs +++ b/packages/neutron-std/src/types/connect/oracle/mod.rs @@ -1,2 +1,2 @@ pub mod module; -pub mod v1; +pub mod v2; diff --git a/packages/neutron-std/src/types/connect/oracle/module/mod.rs b/packages/neutron-std/src/types/connect/oracle/module/mod.rs new file mode 100644 index 0000000..7083bd8 --- /dev/null +++ b/packages/neutron-std/src/types/connect/oracle/module/mod.rs @@ -0,0 +1 @@ +pub mod v2; diff --git a/packages/neutron-std/src/types/slinky/oracle/module/v1.rs b/packages/neutron-std/src/types/connect/oracle/module/v2.rs similarity index 89% rename from packages/neutron-std/src/types/slinky/oracle/module/v1.rs rename to packages/neutron-std/src/types/connect/oracle/module/v2.rs index 9c8d5f6..825fda2 100644 --- a/packages/neutron-std/src/types/slinky/oracle/module/v1.rs +++ b/packages/neutron-std/src/types/connect/oracle/module/v2.rs @@ -11,7 +11,7 @@ use neutron_std_derive::CosmwasmExt; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.module.v1.Module")] +#[proto_message(type_url = "/connect.oracle.module.v2.Module")] pub struct Module { /// Authority defines the custom module authority. If not set, defaults to the /// governance module. diff --git a/packages/neutron-std/src/types/slinky/oracle/v1.rs b/packages/neutron-std/src/types/connect/oracle/v2.rs similarity index 87% rename from packages/neutron-std/src/types/slinky/oracle/v1.rs rename to packages/neutron-std/src/types/connect/oracle/v2.rs index c508ed4..4095707 100644 --- a/packages/neutron-std/src/types/slinky/oracle/v1.rs +++ b/packages/neutron-std/src/types/connect/oracle/v2.rs @@ -12,7 +12,7 @@ use neutron_std_derive::CosmwasmExt; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.QuotePrice")] +#[proto_message(type_url = "/connect.oracle.v2.QuotePrice")] pub struct QuotePrice { #[prost(string, tag = "1")] pub price: ::prost::alloc::string::String, @@ -42,7 +42,7 @@ pub struct QuotePrice { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.CurrencyPairState")] +#[proto_message(type_url = "/connect.oracle.v2.CurrencyPairState")] pub struct CurrencyPairState { /// QuotePrice is the latest price for a currency-pair, notice this value can /// be null in the case that no price exists for the currency-pair @@ -77,11 +77,11 @@ pub struct CurrencyPairState { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.CurrencyPairGenesis")] +#[proto_message(type_url = "/connect.oracle.v2.CurrencyPairGenesis")] pub struct CurrencyPairGenesis { /// The CurrencyPair to be added to module state #[prost(message, optional, tag = "1")] - pub currency_pair: ::core::option::Option, + pub currency_pair: ::core::option::Option, /// A genesis price if one exists (note this will be empty, unless it results /// from forking the state of this module) #[prost(message, optional, tag = "2")] @@ -116,7 +116,7 @@ pub struct CurrencyPairGenesis { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.GenesisState")] +#[proto_message(type_url = "/connect.oracle.v2.GenesisState")] pub struct GenesisState { /// CurrencyPairGenesis is the set of CurrencyPairGeneses for the module. I.e /// the starting set of CurrencyPairs for the module + information regarding @@ -143,9 +143,9 @@ pub struct GenesisState { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.GetAllCurrencyPairsRequest")] +#[proto_message(type_url = "/connect.oracle.v2.GetAllCurrencyPairsRequest")] #[proto_query( - path = "/slinky.oracle.v1.Query/GetAllCurrencyPairs", + path = "/connect.oracle.v2.Query/GetAllCurrencyPairs", response_type = GetAllCurrencyPairsResponse )] pub struct GetAllCurrencyPairsRequest {} @@ -162,12 +162,12 @@ pub struct GetAllCurrencyPairsRequest {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.GetAllCurrencyPairsResponse")] +#[proto_message(type_url = "/connect.oracle.v2.GetAllCurrencyPairsResponse")] pub struct GetAllCurrencyPairsResponse { #[prost(message, repeated, tag = "1")] - pub currency_pairs: ::prost::alloc::vec::Vec, + pub currency_pairs: ::prost::alloc::vec::Vec, } -/// GetPriceRequest either takes a CurrencyPair, or an identifier for the +/// GetPriceRequest takes an identifier for the /// CurrencyPair in the format base/quote. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -180,15 +180,15 @@ pub struct GetAllCurrencyPairsResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.GetPriceRequest")] +#[proto_message(type_url = "/connect.oracle.v2.GetPriceRequest")] #[proto_query( - path = "/slinky.oracle.v1.Query/GetPrice", + path = "/connect.oracle.v2.Query/GetPrice", response_type = GetPriceResponse )] pub struct GetPriceRequest { /// CurrencyPair represents the pair that the user wishes to query. - #[prost(message, optional, tag = "1")] - pub currency_pair: ::core::option::Option, + #[prost(string, tag = "1")] + pub currency_pair: ::prost::alloc::string::String, } /// GetPriceResponse is the response from the GetPrice grpc method exposed from /// the x/oracle query service. @@ -203,7 +203,7 @@ pub struct GetPriceRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.GetPriceResponse")] +#[proto_message(type_url = "/connect.oracle.v2.GetPriceResponse")] pub struct GetPriceResponse { /// QuotePrice represents the quote-price for the CurrencyPair given in /// GetPriceRequest (possibly nil if no update has been made) @@ -217,8 +217,7 @@ pub struct GetPriceResponse { )] pub nonce: u64, /// decimals represents the number of decimals that the quote-price is - /// represented in. For Pairs where ETHEREUM is the quote this will be 18, - /// otherwise it will be 8. + /// represented in. It is used to scale the QuotePrice to its proper value. #[prost(uint64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -247,9 +246,9 @@ pub struct GetPriceResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.GetPricesRequest")] +#[proto_message(type_url = "/connect.oracle.v2.GetPricesRequest")] #[proto_query( - path = "/slinky.oracle.v1.Query/GetPrices", + path = "/connect.oracle.v2.Query/GetPrices", response_type = GetPricesResponse )] pub struct GetPricesRequest { @@ -270,7 +269,7 @@ pub struct GetPricesRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.GetPricesResponse")] +#[proto_message(type_url = "/connect.oracle.v2.GetPricesResponse")] pub struct GetPricesResponse { #[prost(message, repeated, tag = "1")] pub prices: ::prost::alloc::vec::Vec, @@ -287,9 +286,9 @@ pub struct GetPricesResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.GetCurrencyPairMappingRequest")] +#[proto_message(type_url = "/connect.oracle.v2.GetCurrencyPairMappingRequest")] #[proto_query( - path = "/slinky.oracle.v1.Query/GetCurrencyPairMapping", + path = "/connect.oracle.v2.Query/GetCurrencyPairMapping", response_type = GetCurrencyPairMappingResponse )] pub struct GetCurrencyPairMappingRequest {} @@ -305,13 +304,13 @@ pub struct GetCurrencyPairMappingRequest {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.GetCurrencyPairMappingResponse")] +#[proto_message(type_url = "/connect.oracle.v2.GetCurrencyPairMappingResponse")] pub struct GetCurrencyPairMappingResponse { /// currency_pair_mapping is a mapping of the id representing the currency pair /// to the currency pair itself. #[prost(map = "uint64, message", tag = "1")] pub currency_pair_mapping: - ::std::collections::HashMap, + ::std::collections::HashMap, } /// Given an authority + a set of CurrencyPairs, the x/oracle module will /// check to see that the authority has permissions to update the set of @@ -328,7 +327,7 @@ pub struct GetCurrencyPairMappingResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.MsgAddCurrencyPairs")] +#[proto_message(type_url = "/connect.oracle.v2.MsgAddCurrencyPairs")] pub struct MsgAddCurrencyPairs { /// authority is the address of the account that is authorized to update the /// x/oracle's CurrencyPairs @@ -337,7 +336,7 @@ pub struct MsgAddCurrencyPairs { /// set of CurrencyPairs to be added to the module (+ prices if they are to be /// set) #[prost(message, repeated, tag = "2")] - pub currency_pairs: ::prost::alloc::vec::Vec, + pub currency_pairs: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -350,7 +349,7 @@ pub struct MsgAddCurrencyPairs { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.MsgAddCurrencyPairsResponse")] +#[proto_message(type_url = "/connect.oracle.v2.MsgAddCurrencyPairsResponse")] pub struct MsgAddCurrencyPairsResponse {} /// Given an authority + a set of CurrencyPairIDs, the x/oracle module's message /// service will remove all of the CurrencyPairs identified by each @@ -368,7 +367,7 @@ pub struct MsgAddCurrencyPairsResponse {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.MsgRemoveCurrencyPairs")] +#[proto_message(type_url = "/connect.oracle.v2.MsgRemoveCurrencyPairs")] pub struct MsgRemoveCurrencyPairs { /// authority is the address of the account that is authorized to update the /// x/oracle's CurrencyPairs @@ -391,7 +390,7 @@ pub struct MsgRemoveCurrencyPairs { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.oracle.v1.MsgRemoveCurrencyPairsResponse")] +#[proto_message(type_url = "/connect.oracle.v2.MsgRemoveCurrencyPairsResponse")] pub struct MsgRemoveCurrencyPairsResponse {} pub struct OracleQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, @@ -407,7 +406,7 @@ impl<'a, Q: cosmwasm_std::CustomQuery> OracleQuerier<'a, Q> { } pub fn get_price( &self, - currency_pair: ::core::option::Option, + currency_pair: ::prost::alloc::string::String, ) -> Result { GetPriceRequest { currency_pair }.query(self.querier) } diff --git a/packages/neutron-std/src/types/connect/service/mod.rs b/packages/neutron-std/src/types/connect/service/mod.rs new file mode 100644 index 0000000..7083bd8 --- /dev/null +++ b/packages/neutron-std/src/types/connect/service/mod.rs @@ -0,0 +1 @@ +pub mod v2; diff --git a/packages/neutron-std/src/types/slinky/service/v1.rs b/packages/neutron-std/src/types/connect/service/v2.rs similarity index 52% rename from packages/neutron-std/src/types/slinky/service/v1.rs rename to packages/neutron-std/src/types/connect/service/v2.rs index 8088343..67854bd 100644 --- a/packages/neutron-std/src/types/slinky/service/v1.rs +++ b/packages/neutron-std/src/types/connect/service/v2.rs @@ -11,7 +11,7 @@ use neutron_std_derive::CosmwasmExt; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.service.v1.QueryPricesRequest")] +#[proto_message(type_url = "/connect.service.v2.QueryPricesRequest")] pub struct QueryPricesRequest {} /// QueryPricesResponse defines the response type for the Prices method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -25,14 +25,18 @@ pub struct QueryPricesRequest {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.service.v1.QueryPricesResponse")] +#[proto_message(type_url = "/connect.service.v2.QueryPricesResponse")] pub struct QueryPricesResponse { - /// prices defines the list of prices. + /// Prices defines the list of prices. #[prost(map = "string, string", tag = "1")] pub prices: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + /// Timestamp defines the timestamp of the prices. #[prost(message, optional, tag = "2")] pub timestamp: ::core::option::Option, + /// Version defines the version of the oracle service that provided the prices. + #[prost(string, tag = "3")] + pub version: ::prost::alloc::string::String, } /// QueryMarketMapRequest defines the request type for the MarketMap method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -46,7 +50,7 @@ pub struct QueryPricesResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.service.v1.QueryMarketMapRequest")] +#[proto_message(type_url = "/connect.service.v2.QueryMarketMapRequest")] pub struct QueryMarketMapRequest {} /// QueryMarketMapResponse defines the response type for the MarketMap method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -60,9 +64,41 @@ pub struct QueryMarketMapRequest {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.service.v1.QueryMarketMapResponse")] +#[proto_message(type_url = "/connect.service.v2.QueryMarketMapResponse")] pub struct QueryMarketMapResponse { - /// market_map defines the current market map configuration. + /// MarketMap defines the current market map configuration. #[prost(message, optional, tag = "1")] - pub market_map: ::core::option::Option, + pub market_map: ::core::option::Option, +} +/// QueryVersionRequest defines the request type for the Version 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 = "/connect.service.v2.QueryVersionRequest")] +pub struct QueryVersionRequest {} +/// QueryVersionResponse defines the response type for the Version 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 = "/connect.service.v2.QueryVersionResponse")] +pub struct QueryVersionResponse { + /// Version defines the current version of the oracle service. + #[prost(string, tag = "1")] + pub version: ::prost::alloc::string::String, } diff --git a/packages/neutron-std/src/types/connect/types/mod.rs b/packages/neutron-std/src/types/connect/types/mod.rs new file mode 100644 index 0000000..7083bd8 --- /dev/null +++ b/packages/neutron-std/src/types/connect/types/mod.rs @@ -0,0 +1 @@ +pub mod v2; diff --git a/packages/neutron-std/src/types/slinky/types/v1.rs b/packages/neutron-std/src/types/connect/types/v2.rs similarity index 90% rename from packages/neutron-std/src/types/slinky/types/v1.rs rename to packages/neutron-std/src/types/connect/types/v2.rs index 3dbc8f7..9c778a2 100644 --- a/packages/neutron-std/src/types/slinky/types/v1.rs +++ b/packages/neutron-std/src/types/connect/types/v2.rs @@ -12,7 +12,7 @@ use neutron_std_derive::CosmwasmExt; ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/slinky.types.v1.CurrencyPair")] +#[proto_message(type_url = "/connect.types.v2.CurrencyPair")] pub struct CurrencyPair { #[prost(string, tag = "1")] pub base: ::prost::alloc::string::String, diff --git a/packages/neutron-std/src/types/cosmos/ics23/v1.rs b/packages/neutron-std/src/types/cosmos/ics23/v1.rs index a6c6dcd..b3d47ff 100644 --- a/packages/neutron-std/src/types/cosmos/ics23/v1.rs +++ b/packages/neutron-std/src/types/cosmos/ics23/v1.rs @@ -259,6 +259,7 @@ pub struct ProofSpec { #[prost(message, optional, tag = "2")] pub inner_spec: ::core::option::Option, /// max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) + /// the max_depth is interpreted as 128 if set to 0 #[prost(int32, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -518,11 +519,14 @@ pub enum HashOp { NoHash = 0, Sha256 = 1, Sha512 = 2, - Keccak = 3, + Keccak256 = 3, Ripemd160 = 4, /// ripemd160(sha256(x)) Bitcoin = 5, Sha512256 = 6, + Blake2b512 = 7, + Blake2s256 = 8, + Blake3 = 9, } impl HashOp { /// String value of the enum field names used in the ProtoBuf definition. @@ -534,10 +538,13 @@ impl HashOp { HashOp::NoHash => "NO_HASH", HashOp::Sha256 => "SHA256", HashOp::Sha512 => "SHA512", - HashOp::Keccak => "KECCAK", + HashOp::Keccak256 => "KECCAK256", HashOp::Ripemd160 => "RIPEMD160", HashOp::Bitcoin => "BITCOIN", HashOp::Sha512256 => "SHA512_256", + HashOp::Blake2b512 => "BLAKE2B_512", + HashOp::Blake2s256 => "BLAKE2S_256", + HashOp::Blake3 => "BLAKE3", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -546,10 +553,13 @@ impl HashOp { "NO_HASH" => Some(Self::NoHash), "SHA256" => Some(Self::Sha256), "SHA512" => Some(Self::Sha512), - "KECCAK" => Some(Self::Keccak), + "KECCAK256" => Some(Self::Keccak256), "RIPEMD160" => Some(Self::Ripemd160), "BITCOIN" => Some(Self::Bitcoin), "SHA512_256" => Some(Self::Sha512256), + "BLAKE2B_512" => Some(Self::Blake2b512), + "BLAKE2S_256" => Some(Self::Blake2s256), + "BLAKE3" => Some(Self::Blake3), _ => None, } } diff --git a/packages/neutron-std/src/types/mod.rs b/packages/neutron-std/src/types/mod.rs index 9f2df66..51b5f03 100644 --- a/packages/neutron-std/src/types/mod.rs +++ b/packages/neutron-std/src/types/mod.rs @@ -1,4 +1,5 @@ pub mod capability; +pub mod connect; pub mod cosmos; pub mod cosmwasm; pub mod feemarket; @@ -6,5 +7,4 @@ pub mod gaia; pub mod ibc; pub mod neutron; pub mod osmosis; -pub mod slinky; pub mod tendermint; diff --git a/packages/neutron-std/src/types/slinky/abci/mod.rs b/packages/neutron-std/src/types/slinky/abci/mod.rs deleted file mode 100644 index a3a6d96..0000000 --- a/packages/neutron-std/src/types/slinky/abci/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/neutron-std/src/types/slinky/alerts/mod.rs b/packages/neutron-std/src/types/slinky/alerts/mod.rs deleted file mode 100644 index a8429e3..0000000 --- a/packages/neutron-std/src/types/slinky/alerts/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod module; -pub mod v1; diff --git a/packages/neutron-std/src/types/slinky/alerts/module/mod.rs b/packages/neutron-std/src/types/slinky/alerts/module/mod.rs deleted file mode 100644 index a3a6d96..0000000 --- a/packages/neutron-std/src/types/slinky/alerts/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/neutron-std/src/types/slinky/alerts/module/v1.rs b/packages/neutron-std/src/types/slinky/alerts/module/v1.rs deleted file mode 100644 index cf7303a..0000000 --- a/packages/neutron-std/src/types/slinky/alerts/module/v1.rs +++ /dev/null @@ -1,21 +0,0 @@ -use neutron_std_derive::CosmwasmExt; -/// Module is the config object of the alerts 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 = "/slinky.alerts.module.v1.Module")] -pub struct Module { - /// Authority defines the custom module authority. The authority will default - /// to the governance module account if not set. If the authority is set, the - /// address provided must be a valid bech-32 address - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, -} diff --git a/packages/neutron-std/src/types/slinky/alerts/v1.rs b/packages/neutron-std/src/types/slinky/alerts/v1.rs deleted file mode 100644 index 4a53cda..0000000 --- a/packages/neutron-std/src/types/slinky/alerts/v1.rs +++ /dev/null @@ -1,576 +0,0 @@ -use neutron_std_derive::CosmwasmExt; -/// Alert defines the basic meta-data necessary for the alerts module to resolve -/// a claim that the price of a CurrencyPair on-chain is deviating from the price -/// off-chain. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.Alert")] -pub struct Alert { - /// height represents the height for which the alert is filed. - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub height: u64, - /// signer is the signer of this alert, this is the address that will receive - /// the reward in the case of a positive conclusion, or whose bond will get - /// slashed in the event of a negative conclusion. - #[prost(string, tag = "2")] - pub signer: ::prost::alloc::string::String, - /// currency_pair is the currency-pair that this claim asserts is deviating - /// from the price off-chain. - #[prost(message, optional, tag = "3")] - pub currency_pair: ::core::option::Option, -} -/// AlertStatus contains the module specific state for an alert: Has the alert -/// been concluded? What height was the alert submitted, what height should the -/// alert be purged? -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.AlertStatus")] -pub struct AlertStatus { - /// ConclusionStatus determines whether the alert has been concluded. - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub conclusion_status: u64, - /// SubmissionHeight is the height that the alert was submitted in. - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub submission_height: u64, - /// SubmissionTimestamp is the block-timestamp of the block that the alert was - /// submitted in (as a UTC value in Unix time). - #[prost(uint64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub submission_timestamp: u64, - /// PurgeHeight is the height at which the alert should be purged. - #[prost(uint64, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub purge_height: u64, -} -/// AlertWithStatus represents a wrapper around the Alert and AlertStatus -/// objects, this is so that the module specific information about Alerts can be -/// packaged together. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.AlertWithStatus")] -pub struct AlertWithStatus { - /// alert is the alert that this status corresponds to. - #[prost(message, optional, tag = "1")] - pub alert: ::core::option::Option, - /// status is the status of the alert. - #[prost(message, optional, tag = "2")] - pub status: ::core::option::Option, -} -/// Signature is a container for a signer address mapped to a signature. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.Signature")] -pub struct Signature { - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub signature: ::prost::alloc::vec::Vec, -} -/// MultiSigConcluson defines a conclusion that is accompanied by a set of -/// signatures. The signature is defined over the alert UID, status, OracleData, -/// and PriceBound. The signatures are used to verify that the conclusion is -/// valid. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.MultiSigConclusion")] -pub struct MultiSigConclusion { - /// alert is the alert that this conclusion corresponds to. - #[prost(message, optional, tag = "1")] - pub alert: ::core::option::Option, - /// oracle_data is the oracle data that this conclusion references. - #[prost(message, optional, tag = "2")] - pub extended_commit_info: - ::core::option::Option, - /// signatures is a map of signer -> signature. Where the signature is over - /// Alert.UID, PriceBound, the marshalled ExtendedCommitInfo, and status. - #[prost(message, repeated, tag = "3")] - pub signatures: ::prost::alloc::vec::Vec, - /// price-bound is the price bound of the currency-pair off-chain for the - /// designated time-range. - #[prost(message, optional, tag = "4")] - pub price_bound: ::core::option::Option, - /// status is the status of the conclusion. - #[prost(bool, tag = "5")] - pub status: bool, - /// CurrencyPairID is the ID of the currency-pair that this conclusion - /// corresponds to. - #[prost(uint64, tag = "6")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub currency_pair_i_d: u64, -} -/// MultiSigConclusionVerificationParams defines the parameters necessary to -/// verify a MultiSigConclusion. It contains a map between signer and public key. -/// Notice, the public-key (value) are the base-64 encoded bytes of the public -/// key. And the signer (key) is the bech32 encoded address of the signer. -/// Notice, all public keys must be secp256 keys. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.MultiSigConclusionVerificationParams")] -pub struct MultiSigConclusionVerificationParams { - /// signers is a map of signer -> public key. - #[prost(message, repeated, tag = "1")] - pub signers: ::prost::alloc::vec::Vec, -} -/// PriceBound represents the bounds of the price of a currency-pair off chain -/// for a designated time-range -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.PriceBound")] -pub struct PriceBound { - #[prost(string, tag = "1")] - pub high: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub low: ::prost::alloc::string::String, -} -/// AlertParams is the set of parameters for the x/Alerts module's Alerting. It -/// defines whether or not Alerts can be submitted, and if so, the minimum -/// bond amount required to submit an Alert. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.AlertParams")] -pub struct AlertParams { - /// Enabled is a boolean defining whether or not Alerts can be submitted - /// to the module - #[prost(bool, tag = "1")] - pub enabled: bool, - /// BondAmount is the minimum amount of bond required to submit an - /// Alert - #[prost(message, optional, tag = "2")] - pub bond_amount: ::core::option::Option, - /// MaxBlockAge defines the maximum age of an Alert before it is pruned, notice - /// this is defined wrt. the height that the Alert references, i.e Alerts are - /// only relevant until Alert.Height + MaxBlockAge is reached. - #[prost(uint64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub max_block_age: u64, -} -/// PruningParams defines the criterion for pruning Alerts from the 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 = "/slinky.alerts.v1.PruningParams")] -pub struct PruningParams { - /// Enabled defines whether Alerts are to be pruned - #[prost(bool, tag = "1")] - pub enabled: bool, - /// BlocksToPrune defines the number of blocks until an Alert will be pruned - /// from state, notice this is defined wrt. the current block height, i.e - /// Alerts will be stored in state until current_height + BlocksToPrune is - /// reached. - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub blocks_to_prune: u64, -} -/// Params is the set of parameters for the x/Alerts 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 = "/slinky.alerts.v1.Params")] -pub struct Params { - /// AlertParams is the set of parameters for the x/Alerts module's Alerting. - #[prost(message, optional, tag = "1")] - pub alert_params: ::core::option::Option, - /// ConclusionVerificationParams is the set of parameters for the x/Alerts - /// module's conclusion verification. - #[prost(message, optional, tag = "2")] - pub conclusion_verification_params: ::core::option::Option, - /// PruningParams is the set of parameters for the x/Alerts module's pruning. - #[prost(message, optional, tag = "3")] - pub pruning_params: ::core::option::Option, -} -/// GenesisState is the state that must be provided at genesis. It contains -/// params for the module, and the set initial Alerts. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.GenesisState")] -pub struct GenesisState { - /// Params is the set of x/Alerts parameters - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, - /// Alerts is the set of Alerts that have been submitted to the module - #[prost(message, repeated, tag = "2")] - pub alerts: ::prost::alloc::vec::Vec, -} -/// AlertsRequest is the request type for the Query.Alerts RPC method, the status -/// field indicates whether the request should return only Unconcluded / -/// Concluded Alerts, or all Alerts. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.AlertsRequest")] -#[proto_query(path = "/slinky.alerts.v1.Query/Alerts", response_type = AlertsResponse)] -pub struct AlertsRequest { - #[prost(enumeration = "AlertStatusId", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub status: i32, -} -/// AlertsResponse is the response type for the Query.Alerts RPC method, it -/// contains the list of Alerts that are being tracked by the alerts 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 = "/slinky.alerts.v1.AlertsResponse")] -pub struct AlertsResponse { - #[prost(message, repeated, tag = "1")] - pub alerts: ::prost::alloc::vec::Vec, -} -/// ParamsRequest is the request type for the Query.Params 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 = "/slinky.alerts.v1.ParamsRequest")] -#[proto_query(path = "/slinky.alerts.v1.Query/Params", response_type = ParamsResponse)] -pub struct ParamsRequest {} -/// ParamsResponse is the response type for the Query.Params RPC method, it -/// contains the Params of the 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 = "/slinky.alerts.v1.ParamsResponse")] -pub struct ParamsResponse { - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -/// AlertStatus is the type for the status of an Alert, it can be Unconcluded or -/// Concluded. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] -pub enum AlertStatusId { - ConclusionStatusUnspecified = 0, - ConclusionStatusUnconcluded = 1, - ConclusionStatusConcluded = 2, -} -impl AlertStatusId { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - AlertStatusId::ConclusionStatusUnspecified => "CONCLUSION_STATUS_UNSPECIFIED", - AlertStatusId::ConclusionStatusUnconcluded => "CONCLUSION_STATUS_UNCONCLUDED", - AlertStatusId::ConclusionStatusConcluded => "CONCLUSION_STATUS_CONCLUDED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "CONCLUSION_STATUS_UNSPECIFIED" => Some(Self::ConclusionStatusUnspecified), - "CONCLUSION_STATUS_UNCONCLUDED" => Some(Self::ConclusionStatusUnconcluded), - "CONCLUSION_STATUS_CONCLUDED" => Some(Self::ConclusionStatusConcluded), - _ => None, - } - } -} -/// ValidatorAlertIncentive defines the incentive strategy to be executed for a -/// validator that has been confirmed to have at fault for an x/alerts alert. -/// This strategy is expected to slash half of the validator's stake. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.ValidatorAlertIncentive")] -pub struct ValidatorAlertIncentive { - /// The validator that has been confirmed to have been at fault for an alert. - #[prost(message, optional, tag = "1")] - pub validator: ::core::option::Option, - /// AlertSigner is the signer of the alert referenced by the conclusion that - /// created this incentive. - #[prost(string, tag = "2")] - pub alert_signer: ::prost::alloc::string::String, - /// AlertHeight is the height at which the infraction occurred - #[prost(uint64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub alert_height: u64, -} -/// MsgAlert defines a message to create an alert. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.MsgAlert")] -pub struct MsgAlert { - /// alert is the alert to be filed - #[prost(message, optional, tag = "1")] - pub alert: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.MsgAlertResponse")] -pub struct MsgAlertResponse {} -/// MsgConclusion defines a message carrying a Conclusion made by the SecondTier, -/// which will be used to close an alert. And trigger any ramifications of the -/// conclusion. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.MsgConclusion")] -pub struct MsgConclusion { - /// signer is the signer of this transaction (notice, this may not always be a - /// node from the SecondTier) - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// conclusion is the conclusion to be filed - #[prost(message, optional, tag = "2")] - pub conclusion: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.MsgConclusionResponse")] -pub struct MsgConclusionResponse {} -/// MsgUpdateParams defines the message type expected by the UpdateParams rpc. It -/// contains an authority address, and the new Params for the x/alerts 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 = "/slinky.alerts.v1.MsgUpdateParams")] -pub struct MsgUpdateParams { - /// authority is the address of the authority that is submitting the update - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params is the new set of parameters for the x/alerts module - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.alerts.v1.MsgUpdateParamsResponse")] -pub struct MsgUpdateParamsResponse {} -pub struct AlertsQuerier<'a, Q: cosmwasm_std::CustomQuery> { - querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, -} -impl<'a, Q: cosmwasm_std::CustomQuery> AlertsQuerier<'a, Q> { - pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { - Self { querier } - } - pub fn alerts(&self, status: i32) -> Result { - AlertsRequest { status }.query(self.querier) - } - pub fn params(&self) -> Result { - ParamsRequest {}.query(self.querier) - } -} diff --git a/packages/neutron-std/src/types/slinky/incentives/module/mod.rs b/packages/neutron-std/src/types/slinky/incentives/module/mod.rs deleted file mode 100644 index a3a6d96..0000000 --- a/packages/neutron-std/src/types/slinky/incentives/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/neutron-std/src/types/slinky/incentives/module/v1.rs b/packages/neutron-std/src/types/slinky/incentives/module/v1.rs deleted file mode 100644 index 33edfda..0000000 --- a/packages/neutron-std/src/types/slinky/incentives/module/v1.rs +++ /dev/null @@ -1,15 +0,0 @@ -use neutron_std_derive::CosmwasmExt; -/// Module is the config object of the incentives 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 = "/slinky.incentives.module.v1.Module")] -pub struct Module {} diff --git a/packages/neutron-std/src/types/slinky/incentives/v1.rs b/packages/neutron-std/src/types/slinky/incentives/v1.rs deleted file mode 100644 index 3753eb9..0000000 --- a/packages/neutron-std/src/types/slinky/incentives/v1.rs +++ /dev/null @@ -1,192 +0,0 @@ -use neutron_std_derive::CosmwasmExt; -/// BadPriceIncentive is a message that contains the information about a bad -/// price that was submitted by a validator. -/// -/// NOTE: This is an example of a bad price incentive. It is not used in -/// production. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.incentives.v1.BadPriceIncentive")] -pub struct BadPriceIncentive { - /// Validator is the address of the validator that submitted the bad price. - #[prost(string, tag = "1")] - pub validator: ::prost::alloc::string::String, - /// Amount is the amount to slash. - #[prost(string, tag = "2")] - pub amount: ::prost::alloc::string::String, -} -/// GoodPriceIncentive is a message that contains the information about a good -/// price that was submitted by a validator. -/// -/// NOTE: This is an example of a good price incentive. It is not used in -/// production. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.incentives.v1.GoodPriceIncentive")] -pub struct GoodPriceIncentive { - /// Validator is the address of the validator that submitted the good price. - #[prost(string, tag = "1")] - pub validator: ::prost::alloc::string::String, - /// Amount is the amount to reward. - #[prost(string, tag = "2")] - pub amount: ::prost::alloc::string::String, -} -/// GenesisState is the genesis-state for the x/incentives 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 = "/slinky.incentives.v1.GenesisState")] -pub struct GenesisState { - /// Registry is a list of incentives by type. The registry defined here - /// should be a subset of the incentive types defined in the incentive - /// module (keeper). - #[prost(message, repeated, tag = "1")] - pub registry: ::prost::alloc::vec::Vec, -} -/// IncentivesByType encapsulates a list of incentives by type. Each of the -/// entries here must correspond to the same incentive type defined here. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.incentives.v1.IncentivesByType")] -pub struct IncentivesByType { - /// IncentiveType is the incentive type i.e. (BadPriceIncentiveType, - /// GoodPriceIncentiveType). - #[prost(string, tag = "1")] - pub incentive_type: ::prost::alloc::string::String, - /// Entries is a list of incentive bytes. - #[prost(bytes = "vec", repeated, tag = "2")] - pub entries: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -/// GetIncentivesByTypeRequest is the request type for the -/// Query/GetIncentivesByType 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 = "/slinky.incentives.v1.GetIncentivesByTypeRequest")] -#[proto_query( - path = "/slinky.incentives.v1.Query/GetIncentivesByType", - response_type = GetIncentivesByTypeResponse -)] -pub struct GetIncentivesByTypeRequest { - /// IncentiveType is the incentive type i.e. (BadPriceIncentiveType, - /// GoodPriceIncentiveType). - #[prost(string, tag = "1")] - pub incentive_type: ::prost::alloc::string::String, -} -/// GetIncentivesByTypeResponse is the response type for the -/// Query/GetIncentivesByType 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 = "/slinky.incentives.v1.GetIncentivesByTypeResponse")] -pub struct GetIncentivesByTypeResponse { - /// Entries is the list of incentives of the given type. - #[prost(bytes = "vec", repeated, tag = "1")] - pub entries: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -/// GetAllIncentivesRequest is the request type for the Query/GetAllIncentives -/// 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 = "/slinky.incentives.v1.GetAllIncentivesRequest")] -#[proto_query( - path = "/slinky.incentives.v1.Query/GetAllIncentives", - response_type = GetAllIncentivesResponse -)] -pub struct GetAllIncentivesRequest {} -/// GetAllIncentivesResponse is the response type for the Query/GetAllIncentives -/// 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 = "/slinky.incentives.v1.GetAllIncentivesResponse")] -pub struct GetAllIncentivesResponse { - /// Registry is the list of all incentives, grouped by type. - #[prost(message, repeated, tag = "1")] - pub registry: ::prost::alloc::vec::Vec, -} -pub struct IncentivesQuerier<'a, Q: cosmwasm_std::CustomQuery> { - querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, -} -impl<'a, Q: cosmwasm_std::CustomQuery> IncentivesQuerier<'a, Q> { - pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { - Self { querier } - } - pub fn get_incentives_by_type( - &self, - incentive_type: ::prost::alloc::string::String, - ) -> Result { - GetIncentivesByTypeRequest { incentive_type }.query(self.querier) - } - pub fn get_all_incentives(&self) -> Result { - GetAllIncentivesRequest {}.query(self.querier) - } -} diff --git a/packages/neutron-std/src/types/slinky/marketmap/module/mod.rs b/packages/neutron-std/src/types/slinky/marketmap/module/mod.rs deleted file mode 100644 index a3a6d96..0000000 --- a/packages/neutron-std/src/types/slinky/marketmap/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/neutron-std/src/types/slinky/oracle/mod.rs b/packages/neutron-std/src/types/slinky/oracle/mod.rs deleted file mode 100644 index a8429e3..0000000 --- a/packages/neutron-std/src/types/slinky/oracle/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod module; -pub mod v1; diff --git a/packages/neutron-std/src/types/slinky/oracle/module/mod.rs b/packages/neutron-std/src/types/slinky/oracle/module/mod.rs deleted file mode 100644 index a3a6d96..0000000 --- a/packages/neutron-std/src/types/slinky/oracle/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/neutron-std/src/types/slinky/service/mod.rs b/packages/neutron-std/src/types/slinky/service/mod.rs deleted file mode 100644 index a3a6d96..0000000 --- a/packages/neutron-std/src/types/slinky/service/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/neutron-std/src/types/slinky/sla/mod.rs b/packages/neutron-std/src/types/slinky/sla/mod.rs deleted file mode 100644 index a8429e3..0000000 --- a/packages/neutron-std/src/types/slinky/sla/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod module; -pub mod v1; diff --git a/packages/neutron-std/src/types/slinky/sla/module/mod.rs b/packages/neutron-std/src/types/slinky/sla/module/mod.rs deleted file mode 100644 index a3a6d96..0000000 --- a/packages/neutron-std/src/types/slinky/sla/module/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/neutron-std/src/types/slinky/sla/module/v1.rs b/packages/neutron-std/src/types/slinky/sla/module/v1.rs deleted file mode 100644 index 084d0dc..0000000 --- a/packages/neutron-std/src/types/slinky/sla/module/v1.rs +++ /dev/null @@ -1,20 +0,0 @@ -use neutron_std_derive::CosmwasmExt; -/// Module is the config object of the builder 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 = "/slinky.sla.module.v1.Module")] -pub struct Module { - /// Authority defines the custom module authority. If not set, defaults to the - /// governance module. - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, -} diff --git a/packages/neutron-std/src/types/slinky/sla/v1.rs b/packages/neutron-std/src/types/slinky/sla/v1.rs deleted file mode 100644 index c6f261f..0000000 --- a/packages/neutron-std/src/types/slinky/sla/v1.rs +++ /dev/null @@ -1,396 +0,0 @@ -use neutron_std_derive::CosmwasmExt; -/// GenesisState defines the sla 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 = "/slinky.sla.v1.GenesisState")] -pub struct GenesisState { - /// SLAs are the SLAs that are currently active. - #[prost(message, repeated, tag = "1")] - pub slas: ::prost::alloc::vec::Vec, - /// PrceFeeds are the price feeds that are currently active. - #[prost(message, repeated, tag = "2")] - pub price_feeds: ::prost::alloc::vec::Vec, - /// Params are the parameters for the sla module. - #[prost(message, optional, tag = "3")] - pub params: ::core::option::Option, -} -/// Params defines the parameters for the sla 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 = "/slinky.sla.v1.Params")] -pub struct Params { - /// Enabled is a flag to enable or disable the sla module. - #[prost(bool, tag = "1")] - pub enabled: bool, -} -/// PriceFeedSLA defines the the desired SLA for a given set of price feeds. A -/// price feed is defined to be a set of price prices for the same (currency -/// pair, validator). -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.sla.v1.PriceFeedSLA")] -pub struct PriceFeedSla { - /// MaximumViableWindow is the maximum time window that we are interested - /// for the SLA. This is used to determine the moving window of blocks that - /// we are interested in. - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub maximum_viable_window: u64, - /// ExpectedUptime is the expected uptime for the given validator and price - /// feed. - #[prost(string, tag = "2")] - pub expected_uptime: ::prost::alloc::string::String, - /// SlashConstant is the constant by which we will multiply the deviation from - /// the expected uptime. - #[prost(string, tag = "3")] - pub slash_constant: ::prost::alloc::string::String, - /// MinimumBlockUpdates is the minimum number of blocks that the - /// validator had to have voted on in the maximum viable window - /// in order to be considered for the SLA. - #[prost(uint64, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub minimum_block_updates: u64, - /// Frequency is the frequency at which we will check the SLA. - #[prost(uint64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub frequency: u64, - /// ID is the unique identifier for the SLA. - #[prost(string, tag = "6")] - #[serde(alias = "ID")] - pub id: ::prost::alloc::string::String, -} -/// PriceFeed defines the object type that will be utilized to monitor how -/// frequently validators are voting with price updates across the network. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.sla.v1.PriceFeed")] -pub struct PriceFeed { - /// UpdateMap represents the relevant moving window of price feed updates. - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub update_map: ::prost::alloc::vec::Vec, - /// InclusionMap represents the relevant moving window of blocks that the - /// validator has voted on. - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub inclusion_map: ::prost::alloc::vec::Vec, - /// Index corresponds to the current index into the bitmap. - #[prost(uint64, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub index: u64, - /// Validator represents the validator that this SLA corresponds to. - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub validator: ::prost::alloc::vec::Vec, - /// CurrencyPair represents the currency pair that this SLA corresponds to. - #[prost(message, optional, tag = "5")] - pub currency_pair: ::core::option::Option, - /// MaximumViableWindow represents the maximum number of blocks that can be - /// represented by the bit map. - #[prost(uint64, tag = "6")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub maximum_viable_window: u64, - /// ID corresponds to the SLA ID that this price feed corresponds to. - #[prost(string, tag = "7")] - #[serde(alias = "ID")] - pub id: ::prost::alloc::string::String, -} -/// QueryAllSLAsRequest is the request type for the Query/GetAllSLAs 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 = "/slinky.sla.v1.GetAllSLAsRequest")] -#[proto_query( - path = "/slinky.sla.v1.Query/GetAllSLAs", - response_type = GetAllSlAsResponse -)] -pub struct GetAllSlAsRequest {} -/// QueryAllSLAsResponse is the response type for the Query/GetAllSLAs 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 = "/slinky.sla.v1.GetAllSLAsResponse")] -pub struct GetAllSlAsResponse { - #[prost(message, repeated, tag = "1")] - pub slas: ::prost::alloc::vec::Vec, -} -/// QueryGetPriceFeedsRequest is the request type for the Query/GetPriceFeeds 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 = "/slinky.sla.v1.GetPriceFeedsRequest")] -#[proto_query( - path = "/slinky.sla.v1.Query/GetPriceFeeds", - response_type = GetPriceFeedsResponse -)] -pub struct GetPriceFeedsRequest { - /// ID defines the SLA to query price feeds for. - #[prost(string, tag = "1")] - #[serde(alias = "ID")] - pub id: ::prost::alloc::string::String, -} -/// QueryGetPriceFeedsResponse is the response type for the Query/GetPriceFeeds -/// 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 = "/slinky.sla.v1.GetPriceFeedsResponse")] -pub struct GetPriceFeedsResponse { - /// PriceFeeds defines the price feeds for the given SLA. - #[prost(message, repeated, tag = "1")] - pub price_feeds: ::prost::alloc::vec::Vec, -} -/// QueryParamsRequest is the request type for the Query/Params 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 = "/slinky.sla.v1.ParamsRequest")] -#[proto_query(path = "/slinky.sla.v1.Query/Params", response_type = ParamsResponse)] -pub struct ParamsRequest {} -/// QueryParamsResponse is the response type for the Query/Params 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 = "/slinky.sla.v1.ParamsResponse")] -pub struct ParamsResponse { - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -/// MsgAddSLAs defines the Msg/AddSLAs request type. It contains the -/// SLAs to be added to the store. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.sla.v1.MsgAddSLAs")] -pub struct MsgAddSlAs { - /// SLAs defines the SLAs to be added to the store. - #[prost(message, repeated, tag = "1")] - pub slas: ::prost::alloc::vec::Vec, - /// Authority defines the authority that is adding the SLAs. - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, -} -/// MsgAddSLAsResponse defines the Msg/AddSLAs response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.sla.v1.MsgAddSLAsResponse")] -pub struct MsgAddSlAsResponse {} -/// MsgRemoveSLAs defines the Msg/RemoveSLAs request type. It contains the -/// IDs of the SLAs to be removed from the store. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.sla.v1.MsgRemoveSLAs")] -pub struct MsgRemoveSlAs { - /// IDs defines the IDs of the SLAs to be removed from the store. - #[prost(string, repeated, tag = "1")] - pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Authority defines the authority that is removing the SLAs. - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, -} -/// MsgRemoveSLAsResponse defines the Msg/RemoveSLAs response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.sla.v1.MsgRemoveSLAsResponse")] -pub struct MsgRemoveSlAsResponse {} -/// MsgParams defines the Msg/Params request type. It contains the -/// new parameters for the SLA 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 = "/slinky.sla.v1.MsgParams")] -pub struct MsgParams { - /// Params defines the new parameters for the SLA module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, - /// Authority defines the authority that is updating the SLA module parameters. - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, -} -/// MsgParamsResponse defines the Msg/Params response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/slinky.sla.v1.MsgParamsResponse")] -pub struct MsgParamsResponse {} -pub struct SlaQuerier<'a, Q: cosmwasm_std::CustomQuery> { - querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, -} -impl<'a, Q: cosmwasm_std::CustomQuery> SlaQuerier<'a, Q> { - pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { - Self { querier } - } - pub fn get_all_sl_as(&self) -> Result { - GetAllSlAsRequest {}.query(self.querier) - } - pub fn get_price_feeds( - &self, - id: ::prost::alloc::string::String, - ) -> Result { - GetPriceFeedsRequest { id }.query(self.querier) - } - pub fn params(&self) -> Result { - ParamsRequest {}.query(self.querier) - } -} diff --git a/packages/neutron-std/src/types/slinky/types/mod.rs b/packages/neutron-std/src/types/slinky/types/mod.rs deleted file mode 100644 index a3a6d96..0000000 --- a/packages/neutron-std/src/types/slinky/types/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 661c056..b57a4c4 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -23,7 +23,7 @@ const SLINKY_REPO: &str = "https://github.com/skip-mev/slinky.git"; const COSMOS_SDK_REV: &str = "v0.50.9-neutron"; /// The Neutron commit or tag to be cloned and used to build the proto files -const NEUTRON_REV: &str = "main"; +const NEUTRON_REV: &str = "chore/ics-v6"; /// The wasmd commit or tag to be cloned and used to build the proto files const WASMD_REV: &str = "v0.53.0-neutron"; @@ -35,11 +35,11 @@ const COMETBFT_REV: &str = "v0.38.11"; const IBC_GO_REV: &str = "v8.5.1"; /// The ics23 commit or tag to be cloned and used to build the proto files -const ICS23_REV: &str = "go/v0.10.0"; +const ICS23_REV: &str = "go/v0.11.0"; const FEEMARKET_REV: &str = "v1.1.1"; -const SLINKY_REV: &str = "v1.0.3"; +const SLINKY_REV: &str = "v2.0.1"; // All paths must end with a / and either be absolute or include a ./ to reference the current // working directory.