get_fee_estimate - Monero

Example code for the get_fee_estimate JSON-RPC method. Complete guide on how to use get_fee_estimate JSON-RPC in GetBlock Web3 documentation.

This method returns the current per-byte fee estimate for transactions on the network, optionally for a specific priority level. Use it to size fees correctly before broadcasting a transaction.

Parameters

Parameter
Type
Required
Description

grace_blocks

unsigned int

No

Optional grace blocks (defaults to 0). Estimate accounts for fee changes expected within this many blocks

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "get_fee_estimate",
    "params": {},
    "id": "getblock.io"
}'

Response Example

{
    "id": "getblock.io",
    "jsonrpc": "2.0",
    "result": {
        "fee": 187610,
        "fees": [
            20000,
            81700,
            408500,
            4085000
        ],
        "quantization_mask": 10000,
        "status": "OK",
        "untrusted": false
    }
}

Response Parameters

Field
Type
Description

result.fee

unsigned int

Per-byte fee in atomic units for normal priority

result.fees

array of unsigned int

Per-byte fees for [slow, normal, fast, fastest] priority levels

result.quantization_mask

unsigned int

Fees must be a multiple of this value

Use Cases

  • Sizing transaction fees before broadcast

  • Wallet UX showing recommended fee tiers

  • Mining pool fee oracle integration

Error Handling

Status Code
Error Message
Cause

404

Not found

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?