Skip to main content

starknet_call RPC Method

Calls a function in a contract and returns the return value. Using this call will not create a transaction; hence, will not change the state.

Updated on
Mar 18, 2024

starknet_call RPC Method

Parameters

request
object
REQUIRED
The details of the function call which contains the following fields:
contract_address
string
REQUIRED
The address of the contract
entry_point_selector
string
REQUIRED
The entry point selector
calldata
array
REQUIRED
The parameters passed to the constructor
block_id
string
REQUIRED
The hash of the requested block, the block number (height) of the requested block, or a block tag (latest or pending)

Returns

result
array
The function's return value, as defined in the Cairo output
Request
1
curl --location 'https://docs-demo.strk-mainnet.quiknode.pro/' \
2
--header 'accept: application/json' \
3
--header 'content-type: application/json' \
4
--data '{
5
"id": 1,
6
"jsonrpc": "2.0",
7
"method": "starknet_call",
8
"params": [
9
{
10
"contract_address": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
11
"calldata": [
12
"0xbfc2ea1a458d7cac752a4a688dbb8e0cff399e1b"
13
],
14
"entry_point_selector": "0xb2ef42a25c95687d1a3e7c2584885fd4058d102e05c44f65cf35988451bc8"
15
},
16
"latest"
17
]
18
}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free