How drakensoftware/chaingate works
ChainGate is a TypeScript SDK for creating or importing multi-chain wallets, selecting a network, exploring chain data, and preparing, signing, and broadcasting transactions. Its main entry point routes network-specific requests to explorer and connector implementations; the generated API client serves hosted-API operations, while RPC connectors communicate with caller-selected EVM endpoints. Wallet creation, encryption, and real-time event subscriptions are distinct capabilities. The README documents broader explorer and event features than the sampled excerpts show, so uncertain internal wiring is omitted.
Main entry points: ChainGate.ts ChainGate · UtxoExplorer.ts UTXO explorer · Wallet.ts Wallets · UtxoConnector.ts UTXO connector
Components 23
SDK and networks
- ChainGate
src/ChainGate/ChainGate.ts - Network descriptors
src/ChainGate/networks/NetworkCollection.ts
Wallets and keys
- Wallet factory
src/WalletFactory.ts - Wallets
src/Wallet/Wallet.ts - Keystores
src/Keystore/Keystore.ts
Chain access
- UTXO connector
src/Connector/UtxoConnector/UtxoConnector.ts - Bitcoin Cash connector
src/Connector/UtxoConnector/BchConnector/BchConnector.ts - EVM connector
src/Connector/EvmConnector/EvmConnector.ts - EVM RPC connector
src/Connector/EvmRpcConnector/EvmRpcConnector.ts - UTXO explorer
src/Explorer/UtxoExplorer.ts - EVM explorer
src/Explorer/EvmExplorer.ts - EVM RPC explorer
src/Connector/EvmRpcConnector/EvmRpcExplorer.ts - Global explorer
src/Explorer/GlobalExplorer.ts - Generated API client
src/Client/client.gen.ts
Live events
- Event stream manager
src/Events/EventStreams.ts - WebSocket stream
src/Events/EventStream.ts
Signing utilities
- Signing wallets
src/Wallet/SigningWallet/SigningWallet.ts - Amount and units
src/utils/Amount.ts
Other components
- SDK user
- ChainGate API
- EVM RPC service
- Transaction broadcast
- ChainGate event service
Connections 37
- SDK user → ChainGate: creates SDK
- SDK user → Wallet factory: creates or imports
- SDK user → ChainGate: selects network
- ChainGate → Network descriptors: provides networks
- ChainGate → UTXO explorer: creates explorer
- ChainGate → EVM explorer: creates explorer
- ChainGate → EVM RPC explorer: creates explorer
- ChainGate → Global explorer: creates explorer
- ChainGate → UTXO connector: creates connector
- ChainGate → Bitcoin Cash connector: creates connector
- ChainGate → EVM connector: creates connector
- ChainGate → EVM RPC connector: creates connector
- Wallet factory → Wallets: builds wallet
- Wallet factory → Keystores: imports keystore
- UTXO connector → Wallets: uses wallet
- Bitcoin Cash connector → Wallets: uses wallet
- EVM connector → Wallets: uses wallet
- EVM RPC connector → Wallets: uses wallet
- UTXO connector → UTXO explorer: queries and broadcasts
- Bitcoin Cash connector → UTXO explorer: queries and broadcasts
- EVM connector → EVM explorer: queries and broadcasts
- EVM RPC connector → EVM RPC explorer: queries and broadcasts
- UTXO explorer → Generated API client: requests chain data
- EVM explorer → Generated API client: requests chain data
- Global explorer → Generated API client: requests global data
- Generated API client → ChainGate API: sends HTTP requests
- EVM RPC explorer → EVM RPC service: sends RPC requests
- UTXO explorer → Transaction broadcast: submits transactions
- EVM explorer → Transaction broadcast: submits transactions
- EVM RPC connector → Signing wallets: signs transactions
- EVM connector → Signing wallets: signs transactions
- UTXO connector → Signing wallets: signs transactions
- SDK user → Event stream manager: subscribes events
- ChainGate → Event stream manager: provides streams
- Event stream manager → WebSocket stream: manages streams
- WebSocket stream → ChainGate event service: exchanges frames
- SDK user → Amount and units: converts units