⚠️Blast API (blastapi.io) ends Oct 31. Migrate to Dwellir and skip Alchemy's expensive compute units.
Switch Today →
Skip to main content

starknet_estimateFee

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

Parameters

ParameterTypeDescription
requestarrayArray of transactions to estimate
simulation_flagsarrayOptional simulation parameters (SKIP_VALIDATE to skip validation phase)
block_idstringBlock reference: "latest" (most recent block), block hash, or block number
{
"jsonrpc": "2.0",
"method": "starknet_estimateFee",
"params": [
[
{
"type": "INVOKE",
"sender_address": "0x1234567890abcdef1234567890abcdef12345678",
"calldata": [
"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
"0x83afdfe4cdc632f4b21f8bdebabc13e47c1f1b4b97fc8b5b4b1c4e6746a3a7e0",
"0x3",
"0x2386f26fc10000",
"0x0",
"0x456789abcdef456789abcdef456789ab"
],
"version": "0x3",
"signature": ["0x0"],
"nonce": "0x1"
}
],
["SKIP_VALIDATE"],
"latest"
],
"id": 1
}

Returns

ARRAY - Array of fee estimation objects containing:

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

Examples

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
}'