Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove creator and receiver fields from EstimatePlaceLimitOrderRequest #NTRN-318 #149

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions packages/neutron-sdk/schema/neutron_query.json
Original file line number Diff line number Diff line change
Expand Up @@ -689,28 +689,20 @@
"type": "object",
"required": [
"amount_in",
"creator",
"exit_limit_price",
"pick_best_route",
"receiver",
"routes"
],
"properties": {
"amount_in": {
"$ref": "#/definitions/Int128"
},
"creator": {
"type": "string"
},
"exit_limit_price": {
"$ref": "#/definitions/PrecDec"
},
"pick_best_route": {
"type": "boolean"
},
"receiver": {
"type": "string"
},
"routes": {
"type": "array",
"items": {
Expand All @@ -734,9 +726,7 @@
"type": "object",
"required": [
"amount_in",
"creator",
"order_type",
"receiver",
"tick_index_in_to_out",
"token_in",
"token_out"
Expand All @@ -745,9 +735,6 @@
"amount_in": {
"$ref": "#/definitions/Int128"
},
"creator": {
"type": "string"
},
"expiration_time": {
"type": [
"integer",
Expand All @@ -769,9 +756,6 @@
"order_type": {
"$ref": "#/definitions/LimitOrderType"
},
"receiver": {
"type": "string"
},
"tick_index_in_to_out": {
"type": "integer",
"format": "int64"
Expand Down
4 changes: 0 additions & 4 deletions packages/neutron-sdk/src/bindings/dex/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,13 @@ pub enum DexQuery {
},
/// Queries the simulated result of a multihop swap
EstimateMultiHopSwap {
creator: String,
receiver: String,
routes: Vec<MultiHopRoute>,
amount_in: Int128,
exit_limit_price: PrecDec,
pick_best_route: bool,
},
/// Queries the simulated result of a PlaceLimit order
EstimatePlaceLimitOrder {
creator: String,
receiver: String,
token_in: String,
token_out: String,
tick_index_in_to_out: i64,
Expand Down
2 changes: 1 addition & 1 deletion packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a6eae66545df6e128da2c7cac81ff4c1c02deb7b
ffcec4f87490e4652b311ed0d3e536cbf4ae4aa1
8 changes: 8 additions & 0 deletions packages/neutron-sdk/src/proto_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ pub mod neutron {
}
pub mod dex {
include!("neutron.dex.rs");
pub mod v2 {
include!("neutron.dex.v2.rs");
}
}
pub mod dynamicfees {
pub mod v1 {
include!("neutron.dynamicfees.v1.rs");
}
}
pub mod feeburner {
include!("neutron.feeburner.rs");
Expand Down
23 changes: 13 additions & 10 deletions packages/neutron-sdk/src/proto_types/neutron.dex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ pub struct Params {
pub struct DepositOptions {
#[prost(bool, tag = "1")]
pub disable_autoswap: bool,
#[prost(bool, tag = "2")]
pub fail_tx_on_bel: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgDeposit {
Expand All @@ -133,11 +135,20 @@ pub struct MsgDeposit {
pub options: ::prost::alloc::vec::Vec<DepositOptions>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FailedDeposit {
#[prost(uint64, tag = "1")]
pub deposit_idx: u64,
#[prost(string, tag = "2")]
pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgDepositResponse {
#[prost(string, repeated, tag = "1")]
pub reserve0_deposited: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub reserve1_deposited: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "3")]
pub failed_deposits: ::prost::alloc::vec::Vec<FailedDeposit>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgWithdrawal {
Expand Down Expand Up @@ -445,15 +456,15 @@ pub struct QueryAllUserDepositsResponse {
::core::option::Option<cosmos_sdk_proto::cosmos::base::query::v1beta1::PageResponse>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAllUserLimitOrdersRequest {
pub struct QueryAllLimitOrderTrancheUserByAddressRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination:
::core::option::Option<cosmos_sdk_proto::cosmos::base::query::v1beta1::PageRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAllUserLimitOrdersResponse {
pub struct QueryAllLimitOrderTrancheUserByAddressResponse {
#[prost(message, repeated, tag = "1")]
pub limit_orders: ::prost::alloc::vec::Vec<LimitOrderTrancheUser>,
#[prost(message, optional, tag = "2")]
Expand Down Expand Up @@ -544,10 +555,6 @@ pub struct QueryGetPoolReservesResponse {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryEstimateMultiHopSwapRequest {
#[prost(string, tag = "1")]
pub creator: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub receiver: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub routes: ::prost::alloc::vec::Vec<MultiHopRoute>,
#[prost(string, tag = "4")]
Expand All @@ -566,10 +573,6 @@ pub struct QueryEstimateMultiHopSwapResponse {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryEstimatePlaceLimitOrderRequest {
#[prost(string, tag = "1")]
pub creator: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub receiver: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub token_in: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
Expand Down
10 changes: 10 additions & 0 deletions packages/neutron-sdk/src/proto_types/neutron.dex.v2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// @generated
/// Params defines the parameters for the module.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Params {
#[prost(uint64, repeated, tag = "1")]
pub fee_tiers: ::prost::alloc::vec::Vec<u64>,
#[prost(string, tag = "2")]
pub max_true_taker_spread: ::prost::alloc::string::String,
}
// @@protoc_insertion_point(module)
44 changes: 44 additions & 0 deletions packages/neutron-sdk/src/proto_types/neutron.dynamicfees.v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// @generated
/// Params defines the parameters for the module.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Params {
/// List of asset prices by the NTRN
/// it's used in cooperation with feemarket module
/// ntrn_prices is a data source to convert gas_price from feemarket's base_denom (untrn)
/// into a given asset
#[prost(message, repeated, tag = "1")]
pub ntrn_prices: ::prost::alloc::vec::Vec<cosmos_sdk_proto::cosmos::base::v1beta1::DecCoin>,
}
/// GenesisState defines the dynamicfees module's genesis state.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisState {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
/// QueryParamsRequest is request type for the Query/Params RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsRequest {}
/// QueryParamsResponse is response type for the Query/Params RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsResponse {
/// params holds all the parameters of this module.
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
/// MsgUpdateParams is the MsgUpdateParams request type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgUpdateParams {
/// Authority is the address of the governance account.
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
/// params defines the x/dynamicfees parameters to update.
///
/// NOTE: All parameters must be supplied.
#[prost(message, optional, tag = "2")]
pub params: ::core::option::Option<Params>,
}
/// MsgUpdateParamsResponse defines the response structure for executing a
/// MsgUpdateParams message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgUpdateParamsResponse {}
// @@protoc_insertion_point(module)
18 changes: 17 additions & 1 deletion packages/neutron-sdk/src/proto_types/neutron.transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,24 @@ pub struct MsgTransferResponse {
/// channel's sequence_id for outgoing ibc packet. Unique per a channel.
#[prost(uint64, tag = "1")]
pub sequence_id: u64,
/// channel src channel on neutron side trasaction was submitted from
/// channel src channel on neutron side transaction was submitted from
#[prost(string, tag = "2")]
pub channel: ::prost::alloc::string::String,
}
/// MsgUpdateParams is the Msg/UpdateParams request type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgUpdateParams {
/// signer address
#[prost(string, tag = "1")]
pub signer: ::prost::alloc::string::String,
/// params defines the transfer parameters to update.
///
/// NOTE: All parameters must be supplied.
#[prost(message, optional, tag = "2")]
pub params: ::core::option::Option<cosmos_sdk_proto::ibc::applications::transfer::v1::Params>,
}
/// MsgUpdateParamsResponse defines the response structure for executing a
/// MsgUpdateParams message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgUpdateParamsResponse {}
// @@protoc_insertion_point(module)
5 changes: 4 additions & 1 deletion packages/neutron-sdk/src/proto_types/osmosis.tokenfactory.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// @generated
/// WhitelistedHook describes a beforeSendHook which is allowed to be added and executed
/// SetBeforeSendHook can only be called on denoms where the denom creator and
/// code_id for the `contract_addr` match a WhitelistedHook
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WhitelistedHook {
#[prost(uint64, tag = "1")]
Expand All @@ -24,7 +27,7 @@ pub struct Params {
/// are sent to
#[prost(string, tag = "3")]
pub fee_collector_address: ::prost::alloc::string::String,
/// HookWhitelist is the list of hooks which are allowed to be added and executed
/// whitelisted_hooks is the list of hooks which are allowed to be added and executed
#[prost(message, repeated, tag = "4")]
pub whitelisted_hooks: ::prost::alloc::vec::Vec<WhitelistedHook>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ pub struct GenesisDenom {
pub denom: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub authority_metadata: ::core::option::Option<DenomAuthorityMetadata>,
#[prost(string, tag = "3")]
pub hook_contract_address: ::prost::alloc::string::String,
}
/// Params defines the parameters for the tokenfactory module.
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down
15 changes: 8 additions & 7 deletions packages/neutron-sdk/src/stargate/dex/query.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use crate::proto_types::neutron::dex::{
QueryAllInactiveLimitOrderTrancheRequest, QueryAllLimitOrderTrancheRequest,
QueryAllLimitOrderTrancheUserRequest, QueryAllPoolMetadataRequest, QueryAllPoolReservesRequest,
QueryAllTickLiquidityRequest, QueryAllUserDepositsRequest, QueryAllUserLimitOrdersRequest,
QueryEstimateMultiHopSwapRequest, QueryEstimatePlaceLimitOrderRequest,
QueryGetInactiveLimitOrderTrancheRequest, QueryGetLimitOrderTrancheRequest,
QueryGetLimitOrderTrancheUserRequest, QueryGetPoolMetadataRequest, QueryGetPoolReservesRequest,
QueryParamsRequest, QueryPoolByIdRequest, QueryPoolRequest,
QueryAllLimitOrderTrancheUserByAddressRequest, QueryAllLimitOrderTrancheUserRequest,
QueryAllPoolMetadataRequest, QueryAllPoolReservesRequest, QueryAllTickLiquidityRequest,
QueryAllUserDepositsRequest, QueryEstimateMultiHopSwapRequest,
QueryEstimatePlaceLimitOrderRequest, QueryGetInactiveLimitOrderTrancheRequest,
QueryGetLimitOrderTrancheRequest, QueryGetLimitOrderTrancheUserRequest,
QueryGetPoolMetadataRequest, QueryGetPoolReservesRequest, QueryParamsRequest,
QueryPoolByIdRequest, QueryPoolRequest,
};
use crate::stargate::aux::make_stargate_query;
use crate::stargate::dex::types::{
Expand Down Expand Up @@ -83,7 +84,7 @@ pub fn get_limit_order_tranche_user_all_by_address(
make_stargate_query(
deps,
LIMIT_ORDER_TRANCHE_USER_ALL_BY_ADDRESS_QUERY_PATH,
QueryAllUserLimitOrdersRequest::from(req),
QueryAllLimitOrderTrancheUserByAddressRequest::from(req),
)
}

Expand Down
29 changes: 12 additions & 17 deletions packages/neutron-sdk/src/stargate/dex/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ use crate::proto_types::neutron::dex::{
DepositOptions as DepositOptionsGen, MsgCancelLimitOrder, MsgDeposit, MsgMultiHopSwap,
MsgPlaceLimitOrder, MsgWithdrawFilledLimitOrder, MsgWithdrawal, MultiHopRoute,
QueryAllInactiveLimitOrderTrancheRequest, QueryAllLimitOrderTrancheRequest,
QueryAllLimitOrderTrancheUserRequest, QueryAllPoolMetadataRequest, QueryAllPoolReservesRequest,
QueryAllTickLiquidityRequest, QueryAllUserDepositsRequest, QueryAllUserLimitOrdersRequest,
QueryEstimateMultiHopSwapRequest, QueryEstimatePlaceLimitOrderRequest,
QueryGetInactiveLimitOrderTrancheRequest, QueryGetLimitOrderTrancheRequest,
QueryGetLimitOrderTrancheUserRequest, QueryGetPoolMetadataRequest, QueryGetPoolReservesRequest,
QueryParamsRequest, QueryPoolByIdRequest, QueryPoolRequest,
QueryAllLimitOrderTrancheUserByAddressRequest, QueryAllLimitOrderTrancheUserRequest,
QueryAllPoolMetadataRequest, QueryAllPoolReservesRequest, QueryAllTickLiquidityRequest,
QueryAllUserDepositsRequest, QueryEstimateMultiHopSwapRequest,
QueryEstimatePlaceLimitOrderRequest, QueryGetInactiveLimitOrderTrancheRequest,
QueryGetLimitOrderTrancheRequest, QueryGetLimitOrderTrancheUserRequest,
QueryGetPoolMetadataRequest, QueryGetPoolReservesRequest, QueryParamsRequest,
QueryPoolByIdRequest, QueryPoolRequest,
};
use crate::stargate::aux::proto_timestamp_from_i64;
use cosmos_sdk_proto::cosmos::base::query::v1beta1::PageRequest as PageRequestGen;
Expand Down Expand Up @@ -328,9 +329,9 @@ pub struct AllUserLimitOrdersResponse {
pub pagination: Option<PageResponse>,
}

impl From<AllUserLimitOrdersRequest> for QueryAllUserLimitOrdersRequest {
fn from(v: AllUserLimitOrdersRequest) -> QueryAllUserLimitOrdersRequest {
QueryAllUserLimitOrdersRequest {
impl From<AllUserLimitOrdersRequest> for QueryAllLimitOrderTrancheUserByAddressRequest {
fn from(v: AllUserLimitOrdersRequest) -> QueryAllLimitOrderTrancheUserByAddressRequest {
QueryAllLimitOrderTrancheUserByAddressRequest {
address: v.address,
pagination: convert_page_request(v.pagination),
}
Expand Down Expand Up @@ -540,8 +541,6 @@ impl From<GetPoolReservesRequest> for QueryGetPoolReservesRequest {

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
pub struct EstimateMultiHopSwapRequest {
pub creator: String,
pub receiver: String,
pub routes: Vec<Vec<String>>,
pub amount_in: String,
pub exit_limit_price: String,
Expand All @@ -556,8 +555,6 @@ pub struct EstimateMultiHopSwapResponse {
impl From<EstimateMultiHopSwapRequest> for QueryEstimateMultiHopSwapRequest {
fn from(v: EstimateMultiHopSwapRequest) -> QueryEstimateMultiHopSwapRequest {
QueryEstimateMultiHopSwapRequest {
creator: v.creator,
receiver: v.receiver,
routes: v
.routes
.into_iter()
Expand All @@ -574,8 +571,6 @@ impl From<EstimateMultiHopSwapRequest> for QueryEstimateMultiHopSwapRequest {

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
pub struct EstimatePlaceLimitOrderRequest {
pub creator: String,
pub receiver: String,
pub token_in: String,
pub token_out: String,
pub tick_index_in_to_out: i64,
Expand All @@ -601,8 +596,6 @@ pub struct EstimatePlaceLimitOrderResponse {
impl From<EstimatePlaceLimitOrderRequest> for QueryEstimatePlaceLimitOrderRequest {
fn from(v: EstimatePlaceLimitOrderRequest) -> QueryEstimatePlaceLimitOrderRequest {
QueryEstimatePlaceLimitOrderRequest {
creator: v.creator,
receiver: v.receiver,
token_in: v.token_in,
token_out: v.token_out,
tick_index_in_to_out: v.tick_index_in_to_out,
Expand Down Expand Up @@ -697,12 +690,14 @@ pub struct DepositOptions {
/// Autoswap provides a mechanism for users to deposit the entirety of their specified deposit
/// amounts by paying a small fee. By default the `autoswap` option is enabled.
pub disable_autoswap: bool,
pub fail_tx_on_bel: bool,
}

impl From<DepositOptions> for DepositOptionsGen {
fn from(o: DepositOptions) -> DepositOptionsGen {
DepositOptionsGen {
disable_autoswap: o.disable_autoswap,
fail_tx_on_bel: o.fail_tx_on_bel,
}
}
}
Expand Down
Loading