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A2C,EAAU0B,CAAAA,EAAAA,EAAAA,CAAAA,EAAQ,CAChBrB,QAAAA,EAEAC,OAAAA,EAEAqB,cAAe,CACbC,OAAQ,CAAEC,QAAS,EAAM,EACzBC,QAAS,CAAED,QAAS,EAAM,CAC5B,EAEAE,OAAQ,CACNF,QAAS,EACX,EAEAG,YAAa,CACXlD,KAAM,eACNmD,KAAM7E,SAASC,MAAM,CAAG,8BACxB6E,YAAa,wDACbC,2BAA4BtD,CAAAA,EAAAA,EAAAA,EAAAA,GAC9B,EAEAuD,QAAS,CACPC,6BAA8B,GAC9BC,sBAAuB,EACzB,CACF,EAGF","sources":["webpack://_N_E/./src/hooks/wallets/wallets.ts","webpack://_N_E/./src/services/onboard.ts","webpack://_N_E/ignored|/home/circleci/project/repository/node_modules/@metamask/eth-sig-util/node_modules/tweetnacl|crypto","webpack://_N_E/ignored|/home/circleci/project/repository/node_modules/@stablelib/random/lib/source|crypto","webpack://_N_E/ignored|/home/circleci/project/repository/node_modules/tweetnacl-util|buffer","webpack://_N_E/"],"sourcesContent":["import { TREZOR_APP_URL, TREZOR_EMAIL, WC_PROJECT_ID } from '@/config/constants'\nimport type { RecommendedInjectedWallets, WalletInit } from '@web3-onboard/common/dist/types.d'\nimport type { ChainInfo } from '@safe-global/safe-gateway-typescript-sdk'\n\nimport coinbaseModule from '@web3-onboard/coinbase'\nimport injectedWalletModule, { ProviderLabel } from '@web3-onboard/injected-wallets'\nimport keystoneModule from '@web3-onboard/keystone/dist/index'\nimport ledgerModule from '@web3-onboard/ledger/dist/index'\nimport trezorModule from '@web3-onboard/trezor'\nimport walletConnect from '@web3-onboard/walletconnect'\n\nimport { CGW_NAMES, WALLET_KEYS } from './consts'\n\nconst prefersDarkMode = (): boolean => {\n return window?.matchMedia('(prefers-color-scheme: dark)')?.matches\n}\n\nconst walletConnectV2 = (chain: ChainInfo): WalletInit => {\n // WalletConnect v2 requires a project ID\n if (!WC_PROJECT_ID) {\n return () => null\n }\n\n return walletConnect({\n version: 2,\n projectId: WC_PROJECT_ID,\n qrModalOptions: {\n themeVariables: {\n '--wcm-z-index': '1302',\n },\n themeMode: prefersDarkMode() ? 'dark' : 'light',\n },\n requiredChains: [parseInt(chain.chainId)],\n dappUrl: location.origin,\n })\n}\n\nconst WALLET_MODULES: { [key in WALLET_KEYS]: (chain: ChainInfo) => WalletInit } = {\n [WALLET_KEYS.INJECTED]: () => injectedWalletModule(),\n [WALLET_KEYS.WALLETCONNECT_V2]: (chain) => walletConnectV2(chain),\n [WALLET_KEYS.COINBASE]: () => coinbaseModule({ darkMode: prefersDarkMode() }),\n [WALLET_KEYS.LEDGER]: () => ledgerModule(),\n [WALLET_KEYS.TREZOR]: () => trezorModule({ appUrl: TREZOR_APP_URL, email: TREZOR_EMAIL }),\n [WALLET_KEYS.KEYSTONE]: () => keystoneModule(),\n}\n\nexport const getAllWallets = (chain: ChainInfo): WalletInit[] => {\n return Object.values(WALLET_MODULES).map((module) => module(chain))\n}\n\nexport const getRecommendedInjectedWallets = (): RecommendedInjectedWallets[] => {\n return [{ name: ProviderLabel.MetaMask, url: 'https://metamask.io' }]\n}\n\nexport const isWalletSupported = (disabledWallets: string[], walletLabel: string): boolean => {\n const legacyWalletName = CGW_NAMES?.[walletLabel.toUpperCase() as WALLET_KEYS]\n return !disabledWallets.includes(legacyWalletName || walletLabel)\n}\n\nexport const getSupportedWallets = (chain: ChainInfo): WalletInit[] => {\n const enabledWallets = Object.entries(WALLET_MODULES).filter(([key]) => isWalletSupported(chain.disabledWallets, key))\n\n if (enabledWallets.length === 0) {\n return [WALLET_MODULES.INJECTED(chain)]\n }\n\n return enabledWallets.map(([, module]) => module(chain))\n}\n","import Onboard, { type OnboardAPI } from '@web3-onboard/core'\nimport type { ChainInfo } from '@safe-global/safe-gateway-typescript-sdk'\nimport { hexValue } from '@ethersproject/bytes'\nimport { getAllWallets, getRecommendedInjectedWallets } from '@/hooks/wallets/wallets'\nimport type { EnvState } from '@/store/settingsSlice'\n\nlet onboard: OnboardAPI | null = null\n\nexport const createOnboard = (\n chainConfigs: ChainInfo[],\n currentChain: ChainInfo,\n rpcConfig: EnvState['rpc'] | undefined,\n): OnboardAPI => {\n if (onboard) return onboard\n\n const wallets = getAllWallets(currentChain)\n\n const chains = chainConfigs.map((cfg) => ({\n id: hexValue(parseInt(cfg.chainId)),\n label: cfg.chainName,\n rpcUrl: rpcConfig?.[cfg.chainId],\n token: cfg.nativeCurrency.symbol,\n color: cfg.theme.backgroundColor,\n publicRpcUrl: cfg.publicRpcUri.value,\n blockExplorerUrl: new URL(cfg.blockExplorerUriTemplate.address).origin,\n }))\n\n onboard = Onboard({\n wallets,\n\n chains,\n\n accountCenter: {\n mobile: { enabled: false },\n desktop: { enabled: false },\n },\n\n notify: {\n enabled: false,\n },\n\n appMetadata: {\n name: 'Eternal Safe',\n icon: location.origin + '/images/safe-logo-green.png',\n description: 'Eternal Safe is a decentralized fork of Safe{Wallet}.',\n recommendedInjectedWallets: getRecommendedInjectedWallets(),\n },\n\n connect: {\n removeWhereIsMyWalletWarning: true,\n autoConnectLastWallet: false,\n },\n })\n\n return onboard\n}\n","/* (ignored) */","/* (ignored) */","/* (ignored) */"],"names":["prefersDarkMode","window","matchMedia","matches","walletConnectV2","WC_PROJECT_ID","walletConnect","version","projectId","qrModalOptions","themeVariables","themeMode","requiredChains","parseInt","chain","chainId","dappUrl","location","origin","WALLET_MODULES","WALLET_KEYS","INJECTED","injectedWalletModule","WALLETCONNECT_V2","COINBASE","coinbaseModule","darkMode","LEDGER","ledgerModule","TREZOR","trezorModule","appUrl","TREZOR_APP_URL","email","TREZOR_EMAIL","KEYSTONE","keystoneModule","getAllWallets","Object","values","map","module","getRecommendedInjectedWallets","name","ProviderLabel","MetaMask","url","isWalletSupported","disabledWallets","walletLabel","legacyWalletName","CGW_NAMES","toUpperCase","includes","getSupportedWallets","enabledWallets","entries","filter","key","param","length","onboard","createOnboard","chainConfigs","currentChain","rpcConfig","wallets","chains","id","hexValue","cfg","label","chainName","rpcUrl","token","nativeCurrency","symbol","color","theme","backgroundColor","publicRpcUrl","publicRpcUri","value","blockExplorerUrl","URL","blockExplorerUriTemplate","address","Onboard","accountCenter","mobile","enabled","desktop","notify","appMetadata","icon","description","recommendedInjectedWallets","connect","removeWhereIsMyWalletWarning","autoConnectLastWallet"],"sourceRoot":""}