ChainGate RPC endpoints
ChainGate provides RPC endpoints for all supported networks — both EVM and UTXO. One API key gives you access to every network -- no need to sign up with Infura, Alchemy, or any other provider.
Available networks
Access the endpoints via cg.rpcUrls:
import { ChainGate } from 'chaingate'
const cg = new ChainGate({ apiKey: 'your-api-key' })
console.log(cg.rpcUrls.ethereum) // https://api.chaingate.dev/rpc/ethereum?api_key=...
console.log(cg.rpcUrls.bitcoin) // https://api.chaingate.dev/rpc/bitcoin?api_key=...
console.log(cg.rpcUrls.polygon) // https://api.chaingate.dev/rpc/polygon?api_key=...
EVM networks
| Network | Property | Chain ID |
|---|---|---|
| Ethereum | cg.rpcUrls.ethereum | 1 |
| Polygon | cg.rpcUrls.polygon | 137 |
| Arbitrum | cg.rpcUrls.arbitrum | 42161 |
| Base | cg.rpcUrls.base | 8453 |
| Avalanche | cg.rpcUrls.avalanche | 43114 |
| BNB Smart Chain | cg.rpcUrls.bnb | 56 |
| Sonic | cg.rpcUrls.sonic | 146 |
UTXO networks
| Network | Property |
|---|---|
| Bitcoin | cg.rpcUrls.bitcoin |
| Bitcoin Testnet | cg.rpcUrls.bitcoinTestnet |
| Bitcoin Cash | cg.rpcUrls.bitcoincash |
| Litecoin | cg.rpcUrls.litecoin |
| Dogecoin | cg.rpcUrls.dogecoin |
Free tier included
All RPC endpoints are included in the free API key. Get yours at ChainGate's Dashboard.
Use with external libraries
These are standard JSON-RPC endpoints. They work with any Ethereum library out of the box.
ethers.js
import { ethers } from 'ethers'
import { ChainGate } from 'chaingate'
const cg = new ChainGate({ apiKey: 'your-api-key' })
const provider = new ethers.JsonRpcProvider(cg.rpcUrls.ethereum)
const blockNumber = await provider.getBlockNumber()
const balance = await provider.getBalance('0x...')
console.log('Block:', blockNumber, 'Balance:', ethers.formatEther(balance))
viem
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
import { ChainGate } from 'chaingate'
const cg = new ChainGate({ apiKey: 'your-api-key' })
const client = createPublicClient({
chain: mainnet,
transport: http(cg.rpcUrls.ethereum),
})
const blockNumber = await client.getBlockNumber()
const balance = await client.getBalance({ address: '0x...' })
web3.js
import Web3 from 'web3'
import { ChainGate } from 'chaingate'
const cg = new ChainGate({ apiKey: 'your-api-key' })
const web3 = new Web3(cg.rpcUrls.ethereum)
const blockNumber = await web3.eth.getBlockNumber()
const balance = await web3.eth.getBalance('0x...')
Direct fetch (EVM)
const cg = new ChainGate({ apiKey: 'your-api-key' })
const response = await fetch(cg.rpcUrls.ethereum, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
method: 'eth_blockNumber',
params: [],
id: 1,
}),
})
const { result } = await response.json()
console.log('Block number:', parseInt(result, 16))
info
The RPC URLs already include your API key as a query parameter. No additional authentication headers are needed.