|
| 1 | +/** |
| 2 | + * Classification of blockchain protocol families. |
| 3 | + * |
| 4 | + * Groups blockchain networks by their underlying protocol family rather than |
| 5 | + * individual chain identity. Used for routing (which integration handles which |
| 6 | + * addresses), discovery (which standard detects which providers), and display |
| 7 | + * (chain family badges in UI). |
| 8 | + * |
| 9 | + * `ChainFamily` is distinct from `Chain` — a chain family contains multiple |
| 10 | + * chains (e.g., EVM family includes Ethereum, Polygon, Arbitrum, etc.). |
| 11 | + * |
| 12 | + * This is a closed enum. Adding new families requires Enterprise Architecture |
| 13 | + * approval, a new integration bounded context, and correlation registry entries. |
| 14 | + * |
| 15 | + * @example |
| 16 | + * ```typescript |
| 17 | + * import { ChainFamily } from '@cygnus-wealth/data-models'; |
| 18 | + * |
| 19 | + * // Route address to correct integration |
| 20 | + * function getIntegration(family: ChainFamily) { |
| 21 | + * switch (family) { |
| 22 | + * case ChainFamily.EVM: |
| 23 | + * return evmIntegration; |
| 24 | + * case ChainFamily.SOLANA: |
| 25 | + * return solIntegration; |
| 26 | + * default: |
| 27 | + * throw new Error(`No integration for ${family}`); |
| 28 | + * } |
| 29 | + * } |
| 30 | + * ``` |
| 31 | + * |
| 32 | + * @since 1.5.0 |
| 33 | + * @stability extended |
| 34 | + * |
| 35 | + * @see {@link Chain} for specific chain identification within a family |
| 36 | + */ |
| 37 | +export enum ChainFamily { |
| 38 | + /** EVM-compatible chains (Ethereum, Polygon, Arbitrum, Optimism, Avalanche, BSC, Base) */ |
| 39 | + EVM = 'evm', |
| 40 | + |
| 41 | + /** Solana mainnet */ |
| 42 | + SOLANA = 'solana', |
| 43 | + |
| 44 | + /** SUI mainnet (Move-based L1) */ |
| 45 | + SUI = 'sui', |
| 46 | + |
| 47 | + /** Bitcoin mainnet (UTXO model) */ |
| 48 | + BITCOIN = 'bitcoin', |
| 49 | + |
| 50 | + /** Cosmos ecosystem chains (Cosmos Hub, Osmosis, etc.) */ |
| 51 | + COSMOS = 'cosmos', |
| 52 | + |
| 53 | + /** Aptos mainnet (Move-based L1) */ |
| 54 | + APTOS = 'aptos', |
| 55 | +} |
0 commit comments