
Company News
Socket Has Acquired Secure Annex
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.
Multi-chain cryptocurrency SDK for TypeScript β unified API for Bitcoin, Ethereum, Litecoin, Dogecoin, Bitcoin Cash, Polygon, Arbitrum, and any EVM-compatible chain. Create wallets, query balances, send transactions, and manage tokens and NFTs across UTXO
Multi-chain cryptocurrency SDK for TypeScript.
Create wallets, query blockchains, and send transactions across Bitcoin, Ethereum, and more.
npm install chaingate
import { ChainGate, importWallet } from 'chaingate';
const cg = new ChainGate({ apiKey: 'your-api-key' });
const wallet = importWallet({ phrase: 'abandon abandon abandon ...' });
const btc = cg.connect(cg.networks.bitcoin, wallet);
// Convert $20 USD to the equivalent BTC amount at current market rate
const amount = await cg.networks.bitcoin.amountFromCurrency('usd', 20);
const tx = await btc.transfer(amount, 'bc1qRecipient...');
// Review suggested fees and pick one
const fees = tx.recommendedFees();
console.log(fees.normal.estimatedFeeSat); // estimated fee in satoshis
console.log(fees.normal.enoughFunds); // true if balance covers amount + fee
tx.setFee(fees.high);
const broadcasted = await tx.signAndBroadcast();
console.log('txid:', broadcasted.transactionId);
const eth = cg.connect(cg.networks.ethereum, wallet);
const tokens = await eth.addressTokenBalances();
for (const token of tokens) {
if (token.isNFT) {
// ERC-721 or ERC-1155
console.log(`${token.name} -- ${token.ownedTokens.length} NFTs`);
} else {
// ERC-20
console.log(`${token.base()} ${token.symbol}`); // e.g. "1500.50 USDC"
}
}
Full decoded history with token transfers, approvals, wraps, and more:
const eth = cg.connect(cg.networks.ethereum, wallet);
const history = await eth.addressHistory();
for (const tx of history.transactions) {
console.log(tx.txHash, new Date(tx.timestamp * 1000));
// Decoded actions relevant to your address
for (const action of tx.actions) {
// action.type: "transfer_in", "transfer_out", "mint", "burn", "wrap", "unwrap", ...
// action.token: { name, symbol, decimals, logoUrl }
// action.contract: contract address or "native" for ETH transfers
console.log(` ${action.type} on ${action.token.symbol ?? 'ETH'}`);
}
}
const btc = cg.connect(cg.networks.bitcoin, wallet);
const history = await btc.addressHistory();
for (const tx of history.transactions) {
const usd = await tx.amount.toCurrency('usd');
console.log(`${tx.txid}: ${tx.amount.base()} BTC ($${usd})`);
}
import { ChainGate, newWallet } from 'chaingate';
const cg = new ChainGate({ apiKey: 'your-api-key' });
const { phrase, wallet } = newWallet();
console.log('Mnemonic:', phrase);
const eth = cg.connect(cg.networks.ethereum, wallet);
const balance = await eth.addressBalance();
const usd = await balance.confirmed.toCurrency('usd');
console.log(`${balance.confirmed.base()} ${balance.confirmed.symbol} ($${usd})`);
import { importWallet, createWalletFromString } from 'chaingate';
// From mnemonic
const wallet = importWallet({ phrase: 'abandon abandon abandon ...' });
// From private key
importWallet({ privateKey: '0x...' });
// From xpub (view-only)
importWallet({ xpub: 'xpub...' });
// Auto-detect any format
const wallet = createWalletFromString('xprv9s21ZrQH143K...');
const eth = cg.connect(cg.networks.ethereum, wallet);
const usdc = cg.networks.ethereum.amount('100', {
contractAddress: '0xA0b8...eB48',
decimals: 6,
symbol: 'USDC',
});
const tx = await eth.transferToken(usdc, '0xRecipient...');
await tx.signAndBroadcast();
// ERC-721
const tx = await eth.transferNft('0xNftContract...', '0xRecipient...', tokenId);
// ERC-1155 (with quantity)
const tx = await eth.transferErc1155('0xNftContract...', tokenId, 5, '0xRecipient...');
const bsc = cg.networks.evmRpc({
rpcUrl: 'https://bsc-dataseed.binance.org',
chainId: 56,
name: 'BNB Smart Chain',
symbol: 'BNB',
});
const conn = cg.connect(bsc, wallet);
const balance = await conn.addressBalance();
await wallet.encrypt('my-password');
const data = wallet.serialize();
// Restore later
import { deserializeWallet } from 'chaingate';
const restored = deserializeWallet(data, async () => {
return prompt('Enter password:');
});
cg.networks.bitcoin.isValidAddress('bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4'); // true
cg.networks.ethereum.isValidAddress('0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'); // true
cg.networks.bitcoincash.isValidAddress('bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a'); // true
cg.networks.bitcoin.isValidAddress('0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'); // false
cg.networks.ethereum.isValidAddress('not-an-address'); // false
import { signEvmMessage, verifyEvmMessage } from 'chaingate';
// EVM (EIP-191)
const signature = signEvmMessage('Hello', privateKey);
const isValid = verifyEvmMessage('Hello', signature, address);
| Network | Address Types |
|---|---|
| Bitcoin | segwit, legacy, taproot |
| Litecoin | segwit, legacy |
| Dogecoin | legacy |
| Bitcoin Cash | cashaddr, legacy |
| Bitcoin Testnet | segwit, legacy, taproot |
| Ethereum | EOA |
| Any EVM via RPC | EOA |
RPC proxy URLs included for Ethereum, Polygon, Arbitrum, Avalanche, BNB Chain, Base, and Sonic.
FAQs
Multi-chain cryptocurrency SDK for TypeScript β unified API for Bitcoin, Ethereum, Litecoin, Dogecoin, Bitcoin Cash, Polygon, Arbitrum, and any EVM-compatible chain. Create wallets, query balances, send transactions, and manage tokens and NFTs across UTXO
The npm package chaingate receives a total of 196,447 weekly downloads. As such, chaingate popularity was classified as popular.
We found that chaingate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.

Research
/Security News
Socket is tracking cloned Open VSX extensions tied to GlassWorm, with several updated from benign-looking sleepers into malware delivery vehicles.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.