Skip to main content

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

MethodJSON-RPC callDescription
getBalance(address)eth_getBalanceNative balance
getTransactionCount(address)eth_getTransactionCountNonce
estimateGas(params)eth_estimateGasGas estimate
getFeeData()eth_gasPrice + EIP-1559Fee data (gas price, max fee, priority fee)
sendRawTransaction(rawTx)eth_sendRawTransactionBroadcast a signed transaction
getTransactionReceipt(txHash)eth_getTransactionReceiptTransaction 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.