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

fix: default metadata_json is empty string #ntrn-346 #152

Merged
merged 4 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ prost-types = "0.12.1"
cosmos-sdk-proto = { version = "0.20.0", default-features = false }
bech32 = "0.9.1"
thiserror = "1.0.49"
protobuf = { version = "3.3.0" }
protobuf = "~3.3.0"
hex = "0.4.3"
serde_json = { version = "1.0.87" }
tendermint-proto = "0.34"
Expand Down
10 changes: 7 additions & 3 deletions packages/neutron-sdk/schema/neutron_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,8 @@
"additionalProperties": false
},
{
"description": "Proposal to upgrade IBC client",
"description": "Deprecated. Proposal to upgrade IBC client",
"deprecated": true,
"type": "object",
"required": [
"upgrade_proposal"
Expand All @@ -642,7 +643,8 @@
"additionalProperties": false
},
{
"description": "Proposal to update IBC client",
"description": "Deprecated. Proposal to update IBC client",
"deprecated": true,
"type": "object",
"required": [
"client_update_proposal"
Expand Down Expand Up @@ -816,6 +818,7 @@
},
"ClientUpdateProposal": {
"description": "ClientUpdateProposal defines the struct for client update proposal.",
"deprecated": true,
"type": "object",
"required": [
"description",
Expand Down Expand Up @@ -1273,7 +1276,7 @@
]
},
{
"description": "Fill-or-Kill limit orders are taker limit orders that either successfully swap 100% of the supplied AmountIn or return an error. If there is insufficient liquidity to complete the trade at or above the supplied TickIndex a Fill-or-Kill order will return an error `codespace: dex, code: 1134` (https://github.com/neutron-org/neutron/blob/main/x/dex/types/errors.go#L107 ErrGoodTilOrderWithoutExpiration).",
"description": "Fill-or-Kill limit orders are taker limit orders that either successfully swap 100% of the supplied AmountIn or return an error. If there is insufficient liquidity to complete the trade at or above the supplied TickIndex a Fill-or-Kill order will return an error `codespace: dex, code: 1134` (<https://github.com/neutron-org/neutron/blob/main/x/dex/types/errors.go#L107> ErrGoodTilOrderWithoutExpiration).",
"type": "string",
"enum": [
"FILL_OR_KILL"
Expand Down Expand Up @@ -1628,6 +1631,7 @@
},
"UpgradeProposal": {
"description": "UpgradeProposal defines the struct for IBC upgrade proposal.",
"deprecated": true,
"type": "object",
"required": [
"description",
Expand Down
161 changes: 160 additions & 1 deletion packages/neutron-sdk/schema/neutron_query.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,52 @@
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"market_map"
],
"properties": {
"market_map": {
"$ref": "#/definitions/MarketMapQuery"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"oracle"
],
"properties": {
"oracle": {
"$ref": "#/definitions/OracleQuery"
}
},
"additionalProperties": false
}
],
"definitions": {
"Binary": {
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
"type": "string"
},
"CurrencyPair": {
"type": "object",
"required": [
"Base",
"Quote"
],
"properties": {
"Base": {
"type": "string"
},
"Quote": {
"type": "string"
}
}
},
"DexQuery": {
"oneOf": [
{
Expand Down Expand Up @@ -843,7 +882,7 @@
]
},
{
"description": "Fill-or-Kill limit orders are taker limit orders that either successfully swap 100% of the supplied AmountIn or return an error. If there is insufficient liquidity to complete the trade at or above the supplied TickIndex a Fill-or-Kill order will return an error `codespace: dex, code: 1134` (https://github.com/neutron-org/neutron/blob/main/x/dex/types/errors.go#L107 ErrGoodTilOrderWithoutExpiration).",
"description": "Fill-or-Kill limit orders are taker limit orders that either successfully swap 100% of the supplied AmountIn or return an error. If there is insufficient liquidity to complete the trade at or above the supplied TickIndex a Fill-or-Kill order will return an error `codespace: dex, code: 1134` (<https://github.com/neutron-org/neutron/blob/main/x/dex/types/errors.go#L107> ErrGoodTilOrderWithoutExpiration).",
"type": "string",
"enum": [
"FILL_OR_KILL"
Expand Down Expand Up @@ -872,6 +911,67 @@
}
]
},
"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
}
]
},
"MultiHopRoute": {
"type": "object",
"required": [
Expand All @@ -886,6 +986,65 @@
}
}
},
"OracleQuery": {
"oneOf": [
{
"type": "object",
"required": [
"get_all_currency_pairs"
],
"properties": {
"get_all_currency_pairs": {
"type": "object"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"get_price"
],
"properties": {
"get_price": {
"type": "object",
"required": [
"currency_pair"
],
"properties": {
"currency_pair": {
"$ref": "#/definitions/CurrencyPair"
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"get_prices"
],
"properties": {
"get_prices": {
"type": "object",
"required": [
"currency_pair_ids"
],
"properties": {
"currency_pair_ids": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"additionalProperties": false
}
]
},
"PageRequest": {
"type": "object",
"required": [
Expand Down
2 changes: 1 addition & 1 deletion packages/neutron-sdk/src/bindings/dex/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub enum LimitOrderType {
/// of the supplied AmountIn or return an error. If there is insufficient liquidity to
/// complete the trade at or above the supplied TickIndex a Fill-or-Kill order will
/// return an error `codespace: dex, code: 1134`
/// (https://github.com/neutron-org/neutron/blob/main/x/dex/types/errors.go#L107 ErrGoodTilOrderWithoutExpiration).
/// (<https://github.com/neutron-org/neutron/blob/main/x/dex/types/errors.go#L107> ErrGoodTilOrderWithoutExpiration).
FillOrKill,
/// Immediate-or-Cancel limit orders are taker orders that will swap as much as of the
/// AmountIn as possible given available liquidity above the supplied TickIndex.
Expand Down
10 changes: 8 additions & 2 deletions packages/neutron-sdk/src/bindings/marketmap/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ pub struct ProviderConfig {
pub invert: bool,
/// **metadata_json** is a string of JSON that encodes any extra configuration
/// for the given provider config.
#[serde(rename(serialize = "metadata_JSON", deserialize = "metadata_JSON"))]
#[serde(
default,
rename(serialize = "metadata_JSON", deserialize = "metadata_JSON")
)]
pub metadata_json: String,
}

Expand Down Expand Up @@ -73,6 +76,9 @@ pub struct Ticker {
pub enabled: bool,
/// **metadata_json** is a string of JSON that encodes any extra configuration
/// for the given ticker. ,
#[serde(rename(serialize = "metadata_JSON", deserialize = "metadata_JSON"))]
#[serde(
default,
rename(serialize = "metadata_JSON", deserialize = "metadata_JSON")
)]
pub metadata_json: String,
}
2 changes: 1 addition & 1 deletion packages/neutron-sdk/src/bindings/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ pub enum AdminProposal {
since = "0.11.0",
note = "Used only for querying old proposals. Will fail if executed in a new proposal. Use ProposalExecuteMessage instead"
)]
/// Depreacteed Proposal to upgrade IBC client
/// Deprecated. Proposal to upgrade IBC client
UpgradeProposal(UpgradeProposal),

#[deprecated(
Expand Down
Loading