Skip to main content

state_call

Perform a call to a builtin on the chain.

Example Request and Result for state_call method

In this section, we provide an illustrative example of a request made to retrieve details contents using the state_call method. Additionally, we present the resulting response containing information about performing a call to a builtin on the chain.

Parameters

FieldsTypeDescription

method*

stringThe name of the built-in function you want to call

bytes*

stringThe input data to be passed to the built-in function as bytes
blockhashstringThe hash of a specific block in the chain
info

The example in this section uses a non-existing project id.

Make sure you replace it with your Vara Mainnet endpoint when issuing the API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Perform a call to a builtin on the chain.

POST https://vara-mainnet.blastapi.io/<project-id>

Request Body

NameTypeDescription
method*stringpayout_stakers
bytes*string3
blocknumberstring0x1e586e53feb5c0592c47b696c9a3bf75576f3f59e832d4a377c93d8908f2c638

Curl Request example

curl --location 'https://vara-mainnet.blastapi.io/<project-id>' \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "state_call",
"params": {
"method": "payout_stakers",
"bytes": "3",
"blockhash": "0x1e586e53feb5c0592c47b696c9a3bf75576f3f59e832d4a377c93d8908f2c638",
"name":""
}
}'