Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

query_app_smart

Convenience wrapper for {wasm_smart: ...} queries; unwraps the envelope and returns the contract response directly.

Signature

def query_app_smart(
    self,
    contract: Addr,
    msg: dict[str, Any],
    *,
    height: int | None = None,
) -> Any

Example

from dango.info import Info
from dango.utils.constants import MAINNET_API_URL, PERPS_CONTRACT_MAINNET
from dango.utils.types import Addr
 
info = Info(MAINNET_API_URL, skip_ws=True)
 
# Read the perps contract's global parameters
params = info.query_app_smart(Addr(PERPS_CONTRACT_MAINNET), {"param": {}})

Parameters

contractAddr. Target contract address.

msgdict[str, Any]. The externally-tagged query message — Rust serde encodes contract QueryMsg enums as snake_case single-key dicts (e.g. {"param": {}}, {"pair_param": {"pair_id": "..."}}).

heightint | None, optional. Query at a specific block height. Default: None (latest).

Returns

Contract response — the raw shape the contract emits, with the wasm_smart wrapper stripped. Cast to a TypedDict from dango.utils.types if you want a typed view.

Notes

  • The typed perps wrappers (perps_param, pair_param, user_state, etc.) all build on this method.

See also