diff --git a/docs/docs/02-apps/02-interchain-accounts/05-messages.md b/docs/docs/02-apps/02-interchain-accounts/05-messages.md index 0fabc21e094..53db5a65b6f 100644 --- a/docs/docs/02-apps/02-interchain-accounts/05-messages.md +++ b/docs/docs/02-apps/02-interchain-accounts/05-messages.md @@ -74,7 +74,56 @@ The packet `Sequence` is returned in the message response. ### Queries -It is possible to use [`MsgModuleQuerySafe`](https://github.com/cosmos/ibc-go/blob/eecfa5c09a4c38a5c9f2cc2a322d2286f45911da/proto/ibc/applications/interchain_accounts/host/v1/tx.proto#L41-L51) to execute a list of queries on the host chain. This message can be included in the list of encoded `sdk.Msg`s of `InterchainPacketData`. The host chain will return on the acknowledgment the responses for all the queries. Please note that only module safe queries can be executed. The following code block shows an example of how this message can be used to query the account balance of an account on the host chain. The resulting packet data variable is used to set the `PacketData` of `MsgSendTx`. +It is possible to use [`MsgModuleQuerySafe`](https://github.com/cosmos/ibc-go/blob/eecfa5c09a4c38a5c9f2cc2a322d2286f45911da/proto/ibc/applications/interchain_accounts/host/v1/tx.proto#L41-L51) to execute a list of queries on the host chain. This message can be included in the list of encoded `sdk.Msg`s of `InterchainPacketData`. The host chain will return on the acknowledgment the responses for all the queries. Please note that only module safe queries can be executed ([deterministic queries that are safe to be called from within the state machine](https://docs.cosmos.network/main/build/building-modules/query-services#calling-queries-from-the-state-machine)). + +The queries available from Cosmos SDK are: + +```plaintext +/cosmos.auth.v1beta1.Query/Accounts +/cosmos.auth.v1beta1.Query/Account +/cosmos.auth.v1beta1.Query/AccountAddressByID +/cosmos.auth.v1beta1.Query/Params +/cosmos.auth.v1beta1.Query/ModuleAccounts +/cosmos.auth.v1beta1.Query/ModuleAccountByName +/cosmos.auth.v1beta1.Query/AccountInfo +/cosmos.bank.v1beta1.Query/Balance +/cosmos.bank.v1beta1.Query/AllBalances +/cosmos.bank.v1beta1.Query/SpendableBalances +/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom +/cosmos.bank.v1beta1.Query/TotalSupply +/cosmos.bank.v1beta1.Query/SupplyOf +/cosmos.bank.v1beta1.Query/Params +/cosmos.bank.v1beta1.Query/DenomMetadata +/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString +/cosmos.bank.v1beta1.Query/DenomsMetadata +/cosmos.bank.v1beta1.Query/DenomOwners +/cosmos.bank.v1beta1.Query/SendEnabled +/cosmos.circuit.v1.Query/Account +/cosmos.circuit.v1.Query/Accounts +/cosmos.circuit.v1.Query/DisabledList +/cosmos.staking.v1beta1.Query/Validators +/cosmos.staking.v1beta1.Query/Validator +/cosmos.staking.v1beta1.Query/ValidatorDelegations +/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations +/cosmos.staking.v1beta1.Query/Delegation +/cosmos.staking.v1beta1.Query/UnbondingDelegation +/cosmos.staking.v1beta1.Query/DelegatorDelegations +/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations +/cosmos.staking.v1beta1.Query/Redelegations +/cosmos.staking.v1beta1.Query/DelegatorValidators +/cosmos.staking.v1beta1.Query/DelegatorValidator +/cosmos.staking.v1beta1.Query/HistoricalInfo +/cosmos.staking.v1beta1.Query/Pool +/cosmos.staking.v1beta1.Query/Params +``` + +And the query available from ibc-go is: + +```plaintext +/ibc.core.client.v1.Query/VerifyMembership +``` + +The following code block shows an example of how `MsgModuleQuerySafe` can be used to query the account balance of an account on the host chain. The resulting packet data variable is used to set the `PacketData` of `MsgSendTx`. ```go balanceQuery := banktypes.NewQueryBalanceRequest("cosmos1...", "uatom")