Skip to main content
Call read-only smart contract functions (view functions) without submitting a transaction. The Gateway routes the query to the shard hosting the smart contract.

VM query endpoints

Request body

Arguments must be hex-encoded. To pass the number 100, encode it as "64" (hex representation of 100).

Choose the right endpoint

  • /vm-values/query: returns the full response (multiple return values, gas used, return code).
  • /vm-values/hex: returns raw bytes (e.g., reading a storage mapper).
  • /vm-values/string: returns string data (e.g., token names).
  • /vm-values/int: returns numeric values (e.g., balances, counters).

Read a token balance from a smart contract

Historical queries

Add ?blockNonce=12345678 or ?blockHash=abcdef... to query VM state at a specific block.
Historical VM queries require full-history observer nodes. The Gateway routes to full-history observers when block parameters are present.