|
| 1 | +import { type ProviderInfo } from '@rango-dev/wallets-core'; |
| 2 | +import { LegacyNetworks } from '@rango-dev/wallets-core/legacy'; |
| 3 | +import { Networks } from '@rango-dev/wallets-shared'; |
| 4 | +import { type BlockchainMeta } from 'rango-types'; |
| 5 | + |
| 6 | +export const EVM_SUPPORTED_CHAINS = [ |
| 7 | + LegacyNetworks.ETHEREUM, |
| 8 | + LegacyNetworks.POLYGON, |
| 9 | + LegacyNetworks.BASE, |
| 10 | +]; |
| 11 | + |
| 12 | +export const HEXADECIMAL_BASE = 16; |
| 13 | +export const WALLET_ID = 'ledger'; |
| 14 | + |
| 15 | +export const info: ProviderInfo = { |
| 16 | + name: 'Ledger', |
| 17 | + icon: 'https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/ledger/icon.svg', |
| 18 | + extensions: { |
| 19 | + homepage: |
| 20 | + 'https://support.ledger.com/hc/en-us/articles/4404389606417-Download-and-install-Ledger-Live?docs=true', |
| 21 | + }, |
| 22 | + properties: [ |
| 23 | + { |
| 24 | + name: 'namespaces', |
| 25 | + value: { |
| 26 | + selection: 'single', |
| 27 | + data: [ |
| 28 | + { |
| 29 | + label: 'Ethereum', |
| 30 | + value: 'EVM', |
| 31 | + id: 'ETH', |
| 32 | + getSupportedChains: (allBlockchains: BlockchainMeta[]) => |
| 33 | + allBlockchains.filter( |
| 34 | + (chain) => chain.name === Networks.ETHEREUM |
| 35 | + ), |
| 36 | + }, |
| 37 | + { |
| 38 | + label: 'Solana', |
| 39 | + value: 'Solana', |
| 40 | + id: 'SOLANA', |
| 41 | + getSupportedChains: (allBlockchains: BlockchainMeta[]) => |
| 42 | + allBlockchains.filter((chain) => chain.name === Networks.SOLANA), |
| 43 | + }, |
| 44 | + ], |
| 45 | + }, |
| 46 | + }, |
| 47 | + { |
| 48 | + name: 'derivationPath', |
| 49 | + value: { |
| 50 | + data: [ |
| 51 | + { |
| 52 | + id: 'metamask', |
| 53 | + label: `Metamask (m/44'/60'/0'/0/index)`, |
| 54 | + namespace: 'EVM', |
| 55 | + generateDerivationPath: (index: string) => `44'/60'/0'/0/${index}`, |
| 56 | + }, |
| 57 | + { |
| 58 | + id: 'ledgerLive', |
| 59 | + label: `LedgerLive (m/44'/60'/index'/0/0)`, |
| 60 | + namespace: 'EVM', |
| 61 | + generateDerivationPath: (index: string) => `44'/60'/${index}'/0/0`, |
| 62 | + }, |
| 63 | + { |
| 64 | + id: 'legacy', |
| 65 | + label: `Legacy (m/44'/60'/0'/index)`, |
| 66 | + namespace: 'EVM', |
| 67 | + generateDerivationPath: (index: string) => `44'/60'/0'/${index}`, |
| 68 | + }, |
| 69 | + { |
| 70 | + id: `(m/44'/501'/index')`, |
| 71 | + label: `(m/44'/501'/index')`, |
| 72 | + namespace: 'Solana', |
| 73 | + generateDerivationPath: (index: string) => `44'/501'/${index}'`, |
| 74 | + }, |
| 75 | + { |
| 76 | + id: `(m/44'/501'/0'/index)`, |
| 77 | + label: `(m/44'/501'/0'/index)`, |
| 78 | + namespace: 'Solana', |
| 79 | + generateDerivationPath: (index: string) => `44'/501'/0'/${index}`, |
| 80 | + }, |
| 81 | + ], |
| 82 | + }, |
| 83 | + }, |
| 84 | + ], |
| 85 | +}; |
0 commit comments