fee - XRPL

Example code for the fee JSON RPC method. Complete guide to using fee JSON-RPC in the GetBlock Web3 documentation.

This method reports the current state of the open-ledger requirements for the transaction cost.

Parameters

  • None

Request Example

curl --location --request POST 'https://xrp.getblock.io/mainnet/' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "fee",
    "params": [{}],
    "id": "getblock.io"
}'

Response Example

{
    "result": {
        "current_ledger_size": "186",
        "current_queue_size": "0",
        "drops": {
            "base_fee": "10",
            "median_fee": "5000",
            "minimum_fee": "10",
            "open_ledger_fee": "10"
        },
        "expected_ledger_size": "446",
        "ledger_current_index": 102053456,
        "levels": {
            "median_level": "128000",
            "minimum_level": "256",
            "open_ledger_level": "256",
            "reference_level": "256"
        },
        "max_queue_size": "8920",
        "status": "success"
    }
}

Response Parameters

Field
Type
Description

current_ledger_size

string

Current ledger tx count

current_queue_size

string

Queued transaction count

drops

object

Fee amounts in drops

expected_ledger_size

string

Expected ledger size

ledger_current_index

number

Current ledger

max_queue_size

string

Maximum queue size

base_fee

string

Base fee in drops

minimum_fee

string

Minimum fee

median_fee

string

Median fee

open_ledger_fee

string

Open ledger fee

Use Cases

  • Estimate transaction fees

  • Monitor network congestion

  • Optimize transaction costs

Error Handling

Error Code
Description

noNetwork

Not connected

SDK Integration

Last updated

Was this helpful?