chaingate
Version:
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
58 lines (57 loc) • 1.83 kB
TypeScript
/** Network identifiers accepted by the ChainGate RPC proxy. */
export type RpcNetwork = 'bitcoin' | 'bitcointestnet' | 'bitcoincash' | 'litecoin' | 'dogecoin' | 'ethereum' | 'sonic' | 'polygon' | 'arbitrum' | 'avalanche' | 'bnb' | 'base';
/**
* Provides pre-built JSON-RPC endpoint URLs for every network supported by the
* ChainGate RPC proxy.
*
* Each property returns a fully-qualified URL ready to be used with any
* JSON-RPC client (ethers, viem, bitcoinjs, etc.) or with
* {@link ChainGate.networks.evmRpc | `cg.networks.evmRpc()`}. When a
* ChainGate API key is configured, it is appended automatically.
*
* @example
* ```ts
* const cg = new ChainGate();
*
* // Use directly
* console.log(cg.rpcUrls.ethereum);
* // → "https://api.chaingate.dev/rpc/ethereum"
*
* // Combine with evmRpc connector
* const polygon = cg.networks.evmRpc({
* rpcUrl: cg.rpcUrls.polygon,
* chainId: 137,
* name: 'Polygon',
* symbol: 'POL',
* });
* ```
*/
export declare class RpcUrls {
readonly bitcoin: string;
readonly bitcoinTestnet: string;
readonly bitcoincash: string;
readonly litecoin: string;
readonly dogecoin: string;
readonly ethereum: string;
readonly sonic: string;
readonly polygon: string;
readonly arbitrum: string;
readonly avalanche: string;
readonly bnb: string;
readonly base: string;
private readonly _apiKey;
/** @internal */
constructor(apiKey?: string);
/**
* Returns the RPC URL for any supported network by its identifier.
*
* @example
* ```ts
* const url = cg.rpcUrls.get('polygon');
* // → "https://api.chaingate.dev/rpc/polygon"
* ```
*/
get(network: RpcNetwork): string;
}
/** @internal */
export declare function buildRpcUrl(network: RpcNetwork, apiKey?: string): string;