Fantom API Quick Start Guide
BlockEden.xyz provides high-performance, reliable Fantom infrastructure through our comprehensive JSON-RPC API. Connect to Ethereum mainnet, testnets, and layer 2 solutions with enterprise-grade reliability and developer-friendly tools.
Overview
Our Fantom API supports:
- Fantom Mainnet and all major testnets (Sepolia, Holesky)
- Layer 2 Solutions (Polygon, Arbitrum, Optimism)
- Full JSON-RPC Specification with debug and trace methods
- WebSocket Connections for real-time data
- Archive Node Access for historical data
- MEV Protection and transaction simulation
Quick Start
Step 1: Get Your API Key
- Visit BlockEden.xyz Dashboard
- Sign up for a free account if you haven't already
- Create a new API key for Fantom
- Select your target network (Mainnet, Sepolia, etc.)
Step 2: Make Your First Request
Using cURL
curl -X POST https://api.blockeden.xyz/fantom/${accessKey} \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'
Using JavaScript (Fetch)
const response = await fetch('https://api.blockeden.xyz/fantom/${accessKey}', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'eth_blockNumber',
params: [],
id: 1
})
});
const data = await response.json();
console.log('Current block number:', parseInt(data.result, 16));
Using Python
import requests
import json
url = "https://api.blockeden.xyz/fantom/${accessKey}"
payload = {
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}
response = requests.post(url, json=payload)
result = response.json()
print(f"Current block number: {int(result['result'], 16)}")
Core RPC Methods
Account Information
// Get account balance
{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0x742D5Cc6bF2442E8C7c74c7b4Be6AB9d6f10f5B4", "latest"],
"id": 1
}
// Get transaction count (nonce)
{
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": ["0x742D5Cc6bF2442E8C7c74c7b4Be6AB9d6f10f5B4", "latest"],
"id": 1
}
Block Information
// Get latest block
{
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": ["latest", true],
"id": 1
}
// Get block by hash
{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": ["0x1234...abcd", true],
"id": 1
}
Transaction Operations
// Get transaction by hash
{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": ["0x1234...abcd"],
"id": 1
}
// Send raw transaction
{
"jsonrpc": "2.0",
"method": "eth_sendRawTransaction",
"params": ["0x1234...abcd"],
"id": 1
}
Network Endpoints
Mainnet
- HTTP:
https://api.blockeden.xyz/fantom/${accessKey}
- WebSocket:
wss://api.blockeden.xyz/fantom/${accessKey}
Testnets
- Sepolia:
https://ethereum-sepolia.blockeden.xyz/<your-api-key>
- Holesky:
https://ethereum-holesky.blockeden.xyz/<your-api-key>
Layer 2 Networks
- Polygon:
https://polygon-mainnet.blockeden.xyz/<your-api-key>
- Arbitrum:
https://arbitrum-mainnet.blockeden.xyz/<your-api-key>
- Optimism:
https://optimism-mainnet.blockeden.xyz/<your-api-key>