Skip to content

Commit

Permalink
make schema
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Oct 15, 2024
1 parent c31f4db commit f516e52
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 1,790 deletions.
5 changes: 5 additions & 0 deletions contracts/dex_grpc/schema/query_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@
"creator",
"limit_sell_price",
"max_amount_out",
"min_average_sell_price",
"order_type",
"receiver",
"tick_index_in_to_out",
Expand Down Expand Up @@ -872,6 +873,10 @@
"max_amount_out": {
"type": "string"
},
"min_average_sell_price": {
"description": "min_average_sell_price is an optional parameter that sets a required minimum average price for the entire trade. if the min_average_sell_price is not met the trade will fail. If min_average_sell_price is omitted limit_sell_price will be used instead",
"type": "string"
},
"order_type": {
"type": "integer",
"format": "int32"
Expand Down
36 changes: 14 additions & 22 deletions contracts/neutron_interchain_queries/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -375,16 +375,15 @@
"update_interchain_query": {
"type": "object",
"required": [
"new_keys",
"new_update_period",
"query_id"
],
"properties": {
"new_keys": {
"type": [
"array",
"null"
],
"type": "array",
"items": {
"$ref": "#/definitions/KVKey"
"$ref": "#/definitions/KvKey"
}
},
"new_recipient": {
Expand All @@ -394,10 +393,7 @@
]
},
"new_update_period": {
"type": [
"integer",
"null"
],
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
Expand Down Expand Up @@ -531,28 +527,24 @@
}
],
"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"
},
"KVKey": {
"description": "Describes a KV key for which you want to get value from the storage on remote chain",
"KvKey": {
"type": "object",
"required": [
"key",
"path"
],
"properties": {
"key": {
"description": "*key** is a key you want to read from the storage",
"allOf": [
{
"$ref": "#/definitions/Binary"
}
]
"description": "Key you want to read from the storage",
"type": "array",
"items": {
"type": "integer",
"format": "uint8",
"minimum": 0.0
}
},
"path": {
"description": "*path** is a path to the storage (storage prefix) where you want to read value by key (usually name of cosmos-packages module: 'staking', 'bank', etc.)",
"description": "Path (storage prefix) to the storage where you want to read value by key (usually name of cosmos-sdk module: 'staking', 'bank', etc.)",
"type": "string"
}
},
Expand Down
35 changes: 27 additions & 8 deletions contracts/neutron_interchain_txs/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"ordering": {
"anyOf": [
{
"$ref": "#/definitions/ChannelOrdering"
"$ref": "#/definitions/Order"
},
{
"type": "null"
Expand Down Expand Up @@ -309,13 +309,6 @@
}
],
"definitions": {
"ChannelOrdering": {
"type": "string",
"enum": [
"ORDER_ORDERED",
"ORDER_UNORDERED"
]
},
"IntegrationTestsSudoFailureMock": {
"type": "string",
"enum": [
Expand All @@ -324,6 +317,32 @@
"disabled"
]
},
"Order": {
"description": "Order defines if a channel is ORDERED or UNORDERED",
"oneOf": [
{
"description": "zero-value for channel ordering",
"type": "string",
"enum": [
"NoneUnspecified"
]
},
{
"description": "packets can be delivered in any order, which may differ from the order in which they were sent.",
"type": "string",
"enum": [
"Unordered"
]
},
{
"description": "packets are delivered exactly in the order which they were sent",
"type": "string",
"enum": [
"Ordered"
]
}
]
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "QueryInterchainAccountAddressResponse",
"description": "Query response for an interchain account address",
"type": "object",
"required": [
"interchain_account_address"
],
"properties": {
"interchain_account_address": {
"description": "*interchain_account_address** is a interchain account address on the remote chain",
"description": "The corresponding interchain account address on the host chain",
"type": "string"
}
},
Expand Down
9 changes: 6 additions & 3 deletions contracts/neutron_interchain_txs/schema/sudo_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,21 @@
"type": "string"
},
"Height": {
"description": "Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients\n\nNormally the RevisionHeight is incremented at each height while keeping RevisionNumber the same. However some consensus algorithms may choose to reset the height in certain conditions e.g. hard forks, state-machine breaking changes In these cases, the RevisionNumber is incremented so that height continues to be monitonically increasing even as the RevisionHeight gets reset",
"type": "object",
"required": [
"revision_height",
"revision_number"
],
"properties": {
"revision_height": {
"description": "*height** is a height of remote chain",
"default": 0,
"description": "the height within the given revision",
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"revision_number": {
"description": "the revision that the client is currently on",
"default": 0,
"type": "integer",
"format": "uint64",
"minimum": 0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "QueryInterchainAccountAddressResponse",
"description": "Query response for an interchain account address",
"type": "object",
"required": [
"interchain_account_address"
],
"properties": {
"interchain_account_address": {
"description": "*interchain_account_address** is a interchain account address on the remote chain",
"description": "The corresponding interchain account address on the host chain",
"type": "string"
}
},
Expand Down
9 changes: 6 additions & 3 deletions contracts/neutron_validator_test/schema/sudo_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,21 @@
"type": "string"
},
"Height": {
"description": "Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients\n\nNormally the RevisionHeight is incremented at each height while keeping RevisionNumber the same. However some consensus algorithms may choose to reset the height in certain conditions e.g. hard forks, state-machine breaking changes In these cases, the RevisionNumber is incremented so that height continues to be monitonically increasing even as the RevisionHeight gets reset",
"type": "object",
"required": [
"revision_height",
"revision_number"
],
"properties": {
"revision_height": {
"description": "*height** is a height of remote chain",
"default": 0,
"description": "the height within the given revision",
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"revision_number": {
"description": "the revision that the client is currently on",
"default": 0,
"type": "integer",
"format": "uint64",
"minimum": 0.0
Expand Down
Loading

0 comments on commit f516e52

Please sign in to comment.