rpc_call

Sends a low-level JSON-RPC request and returns the response's result value as JSON. Provider errors and transport failures are raised as SQL errors.

Example

Needs RPC · RPC required

1
-- Fetch the current gas price via eth_gasPrice
2
SELECT rpc_call(
3
$client,
4
'eth_gasPrice',
5
'[]'::JSON
6
) AS response;
Notebook ready in readonly mode.

API reference

Exact signatures with descriptions, requirements, inputs, returns, and examples.

rpc_call(CLIENT, VARCHAR, JSON) # RPC required

Sends one method call with params in provider order and returns only the JSON-RPC result field.

Inputs

Name Type Use
client CLIENT

Attached live CLIENT used for the JSON-RPC request.

required positional
method VARCHAR

Method name such as eth_blockNumber or eth_getBalance.

required positional
params JSON

JSON array of method parameters in provider order.

required positional

Returns

Name Type
result JSON

Raw JSON-RPC result. Returns the JSON result field from the provider response. RPC errors are raised as SQL errors.

Guidance

When to use rpc_call

rpc_call is the escape hatch for methods that do not have a typed Determica function.

  • Prefer typed functions such as get_block, get_logs, or read_contract when you want validated inputs and typed SQL results.
  • Pass params as a JSON array in the exact order required by the RPC method.
  • The response envelope is not returned; provider and transport errors become SQL errors.

Related functions

Category and tags

Tag
Client