From 059c329d3bca4624011963a6f08c896796b9ceeb Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 11 Jan 2024 15:42:04 +0200 Subject: [PATCH 1/4] add validator signing infos tests and queries --- Cargo.lock | 4 +- Cargo.toml | 7 +- Makefile | 2 +- .../schema/execute_msg.json | 33 ++++ .../src/contract.rs | 22 ++- .../neutron_interchain_queries/src/msg.rs | 6 + .../src/testing/tests.rs | 99 ++++++++++- contracts/reflect/schema/query_msg.json | 154 ++++++++++++++++++ 8 files changed, 318 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 68d58c3..ce584bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -602,8 +602,8 @@ dependencies = [ [[package]] name = "neutron-sdk" -version = "0.8.0" -source = "git+https://github.com/neutron-org/neutron-sdk?branch=main#680265107cd85f9441f54941a853d7576da78088" +version = "0.7.0" +source = "git+https://github.com/neutron-org/neutron-sdk?rev=6057d9181643887c5a7466a2e96f5d8d69db5008#6057d9181643887c5a7466a2e96f5d8d69db5008" dependencies = [ "bech32", "cosmos-sdk-proto 0.20.0", diff --git a/Cargo.toml b/Cargo.toml index f38050e..d7cc399 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,12 @@ neutron-sdk = { git = "https://github.com/neutron-org/neutron-sdk", branch = "ma prost = "0.12.1" prost-types = "0.12.1" cosmos-sdk-proto = { version = "0.20.0", default-features = false } -cosmwasm-std = "1.4.1" +cosmwasm-std = { version = "1.4.1", features = [ + "stargate", + "staking", + "cosmwasm_1_1", + "cosmwasm_1_2" +] } cw2 = "1.1.1" cw-storage-plus = "1.1.0" schemars = "0.8.15" diff --git a/Makefile b/Makefile index f3fbfdb..c39fd3a 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,6 @@ compile: check_contracts: @cargo install cosmwasm-check - @cosmwasm-check --available-capabilities iterator,staking,stargate,neutron artifacts/*.wasm + @cosmwasm-check --available-capabilities iterator,staking,stargate,neutron,cosmwasm_1_1,cosmwasm_1_2 artifacts/*.wasm build: schema clippy test fmt compile check_contracts diff --git a/contracts/neutron_interchain_queries/schema/execute_msg.json b/contracts/neutron_interchain_queries/schema/execute_msg.json index 79397f8..5ebaae1 100644 --- a/contracts/neutron_interchain_queries/schema/execute_msg.json +++ b/contracts/neutron_interchain_queries/schema/execute_msg.json @@ -238,6 +238,39 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "register_validators_signing_info_query" + ], + "properties": { + "register_validators_signing_info_query": { + "type": "object", + "required": [ + "connection_id", + "update_period", + "validators" + ], + "properties": { + "connection_id": { + "type": "string" + }, + "update_period": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "validators": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false + }, { "type": "object", "required": [ diff --git a/contracts/neutron_interchain_queries/src/contract.rs b/contracts/neutron_interchain_queries/src/contract.rs index 84f1bf8..7714a2e 100644 --- a/contracts/neutron_interchain_queries/src/contract.rs +++ b/contracts/neutron_interchain_queries/src/contract.rs @@ -37,8 +37,9 @@ use neutron_sdk::interchain_queries::types::{ }; use neutron_sdk::interchain_queries::v045::queries::{ query_balance, query_bank_total, query_delegations, query_distribution_fee_pool, - query_government_proposals, query_staking_validators, + query_government_proposals, query_staking_validators, query_validators_signing_infos, }; +use neutron_sdk::interchain_queries::v045::register_queries::new_register_validators_signing_infos_query_msg; use neutron_sdk::interchain_queries::v045::types::{COSMOS_SDK_TRANSFER_MSG_URL, RECIPIENT_FIELD}; use neutron_sdk::interchain_queries::v045::{ new_register_balance_query_msg, new_register_bank_total_supply_query_msg, @@ -108,6 +109,11 @@ pub fn execute( validators, update_period, } => register_delegations_query(connection_id, delegator, validators, update_period), + ExecuteMsg::RegisterValidatorsSigningInfoQuery { + connection_id, + validators, + update_period, + } => register_validators_signing_infos_query(connection_id, validators, update_period), ExecuteMsg::RegisterTransfersQuery { connection_id, recipient, @@ -201,6 +207,17 @@ pub fn register_delegations_query( Ok(Response::new().add_message(msg)) } +pub fn register_validators_signing_infos_query( + connection_id: String, + validators: Vec, + update_period: u64, +) -> NeutronResult> { + let msg = + new_register_validators_signing_infos_query_msg(connection_id, validators, update_period)?; + + Ok(Response::new().add_message(msg)) +} + pub fn register_transfers_query( connection_id: String, recipient: String, @@ -289,6 +306,9 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> NeutronResult QueryMsg::StakingValidators { query_id } => Ok(to_json_binary(&query_staking_validators( deps, env, query_id, )?)?), + QueryMsg::ValidatorsSigningInfos { query_id } => Ok(to_json_binary( + &query_validators_signing_infos(deps, env, query_id)?, + )?), QueryMsg::GovernmentProposals { query_id } => Ok(to_json_binary( &query_government_proposals(deps, env, query_id)?, )?), diff --git a/contracts/neutron_interchain_queries/src/msg.rs b/contracts/neutron_interchain_queries/src/msg.rs index f97968f..c297d84 100644 --- a/contracts/neutron_interchain_queries/src/msg.rs +++ b/contracts/neutron_interchain_queries/src/msg.rs @@ -46,6 +46,11 @@ pub enum ExecuteMsg { connection_id: String, update_period: u64, }, + RegisterValidatorsSigningInfoQuery { + validators: Vec, + connection_id: String, + update_period: u64, + }, UpdateInterchainQuery { query_id: u64, new_keys: Option>, @@ -84,6 +89,7 @@ pub enum QueryMsg { BankTotalSupply { query_id: u64 }, DistributionFeePool { query_id: u64 }, StakingValidators { query_id: u64 }, + ValidatorsSigningInfos { query_id: u64 }, GovernmentProposals { query_id: u64 }, GetDelegations { query_id: u64 }, GetRegisteredQuery { query_id: u64 }, diff --git a/contracts/neutron_interchain_queries/src/testing/tests.rs b/contracts/neutron_interchain_queries/src/testing/tests.rs index 1993b36..30fc1fc 100644 --- a/contracts/neutron_interchain_queries/src/testing/tests.rs +++ b/contracts/neutron_interchain_queries/src/testing/tests.rs @@ -23,6 +23,7 @@ use cosmos_sdk_proto::cosmos::distribution::v1beta1::FeePool as CosmosFeePool; use cosmos_sdk_proto::cosmos::gov::v1beta1::{ Proposal as CosmosProposal, TallyResult as CosmosTallyResult, }; +use cosmos_sdk_proto::cosmos::slashing::v1beta1::ValidatorSigningInfo as CosmosValidatorSigningInfo; use cosmos_sdk_proto::cosmos::staking::v1beta1::Validator as CosmosValidator; use cosmos_sdk_proto::Any; use cosmwasm_std::testing::{mock_env, mock_info, MockApi, MockStorage}; @@ -42,15 +43,15 @@ use neutron_sdk::interchain_queries::types::{ }; use neutron_sdk::interchain_queries::v045::helpers::{ create_account_denom_balance_key, create_fee_pool_key, create_gov_proposal_key, - create_total_denom_key, create_validator_key, + create_total_denom_key, create_validator_key, create_validator_signing_info_key, }; use neutron_sdk::interchain_queries::v045::queries::{ BalanceResponse, DelegatorDelegationsResponse, FeePoolResponse, ProposalResponse, - TotalSupplyResponse, ValidatorResponse, + TotalSupplyResponse, ValidatorResponse, ValidatorSigningInfoResponse, }; use neutron_sdk::interchain_queries::v045::types::{ - Balances, FeePool, GovernmentProposal, Proposal, StakingValidator, TallyResult, TotalSupply, - Validator, DECIMAL_PLACES, RECIPIENT_FIELD, + Balances, FeePool, GovernmentProposal, Proposal, SigningInfo, StakingValidator, TallyResult, + TotalSupply, Validator, ValidatorSigningInfo, DECIMAL_PLACES, RECIPIENT_FIELD, }; use neutron_sdk::NeutronError; use prost::Message as ProstMessage; @@ -173,6 +174,26 @@ fn build_interchain_query_staking_validator_value(validator: String) -> StorageV } } +fn build_interchain_query_validator_signing_info_value(validator: String) -> StorageValue { + let operator_address = decode_and_convert(validator.as_str()).unwrap(); + let validator_key = create_validator_signing_info_key(operator_address).unwrap(); + + let validator = CosmosValidatorSigningInfo { + address: validator, + start_height: 1, + index_offset: 1, + jailed_until: None, + tombstoned: false, + missed_blocks_counter: 987675, + }; + + StorageValue { + storage_prefix: "".to_string(), + key: Binary(validator_key), + value: Binary(validator.encode_to_vec()), + } +} + fn build_interchain_query_gov_proposal_value(proposal_id: u64) -> StorageValue { let proposal_key = create_gov_proposal_key(proposal_id).unwrap(); @@ -534,6 +555,7 @@ fn test_staking_validators_query() { Validator { operator_address: "cosmosvaloper132juzk0gdmwuxvx4phug7m3ymyatxlh9734g4w" .to_string(), + consensus_pubkey: Some(vec!()), status: 1, tokens: "1".to_string(), jailed: false, @@ -554,6 +576,7 @@ fn test_staking_validators_query() { Validator { operator_address: "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0" .to_string(), + consensus_pubkey: Some(vec!()), status: 1, tokens: "1".to_string(), jailed: false, @@ -577,6 +600,74 @@ fn test_staking_validators_query() { ) } +#[test] +fn test_validators_signing_infos_query() { + let mut deps = dependencies(&[]); + let validators = vec![ + "cosmosvalcons1yjf46k064988jdjje068zmrqg8xh4fqqe2wwnl".to_string(), + "cosmosvalcons16tnak7apushwznnd3wtku8gm0rt3xytz6ut006".to_string(), + ]; + + let msg = ExecuteMsg::RegisterValidatorsSigningInfoQuery { + connection_id: "connection".to_string(), + update_period: 10, + validators: validators.clone(), + }; + + let keys = register_query(&mut deps, mock_env(), mock_info("", &[]), msg); + + let registered_query = + build_registered_query_response(1, QueryParam::Keys(keys.0), QueryType::KV, 987); + + let mut kv_results: Vec = vec![]; + + for validator in validators { + let value = build_interchain_query_validator_signing_info_value(validator); + kv_results.push(value); + } + + let validators_response = QueryRegisteredQueryResultResponse { + result: InterchainQueryResult { + kv_results, + height: 0, + revision: 0, + }, + }; + + deps.querier.add_registered_queries(1, registered_query); + deps.querier + .add_query_response(1, to_json_binary(&validators_response).unwrap()); + let validators_signing_infos = QueryMsg::ValidatorsSigningInfos { query_id: 1 }; + let resp: ValidatorSigningInfoResponse = + from_json(query(deps.as_ref(), mock_env(), validators_signing_infos).unwrap()).unwrap(); + assert_eq!( + resp, + ValidatorSigningInfoResponse { + last_submitted_local_height: 987, + signing_infos: SigningInfo { + signing_infos: vec![ + ValidatorSigningInfo { + address: "cosmosvalcons1yjf46k064988jdjje068zmrqg8xh4fqqe2wwnl".to_string(), + start_height: 1, + index_offset: 1, + jailed_until: None, + tombstoned: false, + missed_blocks_counter: 987675, + }, + ValidatorSigningInfo { + address: "cosmosvalcons16tnak7apushwznnd3wtku8gm0rt3xytz6ut006".to_string(), + start_height: 1, + index_offset: 1, + jailed_until: None, + tombstoned: false, + missed_blocks_counter: 987675, + } + ] + } + } + ) +} + #[test] fn test_query_delegator_delegations() { let mut deps = dependencies(&[]); diff --git a/contracts/reflect/schema/query_msg.json b/contracts/reflect/schema/query_msg.json index 20a041f..f2ebe01 100644 --- a/contracts/reflect/schema/query_msg.json +++ b/contracts/reflect/schema/query_msg.json @@ -18,6 +18,27 @@ "definitions": { "BankQuery": { "oneOf": [ + { + "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": [ + "supply" + ], + "properties": { + "supply": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, { "description": "This calls into the native bank module for one denomination Return value is BalanceResponse", "type": "object", @@ -306,6 +327,18 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "staking" + ], + "properties": { + "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", @@ -363,6 +396,104 @@ } ] }, + "StakingQuery": { + "oneOf": [ + { + "description": "Returns the denomination that can be bonded (if there are multiple native tokens on the chain)", + "type": "object", + "required": [ + "bonded_denom" + ], + "properties": { + "bonded_denom": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "description": "AllDelegations will return all delegations by the delegator", + "type": "object", + "required": [ + "all_delegations" + ], + "properties": { + "all_delegations": { + "type": "object", + "required": [ + "delegator" + ], + "properties": { + "delegator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Delegation will return more detailed info on a particular delegation, defined by delegator/validator pair", + "type": "object", + "required": [ + "delegation" + ], + "properties": { + "delegation": { + "type": "object", + "required": [ + "delegator", + "validator" + ], + "properties": { + "delegator": { + "type": "string" + }, + "validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Returns all validators in the currently active validator set.\n\nThe query response type is `AllValidatorsResponse`.", + "type": "object", + "required": [ + "all_validators" + ], + "properties": { + "all_validators": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "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": [ + "validator" + ], + "properties": { + "validator": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "description": "The validator's address (e.g. (e.g. cosmosvaloper1...))", + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, "WasmQuery": { "oneOf": [ { @@ -445,6 +576,29 @@ } }, "additionalProperties": false + }, + { + "description": "Returns a [`CodeInfoResponse`] with metadata of the code", + "type": "object", + "required": [ + "code_info" + ], + "properties": { + "code_info": { + "type": "object", + "required": [ + "code_id" + ], + "properties": { + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false } ] } From c31661b9bd6b694625322629177d1f565ec1b4f0 Mon Sep 17 00:00:00 2001 From: Murad Karammaev Date: Mon, 22 Jan 2024 08:03:26 +0200 Subject: [PATCH 2/4] feat: unbonding delegations query --- Cargo.lock | 72 +++++++++---------- .../schema/execute_msg.json | 37 ++++++++++ .../schema/query_msg.json | 44 ++++++++++++ .../src/contract.rs | 40 +++++++++-- .../neutron_interchain_queries/src/msg.rs | 7 ++ 5 files changed, 160 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce584bc..04b3ba3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -157,9 +157,9 @@ dependencies = [ [[package]] name = "cosmwasm-crypto" -version = "1.5.3" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9934c79e58d9676edfd592557dee765d2a6ef54c09d5aa2edb06156b00148966" +checksum = "8ed6aa9f904de106fa16443ad14ec2abe75e94ba003bb61c681c0e43d4c58d2a" dependencies = [ "digest 0.10.7", "ecdsa", @@ -171,18 +171,18 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "1.5.3" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5e72e330bd3bdab11c52b5ecbdeb6a8697a004c57964caeb5d876f0b088b3c" +checksum = "40abec852f3d4abec6d44ead9a58b78325021a1ead1e7229c3471414e57b2e49" dependencies = [ "syn 1.0.109", ] [[package]] name = "cosmwasm-schema" -version = "1.5.3" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e3a2136e2a60e8b6582f5dffca5d1a683ed77bf38537d330bc1dfccd69010" +checksum = "b166215fbfe93dc5575bae062aa57ae7bb41121cffe53bac33b033257949d2a9" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.5.3" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5d803bea6bd9ed61bd1ee0b4a2eb09ee20dbb539cc6e0b8795614d20952ebb1" +checksum = "8bf12f8e20bb29d1db66b7ca590bc2f670b548d21e9be92499bc0f9022a994a8" dependencies = [ "proc-macro2", "quote", @@ -204,9 +204,9 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "1.5.3" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8666e572a3a2519010dde88c04d16e9339ae751b56b2bb35081fe3f7d6be74" +checksum = "ad011ae7447188e26e4a7dbca2fcd0fc186aa21ae5c86df0503ea44c78f9e469" dependencies = [ "base64", "bech32", @@ -558,9 +558,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "k256" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", "ecdsa", @@ -572,9 +572,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "msg_receiver" @@ -602,8 +602,8 @@ dependencies = [ [[package]] name = "neutron-sdk" -version = "0.7.0" -source = "git+https://github.com/neutron-org/neutron-sdk?rev=6057d9181643887c5a7466a2e96f5d8d69db5008#6057d9181643887c5a7466a2e96f5d8d69db5008" +version = "0.8.0" +source = "git+https://github.com/neutron-org/neutron-sdk?branch=feat/LIDO-68-query-siginig-info#e753df9a24cb0001dfb125ef6f67595da01eee64" dependencies = [ "bech32", "cosmos-sdk-proto 0.20.0", @@ -810,7 +810,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.48", ] [[package]] @@ -955,9 +955,9 @@ checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] @@ -1000,13 +1000,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.48", ] [[package]] @@ -1022,9 +1022,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -1126,7 +1126,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.49", + "syn 2.0.48", ] [[package]] @@ -1157,9 +1157,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.49" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -1204,29 +1204,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.48", ] [[package]] name = "time" -version = "0.3.34" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "num-conv", @@ -1243,9 +1243,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "num-conv", "time-core", diff --git a/contracts/neutron_interchain_queries/schema/execute_msg.json b/contracts/neutron_interchain_queries/schema/execute_msg.json index 5ebaae1..c365623 100644 --- a/contracts/neutron_interchain_queries/schema/execute_msg.json +++ b/contracts/neutron_interchain_queries/schema/execute_msg.json @@ -238,6 +238,43 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "register_delegator_unbonding_delegations_query" + ], + "properties": { + "register_delegator_unbonding_delegations_query": { + "type": "object", + "required": [ + "connection_id", + "delegator", + "update_period", + "validators" + ], + "properties": { + "connection_id": { + "type": "string" + }, + "delegator": { + "type": "string" + }, + "update_period": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "validators": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false + }, { "type": "object", "required": [ diff --git a/contracts/neutron_interchain_queries/schema/query_msg.json b/contracts/neutron_interchain_queries/schema/query_msg.json index 8c59f6b..858f554 100644 --- a/contracts/neutron_interchain_queries/schema/query_msg.json +++ b/contracts/neutron_interchain_queries/schema/query_msg.json @@ -90,6 +90,28 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "validators_signing_infos" + ], + "properties": { + "validators_signing_infos": { + "type": "object", + "required": [ + "query_id" + ], + "properties": { + "query_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, { "type": "object", "required": [ @@ -134,6 +156,28 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "get_unbonding_delegations" + ], + "properties": { + "get_unbonding_delegations": { + "type": "object", + "required": [ + "query_id" + ], + "properties": { + "query_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, { "type": "object", "required": [ diff --git a/contracts/neutron_interchain_queries/src/contract.rs b/contracts/neutron_interchain_queries/src/contract.rs index 7714a2e..37cc1fd 100644 --- a/contracts/neutron_interchain_queries/src/contract.rs +++ b/contracts/neutron_interchain_queries/src/contract.rs @@ -37,15 +37,17 @@ use neutron_sdk::interchain_queries::types::{ }; use neutron_sdk::interchain_queries::v045::queries::{ query_balance, query_bank_total, query_delegations, query_distribution_fee_pool, - query_government_proposals, query_staking_validators, query_validators_signing_infos, + query_government_proposals, query_staking_validators, query_unbonding_delegations, + query_validators_signing_infos, }; use neutron_sdk::interchain_queries::v045::register_queries::new_register_validators_signing_infos_query_msg; use neutron_sdk::interchain_queries::v045::types::{COSMOS_SDK_TRANSFER_MSG_URL, RECIPIENT_FIELD}; use neutron_sdk::interchain_queries::v045::{ new_register_balance_query_msg, new_register_bank_total_supply_query_msg, - new_register_delegator_delegations_query_msg, new_register_distribution_fee_pool_query_msg, - new_register_gov_proposal_query_msg, new_register_staking_validators_query_msg, - new_register_transfers_query_msg, + new_register_delegator_delegations_query_msg, + new_register_delegator_unbonding_delegations_query_msg, + new_register_distribution_fee_pool_query_msg, new_register_gov_proposal_query_msg, + new_register_staking_validators_query_msg, new_register_transfers_query_msg, }; use neutron_sdk::sudo::msg::SudoMsg; use neutron_sdk::{NeutronError, NeutronResult}; @@ -109,6 +111,17 @@ pub fn execute( validators, update_period, } => register_delegations_query(connection_id, delegator, validators, update_period), + ExecuteMsg::RegisterDelegatorUnbondingDelegationsQuery { + connection_id, + delegator, + validators, + update_period, + } => register_unbonding_delegations_query( + connection_id, + delegator, + validators, + update_period, + ), ExecuteMsg::RegisterValidatorsSigningInfoQuery { connection_id, validators, @@ -207,6 +220,22 @@ pub fn register_delegations_query( Ok(Response::new().add_message(msg)) } +pub fn register_unbonding_delegations_query( + connection_id: String, + delegator: String, + validators: Vec, + update_period: u64, +) -> NeutronResult> { + let msg = new_register_delegator_unbonding_delegations_query_msg( + connection_id, + delegator, + validators, + update_period, + )?; + + Ok(Response::new().add_message(msg)) +} + pub fn register_validators_signing_infos_query( connection_id: String, validators: Vec, @@ -315,6 +344,9 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> NeutronResult QueryMsg::GetDelegations { query_id } => { Ok(to_json_binary(&query_delegations(deps, env, query_id)?)?) } + QueryMsg::GetUnbondingDelegations { query_id } => Ok(to_json_binary( + &query_unbonding_delegations(deps, env, query_id)?, + )?), QueryMsg::GetRegisteredQuery { query_id } => { Ok(to_json_binary(&get_registered_query(deps, query_id)?)?) } diff --git a/contracts/neutron_interchain_queries/src/msg.rs b/contracts/neutron_interchain_queries/src/msg.rs index c297d84..70ff045 100644 --- a/contracts/neutron_interchain_queries/src/msg.rs +++ b/contracts/neutron_interchain_queries/src/msg.rs @@ -46,6 +46,12 @@ pub enum ExecuteMsg { connection_id: String, update_period: u64, }, + RegisterDelegatorUnbondingDelegationsQuery { + delegator: String, + validators: Vec, + connection_id: String, + update_period: u64, + }, RegisterValidatorsSigningInfoQuery { validators: Vec, connection_id: String, @@ -92,6 +98,7 @@ pub enum QueryMsg { ValidatorsSigningInfos { query_id: u64 }, GovernmentProposals { query_id: u64 }, GetDelegations { query_id: u64 }, + GetUnbondingDelegations { query_id: u64 }, GetRegisteredQuery { query_id: u64 }, GetRecipientTxs { recipient: String }, KvCallbackStats { query_id: u64 }, From d9e72ab12873ec75faaa2dd159ff396a2572dc4f Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 22 Feb 2024 15:22:46 +0200 Subject: [PATCH 3/4] Fixes after depenceny update --- Cargo.lock | 82 +++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 04b3ba3..6478e34 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,9 +15,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "autocfg" @@ -157,9 +157,9 @@ dependencies = [ [[package]] name = "cosmwasm-crypto" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ed6aa9f904de106fa16443ad14ec2abe75e94ba003bb61c681c0e43d4c58d2a" +checksum = "9934c79e58d9676edfd592557dee765d2a6ef54c09d5aa2edb06156b00148966" dependencies = [ "digest 0.10.7", "ecdsa", @@ -171,18 +171,18 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40abec852f3d4abec6d44ead9a58b78325021a1ead1e7229c3471414e57b2e49" +checksum = "bc5e72e330bd3bdab11c52b5ecbdeb6a8697a004c57964caeb5d876f0b088b3c" dependencies = [ "syn 1.0.109", ] [[package]] name = "cosmwasm-schema" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b166215fbfe93dc5575bae062aa57ae7bb41121cffe53bac33b033257949d2a9" +checksum = "ac3e3a2136e2a60e8b6582f5dffca5d1a683ed77bf38537d330bc1dfccd69010" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf12f8e20bb29d1db66b7ca590bc2f670b548d21e9be92499bc0f9022a994a8" +checksum = "f5d803bea6bd9ed61bd1ee0b4a2eb09ee20dbb539cc6e0b8795614d20952ebb1" dependencies = [ "proc-macro2", "quote", @@ -204,9 +204,9 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad011ae7447188e26e4a7dbca2fcd0fc186aa21ae5c86df0503ea44c78f9e469" +checksum = "ef8666e572a3a2519010dde88c04d16e9339ae751b56b2bb35081fe3f7d6be74" dependencies = [ "base64", "bech32", @@ -558,9 +558,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "k256" -version = "0.13.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if", "ecdsa", @@ -572,9 +572,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "msg_receiver" @@ -603,7 +603,7 @@ dependencies = [ [[package]] name = "neutron-sdk" version = "0.8.0" -source = "git+https://github.com/neutron-org/neutron-sdk?branch=feat/LIDO-68-query-siginig-info#e753df9a24cb0001dfb125ef6f67595da01eee64" +source = "git+https://github.com/neutron-org/neutron-sdk?branch=main#68420318b07be21e3882a3eebc60574237536159" dependencies = [ "bech32", "cosmos-sdk-proto 0.20.0", @@ -810,7 +810,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -905,9 +905,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "schemars" @@ -949,15 +949,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] name = "serde" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] @@ -1000,13 +1000,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -1022,9 +1022,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -1126,7 +1126,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -1157,9 +1157,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" dependencies = [ "proc-macro2", "quote", @@ -1204,29 +1204,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] name = "time" -version = "0.3.31" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "num-conv", @@ -1243,9 +1243,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ "num-conv", "time-core", From db55718c2c6aea99335e84dff1d37420dfb4191d Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 22 Feb 2024 15:32:55 +0200 Subject: [PATCH 4/4] update schema --- contracts/reflect/schema/execute_msg.json | 2077 ++++++++++++++++- .../tokenfactory/schema/execute_msg.json | 108 + 2 files changed, 2184 insertions(+), 1 deletion(-) diff --git a/contracts/reflect/schema/execute_msg.json b/contracts/reflect/schema/execute_msg.json index 5c6683e..0f6b741 100644 --- a/contracts/reflect/schema/execute_msg.json +++ b/contracts/reflect/schema/execute_msg.json @@ -27,6 +27,2081 @@ } }, "additionalProperties": false + }, + { + "type": "object", + "required": [ + "reflect_msg" + ], + "properties": { + "reflect_msg": { + "type": "object", + "required": [ + "msgs" + ], + "properties": { + "msgs": { + "type": "array", + "items": { + "$ref": "#/definitions/CosmosMsg_for_NeutronMsg" + } + } + } + } + }, + "additionalProperties": false + } + ], + "definitions": { + "AdminProposal": { + "description": "AdminProposal defines the struct for various proposals which Neutron's Admin Module may accept.", + "oneOf": [ + { + "description": "Proposal to change params. Note that this works for old params. New params has their own `MsgUpdateParams` msgs that can be supplied to `ProposalExecuteMessage`", + "type": "object", + "required": [ + "param_change_proposal" + ], + "properties": { + "param_change_proposal": { + "$ref": "#/definitions/ParamChangeProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Proposal to upgrade IBC client", + "type": "object", + "required": [ + "upgrade_proposal" + ], + "properties": { + "upgrade_proposal": { + "$ref": "#/definitions/UpgradeProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Proposal to update IBC client", + "type": "object", + "required": [ + "client_update_proposal" + ], + "properties": { + "client_update_proposal": { + "$ref": "#/definitions/ClientUpdateProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Proposal to execute CosmosMsg.", + "type": "object", + "required": [ + "proposal_execute_message" + ], + "properties": { + "proposal_execute_message": { + "$ref": "#/definitions/ProposalExecuteMessage" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Proposal to upgrade network", + "deprecated": true, + "type": "object", + "required": [ + "software_upgrade_proposal" + ], + "properties": { + "software_upgrade_proposal": { + "$ref": "#/definitions/SoftwareUpgradeProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Proposal to cancel existing software upgrade", + "deprecated": true, + "type": "object", + "required": [ + "cancel_software_upgrade_proposal" + ], + "properties": { + "cancel_software_upgrade_proposal": { + "$ref": "#/definitions/CancelSoftwareUpgradeProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Will fail to execute if you use it. Deprecated. Proposal to pin wasm contract codes", + "deprecated": true, + "type": "object", + "required": [ + "pin_codes_proposal" + ], + "properties": { + "pin_codes_proposal": { + "$ref": "#/definitions/PinCodesProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Deprecated. Proposal to unpin wasm contract codes.", + "deprecated": true, + "type": "object", + "required": [ + "unpin_codes_proposal" + ], + "properties": { + "unpin_codes_proposal": { + "$ref": "#/definitions/UnpinCodesProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Proposal to call sudo on contract.", + "deprecated": true, + "type": "object", + "required": [ + "sudo_contract_proposal" + ], + "properties": { + "sudo_contract_proposal": { + "$ref": "#/definitions/SudoContractProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Proposal to update contract admin.", + "deprecated": true, + "type": "object", + "required": [ + "update_admin_proposal" + ], + "properties": { + "update_admin_proposal": { + "$ref": "#/definitions/UpdateAdminProposal" + } + }, + "additionalProperties": false + }, + { + "description": "Deprecated. Proposal to clear contract admin.", + "deprecated": true, + "type": "object", + "required": [ + "clear_admin_proposal" + ], + "properties": { + "clear_admin_proposal": { + "$ref": "#/definitions/ClearAdminProposal" + } + }, + "additionalProperties": false + } + ] + }, + "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" + }, + "CancelSoftwareUpgradeProposal": { + "description": "Deprecated. CancelSoftwareUpgradeProposal defines the struct for cancel software upgrade proposal.", + "deprecated": true, + "type": "object", + "required": [ + "description", + "title" + ], + "properties": { + "description": { + "description": "*description** is a text description of proposal. Non unique.", + "type": "string" + }, + "title": { + "description": "*title** is a text title of proposal. Non unique.", + "type": "string" + } + } + }, + "ClearAdminProposal": { + "description": "Deprecated. SudoContractProposal defines the struct for clear admin proposal.", + "deprecated": true, + "type": "object", + "required": [ + "contract", + "description", + "title" + ], + "properties": { + "contract": { + "description": "*contract** is an address of contract admin will be removed.", + "type": "string" + }, + "description": { + "description": "*description** is a text description of proposal.", + "type": "string" + }, + "title": { + "description": "*title** is a text title of proposal.", + "type": "string" + } + } + }, + "ClientUpdateProposal": { + "description": "ClientUpdateProposal defines the struct for client update proposal.", + "type": "object", + "required": [ + "description", + "subject_client_id", + "substitute_client_id", + "title" + ], + "properties": { + "description": { + "description": "*description** is a text description of proposal. Non unique.", + "type": "string" + }, + "subject_client_id": { + "description": "*subject_client_id** is a subject client id.", + "type": "string" + }, + "substitute_client_id": { + "description": "*substitute_client_id** is a substitute client id.", + "type": "string" + }, + "title": { + "description": "*title** is a text title of proposal.", + "type": "string" + } + } + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "CosmosMsg_for_NeutronMsg": { + "oneOf": [ + { + "type": "object", + "required": [ + "bank" + ], + "properties": { + "bank": { + "$ref": "#/definitions/BankMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "$ref": "#/definitions/NeutronMsg" + } + }, + "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 + } + ] + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "DenomUnit": { + "description": "Replicates the cosmos-sdk bank module DenomUnit type", + "type": "object", + "required": [ + "aliases", + "denom", + "exponent" + ], + "properties": { + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "denom": { + "type": "string" + }, + "exponent": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "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 + } + ] + }, + "GovMsg": { + "description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, vote: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```", + "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": { + "description": "The vote option.\n\nThis should be called \"option\" for consistency with Cosmos SDK. Sorry for that. See .", + "allOf": [ + { + "$ref": "#/definitions/VoteOption" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This maps directly to [MsgVoteWeighted](https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/proto/cosmos/gov/v1beta1/tx.proto#L66-L78) in the Cosmos SDK with voter set to the contract address.", + "type": "object", + "required": [ + "vote_weighted" + ], + "properties": { + "vote_weighted": { + "type": "object", + "required": [ + "options", + "proposal_id" + ], + "properties": { + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/WeightedVoteOption" + } + }, + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + } + ] + }, + "IbcFee": { + "description": "IbcFee defines struct for fees that refund the relayer for `SudoMsg` messages submission. Unused fee kind will be returned back to message sender. Please refer to these links for more information: IBC transaction structure - General mechanics of fee payments - ", + "type": "object", + "required": [ + "ack_fee", + "recv_fee", + "timeout_fee" + ], + "properties": { + "ack_fee": { + "description": "*ack_fee** is an amount of coins to refund relayer for submitting ack message for a particular IBC packet.", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "recv_fee": { + "description": "**recv_fee** currently is used for compatibility with ICS-29 interface only and must be set to zero (i.e. 0untrn), because Neutron's fee module can't refund relayer for submission of Recv IBC packets due to compatibility with target chains.", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "timeout_fee": { + "description": "*timeout_fee** amount of coins to refund relayer for submitting timeout message for a particular IBC packet.", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + }, + "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": "existing 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 (e.g. after resetting the chain this could increment 1 as height drops to 0)", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + }, + "KVKey": { + "description": "Describes a KV key for which you want to get value from the storage on remote chain", + "type": "object", + "required": [ + "key", + "path" + ], + "properties": { + "key": { + "description": "*key** is a key you want to read from the storage", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "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.)", + "type": "string" + } + } + }, + "MsgExecuteContract": { + "description": "MsgExecuteContract defines a call to the contract execution", + "type": "object", + "required": [ + "contract", + "msg" + ], + "properties": { + "contract": { + "description": "*contract** is a contract address that will be called", + "type": "string" + }, + "msg": { + "description": "*msg** is a contract call message", + "type": "string" + } + } + }, + "NeutronMsg": { + "description": "A number of Custom messages that can call into the Neutron bindings.", + "oneOf": [ + { + "description": "RegisterInterchainAccount registers an interchain account on remote chain.", + "type": "object", + "required": [ + "register_interchain_account" + ], + "properties": { + "register_interchain_account": { + "type": "object", + "required": [ + "connection_id", + "interchain_account_id" + ], + "properties": { + "connection_id": { + "description": "*connection_id** is an IBC connection identifier between Neutron and remote chain.", + "type": "string" + }, + "interchain_account_id": { + "description": "**interchain_account_id** is an identifier of your new interchain account. Can be any string. This identifier allows contracts to have multiple interchain accounts on remote chains.", + "type": "string" + }, + "register_fee": { + "description": "*register_fee** is a fees required to be payed to register interchain account", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false + }, + { + "description": "SubmitTx starts the process of executing any Cosmos-SDK *msgs* on remote chain.", + "type": "object", + "required": [ + "submit_tx" + ], + "properties": { + "submit_tx": { + "type": "object", + "required": [ + "connection_id", + "fee", + "interchain_account_id", + "memo", + "msgs", + "timeout" + ], + "properties": { + "connection_id": { + "description": "*connection_id** is an IBC connection identifier between Neutron and remote chain.", + "type": "string" + }, + "fee": { + "description": "**fee** is an ibc fee for the transaction.", + "allOf": [ + { + "$ref": "#/definitions/IbcFee" + } + ] + }, + "interchain_account_id": { + "description": "*interchain_account_id** is an identifier of your interchain account from which you want to execute msgs.", + "type": "string" + }, + "memo": { + "description": "*memo** is a memo you want to attach to your interchain transaction.It behaves like a memo in usual Cosmos transaction.", + "type": "string" + }, + "msgs": { + "description": "*msgs** is a list of protobuf encoded Cosmos-SDK messages you want to execute on remote chain.", + "type": "array", + "items": { + "$ref": "#/definitions/ProtobufAny" + } + }, + "timeout": { + "description": "*timeout** is a timeout in seconds after which the packet times out.", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "RegisterInterchainQuery registers an interchain query.", + "type": "object", + "required": [ + "register_interchain_query" + ], + "properties": { + "register_interchain_query": { + "type": "object", + "required": [ + "connection_id", + "keys", + "query_type", + "transactions_filter", + "update_period" + ], + "properties": { + "connection_id": { + "description": "*connection_id** is an IBC connection identifier between Neutron and remote chain.", + "type": "string" + }, + "keys": { + "description": "*keys** is the KV-storage keys for which we want to get values from remote chain.", + "type": "array", + "items": { + "$ref": "#/definitions/KVKey" + } + }, + "query_type": { + "description": "*query_type** is a query type identifier ('tx' or 'kv' for now).", + "type": "string" + }, + "transactions_filter": { + "description": "*transactions_filter** is the filter for transaction search ICQ.", + "type": "string" + }, + "update_period": { + "description": "*update_period** is used to say how often the query must be updated.", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "RegisterInterchainQuery updates an interchain query.", + "type": "object", + "required": [ + "update_interchain_query" + ], + "properties": { + "update_interchain_query": { + "type": "object", + "required": [ + "query_id" + ], + "properties": { + "new_keys": { + "description": "*new_keys** is the new query keys to retrive.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/KVKey" + } + }, + "new_transactions_filter": { + "description": "*new_transactions_filter** is a new transactions filter of the query.", + "type": [ + "string", + "null" + ] + }, + "new_update_period": { + "description": "*new_update_period** is a new update period of the query.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "query_id": { + "description": "*query_id** is the ID of the query we want to update.", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "RemoveInterchainQuery removes as interchain query.", + "type": "object", + "required": [ + "remove_interchain_query" + ], + "properties": { + "remove_interchain_query": { + "type": "object", + "required": [ + "query_id" + ], + "properties": { + "query_id": { + "description": "*query_id** is ID of the query we want to remove.", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "IbcTransfer sends a fungible token packet over IBC.", + "type": "object", + "required": [ + "ibc_transfer" + ], + "properties": { + "ibc_transfer": { + "type": "object", + "required": [ + "fee", + "memo", + "receiver", + "sender", + "source_channel", + "source_port", + "timeout_height", + "timeout_timestamp", + "token" + ], + "properties": { + "fee": { + "$ref": "#/definitions/IbcFee" + }, + "memo": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "source_channel": { + "type": "string" + }, + "source_port": { + "type": "string" + }, + "timeout_height": { + "$ref": "#/definitions/RequestPacketTimeoutHeight" + }, + "timeout_timestamp": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "token": { + "$ref": "#/definitions/Coin" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "SubmitAdminProposal sends a proposal to neutron's Admin module. This type of messages can be only executed by Neutron DAO.", + "type": "object", + "required": [ + "submit_admin_proposal" + ], + "properties": { + "submit_admin_proposal": { + "type": "object", + "required": [ + "admin_proposal" + ], + "properties": { + "admin_proposal": { + "$ref": "#/definitions/AdminProposal" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "TokenFactory message. Contracts can create denoms, namespaced under the contract's address. A contract may create any number of independent sub-denoms.", + "type": "object", + "required": [ + "create_denom" + ], + "properties": { + "create_denom": { + "type": "object", + "required": [ + "subdenom" + ], + "properties": { + "subdenom": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "TokenFactory message. Contracts can change the admin of a denom that they are the admin of.", + "type": "object", + "required": [ + "change_admin" + ], + "properties": { + "change_admin": { + "type": "object", + "required": [ + "denom", + "new_admin_address" + ], + "properties": { + "denom": { + "type": "string" + }, + "new_admin_address": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "TokenFactory message. Contracts can mint native tokens for an existing factory denom that they are the admin of.", + "type": "object", + "required": [ + "mint_tokens" + ], + "properties": { + "mint_tokens": { + "type": "object", + "required": [ + "amount", + "denom", + "mint_to_address" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + }, + "mint_to_address": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "TokenFactory message. Contracts can burn native tokens for an existing factory denom that they are the admin of. Currently, the burn from address must be the admin contract.", + "type": "object", + "required": [ + "burn_tokens" + ], + "properties": { + "burn_tokens": { + "type": "object", + "required": [ + "amount", + "burn_from_address", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "burn_from_address": { + "description": "Must be set to `\"\"` for now", + "type": "string" + }, + "denom": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "TokenFactory message. Contracts can set before send hooks for denoms, namespaced under the contract's address.", + "type": "object", + "required": [ + "set_before_send_hook" + ], + "properties": { + "set_before_send_hook": { + "type": "object", + "required": [ + "contract_addr", + "denom" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "denom": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "TokenFactoryMessage Contracts can force specified `amount` of an existing factory denom that they are admin of to a `transfer_to_address` from a `transfer_from_address`.", + "type": "object", + "required": [ + "force_transfer" + ], + "properties": { + "force_transfer": { + "type": "object", + "required": [ + "amount", + "denom", + "transfer_from_address", + "transfer_to_address" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + }, + "transfer_from_address": { + "type": "string" + }, + "transfer_to_address": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "TokenFactoryMessage Contracts can set a metadata for of an existing factory denom that they are admin of.", + "type": "object", + "required": [ + "set_denom_metadata" + ], + "properties": { + "set_denom_metadata": { + "type": "object", + "required": [ + "base", + "denom_units", + "description", + "display", + "name", + "symbol", + "uri", + "uri_hash" + ], + "properties": { + "base": { + "description": "*base** represents the base denom (should be the DenomUnit with exponent = 0).", + "type": "string" + }, + "denom_units": { + "description": "*denom_units** represents the list of DenomUnit's for a given coin", + "type": "array", + "items": { + "$ref": "#/definitions/DenomUnit" + } + }, + "description": { + "description": "*description** description of a token", + "type": "string" + }, + "display": { + "description": "**display** indicates the suggested denom that should be displayed in clients.", + "type": "string" + }, + "name": { + "description": "*name** defines the name of the token (eg: Cosmos Atom)", + "type": "string" + }, + "symbol": { + "description": "**symbol** is the token symbol usually shown on exchanges (eg: ATOM). This can be the same as the display.", + "type": "string" + }, + "uri": { + "description": "*uri** to a document (on or off-chain) that contains additional information. Optional.", + "type": "string" + }, + "uri_hash": { + "description": "**uri_hash** is a sha256 hash of a document pointed by URI. It's used to verify that the document didn't change. Optional.", + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "AddSchedule adds new schedule with a given `name`. Until schedule is removed it will execute all `msgs` every `period` blocks. First execution is at least on `current_block + period` block. [Permissioned - DAO Only]", + "type": "object", + "required": [ + "add_schedule" + ], + "properties": { + "add_schedule": { + "type": "object", + "required": [ + "msgs", + "name", + "period" + ], + "properties": { + "msgs": { + "description": "list of cosmwasm messages to be executed", + "type": "array", + "items": { + "$ref": "#/definitions/MsgExecuteContract" + } + }, + "name": { + "description": "Name of a new schedule. Needed to be able to `RemoveSchedule` and to log information about it", + "type": "string" + }, + "period": { + "description": "period in blocks with which `msgs` will be executed", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "RemoveSchedule removes the schedule with a given `name`. [Permissioned - DAO or Security DAO only]", + "type": "object", + "required": [ + "remove_schedule" + ], + "properties": { + "remove_schedule": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Contractmanager message Resubmits failed acknowledgement. Acknowledgement failure is created when contract returns error or acknowledgement is out of gas. [Permissioned - only from contract that is initial caller of IBC transaction]", + "type": "object", + "required": [ + "resubmit_failure" + ], + "properties": { + "resubmit_failure": { + "type": "object", + "required": [ + "failure_id" + ], + "properties": { + "failure_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + } + ] + }, + "ParamChange": { + "description": "ParamChange defines the struct for parameter change request.", + "type": "object", + "required": [ + "key", + "subspace", + "value" + ], + "properties": { + "key": { + "description": "*key** is a name of parameter. Unique for subspace.", + "type": "string" + }, + "subspace": { + "description": "*subspace** is a key of module to which the parameter to change belongs. Unique for each module.", + "type": "string" + }, + "value": { + "description": "*value** is a new value for given parameter. Non unique.", + "type": "string" + } + } + }, + "ParamChangeProposal": { + "description": "ParamChangeProposal defines the struct for single parameter change proposal.", + "type": "object", + "required": [ + "description", + "param_changes", + "title" + ], + "properties": { + "description": { + "description": "*description** is a text description of proposal. Non unique.", + "type": "string" + }, + "param_changes": { + "description": "*param_changes** is a vector of params to be changed. Non unique.", + "type": "array", + "items": { + "$ref": "#/definitions/ParamChange" + } + }, + "title": { + "description": "*title** is a text title of proposal. Non unique.", + "type": "string" + } + } + }, + "PinCodesProposal": { + "description": "Deprecated. PinCodesProposal defines the struct for pin contract codes proposal.", + "deprecated": true, + "type": "object", + "required": [ + "code_ids", + "description", + "title" + ], + "properties": { + "code_ids": { + "description": "*code_ids** is an array of codes to be pined.", + "type": "array", + "items": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "description": { + "description": "*description** is a text description of proposal.", + "type": "string" + }, + "title": { + "description": "*title** is a text title of proposal.", + "type": "string" + } + } + }, + "Plan": { + "description": "Plan defines the struct for planned upgrade.", + "type": "object", + "required": [ + "height", + "info", + "name" + ], + "properties": { + "height": { + "description": "*height** is a height at which the upgrade must be performed", + "type": "integer", + "format": "int64" + }, + "info": { + "description": "*info** is any application specific upgrade info to be included on-chain", + "type": "string" + }, + "name": { + "description": "*name** is a name for the upgrade", + "type": "string" + } + } + }, + "ProposalExecuteMessage": { + "description": "ProposalExecuteMessage defines the struct for sdk47 compatible admin proposal.", + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "description": "*message** is a json representing an sdk message passed to admin module to execute.", + "type": "string" + } + } + }, + "ProtobufAny": { + "description": "Type for wrapping any protobuf message", + "type": "object", + "required": [ + "type_url", + "value" + ], + "properties": { + "type_url": { + "description": "*type_url** describes the type of the serialized message", + "type": "string" + }, + "value": { + "description": "*value** must be a valid serialized protocol buffer of the above specified type", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + } + }, + "RequestPacketTimeoutHeight": { + "type": "object", + "properties": { + "revision_height": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "revision_number": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + } + }, + "SoftwareUpgradeProposal": { + "description": "Deprecated. SoftwareUpgradeProposal defines the struct for software upgrade proposal.", + "deprecated": true, + "type": "object", + "required": [ + "description", + "plan", + "title" + ], + "properties": { + "description": { + "description": "*description** is a text description of proposal. Non unique.", + "type": "string" + }, + "plan": { + "description": "*plan** is a plan of upgrade.", + "allOf": [ + { + "$ref": "#/definitions/Plan" + } + ] + }, + "title": { + "description": "*title** is a text title of proposal. Non unique.", + "type": "string" + } + } + }, + "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 + } + ] + }, + "SudoContractProposal": { + "description": "Deprecated. SudoContractProposal defines the struct for sudo execution proposal.", + "deprecated": true, + "type": "object", + "required": [ + "contract", + "description", + "msg", + "title" + ], + "properties": { + "contract": { + "description": "*contract** is an address of contract to be executed.", + "type": "string" + }, + "description": { + "description": "*description** is a text description of proposal.", + "type": "string" + }, + "msg": { + "description": "**msg*** is a sudo message.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "title": { + "description": "*title** is a text title of proposal.", + "type": "string" + } + } + }, + "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" + }, + "UnpinCodesProposal": { + "description": "Deprecated. UnpinCodesProposal defines the struct for unpin contract codes proposal.", + "deprecated": true, + "type": "object", + "required": [ + "code_ids", + "description", + "title" + ], + "properties": { + "code_ids": { + "description": "*code_ids** is an array of codes to be unpined.", + "type": "array", + "items": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "description": { + "description": "*description** is a text description of proposal.", + "type": "string" + }, + "title": { + "description": "*title** is a text title of proposal.", + "type": "string" + } + } + }, + "UpdateAdminProposal": { + "description": "Deprecated. UpdateAdminProposal defines the struct for update admin proposal.", + "deprecated": true, + "type": "object", + "required": [ + "contract", + "description", + "new_admin", + "title" + ], + "properties": { + "contract": { + "description": "*contract** is an address of contract to update admin.", + "type": "string" + }, + "description": { + "description": "*description** is a text description of proposal.", + "type": "string" + }, + "new_admin": { + "description": "**new_admin*** is an address of new admin", + "type": "string" + }, + "title": { + "description": "*title** is a text title of proposal.", + "type": "string" + } + } + }, + "UpgradeProposal": { + "description": "UpgradeProposal defines the struct for IBC upgrade proposal.", + "type": "object", + "required": [ + "description", + "plan", + "title", + "upgraded_client_state" + ], + "properties": { + "description": { + "description": "*description** is a text description of proposal.", + "type": "string" + }, + "plan": { + "description": "*plan** is a plan of upgrade.", + "allOf": [ + { + "$ref": "#/definitions/Plan" + } + ] + }, + "title": { + "description": "*title** is a text title of proposal.", + "type": "string" + }, + "upgraded_client_state": { + "description": "*upgraded_client_state** is an upgraded client state.", + "allOf": [ + { + "$ref": "#/definitions/ProtobufAny" + } + ] + } + } + }, + "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\nThe contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). `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-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Instantiates a new contracts from previously uploaded Wasm code using a predictable address derivation algorithm implemented in [`cosmwasm_std::instantiate2_address`].\n\nThis is translated to a [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L73-L96). `sender` is automatically filled with the current contract's address. `fix_msg` is automatically set to false.", + "type": "object", + "required": [ + "instantiate2" + ], + "properties": { + "instantiate2": { + "type": "object", + "required": [ + "code_id", + "funds", + "label", + "msg", + "salt" + ], + "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-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "salt": { + "$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 + } + ] + }, + "WeightedVoteOption": { + "type": "object", + "required": [ + "option", + "weight" + ], + "properties": { + "option": { + "$ref": "#/definitions/VoteOption" + }, + "weight": { + "$ref": "#/definitions/Decimal" + } + } } - ] + } } diff --git a/contracts/tokenfactory/schema/execute_msg.json b/contracts/tokenfactory/schema/execute_msg.json index e659fa7..4137274 100644 --- a/contracts/tokenfactory/schema/execute_msg.json +++ b/contracts/tokenfactory/schema/execute_msg.json @@ -145,9 +145,117 @@ } }, "additionalProperties": false + }, + { + "type": "object", + "required": [ + "force_transfer" + ], + "properties": { + "force_transfer": { + "type": "object", + "required": [ + "amount", + "denom", + "from", + "to" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + }, + "from": { + "type": "string" + }, + "to": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "set_denom_metadata" + ], + "properties": { + "set_denom_metadata": { + "type": "object", + "required": [ + "base", + "denom_units", + "description", + "display", + "name", + "symbol", + "uri", + "uri_hash" + ], + "properties": { + "base": { + "type": "string" + }, + "denom_units": { + "type": "array", + "items": { + "$ref": "#/definitions/DenomUnit" + } + }, + "description": { + "type": "string" + }, + "display": { + "type": "string" + }, + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "uri_hash": { + "type": "string" + } + } + } + }, + "additionalProperties": false } ], "definitions": { + "DenomUnit": { + "description": "Replicates the cosmos-sdk bank module DenomUnit type", + "type": "object", + "required": [ + "aliases", + "denom", + "exponent" + ], + "properties": { + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "denom": { + "type": "string" + }, + "exponent": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, "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"