Skip to main content

Parameters

chainId
string
default:"8217"
required
Unique identifier for a blockchain network.
id
number
default:1
required
Request identifier used to match responses.
jsonrpc
string
default:"2.0"
required
JSON-RPC version.
method
string
default:"klay_estimateGas"
required
JSON-RPC method name.
params
object
required
Parameters: [transaction object, block parameter].Positional parameters for klay_estimateGas:
  • params[0]: Legacy transaction (pre-EIP-2718).
  • params[1]: Block identifier. Can be an integer block number or a string tag: “latest”, “earliest”, or “pending”.

Returns

result
string
Estimated gas amount in hex. Example: “0x5208”.
curl --request POST \
  --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=8217 \
  --header 'content-type: application/json' \
  --data '{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "klay_estimateGas",
    "params": [
      {
        "from": "0x1b3c8c1cdb4e6b6b8819345bf3c6d9c926f55f90",
        "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
        "value": "0xde0b6b3a7640000"
      }
    ]
  }'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x5208"
}