Skip to main content

kaia_estimateComputationCost RPC Method

Generates and returns an estimate of how much computation cost will be spent to execute the transaction.

Updated on
Aug 7, 2024

kaia_estimateComputationCost RPC Method

Parameters

transaction
object
REQUIRED
The transaction call object:
from
string
The address from which the transaction is sent
to
string
REQUIRED
The address to which the transaction is addressed
gas
integer
The integer of gas provided for the transaction execution
gasPrice
integer
The integer of gasPrice used for each paid gas encoded as hexadecimal
value
integer
The integer of value sent with this transaction encoded as hexadecimal
data
string
The hash of the method signature and encoded parameters. For more information, see the Contract ABI description in the Solidity documentation.
BlockNumberOrTag
string
REQUIRED
The block number in integer or hexadecimal format or block tag(earliest and latest)

Returns

quantity
string
Return the amount of computation cost used
Request
1
curl https://docs-demo.kaia-kairos.quiknode.pro/ \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{
5
"method": "kaia_estimateComputationCost",
6
"id": 1,
7
"jsonrpc": "2.0",
8
"params": [
9
{
10
"from": "0x73718c4980728857f3aa5148e9d1b471efa3a7dd",
11
"to": "0x069942a3ca0dabf495dba872533134205764bc9c",
12
"value": "0x0",
13
"input": "0x2a31efc7000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000003039"
14
},
15
"latest"
16
]
17
}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free