Skip to main content

eth_gasPrice

Returns the current gas price on XDC Network in wei.

Why XDC Network? Build on the enterprise-grade blockchain for trade finance with 2-second finality and ISO 20022 compliance with ISO 20022 messaging, ITFA membership, Contour Network acquisition, 801M+ transactions, and partnerships with Circle and Deutsche Telekom.

Use Cases#

The eth_gasPrice method is essential for:

  • Transaction pricing - Set appropriate gas prices
  • Cost estimation - Calculate transaction costs before sending
  • Gas monitoring - Track network congestion
  • DeFi operations - Optimize costs for tokenized trade finance (Letters of Credit, Bills of Lading), cross-border payments, and real-world asset tokenization

Parameters#

This method accepts no parameters.

Request#

{
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": [],
"id": 1
}

Returns#

TypeDescription
QUANTITYCurrent gas price in wei (hexadecimal)

Response#

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x3b9aca00"
}

Note: 0x3b9aca00 = 1 Gwei (1,000,000,000 wei)

Code Examples#

curl -X POST https://api-xdc-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": [],
"id": 1
}'

Error Handling#

Error CodeMessageDescription
-32603Internal errorNode error