Skip to main content

Parameters

chainId
string
default:"starknet-sepolia"
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:"starknet_estimateFee"
required
JSON-RPC method name.
params
object
The parameters for method starknet_estimateFee: []Parameters for starknet_estimateFee:
  • params.request: Type: object[].
  • params.block_id: BlockID object containing hash and number.

Returns

result
array
Array of fee estimates corresponding to the transactions.
curl --request POST \
  --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=starknet-sepolia \
  --header 'content-type: application/json' \
  --data '{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "starknet_estimateFee",
    "params": {
      "request": [
        {
          "type": "INVOKE",
          "max_fee": "0x28ed6103d0000",
          "version": "0x1",
          "signature": [
            "0x42527ffe9912b338983cbed67e139cfcc26a4d8cf1d1c2a85e4125fdf5f59ed",
            "0x636147d06fefd02ed37984b752556d4b9aefdac1a50b3df0528ec7c201ad84b"
          ],
          "sender_address": "0x13e3ca9a377084c37dc7eacbd1d9f8c3e3733935bcbad887c32a0e213cd6fe0",
          "calldata": [
            "0x2",
            "0x57c4b510d66eb1188a7173f31cccee47b9736d40185da8144377b896d5ff3",
            "0x2f0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a72734550354",
            "0x0",
            "0x1",
            "0x57c4b510d66eb1188a7173f31cccee47b9736d40185da8144377b896d5ff3",
            "0x2f0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a72734550354",
            "0x1",
            "0x1",
            "0x2",
            "0x0",
            "0x1"
          ],
          "nonce": "0x1"
        }
      ],
      "block_id": {
        "block_number": 59999
      }
    }
  }'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "gas_consumed": "0x41de",
      "gas_price": "0x67edb4f57",
      "overall_fee": "0x1abd7b153e472"
    }
  ]
}