EVM RPC explorer
EvmRpcExplorer provides direct JSON-RPC access for custom EVM networks created via cg.networks.evmRpc(). It wraps standard Ethereum JSON-RPC methods and works with any EVM-compatible chain.
import { ChainGate } from 'chaingate'
const cg = new ChainGate({ apiKey: 'your-api-key' })
const bsc = cg.networks.evmRpc({
rpcUrl: 'https://bsc-dataseed.binance.org',
chainId: 56,
name: 'BNB Smart Chain',
symbol: 'BNB',
})
const explorer = cg.explore(bsc)
Available methods
| Method | JSON-RPC call | Description |
|---|---|---|
getBalance(address) | eth_getBalance | Native balance |
getTransactionCount(address) | eth_getTransactionCount | Nonce |
estimateGas(params) | eth_estimateGas | Gas estimate |
getFeeData() | eth_gasPrice + EIP-1559 | Fee data (gas price, max fee, priority fee) |
sendRawTransaction(rawTx) | eth_sendRawTransaction | Broadcast a signed transaction |
getTransactionReceipt(txHash) | eth_getTransactionReceipt | Transaction receipt |
Example
const explorer = cg.explore(bsc)
// Check balance
const balance = await explorer.getBalance('0x...')
// Get current fees
const feeData = await explorer.getFeeData()
console.log('Gas price:', feeData.gasPrice)
// Transaction receipt
const receipt = await explorer.getTransactionReceipt('0xtxhash...')
console.log('Status:', receipt.status)
Difference with EvmExplorer
EvmExplorer (for natively supported networks like Ethereum) queries the ChainGate API and provides richer data — token balances, transaction history, network status, NFT metadata, etc. EvmRpcExplorer talks directly to a JSON-RPC endpoint and is limited to standard Ethereum RPC methods.