From a474ae3fcc37fd49813b31bbe880f8ff7fae1fd7 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Tue, 6 Dec 2022 11:30:07 +0100 Subject: [PATCH 1/3] Fix data in raw/{query,migrate,sudo}.json --- packages/schema/src/idl.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/schema/src/idl.rs b/packages/schema/src/idl.rs index ec2c5478aa..0cad4da9f0 100644 --- a/packages/schema/src/idl.rs +++ b/packages/schema/src/idl.rs @@ -97,19 +97,19 @@ impl JsonApi { serde_json::to_string_pretty(&execute)?, )); } - if let Some(query) = &self.execute { + if let Some(query) = &self.query { result.push(( "query.json".to_string(), serde_json::to_string_pretty(&query)?, )); } - if let Some(migrate) = &self.execute { + if let Some(migrate) = &self.migrate { result.push(( "migrate.json".to_string(), serde_json::to_string_pretty(&migrate)?, )); } - if let Some(sudo) = &self.execute { + if let Some(sudo) = &self.sudo { result.push(( "sudo.json".to_string(), serde_json::to_string_pretty(&sudo)?, From e10ea6fd2b0760e0609db9777789ffa0ada1022c Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Tue, 6 Dec 2022 11:30:20 +0100 Subject: [PATCH 2/3] Regenerate contract schemas --- contracts/burner/schema/raw/migrate.json | 14 + contracts/crypto-verify/schema/raw/query.json | 268 ++++++ contracts/cyberpunk/schema/raw/query.json | 34 +- contracts/floaty/schema/raw/query.json | 30 +- contracts/hackatom/schema/raw/migrate.json | 135 +-- contracts/hackatom/schema/raw/query.json | 100 +-- contracts/hackatom/schema/raw/sudo.json | 132 +-- .../ibc-reflect-send/schema/raw/query.json | 780 +----------------- contracts/ibc-reflect/schema/raw/migrate.json | 6 + contracts/ibc-reflect/schema/raw/query.json | 42 + contracts/queue/schema/raw/migrate.json | 41 +- contracts/queue/schema/raw/query.json | 69 +- contracts/reflect/schema/raw/query.json | 721 +++++----------- contracts/staking/schema/raw/query.json | 76 +- 14 files changed, 732 insertions(+), 1716 deletions(-) create mode 100644 contracts/burner/schema/raw/migrate.json create mode 100644 contracts/crypto-verify/schema/raw/query.json create mode 100644 contracts/ibc-reflect/schema/raw/migrate.json create mode 100644 contracts/ibc-reflect/schema/raw/query.json diff --git a/contracts/burner/schema/raw/migrate.json b/contracts/burner/schema/raw/migrate.json new file mode 100644 index 0000000000..231a265325 --- /dev/null +++ b/contracts/burner/schema/raw/migrate.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MigrateMsg", + "type": "object", + "required": [ + "payout" + ], + "properties": { + "payout": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/contracts/crypto-verify/schema/raw/query.json b/contracts/crypto-verify/schema/raw/query.json new file mode 100644 index 0000000000..dbb6e99374 --- /dev/null +++ b/contracts/crypto-verify/schema/raw/query.json @@ -0,0 +1,268 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Cosmos format (secp256k1 verification scheme).", + "type": "object", + "required": [ + "verify_cosmos_signature" + ], + "properties": { + "verify_cosmos_signature": { + "type": "object", + "required": [ + "message", + "public_key", + "signature" + ], + "properties": { + "message": { + "description": "Message to verify.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "public_key": { + "description": "Serialized compressed (33 bytes) or uncompressed (65 bytes) public key.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "signature": { + "description": "Serialized signature. Cosmos format (64 bytes).", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Ethereum text verification (compatible to the eth_sign RPC/web3 enpoint). This cannot be used to verify transaction.\n\nSee https://web3js.readthedocs.io/en/v1.2.0/web3-eth.html#sign", + "type": "object", + "required": [ + "verify_ethereum_text" + ], + "properties": { + "verify_ethereum_text": { + "type": "object", + "required": [ + "message", + "signature", + "signer_address" + ], + "properties": { + "message": { + "description": "Message to verify. This will be wrapped in the standard container `\"\\x19Ethereum Signed Message:\\n\" + len(message) + message` before verification.", + "type": "string" + }, + "signature": { + "description": "Serialized signature. Fixed length format (64 bytes `r` and `s` plus the one byte `v`).", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "signer_address": { + "description": "Signer address. This is matched case insensitive, so you can provide checksummed and non-checksummed addresses. Checksums are not validated.", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "verify_ethereum_transaction" + ], + "properties": { + "verify_ethereum_transaction": { + "type": "object", + "required": [ + "chain_id", + "data", + "from", + "gas_limit", + "gas_price", + "nonce", + "r", + "s", + "to", + "v", + "value" + ], + "properties": { + "chain_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "data": { + "$ref": "#/definitions/Binary" + }, + "from": { + "description": "Ethereum address in hex format (42 characters, starting with 0x)", + "type": "string" + }, + "gas_limit": { + "$ref": "#/definitions/Uint128" + }, + "gas_price": { + "$ref": "#/definitions/Uint128" + }, + "nonce": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "r": { + "$ref": "#/definitions/Binary" + }, + "s": { + "$ref": "#/definitions/Binary" + }, + "to": { + "description": "Ethereum address in hex format (42 characters, starting with 0x)", + "type": "string" + }, + "v": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "value": { + "$ref": "#/definitions/Uint128" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Tendermint format (ed25519 verification scheme).", + "type": "object", + "required": [ + "verify_tendermint_signature" + ], + "properties": { + "verify_tendermint_signature": { + "type": "object", + "required": [ + "message", + "public_key", + "signature" + ], + "properties": { + "message": { + "description": "Message to verify.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "public_key": { + "description": "Serialized public key. Tendermint format (32 bytes).", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "signature": { + "description": "Serialized signature. Tendermint format (64 bytes).", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Tendermint format (batch ed25519 verification scheme).", + "type": "object", + "required": [ + "verify_tendermint_batch" + ], + "properties": { + "verify_tendermint_batch": { + "type": "object", + "required": [ + "messages", + "public_keys", + "signatures" + ], + "properties": { + "messages": { + "description": "Messages to verify.", + "type": "array", + "items": { + "$ref": "#/definitions/Binary" + } + }, + "public_keys": { + "description": "Serialized public keys. Tendermint format (32 bytes).", + "type": "array", + "items": { + "$ref": "#/definitions/Binary" + } + }, + "signatures": { + "description": "Serialized signatures. Tendermint format (64 bytes).", + "type": "array", + "items": { + "$ref": "#/definitions/Binary" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns a list of supported verification schemes. No pagination - this is a short list.", + "type": "object", + "required": [ + "list_verification_schemes" + ], + "properties": { + "list_verification_schemes": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec 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. See also .", + "type": "string" + }, + "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" + } + } +} diff --git a/contracts/cyberpunk/schema/raw/query.json b/contracts/cyberpunk/schema/raw/query.json index 8e7af5fe3c..18c07a5622 100644 --- a/contracts/cyberpunk/schema/raw/query.json +++ b/contracts/cyberpunk/schema/raw/query.json @@ -1,39 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", + "title": "QueryMsg", "oneOf": [ - { - "description": "Hashes some data. Uses CPU and memory, but no external calls.", - "type": "object", - "required": [ - "argon2" - ], - "properties": { - "argon2": { - "type": "object", - "required": [ - "mem_cost", - "time_cost" - ], - "properties": { - "mem_cost": { - "description": "The amount of memory requested (KB).", - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "time_cost": { - "description": "The number of passes.", - "type": "integer", - "format": "uint32", - "minimum": 0.0 - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, { "description": "Returns the env for testing", "type": "object", diff --git a/contracts/floaty/schema/raw/query.json b/contracts/floaty/schema/raw/query.json index 76967fd17b..b96c3dfb8a 100644 --- a/contracts/floaty/schema/raw/query.json +++ b/contracts/floaty/schema/raw/query.json @@ -1,20 +1,42 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", + "title": "QueryMsg", "oneOf": [ { - "description": "Releasing all funds in the contract to the beneficiary. This is the only \"proper\" action of this demo contract.", + "description": "returns a human-readable representation of the verifier use to ensure query path works in integration tests", "type": "object", "required": [ - "release" + "verifier" ], "properties": { - "release": { + "verifier": { "type": "object", "additionalProperties": false } }, "additionalProperties": false + }, + { + "description": "This returns cosmwasm_std::AllBalanceResponse to demo use of the querier", + "type": "object", + "required": [ + "other_balance" + ], + "properties": { + "other_balance": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false } ] } diff --git a/contracts/hackatom/schema/raw/migrate.json b/contracts/hackatom/schema/raw/migrate.json index a82fdeef2d..2696e3ac26 100644 --- a/contracts/hackatom/schema/raw/migrate.json +++ b/contracts/hackatom/schema/raw/migrate.json @@ -1,128 +1,15 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", - "oneOf": [ - { - "description": "Releasing all funds in the contract to the beneficiary. This is the only \"proper\" action of this demo contract.", - "type": "object", - "required": [ - "release" - ], - "properties": { - "release": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Infinite loop to burn cpu cycles (only run when metering is enabled)", - "type": "object", - "required": [ - "cpu_loop" - ], - "properties": { - "cpu_loop": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Infinite loop making storage calls (to test when their limit hits)", - "type": "object", - "required": [ - "storage_loop" - ], - "properties": { - "storage_loop": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Infinite loop reading and writing memory", - "type": "object", - "required": [ - "memory_loop" - ], - "properties": { - "memory_loop": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Infinite loop sending message to itself", - "type": "object", - "required": [ - "message_loop" - ], - "properties": { - "message_loop": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Allocate large amounts of memory without consuming much gas", - "type": "object", - "required": [ - "allocate_large_memory" - ], - "properties": { - "allocate_large_memory": { - "type": "object", - "required": [ - "pages" - ], - "properties": { - "pages": { - "type": "integer", - "format": "uint32", - "minimum": 0.0 - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Trigger a panic to ensure framework handles gracefully", - "type": "object", - "required": [ - "panic" - ], - "properties": { - "panic": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Starting with CosmWasm 0.10, some API calls return user errors back to the contract. This triggers such user errors, ensuring the transaction does not fail in the backend.", - "type": "object", - "required": [ - "user_errors_in_api_calls" - ], - "properties": { - "user_errors_in_api_calls": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false + "title": "MigrateMsg", + "description": "MigrateMsg allows a privileged contract administrator to run a migration on the contract. In this (demo) case it is just migrating from one hackatom code to the same code, but taking advantage of the migration step to set a new validator.\n\nNote that the contract doesn't enforce permissions here, this is done by blockchain logic (in the future by blockchain governance)", + "type": "object", + "required": [ + "verifier" + ], + "properties": { + "verifier": { + "type": "string" } - ] + }, + "additionalProperties": false } diff --git a/contracts/hackatom/schema/raw/query.json b/contracts/hackatom/schema/raw/query.json index a82fdeef2d..dfd58202b2 100644 --- a/contracts/hackatom/schema/raw/query.json +++ b/contracts/hackatom/schema/raw/query.json @@ -1,15 +1,15 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", + "title": "QueryMsg", "oneOf": [ { - "description": "Releasing all funds in the contract to the beneficiary. This is the only \"proper\" action of this demo contract.", + "description": "returns a human-readable representation of the verifier use to ensure query path works in integration tests", "type": "object", "required": [ - "release" + "verifier" ], "properties": { - "release": { + "verifier": { "type": "object", "additionalProperties": false } @@ -17,75 +17,47 @@ "additionalProperties": false }, { - "description": "Infinite loop to burn cpu cycles (only run when metering is enabled)", + "description": "This returns cosmwasm_std::AllBalanceResponse to demo use of the querier", "type": "object", "required": [ - "cpu_loop" + "other_balance" ], "properties": { - "cpu_loop": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Infinite loop making storage calls (to test when their limit hits)", - "type": "object", - "required": [ - "storage_loop" - ], - "properties": { - "storage_loop": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Infinite loop reading and writing memory", - "type": "object", - "required": [ - "memory_loop" - ], - "properties": { - "memory_loop": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Infinite loop sending message to itself", - "type": "object", - "required": [ - "message_loop" - ], - "properties": { - "message_loop": { + "other_balance": { "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "type": "string" + } + }, "additionalProperties": false } }, "additionalProperties": false }, { - "description": "Allocate large amounts of memory without consuming much gas", + "description": "Recurse will execute a query into itself up to depth-times and return Each step of the recursion may perform some extra work to test gas metering (`work` rounds of sha256 on contract). Now that we have Env, we can auto-calculate the address to recurse into", "type": "object", "required": [ - "allocate_large_memory" + "recurse" ], "properties": { - "allocate_large_memory": { + "recurse": { "type": "object", "required": [ - "pages" + "depth", + "work" ], "properties": { - "pages": { + "depth": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "work": { "type": "integer", "format": "uint32", "minimum": 0.0 @@ -97,27 +69,13 @@ "additionalProperties": false }, { - "description": "Trigger a panic to ensure framework handles gracefully", - "type": "object", - "required": [ - "panic" - ], - "properties": { - "panic": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Starting with CosmWasm 0.10, some API calls return user errors back to the contract. This triggers such user errors, ensuring the transaction does not fail in the backend.", + "description": "GetInt returns a hardcoded u32 value", "type": "object", "required": [ - "user_errors_in_api_calls" + "get_int" ], "properties": { - "user_errors_in_api_calls": { + "get_int": { "type": "object", "additionalProperties": false } diff --git a/contracts/hackatom/schema/raw/sudo.json b/contracts/hackatom/schema/raw/sudo.json index a82fdeef2d..d41253aeb0 100644 --- a/contracts/hackatom/schema/raw/sudo.json +++ b/contracts/hackatom/schema/raw/sudo.json @@ -1,128 +1,56 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", + "title": "SudoMsg", + "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call. This is showing how we can expose \"admin\" functionality than can not be called by external users or contracts, but only trusted (native/Go) code in the blockchain", "oneOf": [ { - "description": "Releasing all funds in the contract to the beneficiary. This is the only \"proper\" action of this demo contract.", "type": "object", "required": [ - "release" + "steal_funds" ], "properties": { - "release": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Infinite loop to burn cpu cycles (only run when metering is enabled)", - "type": "object", - "required": [ - "cpu_loop" - ], - "properties": { - "cpu_loop": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Infinite loop making storage calls (to test when their limit hits)", - "type": "object", - "required": [ - "storage_loop" - ], - "properties": { - "storage_loop": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Infinite loop reading and writing memory", - "type": "object", - "required": [ - "memory_loop" - ], - "properties": { - "memory_loop": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Infinite loop sending message to itself", - "type": "object", - "required": [ - "message_loop" - ], - "properties": { - "message_loop": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Allocate large amounts of memory without consuming much gas", - "type": "object", - "required": [ - "allocate_large_memory" - ], - "properties": { - "allocate_large_memory": { + "steal_funds": { "type": "object", "required": [ - "pages" + "amount", + "recipient" ], "properties": { - "pages": { - "type": "integer", - "format": "uint32", - "minimum": 0.0 + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "recipient": { + "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false - }, - { - "description": "Trigger a panic to ensure framework handles gracefully", + } + ], + "definitions": { + "Coin": { "type": "object", "required": [ - "panic" + "amount", + "denom" ], "properties": { - "panic": { - "type": "object", - "additionalProperties": false + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" } - }, - "additionalProperties": false + } }, - { - "description": "Starting with CosmWasm 0.10, some API calls return user errors back to the contract. This triggers such user errors, ensuring the transaction does not fail in the backend.", - "type": "object", - "required": [ - "user_errors_in_api_calls" - ], - "properties": { - "user_errors_in_api_calls": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false + "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" } - ] + } } diff --git a/contracts/ibc-reflect-send/schema/raw/query.json b/contracts/ibc-reflect-send/schema/raw/query.json index e08109d489..05a60cc1b8 100644 --- a/contracts/ibc-reflect-send/schema/raw/query.json +++ b/contracts/ibc-reflect-send/schema/raw/query.json @@ -1,24 +1,15 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", + "title": "QueryMsg", "oneOf": [ { - "description": "Changes the admin", "type": "object", "required": [ - "update_admin" + "admin" ], "properties": { - "update_admin": { + "admin": { "type": "object", - "required": [ - "admin" - ], - "properties": { - "admin": { - "type": "string" - } - }, "additionalProperties": false } }, @@ -27,26 +18,11 @@ { "type": "object", "required": [ - "send_msgs" + "list_accounts" ], "properties": { - "send_msgs": { + "list_accounts": { "type": "object", - "required": [ - "channel_id", - "msgs" - ], - "properties": { - "channel_id": { - "type": "string" - }, - "msgs": { - "type": "array", - "items": { - "$ref": "#/definitions/CosmosMsg_for_Empty" - } - } - }, "additionalProperties": false } }, @@ -55,10 +31,10 @@ { "type": "object", "required": [ - "check_remote_balance" + "account" ], "properties": { - "check_remote_balance": { + "account": { "type": "object", "required": [ "channel_id" @@ -72,746 +48,6 @@ } }, "additionalProperties": false - }, - { - "description": "If you sent funds to this contract, it will attempt to ibc transfer them to the account on the remote side of this channel. If we don't have the address yet, this fails.", - "type": "object", - "required": [ - "send_funds" - ], - "properties": { - "send_funds": { - "type": "object", - "required": [ - "reflect_channel_id", - "transfer_channel_id" - ], - "properties": { - "reflect_channel_id": { - "description": "The channel id we use above to talk with the reflect contract", - "type": "string" - }, - "transfer_channel_id": { - "description": "The channel to use for ibctransfer. This is bound to a different port and handled by a different module. It should connect to the same chain as the reflect_channel_id does", - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ], - "definitions": { - "BankMsg": { - "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", - "oneOf": [ - { - "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "send" - ], - "properties": { - "send": { - "type": "object", - "required": [ - "amount", - "to_address" - ], - "properties": { - "amount": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - }, - "to_address": { - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - { - "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", - "type": "object", - "required": [ - "burn" - ], - "properties": { - "burn": { - "type": "object", - "required": [ - "amount" - ], - "properties": { - "amount": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - } - } - } - }, - "additionalProperties": false - } - ] - }, - "Binary": { - "description": "Binary is a wrapper around Vec 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. See also .", - "type": "string" - }, - "Coin": { - "type": "object", - "required": [ - "amount", - "denom" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "denom": { - "type": "string" - } - } - }, - "CosmosMsg_for_Empty": { - "oneOf": [ - { - "type": "object", - "required": [ - "bank" - ], - "properties": { - "bank": { - "$ref": "#/definitions/BankMsg" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "custom" - ], - "properties": { - "custom": { - "$ref": "#/definitions/Empty" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "staking" - ], - "properties": { - "staking": { - "$ref": "#/definitions/StakingMsg" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "distribution" - ], - "properties": { - "distribution": { - "$ref": "#/definitions/DistributionMsg" - } - }, - "additionalProperties": false - }, - { - "description": "A Stargate message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", - "type": "object", - "required": [ - "stargate" - ], - "properties": { - "stargate": { - "type": "object", - "required": [ - "type_url", - "value" - ], - "properties": { - "type_url": { - "type": "string" - }, - "value": { - "$ref": "#/definitions/Binary" - } - } - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "ibc" - ], - "properties": { - "ibc": { - "$ref": "#/definitions/IbcMsg" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "wasm" - ], - "properties": { - "wasm": { - "$ref": "#/definitions/WasmMsg" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "gov" - ], - "properties": { - "gov": { - "$ref": "#/definitions/GovMsg" - } - }, - "additionalProperties": false - } - ] - }, - "DistributionMsg": { - "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", - "oneOf": [ - { - "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "set_withdraw_address" - ], - "properties": { - "set_withdraw_address": { - "type": "object", - "required": [ - "address" - ], - "properties": { - "address": { - "description": "The `withdraw_address`", - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - { - "description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "withdraw_delegator_reward" - ], - "properties": { - "withdraw_delegator_reward": { - "type": "object", - "required": [ - "validator" - ], - "properties": { - "validator": { - "description": "The `validator_address`", - "type": "string" - } - } - } - }, - "additionalProperties": false - } - ] - }, - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" - }, - "GovMsg": { - "oneOf": [ - { - "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", - "type": "object", - "required": [ - "vote" - ], - "properties": { - "vote": { - "type": "object", - "required": [ - "proposal_id", - "vote" - ], - "properties": { - "proposal_id": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "vote": { - "$ref": "#/definitions/VoteOption" - } - } - } - }, - "additionalProperties": false - } - ] - }, - "IbcMsg": { - "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)", - "oneOf": [ - { - "description": "Sends bank tokens owned by the contract to the given address on another chain. The channel must already be established between the ibctransfer module on this chain and a matching module on the remote chain. We cannot select the port_id, this is whatever the local chain has bound the ibctransfer module to.", - "type": "object", - "required": [ - "transfer" - ], - "properties": { - "transfer": { - "type": "object", - "required": [ - "amount", - "channel_id", - "timeout", - "to_address" - ], - "properties": { - "amount": { - "description": "packet data only supports one coin https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20", - "allOf": [ - { - "$ref": "#/definitions/Coin" - } - ] - }, - "channel_id": { - "description": "exisiting channel to send the tokens over", - "type": "string" - }, - "timeout": { - "description": "when packet times out, measured on remote chain", - "allOf": [ - { - "$ref": "#/definitions/IbcTimeout" - } - ] - }, - "to_address": { - "description": "address on the remote chain to receive these tokens", - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - { - "description": "Sends an IBC packet with given data over the existing channel. Data should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.", - "type": "object", - "required": [ - "send_packet" - ], - "properties": { - "send_packet": { - "type": "object", - "required": [ - "channel_id", - "data", - "timeout" - ], - "properties": { - "channel_id": { - "type": "string" - }, - "data": { - "$ref": "#/definitions/Binary" - }, - "timeout": { - "description": "when packet times out, measured on remote chain", - "allOf": [ - { - "$ref": "#/definitions/IbcTimeout" - } - ] - } - } - } - }, - "additionalProperties": false - }, - { - "description": "This will close an existing channel that is owned by this contract. Port is auto-assigned to the contract's IBC port", - "type": "object", - "required": [ - "close_channel" - ], - "properties": { - "close_channel": { - "type": "object", - "required": [ - "channel_id" - ], - "properties": { - "channel_id": { - "type": "string" - } - } - } - }, - "additionalProperties": false - } - ] - }, - "IbcTimeout": { - "description": "In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.", - "type": "object", - "properties": { - "block": { - "anyOf": [ - { - "$ref": "#/definitions/IbcTimeoutBlock" - }, - { - "type": "null" - } - ] - }, - "timestamp": { - "anyOf": [ - { - "$ref": "#/definitions/Timestamp" - }, - { - "type": "null" - } - ] - } - } - }, - "IbcTimeoutBlock": { - "description": "IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)", - "type": "object", - "required": [ - "height", - "revision" - ], - "properties": { - "height": { - "description": "block height after which the packet times out. the height within the given revision", - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "revision": { - "description": "the version that the client is currently on (eg. after reseting the chain this could increment 1 as height drops to 0)", - "type": "integer", - "format": "uint64", - "minimum": 0.0 - } - } - }, - "StakingMsg": { - "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", - "oneOf": [ - { - "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "delegate" - ], - "properties": { - "delegate": { - "type": "object", - "required": [ - "amount", - "validator" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Coin" - }, - "validator": { - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - { - "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "undelegate" - ], - "properties": { - "undelegate": { - "type": "object", - "required": [ - "amount", - "validator" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Coin" - }, - "validator": { - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - { - "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "redelegate" - ], - "properties": { - "redelegate": { - "type": "object", - "required": [ - "amount", - "dst_validator", - "src_validator" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Coin" - }, - "dst_validator": { - "type": "string" - }, - "src_validator": { - "type": "string" - } - } - } - }, - "additionalProperties": false - } - ] - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "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" - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 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 `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - }, - "VoteOption": { - "type": "string", - "enum": [ - "yes", - "no", - "abstain", - "no_with_veto" - ] - }, - "WasmMsg": { - "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", - "oneOf": [ - { - "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "execute" - ], - "properties": { - "execute": { - "type": "object", - "required": [ - "contract_addr", - "funds", - "msg" - ], - "properties": { - "contract_addr": { - "type": "string" - }, - "funds": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - }, - "msg": { - "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - } - } - } - }, - "additionalProperties": false - }, - { - "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "instantiate" - ], - "properties": { - "instantiate": { - "type": "object", - "required": [ - "code_id", - "funds", - "label", - "msg" - ], - "properties": { - "admin": { - "type": [ - "string", - "null" - ] - }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "funds": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - }, - "label": { - "description": "A human-readbale label for the contract", - "type": "string" - }, - "msg": { - "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - } - } - } - }, - "additionalProperties": false - }, - { - "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "migrate" - ], - "properties": { - "migrate": { - "type": "object", - "required": [ - "contract_addr", - "msg", - "new_code_id" - ], - "properties": { - "contract_addr": { - "type": "string" - }, - "msg": { - "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - }, - "new_code_id": { - "description": "the code_id of the new logic to place in the given contract", - "type": "integer", - "format": "uint64", - "minimum": 0.0 - } - } - } - }, - "additionalProperties": false - }, - { - "description": "Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.", - "type": "object", - "required": [ - "update_admin" - ], - "properties": { - "update_admin": { - "type": "object", - "required": [ - "admin", - "contract_addr" - ], - "properties": { - "admin": { - "type": "string" - }, - "contract_addr": { - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - { - "description": "Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.", - "type": "object", - "required": [ - "clear_admin" - ], - "properties": { - "clear_admin": { - "type": "object", - "required": [ - "contract_addr" - ], - "properties": { - "contract_addr": { - "type": "string" - } - } - } - }, - "additionalProperties": false - } - ] } - } + ] } diff --git a/contracts/ibc-reflect/schema/raw/migrate.json b/contracts/ibc-reflect/schema/raw/migrate.json new file mode 100644 index 0000000000..2bba958247 --- /dev/null +++ b/contracts/ibc-reflect/schema/raw/migrate.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MigrateMsg", + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" +} diff --git a/contracts/ibc-reflect/schema/raw/query.json b/contracts/ibc-reflect/schema/raw/query.json new file mode 100644 index 0000000000..2fb7b34e6f --- /dev/null +++ b/contracts/ibc-reflect/schema/raw/query.json @@ -0,0 +1,42 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Returns (reflect) account that is attached to this channel, or none.", + "type": "object", + "required": [ + "account" + ], + "properties": { + "account": { + "type": "object", + "required": [ + "channel_id" + ], + "properties": { + "channel_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns all (channel, reflect_account) pairs. No pagination - this is a test contract", + "type": "object", + "required": [ + "list_accounts" + ], + "properties": { + "list_accounts": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/queue/schema/raw/migrate.json b/contracts/queue/schema/raw/migrate.json index 1877209732..7fbe8c5708 100644 --- a/contracts/queue/schema/raw/migrate.json +++ b/contracts/queue/schema/raw/migrate.json @@ -1,41 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", - "oneOf": [ - { - "type": "object", - "required": [ - "enqueue" - ], - "properties": { - "enqueue": { - "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "dequeue" - ], - "properties": { - "dequeue": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] + "title": "MigrateMsg", + "type": "object", + "additionalProperties": false } diff --git a/contracts/queue/schema/raw/query.json b/contracts/queue/schema/raw/query.json index 1877209732..3c61d5fc57 100644 --- a/contracts/queue/schema/raw/query.json +++ b/contracts/queue/schema/raw/query.json @@ -1,24 +1,15 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", + "title": "QueryMsg", "oneOf": [ { "type": "object", "required": [ - "enqueue" + "count" ], "properties": { - "enqueue": { + "count": { "type": "object", - "required": [ - "value" - ], - "properties": { - "value": { - "type": "integer", - "format": "int32" - } - }, "additionalProperties": false } }, @@ -27,15 +18,65 @@ { "type": "object", "required": [ - "dequeue" + "sum" ], "properties": { - "dequeue": { + "sum": { "type": "object", "additionalProperties": false } }, "additionalProperties": false + }, + { + "type": "object", + "required": [ + "reducer" + ], + "properties": { + "reducer": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "list" + ], + "properties": { + "list": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Opens the given number of iterators for no reason other than testing. Returns and `Empty` response.", + "type": "object", + "required": [ + "open_iterators" + ], + "properties": { + "open_iterators": { + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false } ] } diff --git a/contracts/reflect/schema/raw/query.json b/contracts/reflect/schema/raw/query.json index e0db5ae603..04512e6f3f 100644 --- a/contracts/reflect/schema/raw/query.json +++ b/contracts/reflect/schema/raw/query.json @@ -1,24 +1,35 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", + "title": "QueryMsg", "oneOf": [ { "type": "object", "required": [ - "reflect_msg" + "owner" ], "properties": { - "reflect_msg": { + "owner": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This will call out to SpecialQuery::Capitalized", + "type": "object", + "required": [ + "capitalized" + ], + "properties": { + "capitalized": { "type": "object", "required": [ - "msgs" + "text" ], "properties": { - "msgs": { - "type": "array", - "items": { - "$ref": "#/definitions/CosmosMsg_for_CustomMsg" - } + "text": { + "type": "string" } }, "additionalProperties": false @@ -27,22 +38,20 @@ "additionalProperties": false }, { + "description": "Queries the blockchain and returns the result untouched", "type": "object", "required": [ - "reflect_sub_msg" + "chain" ], "properties": { - "reflect_sub_msg": { + "chain": { "type": "object", "required": [ - "msgs" + "request" ], "properties": { - "msgs": { - "type": "array", - "items": { - "$ref": "#/definitions/SubMsg_for_CustomMsg" - } + "request": { + "$ref": "#/definitions/QueryRequest_for_SpecialQuery" } }, "additionalProperties": false @@ -51,19 +60,48 @@ "additionalProperties": false }, { + "description": "Queries another contract and returns the data", "type": "object", "required": [ - "change_owner" + "raw" ], "properties": { - "change_owner": { + "raw": { "type": "object", "required": [ - "owner" + "contract", + "key" ], "properties": { - "owner": { + "contract": { "type": "string" + }, + "key": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "If there was a previous ReflectSubMsg with this ID, returns cosmwasm_std::Reply", + "type": "object", + "required": [ + "sub_msg_result" + ], + "properties": { + "sub_msg_result": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 } }, "additionalProperties": false @@ -73,30 +111,22 @@ } ], "definitions": { - "BankMsg": { - "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", + "BankQuery": { "oneOf": [ { - "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address.", + "description": "This calls into the native bank module for querying the total supply of one denomination. It does the same as the SupplyOf call in Cosmos SDK's RPC API. Return value is of type SupplyResponse.", "type": "object", "required": [ - "send" + "supply" ], "properties": { - "send": { + "supply": { "type": "object", "required": [ - "amount", - "to_address" + "denom" ], "properties": { - "amount": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - }, - "to_address": { + "denom": { "type": "string" } } @@ -105,133 +135,133 @@ "additionalProperties": false }, { - "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "description": "This calls into the native bank module for one denomination Return value is BalanceResponse", "type": "object", "required": [ - "burn" + "balance" ], "properties": { - "burn": { + "balance": { "type": "object", "required": [ - "amount" + "address", + "denom" ], "properties": { - "amount": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } + "address": { + "type": "string" + }, + "denom": { + "type": "string" } } } }, "additionalProperties": false - } - ] - }, - "Binary": { - "description": "Binary is a wrapper around Vec 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. See also .", - "type": "string" - }, - "Coin": { - "type": "object", - "required": [ - "amount", - "denom" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" }, - "denom": { - "type": "string" - } - } - }, - "CosmosMsg_for_CustomMsg": { - "oneOf": [ { + "description": "This calls into the native bank module for all denominations. Note that this may be much more expensive than Balance and should be avoided if possible. Return value is AllBalanceResponse.", "type": "object", "required": [ - "bank" - ], - "properties": { - "bank": { - "$ref": "#/definitions/BankMsg" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "custom" + "all_balances" ], "properties": { - "custom": { - "$ref": "#/definitions/CustomMsg" + "all_balances": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "type": "string" + } + } } }, "additionalProperties": false - }, + } + ] + }, + "Binary": { + "description": "Binary is a wrapper around Vec 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. See also .", + "type": "string" + }, + "IbcQuery": { + "description": "These are queries to the various IBC modules to see the state of the contract's IBC connection. These will return errors if the contract is not \"ibc enabled\"", + "oneOf": [ { + "description": "Gets the Port ID the current contract is bound to.\n\nReturns a `PortIdResponse`.", "type": "object", "required": [ - "staking" + "port_id" ], "properties": { - "staking": { - "$ref": "#/definitions/StakingMsg" + "port_id": { + "type": "object" } }, "additionalProperties": false }, { + "description": "Lists all channels that are bound to a given port. If `port_id` is omitted, this list all channels bound to the contract's port.\n\nReturns a `ListChannelsResponse`.", "type": "object", "required": [ - "distribution" + "list_channels" ], "properties": { - "distribution": { - "$ref": "#/definitions/DistributionMsg" + "list_channels": { + "type": "object", + "properties": { + "port_id": { + "type": [ + "string", + "null" + ] + } + } } }, "additionalProperties": false }, { - "description": "A Stargate message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "description": "Lists all information for a (portID, channelID) pair. If port_id is omitted, it will default to the contract's own channel. (To save a PortId{} call)\n\nReturns a `ChannelResponse`.", "type": "object", "required": [ - "stargate" + "channel" ], "properties": { - "stargate": { + "channel": { "type": "object", "required": [ - "type_url", - "value" + "channel_id" ], "properties": { - "type_url": { + "channel_id": { "type": "string" }, - "value": { - "$ref": "#/definitions/Binary" + "port_id": { + "type": [ + "string", + "null" + ] } } } }, "additionalProperties": false - }, + } + ] + }, + "QueryRequest_for_SpecialQuery": { + "oneOf": [ { "type": "object", "required": [ - "ibc" + "bank" ], "properties": { - "ibc": { - "$ref": "#/definitions/IbcMsg" + "bank": { + "$ref": "#/definitions/BankQuery" } }, "additionalProperties": false @@ -239,11 +269,11 @@ { "type": "object", "required": [ - "wasm" + "custom" ], "properties": { - "wasm": { - "$ref": "#/definitions/WasmMsg" + "custom": { + "$ref": "#/definitions/SpecialQuery" } }, "additionalProperties": false @@ -251,64 +281,39 @@ { "type": "object", "required": [ - "gov" - ], - "properties": { - "gov": { - "$ref": "#/definitions/GovMsg" - } - }, - "additionalProperties": false - } - ] - }, - "CustomMsg": { - "description": "CustomMsg is an override of CosmosMsg::Custom to show this works and can be extended in the contract", - "oneOf": [ - { - "type": "object", - "required": [ - "debug" + "staking" ], "properties": { - "debug": { - "type": "string" + "staking": { + "$ref": "#/definitions/StakingQuery" } }, "additionalProperties": false }, { + "description": "A Stargate query is encoded the same way as abci_query, with path and protobuf encoded request data. The format is defined in [ADR-21](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md). The response is protobuf encoded data directly without a JSON response wrapper. The caller is responsible for compiling the proper protobuf definitions for both requests and responses.", "type": "object", "required": [ - "raw" - ], - "properties": { - "raw": { - "$ref": "#/definitions/Binary" - } - }, - "additionalProperties": false - } - ] - }, - "DistributionMsg": { - "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", - "oneOf": [ - { - "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "set_withdraw_address" + "stargate" ], "properties": { - "set_withdraw_address": { + "stargate": { "type": "object", "required": [ - "address" + "data", + "path" ], "properties": { - "address": { - "description": "The `withdraw_address`", + "data": { + "description": "this is the expected protobuf message type (not any), binary encoded", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "path": { + "description": "this is the fully qualified service path used for routing, eg. custom/cosmos_sdk.x.bank.v1.Query/QueryBalance", "type": "string" } } @@ -317,244 +322,99 @@ "additionalProperties": false }, { - "description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", "type": "object", "required": [ - "withdraw_delegator_reward" + "ibc" ], "properties": { - "withdraw_delegator_reward": { - "type": "object", - "required": [ - "validator" - ], - "properties": { - "validator": { - "description": "The `validator_address`", - "type": "string" - } - } + "ibc": { + "$ref": "#/definitions/IbcQuery" } }, "additionalProperties": false - } - ] - }, - "GovMsg": { - "oneOf": [ + }, { - "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", "type": "object", "required": [ - "vote" + "wasm" ], "properties": { - "vote": { - "type": "object", - "required": [ - "proposal_id", - "vote" - ], - "properties": { - "proposal_id": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "vote": { - "$ref": "#/definitions/VoteOption" - } - } + "wasm": { + "$ref": "#/definitions/WasmQuery" } }, "additionalProperties": false } ] }, - "IbcMsg": { - "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)", + "SpecialQuery": { + "description": "An implementation of QueryRequest::Custom to show this works and can be extended in the contract", "oneOf": [ { - "description": "Sends bank tokens owned by the contract to the given address on another chain. The channel must already be established between the ibctransfer module on this chain and a matching module on the remote chain. We cannot select the port_id, this is whatever the local chain has bound the ibctransfer module to.", "type": "object", "required": [ - "transfer" + "ping" ], "properties": { - "transfer": { + "ping": { "type": "object", - "required": [ - "amount", - "channel_id", - "timeout", - "to_address" - ], - "properties": { - "amount": { - "description": "packet data only supports one coin https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20", - "allOf": [ - { - "$ref": "#/definitions/Coin" - } - ] - }, - "channel_id": { - "description": "exisiting channel to send the tokens over", - "type": "string" - }, - "timeout": { - "description": "when packet times out, measured on remote chain", - "allOf": [ - { - "$ref": "#/definitions/IbcTimeout" - } - ] - }, - "to_address": { - "description": "address on the remote chain to receive these tokens", - "type": "string" - } - } + "additionalProperties": false } }, "additionalProperties": false }, { - "description": "Sends an IBC packet with given data over the existing channel. Data should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.", "type": "object", "required": [ - "send_packet" + "capitalized" ], "properties": { - "send_packet": { + "capitalized": { "type": "object", "required": [ - "channel_id", - "data", - "timeout" + "text" ], "properties": { - "channel_id": { + "text": { "type": "string" - }, - "data": { - "$ref": "#/definitions/Binary" - }, - "timeout": { - "description": "when packet times out, measured on remote chain", - "allOf": [ - { - "$ref": "#/definitions/IbcTimeout" - } - ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false - }, + } + ] + }, + "StakingQuery": { + "oneOf": [ { - "description": "This will close an existing channel that is owned by this contract. Port is auto-assigned to the contract's IBC port", + "description": "Returns the denomination that can be bonded (if there are multiple native tokens on the chain)", "type": "object", "required": [ - "close_channel" + "bonded_denom" ], "properties": { - "close_channel": { - "type": "object", - "required": [ - "channel_id" - ], - "properties": { - "channel_id": { - "type": "string" - } - } + "bonded_denom": { + "type": "object" } }, "additionalProperties": false - } - ] - }, - "IbcTimeout": { - "description": "In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.", - "type": "object", - "properties": { - "block": { - "anyOf": [ - { - "$ref": "#/definitions/IbcTimeoutBlock" - }, - { - "type": "null" - } - ] - }, - "timestamp": { - "anyOf": [ - { - "$ref": "#/definitions/Timestamp" - }, - { - "type": "null" - } - ] - } - } - }, - "IbcTimeoutBlock": { - "description": "IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)", - "type": "object", - "required": [ - "height", - "revision" - ], - "properties": { - "height": { - "description": "block height after which the packet times out. the height within the given revision", - "type": "integer", - "format": "uint64", - "minimum": 0.0 }, - "revision": { - "description": "the version that the client is currently on (eg. after reseting the chain this could increment 1 as height drops to 0)", - "type": "integer", - "format": "uint64", - "minimum": 0.0 - } - } - }, - "ReplyOn": { - "description": "Use this to define when the contract gets a response callback. If you only need it for errors or success you can select just those in order to save gas.", - "type": "string", - "enum": [ - "always", - "error", - "success", - "never" - ] - }, - "StakingMsg": { - "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", - "oneOf": [ { - "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address.", + "description": "AllDelegations will return all delegations by the delegator", "type": "object", "required": [ - "delegate" + "all_delegations" ], "properties": { - "delegate": { + "all_delegations": { "type": "object", "required": [ - "amount", - "validator" + "delegator" ], "properties": { - "amount": { - "$ref": "#/definitions/Coin" - }, - "validator": { + "delegator": { "type": "string" } } @@ -563,21 +423,21 @@ "additionalProperties": false }, { - "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address.", + "description": "Delegation will return more detailed info on a particular delegation, defined by delegator/validator pair", "type": "object", "required": [ - "undelegate" + "delegation" ], "properties": { - "undelegate": { + "delegation": { "type": "object", "required": [ - "amount", + "delegator", "validator" ], "properties": { - "amount": { - "$ref": "#/definitions/Coin" + "delegator": { + "type": "string" }, "validator": { "type": "string" @@ -588,172 +448,63 @@ "additionalProperties": false }, { - "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.", + "description": "Returns all validators in the currently active validator set.\n\nThe query response type is `AllValidatorsResponse`.", "type": "object", "required": [ - "redelegate" + "all_validators" ], "properties": { - "redelegate": { - "type": "object", - "required": [ - "amount", - "dst_validator", - "src_validator" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Coin" - }, - "dst_validator": { - "type": "string" - }, - "src_validator": { - "type": "string" - } - } + "all_validators": { + "type": "object" } }, "additionalProperties": false - } - ] - }, - "SubMsg_for_CustomMsg": { - "description": "A submessage that will guarantee a `reply` call on success or error, depending on the `reply_on` setting. If you do not need to process the result, use regular messages instead.\n\nNote: On error the submessage execution will revert any partial state changes due to this message, but not revert any state changes in the calling contract. If this is required, it must be done manually in the `reply` entry point.", - "type": "object", - "required": [ - "id", - "msg", - "reply_on" - ], - "properties": { - "gas_limit": { - "description": "Gas limit measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md).", - "type": [ - "integer", - "null" - ], - "format": "uint64", - "minimum": 0.0 - }, - "id": { - "description": "An arbitrary ID chosen by the contract. This is typically used to match `Reply`s in the `reply` entry point to the submessage.", - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "msg": { - "$ref": "#/definitions/CosmosMsg_for_CustomMsg" }, - "reply_on": { - "$ref": "#/definitions/ReplyOn" - } - } - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ { - "$ref": "#/definitions/Uint64" - } - ] - }, - "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" - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 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 `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - }, - "VoteOption": { - "type": "string", - "enum": [ - "yes", - "no", - "abstain", - "no_with_veto" - ] - }, - "WasmMsg": { - "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", - "oneOf": [ - { - "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address.", + "description": "Returns the validator at the given address. Returns None if the validator is not part of the currently active validator set.\n\nThe query response type is `ValidatorResponse`.", "type": "object", "required": [ - "execute" + "validator" ], "properties": { - "execute": { + "validator": { "type": "object", "required": [ - "contract_addr", - "funds", - "msg" + "address" ], "properties": { - "contract_addr": { + "address": { + "description": "The validator's address (e.g. (e.g. cosmosvaloper1...))", "type": "string" - }, - "funds": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - }, - "msg": { - "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] } } } }, "additionalProperties": false - }, + } + ] + }, + "WasmQuery": { + "oneOf": [ { - "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", + "description": "this queries the public API of another contract at a known address (with known ABI) Return value is whatever the contract returns (caller should know), wrapped in a ContractResult that is JSON encoded.", "type": "object", "required": [ - "instantiate" + "smart" ], "properties": { - "instantiate": { + "smart": { "type": "object", "required": [ - "code_id", - "funds", - "label", + "contract_addr", "msg" ], "properties": { - "admin": { - "type": [ - "string", - "null" - ] - }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "funds": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - }, - "label": { - "description": "A human-readbale label for the contract", + "contract_addr": { "type": "string" }, "msg": { - "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "description": "msg is the json-encoded QueryMsg struct", "allOf": [ { "$ref": "#/definitions/Binary" @@ -766,61 +517,29 @@ "additionalProperties": false }, { - "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address.", + "description": "this queries the raw kv-store of the contract. returns the raw, unparsed data stored at that key, which may be an empty vector if not present", "type": "object", "required": [ - "migrate" + "raw" ], "properties": { - "migrate": { + "raw": { "type": "object", "required": [ "contract_addr", - "msg", - "new_code_id" + "key" ], "properties": { "contract_addr": { "type": "string" }, - "msg": { - "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", + "key": { + "description": "Key is the raw key used in the contracts Storage", "allOf": [ { "$ref": "#/definitions/Binary" } ] - }, - "new_code_id": { - "description": "the code_id of the new logic to place in the given contract", - "type": "integer", - "format": "uint64", - "minimum": 0.0 - } - } - } - }, - "additionalProperties": false - }, - { - "description": "Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.", - "type": "object", - "required": [ - "update_admin" - ], - "properties": { - "update_admin": { - "type": "object", - "required": [ - "admin", - "contract_addr" - ], - "properties": { - "admin": { - "type": "string" - }, - "contract_addr": { - "type": "string" } } } @@ -828,13 +547,13 @@ "additionalProperties": false }, { - "description": "Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.", + "description": "returns a ContractInfoResponse with metadata on the contract from the runtime", "type": "object", "required": [ - "clear_admin" + "contract_info" ], "properties": { - "clear_admin": { + "contract_info": { "type": "object", "required": [ "contract_addr" diff --git a/contracts/staking/schema/raw/query.json b/contracts/staking/schema/raw/query.json index 159d67cd90..6427a6bc87 100644 --- a/contracts/staking/schema/raw/query.json +++ b/contracts/staking/schema/raw/query.json @@ -1,25 +1,21 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", + "title": "QueryMsg", "oneOf": [ { - "description": "Transfer moves the derivative token", + "description": "Balance shows the number of staking derivatives", "type": "object", "required": [ - "transfer" + "balance" ], "properties": { - "transfer": { + "balance": { "type": "object", "required": [ - "amount", - "recipient" + "address" ], "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "recipient": { + "address": { "type": "string" } }, @@ -29,34 +25,20 @@ "additionalProperties": false }, { - "description": "Bond will bond all staking tokens sent with the message and release derivative tokens", + "description": "Claims shows the number of tokens this address can access when they are done unbonding", "type": "object", "required": [ - "bond" + "claims" ], "properties": { - "bond": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Unbond will \"burn\" the given amount of derivative tokens and send the unbonded staking tokens to the message sender (after exit tax is deducted)", - "type": "object", - "required": [ - "unbond" - ], - "properties": { - "unbond": { + "claims": { "type": "object", "required": [ - "amount" + "address" ], "properties": { - "amount": { - "$ref": "#/definitions/Uint128" + "address": { + "type": "string" } }, "additionalProperties": false @@ -65,13 +47,13 @@ "additionalProperties": false }, { - "description": "Claim is used to claim your native tokens that you previously \"unbonded\" after the chain-defined waiting period (eg. 3 weeks)", + "description": "TokenInfo shows the metadata of the token for UIs", "type": "object", "required": [ - "claim" + "token_info" ], "properties": { - "claim": { + "token_info": { "type": "object", "additionalProperties": false } @@ -79,38 +61,18 @@ "additionalProperties": false }, { - "description": "Reinvest will check for all accumulated rewards, withdraw them, and re-bond them to the same validator. Anyone can call this, which updates the value of the token (how much under custody).", + "description": "Investment shows info on total staking tokens under custody, with which validator, as well as how many derivative tokens are lists. It also shows with the exit tax.", "type": "object", "required": [ - "reinvest" + "investment" ], "properties": { - "reinvest": { + "investment": { "type": "object", "additionalProperties": false } }, "additionalProperties": false - }, - { - "description": "_BondAllTokens can only be called by the contract itself, after all rewards have been withdrawn. This is an example of using \"callbacks\" in message flows. This can only be invoked by the contract itself as a return from Reinvest", - "type": "object", - "required": [ - "__bond_all_tokens" - ], - "properties": { - "__bond_all_tokens": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - } - ], - "definitions": { - "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" } - } + ] } From c939aff71fe2ca0e09926eccb62c7e99c0c8e809 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Tue, 6 Dec 2022 11:45:52 +0100 Subject: [PATCH 3/3] Add PR links to raw JSON Schema directory change --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d780adf87..d6472e1d97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,10 +15,13 @@ and this project adheres to - cosmwasm-std: Add `instantiate2_address` which allows calculating the predictable addresses for `MsgInstantiateContract2` ([#1437]). - cosmwasm-schema: In contracts, `cosmwasm schema` will now output a separate - JSON Schema file for each entrypoint in the `raw` subdirectory. + JSON Schema file for each entrypoint in the `raw` subdirectory ([#1478], + [#1533]). [#1437]: https://github.com/CosmWasm/cosmwasm/issues/1437 [#1481]: https://github.com/CosmWasm/cosmwasm/pull/1481 +[#1478]: https://github.com/CosmWasm/cosmwasm/pull/1478 +[#1533]: https://github.com/CosmWasm/cosmwasm/pull/1533 ### Changed