diff --git a/contracts/neutron_interchain_txs/schema/execute_msg.json b/contracts/neutron_interchain_txs/schema/execute_msg.json index 6e64e370..62b9e3f1 100644 --- a/contracts/neutron_interchain_txs/schema/execute_msg.json +++ b/contracts/neutron_interchain_txs/schema/execute_msg.json @@ -22,6 +22,16 @@ "interchain_account_id": { "type": "string" }, + "ordering": { + "anyOf": [ + { + "$ref": "#/definitions/ChannelOrdering" + }, + { + "type": "null" + } + ] + }, "register_fee": { "type": "array", "items": { @@ -122,6 +132,13 @@ } ], "definitions": { + "ChannelOrdering": { + "type": "string", + "enum": [ + "ORDER_ORDERED", + "ORDER_UNORDERED" + ] + }, "Coin": { "type": "object", "required": [ diff --git a/packages/neutron-sdk/schema/neutron_msg.json b/packages/neutron-sdk/schema/neutron_msg.json index 73a09990..d43ee446 100644 --- a/packages/neutron-sdk/schema/neutron_msg.json +++ b/packages/neutron-sdk/schema/neutron_msg.json @@ -25,6 +25,17 @@ "description": "**interchain_account_id** is an identifier of your new interchain account. Can be any string. This identifier allows contracts to have multiple interchain accounts on remote chains.", "type": "string" }, + "ordering": { + "description": "**ordering** is an order of channel. Can be ordered or unordered. Set to ordered if not specified.", + "anyOf": [ + { + "$ref": "#/definitions/ChannelOrdering" + }, + { + "type": "null" + } + ] + }, "register_fee": { "description": "*register_fee** is a fees required to be payed to register interchain account", "type": [ @@ -160,7 +171,7 @@ ], "properties": { "new_keys": { - "description": "*new_keys** is the new query keys to retrive.", + "description": "*new_keys** is the new query keys to retrieve.", "type": [ "array", "null" @@ -810,6 +821,13 @@ }, "additionalProperties": false }, + "ChannelOrdering": { + "type": "string", + "enum": [ + "ORDER_ORDERED", + "ORDER_UNORDERED" + ] + }, "ClearAdminProposal": { "description": "Deprecated. SudoContractProposal defines the struct for clear admin proposal.", "deprecated": true, @@ -907,14 +925,20 @@ }, "additionalProperties": false }, - "DepositOption": { + "DepositOptions": { "type": "object", - "required": [ - "disable_swap" - ], "properties": { - "disable_swap": { - "type": "boolean" + "disable_autoswap": { + "type": [ + "boolean", + "null" + ] + }, + "fail_tx_on_bel": { + "type": [ + "boolean", + "null" + ] } }, "additionalProperties": false @@ -968,7 +992,7 @@ "description": "Additional deposit options", "type": "array", "items": { - "$ref": "#/definitions/DepositOption" + "$ref": "#/definitions/DepositOptions" } }, "receiver": { diff --git a/packages/neutron-sdk/src/bindings/dex/msg.rs b/packages/neutron-sdk/src/bindings/dex/msg.rs index c7d711e5..d1e06baa 100644 --- a/packages/neutron-sdk/src/bindings/dex/msg.rs +++ b/packages/neutron-sdk/src/bindings/dex/msg.rs @@ -3,7 +3,7 @@ use cosmwasm_std::Uint128; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use super::types::{DepositOption, MultiHopRoute, PrecDec}; +use super::types::{DepositOptions, MultiHopRoute, PrecDec}; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] @@ -26,7 +26,7 @@ pub enum DexMsg { /// Fees to use for each deposit fees: Vec, /// Additional deposit options - options: Vec, + options: Vec, }, /// Withdraw is used to redeem PoolShares for the user’s pro-rata /// portion of tokens within a liquidity pool. Users can withdraw from a pool at any time diff --git a/packages/neutron-sdk/src/bindings/dex/types.rs b/packages/neutron-sdk/src/bindings/dex/types.rs index 95204533..58c4742b 100644 --- a/packages/neutron-sdk/src/bindings/dex/types.rs +++ b/packages/neutron-sdk/src/bindings/dex/types.rs @@ -78,6 +78,13 @@ pub struct TradePairID { pub taker_denom: String, } +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, Default)] +#[serde(rename_all = "snake_case")] +pub struct FailedDeposit { + pub deposit_idx: Option, + pub error: Option, +} + // TODO implement math for PrecDec #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] @@ -102,8 +109,9 @@ impl From for PrecDec { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] -pub struct DepositOption { - pub disable_swap: bool, +pub struct DepositOptions { + pub disable_autoswap: Option, + pub fail_tx_on_bel: Option, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] diff --git a/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT b/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT index 7187e63e..85515d2d 100644 --- a/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT +++ b/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT @@ -1 +1 @@ -1bf83371924e7f3f5a756c8a9ea35e2d607a984e \ No newline at end of file +6bef62c6d9182b51fd5facc41088689c809b96d5 diff --git a/packages/neutron-sdk/src/proto_types/neutron/dex/mod.rs b/packages/neutron-sdk/src/proto_types/neutron/dex/mod.rs index ad490437..007b04f2 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/dex/mod.rs +++ b/packages/neutron-sdk/src/proto_types/neutron/dex/mod.rs @@ -351,6 +351,8 @@ pub struct MsgDepositResponse { pub reserve1_deposited: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, #[prost(message, repeated, tag = "3")] pub failed_deposits: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub shares_issued: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -400,7 +402,14 @@ pub struct MsgWithdrawal { CosmwasmExt, )] #[proto_message(type_url = "/neutron.dex.MsgWithdrawalResponse")] -pub struct MsgWithdrawalResponse {} +pub struct MsgWithdrawalResponse { + #[prost(string, tag = "1")] + pub reserve0_withdrawn: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub reserve1_withdrawn: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub shares_burned: ::prost::alloc::vec::Vec, +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -470,6 +479,9 @@ pub struct MsgPlaceLimitOrderResponse { /// maker portion which will have withdrawn in the future #[prost(message, optional, tag = "3")] pub taker_coin_out: ::core::option::Option, + /// Total amount of the token in that was immediately swapped for takerOutCoin + #[prost(message, optional, tag = "4")] + pub taker_coin_in: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -501,7 +513,14 @@ pub struct MsgWithdrawFilledLimitOrder { CosmwasmExt, )] #[proto_message(type_url = "/neutron.dex.MsgWithdrawFilledLimitOrderResponse")] -pub struct MsgWithdrawFilledLimitOrderResponse {} +pub struct MsgWithdrawFilledLimitOrderResponse { + /// Total amount of taker reserves that were withdrawn + #[prost(message, optional, tag = "1")] + pub taker_coin_out: ::core::option::Option, + /// Total amount of maker reserves that were withdrawn --only applies to inactive LimitOrders + #[prost(message, optional, tag = "2")] + pub maker_coin_out: ::core::option::Option, +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -532,7 +551,14 @@ pub struct MsgCancelLimitOrder { CosmwasmExt, )] #[proto_message(type_url = "/neutron.dex.MsgCancelLimitOrderResponse")] -pub struct MsgCancelLimitOrderResponse {} +pub struct MsgCancelLimitOrderResponse { + /// Total amount of taker reserves that were withdrawn + #[prost(message, optional, tag = "1")] + pub taker_coin_out: ::core::option::Option, + /// Total amount of maker reserves that were canceled + #[prost(message, optional, tag = "2")] + pub maker_coin_out: ::core::option::Option, +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -592,6 +618,10 @@ pub struct MsgMultiHopSwap { pub struct MsgMultiHopSwapResponse { #[prost(message, optional, tag = "1")] pub coin_out: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub route: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub dust: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -1363,6 +1393,7 @@ pub struct QueryGetPoolReservesResponse { response_type = QueryEstimateMultiHopSwapResponse )] pub struct QueryEstimateMultiHopSwapRequest { + /// DEPRECATED: Use QuerySimulateMultiHopSwap #[prost(string, tag = "1")] pub creator: ::prost::alloc::string::String, #[prost(string, tag = "2")] @@ -1411,6 +1442,7 @@ pub struct QueryEstimateMultiHopSwapResponse { response_type = QueryEstimatePlaceLimitOrderResponse )] pub struct QueryEstimatePlaceLimitOrderRequest { + /// DEPRECATED: Use QuerySimulatePlaceLimitOrder #[prost(string, tag = "1")] pub creator: ::prost::alloc::string::String, #[prost(string, tag = "2")] @@ -1615,6 +1647,222 @@ pub struct QueryAllPoolMetadataResponse { pub pagination: ::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 = "/neutron.dex.QuerySimulateDepositRequest")] +#[proto_query( + path = "/neutron.dex.Query/SimulateDeposit", + response_type = QuerySimulateDepositResponse +)] +pub struct QuerySimulateDepositRequest { + #[prost(message, optional, tag = "1")] + pub msg: ::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 = "/neutron.dex.QuerySimulateDepositResponse")] +pub struct QuerySimulateDepositResponse { + #[prost(message, optional, tag = "1")] + pub resp: ::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 = "/neutron.dex.QuerySimulateWithdrawalRequest")] +#[proto_query( + path = "/neutron.dex.Query/SimulateWithdrawal", + response_type = QuerySimulateWithdrawalResponse +)] +pub struct QuerySimulateWithdrawalRequest { + #[prost(message, optional, tag = "1")] + pub msg: ::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 = "/neutron.dex.QuerySimulateWithdrawalResponse")] +pub struct QuerySimulateWithdrawalResponse { + #[prost(message, optional, tag = "1")] + pub resp: ::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 = "/neutron.dex.QuerySimulatePlaceLimitOrderRequest")] +#[proto_query( + path = "/neutron.dex.Query/SimulatePlaceLimitOrder", + response_type = QuerySimulatePlaceLimitOrderResponse +)] +pub struct QuerySimulatePlaceLimitOrderRequest { + #[prost(message, optional, tag = "1")] + pub msg: ::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 = "/neutron.dex.QuerySimulatePlaceLimitOrderResponse")] +pub struct QuerySimulatePlaceLimitOrderResponse { + #[prost(message, optional, tag = "1")] + pub resp: ::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 = "/neutron.dex.QuerySimulateWithdrawFilledLimitOrderRequest")] +#[proto_query( + path = "/neutron.dex.Query/SimulateWithdrawFilledLimitOrder", + response_type = QuerySimulateWithdrawFilledLimitOrderResponse +)] +pub struct QuerySimulateWithdrawFilledLimitOrderRequest { + #[prost(message, optional, tag = "1")] + pub msg: ::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 = "/neutron.dex.QuerySimulateWithdrawFilledLimitOrderResponse")] +pub struct QuerySimulateWithdrawFilledLimitOrderResponse { + #[prost(message, optional, tag = "1")] + pub resp: ::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 = "/neutron.dex.QuerySimulateCancelLimitOrderRequest")] +#[proto_query( + path = "/neutron.dex.Query/SimulateCancelLimitOrder", + response_type = QuerySimulateCancelLimitOrderResponse +)] +pub struct QuerySimulateCancelLimitOrderRequest { + #[prost(message, optional, tag = "1")] + pub msg: ::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 = "/neutron.dex.QuerySimulateCancelLimitOrderResponse")] +pub struct QuerySimulateCancelLimitOrderResponse { + #[prost(message, optional, tag = "1")] + pub resp: ::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 = "/neutron.dex.QuerySimulateMultiHopSwapRequest")] +#[proto_query( + path = "/neutron.dex.Query/SimulateMultiHopSwap", + response_type = QuerySimulateMultiHopSwapResponse +)] +pub struct QuerySimulateMultiHopSwapRequest { + #[prost(message, optional, tag = "1")] + pub msg: ::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 = "/neutron.dex.QuerySimulateMultiHopSwapResponse")] +pub struct QuerySimulateMultiHopSwapResponse { + #[prost(message, optional, tag = "1")] + pub resp: ::core::option::Option, +} pub struct DexQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -1758,6 +2006,7 @@ impl<'a, Q: cosmwasm_std::CustomQuery> DexQuerier<'a, Q> { } .query(self.querier) } + #[deprecated] pub fn estimate_multi_hop_swap( &self, creator: ::prost::alloc::string::String, @@ -1777,6 +2026,7 @@ impl<'a, Q: cosmwasm_std::CustomQuery> DexQuerier<'a, Q> { } .query(self.querier) } + #[deprecated] #[allow(clippy::too_many_arguments)] pub fn estimate_place_limit_order( &self, @@ -1831,4 +2081,40 @@ impl<'a, Q: cosmwasm_std::CustomQuery> DexQuerier<'a, Q> { ) -> Result { QueryAllPoolMetadataRequest { pagination }.query(self.querier) } + pub fn simulate_deposit( + &self, + msg: ::core::option::Option, + ) -> Result { + QuerySimulateDepositRequest { msg }.query(self.querier) + } + pub fn simulate_withdrawal( + &self, + msg: ::core::option::Option, + ) -> Result { + QuerySimulateWithdrawalRequest { msg }.query(self.querier) + } + pub fn simulate_place_limit_order( + &self, + msg: ::core::option::Option, + ) -> Result { + QuerySimulatePlaceLimitOrderRequest { msg }.query(self.querier) + } + pub fn simulate_withdraw_filled_limit_order( + &self, + msg: ::core::option::Option, + ) -> Result { + QuerySimulateWithdrawFilledLimitOrderRequest { msg }.query(self.querier) + } + pub fn simulate_cancel_limit_order( + &self, + msg: ::core::option::Option, + ) -> Result { + QuerySimulateCancelLimitOrderRequest { msg }.query(self.querier) + } + pub fn simulate_multi_hop_swap( + &self, + msg: ::core::option::Option, + ) -> Result { + QuerySimulateMultiHopSwapRequest { msg }.query(self.querier) + } } diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index e88509ba..1308432c 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.8-neutron"; /// The Neutron commit or tag to be cloned and used to build the proto files -const NEUTRON_REV: &str = "1bf83371924e7f3f5a756c8a9ea35e2d607a984e"; +const NEUTRON_REV: &str = "6bef62c6d9182b51fd5facc41088689c809b96d5"; /// The wasmd commit or tag to be cloned and used to build the proto files const WASMD_REV: &str = "v0.51.0";