Skip to content

Commit

Permalink
remove simulate bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
jcompagni10 committed Sep 4, 2024
1 parent 9fb4fbd commit 90e60af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 161 deletions.
56 changes: 4 additions & 52 deletions packages/neutron-sdk/src/bindings/dex/query.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::bindings::dex::types::{
DepositRecord, LimitOrderTranche, LimitOrderTrancheUser, LimitOrderType, MsgCancelLimitOrder,
MsgCancelLimitOrderResponse, MsgDeposit, MsgDepositResponse, MsgMultiHopSwap,
MsgMultiHopSwapResponse, MsgPlaceLimitOrder, MsgPlaceLimitOrderResponse,
MsgWithdrawFilledLimitOrder, MsgWithdrawFilledLimitOrderResponse, MsgWithdrawal,
DepositRecord, LimitOrderTranche, LimitOrderTrancheUser, LimitOrderType,
MsgCancelLimitOrderResponse, MsgDepositResponse,
MsgMultiHopSwapResponse, MsgPlaceLimitOrderResponse,
MsgWithdrawFilledLimitOrderResponse,
MsgWithdrawalResponse, MultiHopRoute, Params, Pool, PoolMetadata, PoolReserves, PrecDec,
TickLiquidity,
};
Expand Down Expand Up @@ -110,18 +110,6 @@ pub enum DexQuery {
PoolMetadata { id: u64 },
/// Queries a list of PoolMetadata items.
PoolMetadataAll { pagination: Option<PageRequest> },
/// Simulates MsgDeposit
SimulateDeposit { msg: MsgDeposit },
/// Simulates MsgWithdrawal
SimulateWithdrawal { msg: MsgWithdrawal },
/// Simulates MsgPlaceLimitOrder
SimulatePlaceLimitOrder { msg: MsgPlaceLimitOrder },
/// Simulates MsgWithdrawFilledLimitOrder
SimulateWithdrawFilledLimitOrder { msg: MsgWithdrawFilledLimitOrder },
/// Simulates MsgCancelLimitOrder
SimulateCancelLimitOrder { msg: MsgCancelLimitOrder },
/// Simulates MsgMultiHopSwap
SimulateMultiHopSwap { msg: MsgMultiHopSwap },
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
Expand Down Expand Up @@ -245,39 +233,3 @@ pub struct AllPoolMetadataResponse {
pub pool_metadata: Vec<PoolMetadata>,
pub pagination: Option<PageResponse>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct SimulateDepositResponse {
resp: MsgDepositResponse,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct SimulateWithdrawalResponse {
resp: MsgWithdrawalResponse,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct SimulatePlaceLimitOrderResponse {
resp: MsgPlaceLimitOrderResponse,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct SimulateWithdrawFilledLimitOrderResponse {
resp: MsgWithdrawFilledLimitOrderResponse,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct SimulateCancelLimitOrderResponse {
resp: MsgCancelLimitOrderResponse,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct SimulateMultiHopSwapResponse {
resp: MsgMultiHopSwapResponse,
}
110 changes: 1 addition & 109 deletions packages/neutron-sdk/src/bindings/dex/types.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cosmwasm_std::{Coin, Int128, Uint128};
use cosmwasm_std::{Int128};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -197,111 +197,3 @@ pub struct PoolReservesKey {
pub tick_index_taker_to_maker: i64,
pub fee: Option<u64>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MsgDeposit {
pub token_a: String,
pub token_b: String,
pub amounts_a: Vec<Uint128>,
pub amounts_b: Vec<Uint128>,
pub tick_indexes_a_to_b: Vec<i64>,
pub fees: Vec<u64>,
pub options: Vec<DepositOptions>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MsgDepositResponse {
pub reserve0_deposited: Vec<Uint128>,
pub reserve1_deposited: Vec<Uint128>,
pub failed_deposits: Option<Vec<FailedDeposit>>,
pub shares_issued: Vec<Coin>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MsgWithdrawal {
pub creator: String,
pub receiver: String,
pub token_a: String,
pub token_b: String,
pub shares_to_remove: Vec<Uint128>,
pub tick_indexes_a_to_b: Vec<i64>,
pub fees: Vec<u64>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MsgWithdrawalResponse {
pub reserve0_withdrawn: Option<Uint128>,
pub reserve1_withdrawn: Option<Uint128>,
pub shares_burned: Vec<Coin>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MsgPlaceLimitOrder {
pub token_in: String,
pub token_out: String,
pub tick_index_in_to_out: i64,
pub amount_in: Uint128,
pub order_type: LimitOrderType,
pub expiration_time: Option<u64>,
pub max_amount_out: Option<Uint128>,
pub limit_sell_price: PrecDec,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MsgPlaceLimitOrderResponse {
pub tranche_key: Option<String>,
pub coin_in: Coin,
pub taker_coin_out: Option<Coin>,
pub taker_coin_in: Option<Coin>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MsgWithdrawFilledLimitOrder {
pub creator: String,
pub tranche_key: String,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MsgWithdrawFilledLimitOrderResponse {
pub taker_coin_out: Option<Coin>,
pub maker_coin_out: Option<Coin>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MsgCancelLimitOrder {
pub creator: String,
pub tranche_key: String,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MsgCancelLimitOrderResponse {
pub taker_coin_out: Option<Coin>,
pub maker_coin_out: Option<Coin>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MsgMultiHopSwap {
pub routes: Vec<MultiHopRoute>,
pub amount_in: Uint128,
pub exit_limit_price: PrecDec,
pub pick_best_route: bool,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MsgMultiHopSwapResponse {
pub coin_out: Coin,
pub route: MultiHopRoute,
pub dust: Option<Vec<Coin>>,
}

0 comments on commit 90e60af

Please sign in to comment.