Skip to content

Commit

Permalink
remove creator and receiver fields from estimateXX dex query messages
Browse files Browse the repository at this point in the history
  • Loading branch information
joldie777 committed Jun 20, 2024
1 parent c0495f5 commit 2c5100d
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 539 deletions.
453 changes: 16 additions & 437 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["contracts/*"]
members = ["contracts/dex_stargate"]

[profile.release]
opt-level = 3
Expand All @@ -13,7 +13,7 @@ incremental = false
overflow-checks = true

[workspace.dependencies]
neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", branch = "main" }
neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", rev = "2a68d5ea8d472a02998006a13b66e08a615b5afa" }
prost = "0.12.4"
prost-types = "0.12.4"
cosmos-sdk-proto = { version = "0.20.0", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion contracts/balance-tracker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ cosmwasm-std = "1.5"
cw-storage-plus = "1.2"
cosmwasm-schema = "1.5"
thiserror = "1"
astroport = { git = "https://github.com/astroport-fi/astroport-core", version = "4" }
astroport = { git = "https://github.com/astroport-fi/astroport-core", version = "5" }
16 changes: 0 additions & 16 deletions contracts/dex/schema/dex_query.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,28 +376,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 @@ -420,9 +412,7 @@
"type": "object",
"required": [
"amount_in",
"creator",
"order_type",
"receiver",
"tick_index_in_to_out",
"token_in",
"token_out"
Expand All @@ -431,9 +421,6 @@
"amount_in": {
"$ref": "#/definitions/Int128"
},
"creator": {
"type": "string"
},
"expiration_time": {
"type": [
"integer",
Expand All @@ -455,9 +442,6 @@
"order_type": {
"$ref": "#/definitions/LimitOrderType"
},
"receiver": {
"type": "string"
},
"tick_index_in_to_out": {
"type": "integer",
"format": "int64"
Expand Down
6 changes: 5 additions & 1 deletion contracts/dex_stargate/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,16 @@
"DepositOptions": {
"type": "object",
"required": [
"disable_autoswap"
"disable_autoswap",
"fail_tx_on_bel"
],
"properties": {
"disable_autoswap": {
"description": "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.",
"type": "boolean"
},
"fail_tx_on_bel": {
"type": "boolean"
}
}
}
Expand Down
16 changes: 0 additions & 16 deletions contracts/dex_stargate/schema/query_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,28 +367,20 @@
"type": "object",
"required": [
"amount_in",
"creator",
"exit_limit_price",
"pick_best_route",
"receiver",
"routes"
],
"properties": {
"amount_in": {
"type": "string"
},
"creator": {
"type": "string"
},
"exit_limit_price": {
"type": "string"
},
"pick_best_route": {
"type": "boolean"
},
"receiver": {
"type": "string"
},
"routes": {
"type": "array",
"items": {
Expand All @@ -413,9 +405,7 @@
"type": "object",
"required": [
"amount_in",
"creator",
"order_type",
"receiver",
"tick_index_in_to_out",
"token_in",
"token_out"
Expand All @@ -424,9 +414,6 @@
"amount_in": {
"type": "string"
},
"creator": {
"type": "string"
},
"expiration_time": {
"type": [
"integer",
Expand All @@ -444,9 +431,6 @@
"type": "integer",
"format": "int32"
},
"receiver": {
"type": "string"
},
"tick_index_in_to_out": {
"type": "integer",
"format": "int64"
Expand Down
8 changes: 0 additions & 8 deletions contracts/dex_stargate/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,13 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
)?)?),

QueryMsg::EstimateMultiHopSwap {
creator,
receiver,
routes,
amount_in,
exit_limit_price,
pick_best_route,
} => Ok(to_json_binary(&get_estimate_multi_hop_swap(
deps,
EstimateMultiHopSwapRequest {
creator,
receiver,
routes,
amount_in,
exit_limit_price,
Expand All @@ -318,8 +314,6 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
)?)?),

QueryMsg::EstimatePlaceLimitOrder {
creator,
receiver,
token_in,
token_out,
tick_index_in_to_out,
Expand All @@ -330,8 +324,6 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
} => Ok(to_json_binary(&get_estimate_place_limit_order(
deps,
EstimatePlaceLimitOrderRequest {
creator,
receiver,
token_in,
token_out,
tick_index_in_to_out,
Expand Down
4 changes: 0 additions & 4 deletions contracts/dex_stargate/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,12 @@ pub enum QueryMsg {
fee: u64,
},
EstimateMultiHopSwap {
creator: String,
receiver: String,
routes: Vec<Vec<String>>,
amount_in: String,
exit_limit_price: String,
pick_best_route: bool,
},
EstimatePlaceLimitOrder {
creator: String,
receiver: String,
token_in: String,
token_out: String,
tick_index_in_to_out: i64,
Expand Down
80 changes: 80 additions & 0 deletions contracts/marketmap/schema/market_map_query.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MarketMapQuery",
"oneOf": [
{
"description": "Parameters queries the parameters of the module.",
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"last_updated"
],
"properties": {
"last_updated": {
"type": "object"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"market_map"
],
"properties": {
"market_map": {
"type": "object"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"market"
],
"properties": {
"market": {
"type": "object",
"required": [
"currency_pair"
],
"properties": {
"currency_pair": {
"$ref": "#/definitions/CurrencyPair"
}
}
}
},
"additionalProperties": false
}
],
"definitions": {
"CurrencyPair": {
"type": "object",
"required": [
"Base",
"Quote"
],
"properties": {
"Base": {
"type": "string"
},
"Quote": {
"type": "string"
}
}
}
}
}
43 changes: 0 additions & 43 deletions contracts/marketmap/schema/marketmap_query.json

This file was deleted.

17 changes: 8 additions & 9 deletions contracts/oracle/schema/oracle_query.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"title": "OracleQuery",
"oneOf": [
{
"description": "Parameters queries the parameters of the module.",
"type": "object",
"required": [
"get_all_currency_pairs"
Expand All @@ -18,10 +17,10 @@
{
"type": "object",
"required": [
"get_price_request"
"get_price"
],
"properties": {
"get_price_request": {
"get_price": {
"type": "object",
"required": [
"currency_pair"
Expand All @@ -38,10 +37,10 @@
{
"type": "object",
"required": [
"get_prices_request"
"get_prices"
],
"properties": {
"get_prices_request": {
"get_prices": {
"type": "object",
"required": [
"currency_pair_ids"
Expand All @@ -63,14 +62,14 @@
"CurrencyPair": {
"type": "object",
"required": [
"base",
"quote"
"Base",
"Quote"
],
"properties": {
"base": {
"Base": {
"type": "string"
},
"quote": {
"Quote": {
"type": "string"
}
}
Expand Down
Loading

0 comments on commit 2c5100d

Please sign in to comment.