Getting started
ChainGate is a TypeScript-first framework for building multi-chain crypto apps. A single library covers Bitcoin, Ethereum, Litecoin, Dogecoin, Bitcoin Cash — plus any EVM chain you want — one API for wallets, balances, gas estimation, transfers, and JSON-RPC, usable from Node.js or any modern browser.
Manage digital assets, query blockchain data, and execute transactions across supported networks using a unified API.
ChainGate is designed with security in mind: Your private key never leaves your device. All signing operations, address generation, and sensitive cryptographic logic are executed locally in memory. ChainGate servers never have access to your private keys or seed phrases.
Supported blockchains
ChainGate currently supports these networks (expanded regularly):
Need another chain? Request integration.
Installation
Install ChainGate via npm:
npm install chaingate
No signup needed — you can start using the library immediately.
Create a wallet
Wallet creation is synchronous and runs entirely on your machine:
import { newWallet } from 'chaingate'
const { phrase, wallet } = newWallet()
console.log('Recovery phrase:', phrase)
You can also import an existing wallet from a mnemonic phrase, seed, private key, xpriv, xpub, public key, or keystore file.
Initialize ChainGate
To interact with blockchain networks (balances, transactions, blocks, gas prices, etc.) you need a ChainGate instance:
import { ChainGate } from 'chaingate'
const cg = new ChainGate()
That's it — no API key required to get going.
Quick start example
Derive an address and check a balance on two different networks from the same wallet:
import { newWallet, ChainGate } from 'chaingate'
const { phrase, wallet } = newWallet()
const cg = new ChainGate()
// Connect wallet to Bitcoin
const bitcoin = cg.connect(cg.networks.bitcoin, wallet)
console.log('Bitcoin address:', await bitcoin.address())
// Connect wallet to Ethereum and check the balance
const ethereum = cg.connect(cg.networks.ethereum, wallet)
const { confirmed } = await ethereum.addressBalance()
console.log('ETH balance:', confirmed.base(), confirmed.symbol)
console.log('ETH → USD:', await confirmed.toCurrency('usd'))
Send a transaction
The same flow works for every supported chain — Bitcoin, Litecoin, Dogecoin, Bitcoin Cash, Ethereum, Avalanche, and any custom EVM RPC network:
// Create an amount and transfer
const amount = cg.networks.bitcoin.amount('0.001')
const tx = await bitcoin.transfer(amount, 'bc1q...')
// Review recommended fees and broadcast
const fees = tx.recommendedFees()
if (fees.normal.enoughFunds) {
tx.setFee(fees.normal)
const broadcasted = await tx.signAndBroadcast()
console.log('TX ID:', broadcasted.transactionId)
}
Swap cg.networks.bitcoin for cg.networks.litecoin, cg.networks.dogecoin, cg.networks.bitcoincash, cg.networks.ethereum, or cg.networks.avalanche — the helpers (amount(), transfer(), recommendedFees(), signAndBroadcast()) have the same signature everywhere.
Query blockchain data (without a wallet)
You can query blockchain data without connecting a wallet using explorers:
const btcExplorer = cg.explore(cg.networks.bitcoin)
const balance = await btcExplorer.getAddressBalance('bc1q...')
const block = await btcExplorer.getLatestBlock()
// Current Ethereum gas price (in gwei)
const ethExplorer = cg.explore(cg.networks.ethereum)
const status = await ethExplorer.getNetworkStatus()
console.log('Base fee:', status.currentBaseFeeGWei, 'gwei')
Most ChainGate methods return Promise-based responses for async operations. Use async/await or standard Promise handling.
Want a higher rate limit? Get a free API key
The default new ChainGate() runs on a small rate limit suitable for development and trying things out. When you're ready for production traffic, grab a free API key at ChainGate's Dashboard and pass it in:
const cg = new ChainGate({ apiKey: 'your-api-key-from-dashboard' })
One key unlocks every chain, every RPC proxy, and every market-data endpoint — no need to combine an Etherscan API key, an Infura key, and a separate provider per UTXO network. If you hit the keyless rate limit before adding a key, ChainGate throws a RateLimitError pointing you to the dashboard.