Complete technical reference for the Interchain Queries module
interchainqueries
module. This message should only be issued by a smart contract. The calling contract is automatically charged a query registration deposit. The deposit is refunded when the query is removed.
Proto Definition:
query_type
- The query type identifier: "kv"
or "tx"
keys
- KV-storage keys for KV queries (max: max_kv_query_keys_count
param)transactions_filter
- JSON filter for TX queries (max: max_transactions_filters
param)connection_id
- IBC connection ID to the remote chainupdate_period
- Minimal delay between consecutive query executionssender
- Address of the message sendertransactions_filter
field expects a JSON array:
eq
, lt
, gt
, lte
, gte
interchainqueries
module.
Proto Definition:
GET /neutron/interchainqueries/params
GET /neutron/interchainqueries/registered_queries
GET /neutron/interchainqueries/registered_query
GET /neutron/interchainqueries/query_result
GET /neutron/interchainqueries/remote_height
Parameter | Type | Default | Description |
---|---|---|---|
query_submit_timeout | uint64 | 1036800 | Blocks after which anyone can remove a query (~1 month) |
query_deposit | sdk.Coins | 1000000untrn | Deposit required for query registration |
tx_query_removal_limit | uint64 | 10000 | Max TX queries removed per EndBlock |
max_kv_query_keys_count | uint64 | 32 | Maximum keys in a single KV query |
max_transactions_filters | uint64 | 32 | Maximum filters in a single TX query |
neutron
Attribute Key | Attribute Value | Description |
---|---|---|
module | interchainqueries | Module name |
action | query_updated | query_removed | Action performed |
query_id | {query_id} | Query identifier |
connection_id | {connection_id} | IBC connection ID |
owner | {owner_address} | Query owner (query_updated only) |
type | kv | tx | Query type (query_updated only) |
tx_filter | {filter_json} | TX filter (query_updated only) |
kv_key | {keys_string} | KV keys (query_updated only) |
query_updated
- When a query is registered or updatedquery_removed
- When a query is removedRegisteredQueryKey
- Stores registered queries by IDRegisteredQueryResultKey
- Stores KV query results by IDSubmittedTxKey
- Stores submitted TX hashesTxQueryToRemoveKey
- Stores TX queries marked for removalLastRegisteredQueryIDKey
- Stores last assigned query IDMethod | Endpoint | Description |
---|---|---|
GET | /neutron/interchainqueries/params | Get module parameters |
GET | /neutron/interchainqueries/registered_queries | List registered queries |
GET | /neutron/interchainqueries/registered_query | Get specific query |
GET | /neutron/interchainqueries/query_result | Get query result |
GET | /neutron/interchainqueries/remote_height | Get remote height |
module-reference/x/interchainqueries/types/errors.go
):
Code | Name | Description |
---|---|---|
1100 | ErrInvalidQueryID | Invalid query id |
1101 | ErrEmptyResult | Empty result |
1102 | ErrInvalidClientID | Invalid client id |
1103 | ErrInvalidUpdatePeriod | Invalid update period |
1104 | ErrInvalidConnectionID | Invalid connection id |
1105 | ErrInvalidQueryType | Invalid query type |
1106 | ErrInvalidTransactionsFilter | Invalid transactions filter |
1107 | ErrInvalidSubmittedResult | Invalid result |
1108 | ErrProtoMarshal | Failed to marshal protobuf bytes |
1109 | ErrProtoUnmarshal | Failed to unmarshal protobuf bytes |
1110 | ErrInvalidType | Invalid type |
1111 | ErrInternal | Internal error |
1112 | ErrInvalidProof | Merkle proof is invalid |
1113 | ErrInvalidHeader | Header is invalid |
1114 | ErrInvalidHeight | Height is invalid |
1115 | ErrNoQueryResult | No query result |
1116 | ErrNotContract | Not a contract |
1117 | ErrEmptyKeys | Keys are empty |
1118 | ErrEmptyKeyPath | Key path is empty |
1119 | ErrEmptyKeyID | Key id is empty |
1120 | ErrTooManyKVQueryKeys | Too many keys |
1121 | ErrUnexpectedQueryTypeGenesis | Unexpected query type |
nil
values.
Impact: KV queries targeting keys with empty values will fail during proof verification.
Workaround: Avoid querying keys that might have empty values, or handle missing responses gracefully.