Docs

starknet_estimateFee - Estimate Transaction...

Estimate fees for Starknet transactions before execution.

Estimates the resources and fees required for executing a sequence of transactions on Starknet.

Request Parameters

Request
requestarray

Array of transactions to estimate

simulation_flagsarray

Optional simulation parameters (`SKIP_VALIDATE` to skip validation phase)

block_idstring

Block reference: `"latest"` (most recent block), block hash, or block number

Response Body

Response
resultOBJECT

`overall_fee` - Total fee in wei (felt252) `gas_consumed` - Total gas consumed (felt252) `gas_price` - Gas price in wei per unit (felt252)

Examples

Bash
curl -X POST https://api-starknet-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "starknet_estimateFee",
    "params": [
      [
        {
          "type": "INVOKE",
          "sender_address": "0x1234567890abcdef1234567890abcdef12345678",
          "calldata": [
            "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
            "0x83afdfe4cdc632f4b21f8bdebabc13e47c1f1b4b97fc8b5b4b1c4e6746a3a7e0",
            "0x3",
            "0xde0b6b3a7640000",
            "0x0",
            "0x456789abcdef456789abcdef456789ab"
          ],
          "version": "0x3",
          "signature": ["0x0"],
          "nonce": "0x1"
        }
      ],
      ["SKIP_VALIDATE"],
      "latest"
    ],
    "id": 1
  }'

On this page