Validate Query
AI-generatedSummary
Type-checks a CEL query expression against a chosen EVM chain and a declared schema of named contracts and context variables, returning a validation verdict and estimated credit cost without executing the query on-chain.
Inputs
- Chain (required) — EVM chain to validate against. Options load dynamically from the evmquery /chains endpoint, with a static fallback (Ethereum, Base, BNB Smart Chain) if the API is unreachable. Defaults to evm_ethereum; an evm_* chain id can also be passed via expression.
- Expression (required) — The CEL expression to validate, e.g.
Token.balanceOf(holder). Contracts and context variables are referenced by name; context variables are accessed via the vars map. - Contracts — Named contract references used inside the expression. Each entry has a Name (valid CEL identifier: letters, digits, underscores only; cannot start with a digit) and an Address (0x-prefixed, 20 bytes). Entries are sent as
{ name: { address } }. - Context Variables — Declared variables referenced via
vars.<name>in the expression. Each entry has a Name and a Type (sol_int, sol_address, bool, string, bytes, list, list , list , list , list ). Only the type declarations are sent for validation; the Value column shown in the UI is ignored by this operation. - Options — Declared in the UI for Validate (Timeout (Ms) sub-option), but the Validate executor does not read or forward it. Output Format applies only to Execute.
Output shape
Full API validation envelope returned verbatim.
One output item per input item, containing the evmquery /query/validate response verbatim. The node source documents the envelope as
{ valid, type, estimatedCredits }. HTTP failures are surfaced as NodeApiError with a friendly message (e.g., a 400 recommends using Validate to sanity-check the query).
Examples
Example 1: Sanity-check a custom query and estimate its credit cost before running Execute.
Validate a hand-written CEL expression against Ethereum before executing it. Set Chain to Ethereum (evm_ethereum), Expression to Token.balanceOf(holder), add a contract named Token with the ERC-20 address, and add a context variable named holder of type sol_address. Leave the Value field empty or ignore it.