Ethereum API Integration

Overview

Ethereum is supported by Pocket Network's enterprise-grade infrastructure with guaranteed uptime, global edge network, and developer-first tooling.

Network Information

Property Value
Network Name Ethereum Mainnet
Native Token ETH
EVM Chain ID 1
Pocket Service ID eth
Block Explorer Etherscan

Integration Examples

Quick Setup

// Using ethers.js
import { JsonRpcProvider } from 'ethers';

const provider = new JsonRpcProvider('YOUR_ENDPOINT');

// Get latest block
const blockNumber = await provider.getBlockNumber();
console.log('Latest block:', blockNumber);

// Get account balance
const balance = await provider.getBalance('0x742d35Cc6634C0532925a3b8D341EAF9fec0D30D');
console.log('Balance:', balance.toString());

Smart Contract Interaction

// Contract interaction example
const contractABI = [...]; // Your contract ABI
const contractAddress = '0x...'; // Your contract address

const contract = new Contract(contractAddress, contractABI, provider);

// Read contract data
const result = await contract.someReadMethod();

// Write to contract (requires signer)
const signer = provider.getSigner();
const contractWithSigner = contract.connect(signer);
const tx = await contractWithSigner.someWriteMethod(param1, param2);
await tx.wait(); // Wait for confirmation

Developer Resources

📚 Essential Links

🛠️ Tools & SDKs

💬 Community & Support

Public Endpoint

Free public RPC endpoint available with fair use limits. No API key required.

View Public Endpoint →