Execute a Read-Only Contract Query

post

/v1/besu/query

Executes a read-only smart contract call using the Ethereum JSON-RPC `eth_call` method. Supports encoding requests with `functionSignature` and `functionArgs`. A contract execution revert is a completed query and returns HTTP 200 with `executionStatus: REVERTED`. HTTP error responses are reserved for request validation failures and communication failures with the Besu node.

Request

Header Parameters
  • Optional operator-defined Besu node identifier. Supported values include rpc-0, rpc-1, archive-0, validator-0, and bootnode-0.
  • Optional correlation ID. Echoed in the response when provided.
Supported Media Types
Request Body - application/json ()
Root Schema : schema
Type: object
Defines a read-only contract query.
Show Source
Nested Schema : contractAbi
Type: array
Optional ABI used to infer parameter types when `functionSignature` contains only a function name. If omitted, the ABI associated with `toAddress` is used when available.
Show Source
Nested Schema : QueryDecodeOptions
Type: object
Decode options. Each option defaults to `false` when omitted.
Show Source
  • Decode revert reasons. Decoding occurs only when true and decodable revert bytes are present.
  • Decode `rawResult` into function outputs, including nested tuples and arrays when ABI is available. If some values cannot be decoded, the response includes structured `meta.issues` and `null` for affected fields without failing the request.
Nested Schema : functionArgs
Type: array
Function arguments as strings. Scalars use plain strings; arrays and tuples use JSON strings, such as '["1","2"]'.
Show Source
Nested Schema : items
Type: object
Examples

Back to Top

Response

Supported Media Types

200 Response

Returns the read-only contract query result.
Body ()
Root Schema : QueryResponse
Type: object
Result of a read-only contract query.
Show Source
  • Block parameter used for the call: `latest`, `pending`, `earliest`, or a block number.
  • Calldata used for the call, in 0x-prefixed hexadecimal format.
  • Decoded result for enabled decode options. `rawResult` contains the complete return value. For successful queries, incomplete or invalid ABI data can return `null` for affected fields and include structured `meta.issues` without failing the request. Output decoding applies to successful queries. Revert decoding is exposed through `decodedError`.
  • Decoded revert payload when `decode.errors=true` and sufficient information is available. Its absence does not change a reverted query into an HTTP error.
  • Allowed Values: [ "SUCCESS", "REVERTED" ]
    `SUCCESS` when `eth_call` returns normally, or `REVERTED` when Besu completes `eth_call` and the EVM reverts. A reverted execution is returned with HTTP 200.
  • Sender address used to execute `eth_call`.
  • Return data from a successful `eth_call`, in 0x-prefixed hexadecimal format. Absent when `executionStatus` is `REVERTED`.
  • Client-provided correlation ID echoed for reverted queries.
  • Target contract address for the call.
  • Besu JSON-RPC error code when `executionStatus` is `REVERTED`.
  • Besu revert payload or error data when `executionStatus` is `REVERTED`.
  • upstreamError
    Additional Properties Allowed: true
    Complete Besu error object for a reverted execution, including revert information.
Nested Schema : upstreamError
Type: object
Additional Properties Allowed: true
Complete Besu error object for a reverted execution, including revert information.
Examples

400 Response

Validation failed.
Body ()
Root Schema : ErrorResponse
Type: object
Error response returned by the service.
Show Source
Nested Schema : upstreamError
Type: object
Additional Properties Allowed: true
Complete error object returned by the Besu node, including code, message, and data fields, when available.

502 Response

Communication failure with the Besu node; EVM reverts return HTTP 200.
Body ()
Root Schema : ErrorResponse
Type: object
Error response returned by the service.
Show Source
Nested Schema : upstreamError
Type: object
Additional Properties Allowed: true
Complete error object returned by the Besu node, including code, message, and data fields, when available.
Examples

Back to Top