From 5a8bcfd871f61278589cdc8c2ee53edea83dddbd Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Fri, 1 Dec 2023 19:30:22 +0300 Subject: [PATCH] wip: normalizing stargate dex responses --- .../neutron-sdk/src/stargate/types_dex.rs | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/packages/neutron-sdk/src/stargate/types_dex.rs b/packages/neutron-sdk/src/stargate/types_dex.rs index 63afde9c..c1890d68 100644 --- a/packages/neutron-sdk/src/stargate/types_dex.rs +++ b/packages/neutron-sdk/src/stargate/types_dex.rs @@ -183,7 +183,7 @@ pub struct AllTickLiquidityRequest { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct AllTickLiquidityResponse { - pub tick_liquidity: Vec, + pub tick_liquidity: Vec, pub pagination: Option, } @@ -464,7 +464,6 @@ impl From for DepositOptionsGen { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct Params { pub fee_tiers: Vec, pub max_true_taker_spread: String, @@ -499,7 +498,6 @@ impl TryFrom for LimitOrderType { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct LimitOrderTrancheUser { pub trade_pair_id: TradePairID, pub tick_index_taker_to_maker: Int64, @@ -512,7 +510,6 @@ pub struct LimitOrderTrancheUser { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct LimitOrderTrancheKey { pub trade_pair_id: TradePairID, pub tick_index_taker_to_maker: Int64, @@ -520,7 +517,6 @@ pub struct LimitOrderTrancheKey { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct LimitOrderTranche { pub key: LimitOrderTrancheKey, pub reserves_maker_denom: Int128, @@ -532,7 +528,6 @@ pub struct LimitOrderTranche { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct DepositRecord { pub pair_id: PairID, pub shares_owned: Int128, @@ -543,28 +538,18 @@ pub struct DepositRecord { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, Default)] -#[serde(rename_all = "snake_case")] pub struct PairID { pub token0: String, pub token1: String, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] -pub struct TickLiquidity { - #[serde(rename = "Liquidity")] - pub liquidity: Liquidity, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub enum Liquidity { PoolReserves(PoolReserves), LimitOrderTranche(LimitOrderTranche), } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct PoolReserves { pub key: PoolReservesKey, pub reserves_maker_denom: Int128, @@ -573,7 +558,6 @@ pub struct PoolReserves { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct PoolReservesKey { pub trade_pair_id: TradePairID, pub tick_index_taker_to_maker: Int64, @@ -581,24 +565,19 @@ pub struct PoolReservesKey { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct TradePairID { pub maker_denom: String, pub taker_denom: String, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] pub struct Pool { - #[serde(default)] pub id: Uint64, pub lower_tick0: Option, pub lower_tick1: Option, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, Default)] -#[serde(rename_all = "snake_case")] -#[serde(default)] pub struct PoolMetadata { pub id: Uint64, pub tick: Int64,