Query A Contract
Describes how to query a cosmwasm smart contract with the CLI & REST API.
Command Line Interface
junod query wasm contract-state smart [contract_bech32] [query] [flags]CONTRACT=juno1anh4pf98fe8uh64uuhaasqdmg89qe6kk5xsklxuvtjmu6rhpg53sj9uejj
junod q wasm contract-state smart $CONTRACT '{"abcde":{}}'
# Error parsing into type
# cw721_base::msg::QueryMsg<cosmwasm_std::results::empty::Empty>
# unknown variant `abcde`,
# expected one of `owner_of`, `approval`, `approvals`, `all_operators`,
# `num_tokens`, `contract_info`, `nft_info`, `all_nft_info`, `tokens`,
# `all_tokens`, `minter`, `extension`CONTRACT=juno1anh4pf98fe8uh64uuhaasqdmg89qe6kk5xsklxuvtjmu6rhpg53sj9uejj
junod q wasm contract-state smart $CONTRACT '{"all_tokens":{}}'
data:
tokens:
- "0"
- "1"
- "2"
- "3"
- "4"
- "5"
- "6"
- "7"
- "8"
# You can use --output=json to read it via JSON form
# junod q wasm contract-state smart $CONTRACT '{"all_tokens":{}}' --output=json | jq .dataRest API Query
Cosmology Smart Contract Query
CosmJS Query
Internal
Last updated
Was this helpful?