{"version":3,"sources":["features/modal/modalSlice.ts","app/hooks.ts","features/bridge/bridgeSlice.ts","helpers/constants.ts","entities/baseCurrency.ts","entities/nativeCurrency.ts","entities/token.ts","entities/weth9.ts","entities/ether.ts","entities/olt.ts","entities/bnb.ts","entities/matic.ts","entities/bridgeToken.ts","helpers/chains.ts","helpers/utilities.ts","components/icons/ImgIcon.tsx","components/buttons/TokenButton.tsx","components/buttons/ColorizedButton.tsx","components/buttons/BridgeChainButton.tsx","features/api/chainListApiSlice.ts","hooks/useFetchMetamaskAPI.ts","features/wallet/transactionSlice.ts","components/buttons/AddTokenButton.tsx","features/api/web3ApiSlice.ts","hooks/useFetchBalancePerCurrencies.ts","components/buttons/SafeMaxButton.tsx","components/inputs/BridgeInput.tsx","helpers/connectors.ts","hooks/useCheckAllowance.ts","hooks/useFetchTransactions.ts","hooks/useWatchTx.ts","hooks/useERC20Approve.ts","components/buttons/BridgeTransferButton.tsx","features/api/tokenListApiSlice.ts","hooks/useFetchBridgeCurrencies.ts","features/settings/settingsSlice.ts","components/buttons/BridgeSettingsButton.tsx","components/buttons/ConnectButton.tsx","components/buttons/SmartConnectorWrapperButton.tsx","components/pages/Bridge.tsx","routes.tsx","components/buttons/ThemeButton.tsx","components/buttons/RouteButton.tsx","assets/icons/oneledger.svg","components/Navigation.tsx","features/wallet/walletSlice.ts","providers/MetaMaskProvider.tsx","providers/utils.ts","features/api/cosignerApiSlice.ts","providers/BridgeProvider.tsx","components/modals/BootstrapDialogTitle.tsx","assets/icons/wallets/MetaMaskIcon.png","components/buttons/MetaMaskButton.tsx","components/modals/ConnectModal.tsx","components/modals/BridgeTokenModal.tsx","components/modals/BridgeChainSelectModal.tsx","components/modals/WrongNetworkModal.tsx","assets/icons/mining.svg","assets/icons/moon-man.svg","assets/icons/connect.svg","features/api/priceApiSlice.ts","hooks/useFetchPriceCurrency.ts","components/boxes/PriceBox.tsx","components/modals/BridgeTransferModal.tsx","components/buttons/UnfinishedBridgeTxButton.tsx","components/modals/WalletModal.tsx","providers/ModalBaseline.tsx","providers/RefetcherProvider.tsx","providers/SnackbarWrappedProvider.tsx","theme.ts","App.tsx","app/store.ts","serviceWorker.ts","index.tsx"],"names":["ModalType","useAppDispatch","useDispatch","useAppSelector","useSelector","BridgeDirectionName","BridgeStatus","generateInitState","Object","values","filter","mType","reduce","obj","key","initialState","modalSlice","createSlice","name","reducers","closeModal","openModal","state","action","payload","actions","balance","ethers","constants","Zero","selected","undefined","status","REQURED_AMOUNT","directions","SOURCE","TARGET","updateStatus","statusToUpdate","source","target","currency","value","eq","lt","NOT_ENOUGH_BALANCE","READY","UNSUPPORTED_DIRECTION","bridgeSlice","setBalance","setDirection","bridgeDirection","direction","chainId","setDualDirection","sourceInput","SourceNetwork","targetInput","TargetNetwork","sourceDirection","targetDirection","swapDirection","reset","setValue","selectDirection","DEFAULT_TOKEN_SYMBOL","SYNDICATE_TOKEN_LIST_BASE_URI","BaseCurrency","address","decimals","symbol","logoURI","isToken","isBridged","invariant","Number","isSafeInteger","isInteger","this","tokenAddress","originBridgeAddress","AddressZero","destBridgeAddress","NativeCurrency","isNative","Token","other","toLowerCase","WETH9","Ether","getTokenLogoURI","weth9","OLT","BNB","MATIC","BridgeToken","linkMap","tokenLink","supportedChains","shortName","chain","network","networkId","rpcURL","explorerURL","isTest","nativeCurrency","defaultTargetChainId","bridgeAddress","getChainData","getShortAddress","substring","length","prettyFormat","unitName","formatUnits","toFixed","getContract","abi","provider","Contract","sleep","ms","Promise","resolve","setTimeout","timeout","prom","time","race","_r","rej","createStorage","dbName","db","localForage","createInstance","getItem","setItem","removeItem","Img","styled","display","height","width","ImgIcon","memo","alt","restImgProps","Icon","sx","displayName","TokenButton","disabled","onClick","Button","fullWidth","color","variant","startIcon","src","endIcon","textTransform","ColorizedButton","LoadingButton","theme","palette","mode","borderColor","backgroundColor","marginLeft","BridgeChainButton","dispatch","chainData","handleClick","a","SELECT_BRIDGE_NETWORK","size","fontSize","chainListApiSlice","createApi","reducerPath","baseQuery","fetchBaseQuery","baseUrl","endpoints","builder","chainList","query","useChainListQuery","getContractData","method","params","contract","populateTransaction","unsignedTx","data","CrossChainTransferStatus","LocalTxStatus","useFetchMetamaskAPI","useState","error","setError","isLoading","setLoading","enqueueSnackbar","useSnackbar","ethereum","window","getChain","useCallback","callContract","from","destination","to","transactionParameters","toBigInt","toString","request","txHash","errMsg","message","Sentry","switchNetwork","switchChain","hexChainId","err","code","chainName","rpcUrls","rpc","blockExplorerUrls","explorers","url","iconUrls","addToken","currentChainId","parseInt","slice","type","options","image","isError","AddTokenButton","loading","style","rpcCall","extraOptions","multiCallProvider","providers","MulticallProvider","future","callStatic","result","web3Error","console","log","rpcCallBatch","requests","all","map","web3ApiSlice","fakeBaseQuery","tagTypes","web3Request","queryFn","Array","isArray","results","useWeb3RequestQuery","useLazyWeb3RequestQuery","prepareRequest","IERC20ABI","useFetchBalancePerCurrencies","fetchInfo","pollingInterval","useMemo","info","queryData","response","BigNumber","SafeMaxButton","restProps","bridge","addMax","InputBox","Box","marginTop","spacing","marginBottom","padding","borderRadius","AccountBalance","account","isFetching","useEffect","Typography","noWrap","marginRight","CircularProgress","disableShrink","fontWeight","minWidth","BridgeInput","labelName","wallet","bridgeValue","useWeb3React","currentProvider","library","active","connector","isUnsupportedChainIdError","UnsupportedChainIdError","isAuthorized","Grid","container","item","xs","justifyContent","alignItems","TextField","placeholder","InputProps","disableUnderline","autoComplete","autoCorrect","InputLabelProps","shrink","onChange","event","includes","splitedV","split","parseUnits","SELECT_BRIDGE_TOKEN","ConnectorNames","CrossChainTransferStatusList","current","txs","isBridgeTx","object","prototype","hasOwnProperty","call","stateUpdateCurrent","updatedAt","Math","floor","Date","now","index","findIndex","tx","id","push","transactionSlice","initializeTx","uuidv4","createdAt","store","update","selectCurrent","match","find","clearCurrent","clearAllTxs","updateCurrent","clearTransfer","updateSignedData","signedData","resetDepositTx","deposit","resetWithdrawTx","withdraw","updateDepositData","confirmations","updateWithdrawData","updateLocalTxByHash","getAccountTransactions","transaction","sort","tx1","tx2","getUnfinishedTxCount","DONE","PENDING","getCurrentBridgeTx","getLocalTxByFilter","reduceState","keys","forEach","resTx","resFilter","filterSearch","txMsgPackCompressor","createTransform","encoded","encode","decode","whitelist","persistReducer","version","storage","blacklist","transforms","reducer","useCheckAllowance","skip","storageData","storageQueryData","implementation","allowanceData","allowanceQueryData","allowance","funcSig","utils","keccak256","toUtf8Bytes","isMintable","indexOf","isSkipped","isRequired","isSuccess","useFetchTransactions","txHashes","useWatchTx","onSuccess","onError","receipt","transactionHash","useERC20Approve","addressToApprove","isLocked","setLock","currentTxHash","setTxHash","txFilter","currentState","SUCCESS","FAIL","approve","selectedChainId","MaxUint256","BridgeTransferButton","props","sourceCurrency","targetCurrency","bridgeStatus","isApproved","gte","sourceBridgeAddress","getBridged","isApproveLoading","onApprove","onCrossChainTransfer","targetBridgeAddress","DEPOSIT_INITIATION","BRIDGE_TRANSFER","text","fetchTokens","axios","get","tokens","tokenListApiSlice","urls","responseToken","storedToken","extensions","bridgeInfo","useFetchTokensQuery","matchToken","addressOrSymbol","startsWith","useFetchBridgeCurrencies","bridgeCurrencies","currencies","updateOrCreateToken","bridgeToken","getFromCache","crs","token","sourceToken","targetTokenLink","nativeToken","getNativeCurrency","sourceTokenLink","targetToken","addLink","getCurrency","getLinkCurrency","sourceChainId","targetChainId","link","getDefaultCurrency","settingsSlice","useExperimental","safeMax","isDark","updateBridgeSettings","updateThemeSettings","getBridgeSettings","settings","getThemeSettings","HtmlTooltip","className","Tooltip","classes","popper","tooltipClasses","tooltip","maxWidth","typography","pxToRem","border","SettingsCheckbox","Checkbox","BridgeSettingsButton","bridgeSettings","open","setOpen","handleTooltipClose","ClickAwayListener","onClickAway","PopperProps","disablePortal","onClose","disableFocusListener","disableHoverListener","disableTouchListener","placement","title","p","flexDirection","FormGroup","FormControlLabel","control","checked","label","IconButton","prev","ConnectButton","CONNECT","SmartConnectorWrapperButton","children","otherProps","cloneElement","FormBox","Paper","body2","textAlign","secondary","boxShadow","margin","WarningPaper","baseRoutes","path","component","useTheme","initialized","setInitialized","minHeight","align","main","ThemeButton","themeSettings","disableFocusRipple","NavLinkMui","forwardRef","ref","role","isActive","textDecoration","RouteButton","dprops","my","bprops","rel","href","disableRipple","disableElevation","LogoButton","OneLedgerSvg","Navigation","anchorElNav","setAnchorElNav","unfinishedTxCount","handleCloseNavMenu","openWalletModal","WALLET","flexGrow","AppBar","position","Container","Toolbar","disableGutters","md","currentTarget","Menu","anchorEl","anchorOrigin","vertical","horizontal","keepMounted","transformOrigin","Boolean","route","ButtonGroup","loaded","WRONG_NETWORK_MODAL","forcedExit","walletSlice","setLoaded","authorize","deauthorize","deforceWallet","supportedChainIds","injected","InjectedConnector","sourceNetwork","NetworkConnector","defaultChainId","targetNetwork","refetcher","connectorsByName","Injected","Refetcher","MetaMaskProvider","networkActive","networkError","activateNetwork","activate","isLoaded","modalOpened","modal","isUnsupportedModalOpened","originalFetch","fetch","opts","body","headers","ResponseMsgStatus","getLibrary","Web3Provider","Web3SourceProvider","createWeb3ReactRoot","Web3TargetProvider","Web3RefetcherProvider","Web3BridgeDirectionInjector","directionChainId","deactivate","changeChainId","Web3BridgeNetworkInjector","BridgeProvider","BootstrapDialogTitle","DialogTitle","m","MetaMaskButton","paddingLeft","paddingRight","MetaMaskIcon","NotificationPaper","orange","textDecorationColor","grey","ConnectModal","connection","setConnection","handleClose","Dialog","DialogContent","dividers","List","ListItem","Link","SearchField","SelectTokenButton","InnerBridgeTokenModal","searchValue","setSearchValue","bridgeDirections","hcurs","reverse","reverseDirection","balances","handleSelect","reverseCurrency","Stack","dense","paddingBottom","BridgeTokenModal","BridgeChainSelectModal","reverseSelected","chains","currentDirection","group","nominatedCurrency","Error","derivedCurrency","derivedChainId","groupEnd","buttonEnabled","WrongNetworkModal","handleNetwork","cosignerApiSlice","cosignerSignatures","post","tx_hash","source_chain_id","target_chain_id","OK","msg","useCosignerSignaturesQuery","priceApiSlice","prepareHeaders","set","fetchPrice","validateStatus","Response","transformResponse","useFetchPriceQuery","useFetchPriceCurrency","price","PriceBox","convertedPrice","getPriceForCurrency","getEstMinutesDescription","DepositContent","lock","rState","depositChain","withdrawChain","COSIGNER_APPROVAL","handleDeposit","IBridgeRouterABI","descrText","MiningSvg","loadingIndicator","WithdrawContent","handleWithdraw","signatures","DoneContent","sourceChain","targetChain","MoonManSvg","CosignerContent","WITHDRAW_INITIATION","updateCosignData","ConnectSvg","paddingTop","ProgressBarContent","activeStep","steps","Stepper","alternativeLabel","Step","StepLabel","BridgeTransferModal","depositProvider","withdrawProvider","stateContent","transitionDuration","exit","UnfinishedBridgeTxButton","onlyIcon","notFinishedTx","getUnfinishedBridgeTx","depositCurrency","equals","withdrawCurrency","resumeTx","CopyAddressLink","copied","setCopied","clearTimeout","onCopy","TxLink","BridgeTxBox","statusBlock","resumeBlock","LocalTxBox","textBlock","TransactionContent","preventDefault","WalletModal","gutterBottom","maxHeight","ModalBaseline","InnerProvider","useDeepCompareEffect","timer","loop","i","getTransactionReceipt","RefetcherProvider","useStyles","makeStyles","wrapped","variantSuccess","primary","variantError","variantInfo","variantWarning","warning","SnackbarWrappedProvider","maxSnack","preventDuplicate","hideIconVariant","TransitionComponent","Fade","baseThemeOpts","MuiButton","styleOverrides","root","MuiDialog","paper","MuiPaper","MuiButtonGroup","MuiAppBar","LightThemeOpts","components","DarkThemeOpts","MuiCssBaseline","darkScrollbar","background","App","responsiveFontSizes","createTheme","ThemeProvider","CssBaseline","enableColorScheme","Component","element","middlewares","middleware","rootReducer","combineReducers","configureStore","getDefaultMiddleware","serializableCheck","concat","devTools","process","location","hostname","persistor","persistStore","dsn","integrations","Integrations","BrowserTracing","tracesSampleRate","release","ReactDOM","render","StrictMode","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister","catch"],"mappings":"42FAEYA,E,2ICGCC,EAAiB,kBAAMC,eACvBC,EAAkDC,I,qLDJnDJ,O,qBAAAA,I,mBAAAA,I,qCAAAA,I,6CAAAA,I,iDAAAA,I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static/js/main.453d3647.chunk.js","sourcesContent":["import { createSlice, PayloadAction } from '@reduxjs/toolkit'\n\nexport enum ModalType {\n CONNECT = 1,\n WALLET = 2,\n BRIDGE_TRANSFER = 3,\n SELECT_BRIDGE_TOKEN = 4,\n SELECT_BRIDGE_NETWORK = 5,\n WRONG_NETWORK_MODAL = 6,\n}\n\ntype ModalState = {\n [mType in ModalType]: boolean\n}\n\nconst generateInitState = () => (\n Object.values(ModalType).filter((mType) => typeof mType !== 'string').reduce((obj, key) => {\n obj[key as unknown as ModalType] = false\n return obj\n }, {} as ModalState)\n)\n\nconst initialState = generateInitState()\n\nexport const modalSlice = createSlice({\n name: 'modal',\n initialState,\n reducers: {\n closeModal: () => (\n generateInitState()\n ),\n openModal: (state, action: PayloadAction) => {\n state[action.payload] = true\n },\n },\n})\n\nexport const { openModal, closeModal } = modalSlice.actions\n\nexport default modalSlice.reducer\n","import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'\nimport type { RootState, AppDispatch } from './store'\n\n// Use throughout your app instead of plain `useDispatch` and `useSelector`\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport const useAppDispatch = () => useDispatch()\nexport const useAppSelector: TypedUseSelectorHook = useSelector\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit'\n\nimport { BigNumber, ethers } from 'ethers'\n\nimport { Currency } from '../../entities'\n\nexport enum BridgeDirectionName {\n SOURCE = 'SourceNetwork',\n TARGET = 'TargetNetwork',\n}\n\nexport enum BridgeStatus {\n READY = 1,\n NOT_ENOUGH_BALANCE = 2,\n UNSUPPORTED_DIRECTION = 3,\n REQURED_AMOUNT = 4,\n}\n\nexport interface BridgeAccountInfo {\n chainId?: number\n currency?: Currency\n // for input value\n value?: BigNumber\n}\n\ninterface BridgeState {\n // current balance\n balance: BigNumber\n // for modal selection\n selected?: BridgeDirectionName\n // for transfer enabling\n status: BridgeStatus,\n directions: {\n [BridgeDirectionName.SOURCE]: BridgeAccountInfo,\n [BridgeDirectionName.TARGET]: BridgeAccountInfo,\n }\n}\n\ninterface SetInput {\n direction: BridgeDirectionName\n chainId?: number\n currency?: Currency\n}\n\ninterface DualInput {\n [direction: string]: {\n chainId?: number\n currency?: Currency\n }\n}\n\nconst initialState: BridgeState = {\n balance: ethers.constants.Zero,\n selected: undefined,\n status: BridgeStatus.REQURED_AMOUNT,\n directions: {\n [BridgeDirectionName.SOURCE]: {},\n [BridgeDirectionName.TARGET]: {},\n },\n}\n\n// should be used internal\nconst updateStatus = (state: BridgeState) => {\n const source = state.directions[BridgeDirectionName.SOURCE]\n const target = state.directions[BridgeDirectionName.TARGET]\n\n let statusToUpdate: BridgeStatus | undefined\n\n if (!source.currency || !target.currency) {\n statusToUpdate = BridgeStatus.UNSUPPORTED_DIRECTION\n } else if (!source.value || source.value.eq(ethers.constants.Zero)) {\n statusToUpdate = BridgeStatus.REQURED_AMOUNT\n } else if (state.balance.lt(source.value)) {\n statusToUpdate = BridgeStatus.NOT_ENOUGH_BALANCE\n } else {\n statusToUpdate = BridgeStatus.READY\n }\n\n if (statusToUpdate && statusToUpdate !== state.status) {\n state.status = statusToUpdate\n }\n}\n\nexport const bridgeSlice = createSlice({\n name: 'bridge',\n initialState,\n reducers: {\n setBalance: (state, action: PayloadAction) => {\n if (!state.balance.eq(action.payload)) {\n state.balance = action.payload\n }\n updateStatus(state)\n },\n setDirection: (state, action: PayloadAction) => {\n const bridgeDirection = state.directions[action.payload.direction]\n\n bridgeDirection.chainId = action.payload.chainId\n bridgeDirection.currency = action.payload.currency\n updateStatus(state)\n },\n setDualDirection: (state, action: PayloadAction) => {\n const sourceInput = action.payload.SourceNetwork\n const targetInput = action.payload.TargetNetwork\n\n const sourceDirection = state.directions[BridgeDirectionName.SOURCE]\n const targetDirection = state.directions[BridgeDirectionName.TARGET]\n\n state.directions = {\n [BridgeDirectionName.SOURCE]: {\n ...sourceDirection,\n currency: sourceInput.currency,\n chainId: sourceInput.chainId || sourceDirection.chainId,\n },\n [BridgeDirectionName.TARGET]: {\n ...targetDirection,\n ...targetInput,\n currency: targetInput.currency,\n chainId: targetInput.chainId || targetDirection.chainId,\n },\n }\n updateStatus(state)\n },\n swapDirection: (state) => {\n const sourceDirection = state.directions[BridgeDirectionName.SOURCE]\n const targetDirection = state.directions[BridgeDirectionName.TARGET]\n state.directions = {\n [BridgeDirectionName.SOURCE]: targetDirection,\n [BridgeDirectionName.TARGET]: sourceDirection,\n }\n updateStatus(state)\n },\n reset: () => initialState,\n setValue: (state, action: PayloadAction) => {\n const sourceDirection = state.directions[BridgeDirectionName.SOURCE]\n const targetDirection = state.directions[BridgeDirectionName.TARGET]\n if (\n !action.payload\n || !sourceDirection.value\n || (\n action.payload\n && sourceDirection.value\n && !sourceDirection.value.eq(action.payload)\n )\n ) {\n sourceDirection.value = action.payload\n targetDirection.value = action.payload\n }\n updateStatus(state)\n },\n selectDirection: (state, action: PayloadAction) => {\n state.selected = action.payload\n },\n },\n})\n\nexport const {\n setDirection, swapDirection, reset,\n setValue, selectDirection, setDualDirection,\n setBalance,\n} = bridgeSlice.actions\n\nexport default bridgeSlice.reducer\n","export const DEFAULT_CHAIN_ID = 1\nexport const DEFAULT_TOKEN_SYMBOL = 'OLT'\nexport const SYNDICATE_TOKEN_LIST_BASE_URI = 'https://raw.githubusercontent.com/Oneledger/syndicate-token-list/v0.2.0'\nexport const SYNDICATE_BOWL_BASE_URI = 'https://api-syndicate-bowl.oneledger.network/api/v1'\n","import { ethers } from 'ethers'\nimport invariant from 'tiny-invariant'\nimport { Currency } from './currency'\nimport { Token } from './token'\nimport { TokenLink } from './types'\n\n/**\n * A currency is any fungible financial instrument, including Ether, all ERC20 tokens, and other chain-native currencies\n */\nexport abstract class BaseCurrency {\n /**\n * Returns whether the currency is native to the chain and must be wrapped (e.g. Ether)\n */\n public abstract get isNative(): boolean\n\n /**\n * Returns whether the currency is a token that is usable in Uniswap without wrapping\n */\n public abstract readonly isToken: boolean\n\n /**\n * Returns whether the currency is a bridged and have link\n */\n public abstract readonly isBridged: boolean\n\n /**\n * The chain ID on which this currency resides\n */\n public readonly chainId: number\n\n /**\n * The contract address on the chain on which this token lives\n */\n public readonly address: string\n\n /**\n * The decimals used in representing currency amounts\n */\n public readonly decimals: number\n\n /**\n * The symbol of the currency, i.e. a short textual non-unique identifier\n */\n public readonly symbol: string\n\n /**\n * The name of the currency, i.e. a descriptive textual non-unique identifier\n */\n public readonly name: string\n\n /**\n * The logo of the currency, i.e. a short URI for logo image\n */\n public readonly logoURI?: string\n\n /**\n * Constructs an instance of the base class `BaseCurrency`.\n * @param chainId the chain ID on which this currency resides\n * @param decimals decimals of the currency\n * @param symbol symbol of the currency\n * @param name of the currency\n */\n public constructor(\n chainId: number,\n address: string,\n decimals: number,\n symbol: string,\n name: string,\n logoURI?: string,\n ) {\n invariant(Number.isSafeInteger(chainId), 'CHAIN_ID')\n invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')\n\n this.chainId = chainId\n this.address = address\n this.decimals = decimals\n this.symbol = symbol\n this.name = name\n this.logoURI = logoURI\n }\n\n /**\n * Returns whether this currency is functionally equivalent to the other currency\n * @param other the other currency\n */\n public abstract equals(other: Currency): boolean\n\n /**\n * Return the wrapped version of this currency that can be used with the Uniswap contracts. Currencies must\n * implement this to be used in Uniswap\n */\n public abstract get wrapped(): Token\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n public getBridged(chainId?: number): TokenLink | undefined {\n return {\n tokenAddress: this.address,\n originBridgeAddress: ethers.constants.AddressZero,\n destBridgeAddress: ethers.constants.AddressZero,\n }\n }\n}\n","import { BaseCurrency } from './baseCurrency'\n\n/**\n * Represents the native currency of the chain on which it resides, e.g.\n */\nexport abstract class NativeCurrency extends BaseCurrency {\n public readonly isNative: boolean = true\n\n public readonly isToken: boolean = false\n\n public readonly isBridged: boolean = false\n}\n","import invariant from 'tiny-invariant'\nimport { BaseCurrency } from './baseCurrency'\nimport { Currency } from './currency'\n\n/**\n * Represents an ERC20 token with a unique address and some metadata.\n */\nexport class Token extends BaseCurrency {\n public readonly isNative: boolean = false\n\n public readonly isToken: boolean = true\n\n public readonly isBridged: boolean = false\n\n /**\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\n * @param other other token to compare\n */\n public equals(other: Currency): boolean {\n return other.isToken && this.chainId === other.chainId && this.address === other.address\n }\n\n /**\n * Returns true if the address of this token sorts before the address of the other token\n * @param other other token to compare\n * @throws if the tokens have the same address\n * @throws if the tokens are on different chains\n */\n public sortsBefore(other: Token): boolean {\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\n invariant(this.address !== other.address, 'ADDRESSES')\n return this.address.toLowerCase() < other.address.toLowerCase()\n }\n\n /**\n * Return this token, which does not need to be wrapped\n */\n public get wrapped(): Token {\n return this\n }\n}\n","import { ethers } from 'ethers'\nimport { Token } from './token'\n\n/**\n * Known WETH9 implementation addresses, used in our implementation of Ether#wrapped\n */\nexport const WETH9: { [chainId: number]: Token } = {\n // ethereum and testnets\n 1: new Token(1, '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 18, 'WETH9', 'Wrapped Ether'),\n 3: new Token(3, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH9', 'Wrapped Ether'),\n // oneledger and testnets\n // TODO: Add when will be available\n 311752642: new Token(311752642, ethers.constants.AddressZero, 18, 'WOLT', 'Wrapped OLT'),\n 4216137055: new Token(4216137055, ethers.constants.AddressZero, 18, 'WOLT', 'Wrapped OLT'),\n // binance and testnets\n 56: new Token(56, '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c', 18, 'WBNB', 'Wrapped BNB'),\n 97: new Token(97, '0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd', 18, 'WBNB', 'Wrapped BNB'),\n}\n","import { ethers } from 'ethers'\nimport invariant from 'tiny-invariant'\nimport { getTokenLogoURI } from '../helpers/utilities'\nimport { Currency } from './currency'\nimport { NativeCurrency } from './nativeCurrency'\nimport { Token } from './token'\nimport { WETH9 } from './weth9'\n\n/**\n * Ether is the main usage of a 'native' currency, i.e. for Ethereum mainnet and all testnets\n */\nexport class Ether extends NativeCurrency {\n public constructor(chainId: number) {\n super(chainId, ethers.constants.AddressZero, 18, 'ETH', 'Ether', getTokenLogoURI('ETH'))\n }\n\n public get wrapped(): Token {\n const weth9 = WETH9[this.chainId]\n invariant(!!weth9, 'WRAPPED')\n return weth9\n }\n\n public equals(other: Currency): boolean {\n return other.isNative && other.chainId === this.chainId\n }\n}\n","import { ethers } from 'ethers'\nimport invariant from 'tiny-invariant'\nimport { getTokenLogoURI } from '../helpers/utilities'\nimport { Currency } from './currency'\nimport { NativeCurrency } from './nativeCurrency'\nimport { Token } from './token'\nimport { WETH9 } from './weth9'\n\n/**\n * OLT is the main usage of a 'native' currency, i.e. for OneLedger mainnet and all testnets\n */\nexport class OLT extends NativeCurrency {\n public constructor(chainId: number) {\n super(chainId, ethers.constants.AddressZero, 18, 'OLT', 'OneLedger', getTokenLogoURI('OLT'))\n }\n\n public get wrapped(): Token {\n const weth9 = WETH9[this.chainId]\n invariant(!!weth9, 'WRAPPED')\n return weth9\n }\n\n public equals(other: Currency): boolean {\n return other.isNative && other.chainId === this.chainId\n }\n}\n","import { ethers } from 'ethers'\nimport invariant from 'tiny-invariant'\nimport { getTokenLogoURI } from '../helpers/utilities'\nimport { Currency } from './currency'\nimport { NativeCurrency } from './nativeCurrency'\nimport { Token } from './token'\nimport { WETH9 } from './weth9'\n\n/**\n * BNB is the main usage of a 'native' currency, i.e. for Binance mainnet and all testnets\n */\nexport class BNB extends NativeCurrency {\n public constructor(chainId: number) {\n super(chainId, ethers.constants.AddressZero, 18, 'BNB', 'Binance', getTokenLogoURI('BNB'))\n }\n\n public get wrapped(): Token {\n const weth9 = WETH9[this.chainId]\n invariant(!!weth9, 'WRAPPED')\n return weth9\n }\n\n public equals(other: Currency): boolean {\n return other.isNative && other.chainId === this.chainId\n }\n}\n","import { ethers } from 'ethers'\nimport invariant from 'tiny-invariant'\nimport { getTokenLogoURI } from '../helpers/utilities'\nimport { Currency } from './currency'\nimport { NativeCurrency } from './nativeCurrency'\nimport { Token } from './token'\nimport { WETH9 } from './weth9'\n\n/**\n * MATIC is the main usage of a 'native' currency, i.e. for Polygon mainnet and all testnets\n */\nexport class MATIC extends NativeCurrency {\n public constructor(chainId: number) {\n super(chainId, ethers.constants.AddressZero, 18, 'MATIC', 'Polygon', getTokenLogoURI('MATIC'))\n }\n\n public get wrapped(): Token {\n const weth9 = WETH9[this.chainId]\n invariant(!!weth9, 'WRAPPED')\n return weth9\n }\n\n public equals(other: Currency): boolean {\n return other.isNative && other.chainId === this.chainId\n }\n}\n","import { ethers } from 'ethers'\nimport invariant from 'tiny-invariant'\nimport { BaseCurrency } from './baseCurrency'\nimport { Currency } from './currency'\nimport { Token } from './token'\nimport { TokenLink, TokenLinkMap } from './types'\n\n/**\n * Represents an ERC20 token with a unique address, some metadata and link between bridge token\n */\nexport class BridgeToken extends BaseCurrency {\n public get isNative(): boolean {\n return this.address === ethers.constants.AddressZero\n }\n\n public readonly isToken: boolean = true\n\n public readonly isBridged: boolean = true\n\n /**\n * The list of tokens which could be bridged with current currency\n */\n private linkMap: TokenLinkMap = {}\n\n public addLink(chainId: number, tokenLink: TokenLink): void {\n if (this.linkMap[chainId]) return\n\n this.linkMap[chainId] = tokenLink\n }\n\n public getBridged(chainId?: number): TokenLink | undefined {\n if (!chainId) return undefined\n\n return this.linkMap[chainId]\n }\n\n /**\n * Returns true if the two tokens are equivalent, i.e. have the same chainId and address.\n * @param other other token to compare\n */\n public equals(other: Currency): boolean {\n return other.isToken && this.chainId === other.chainId && this.address.toLowerCase() === other.address.toLowerCase()\n }\n\n /**\n * Returns true if the address of this token sorts before the address of the other token\n * @param other other token to compare\n * @throws if the tokens have the same address\n * @throws if the tokens are on different chains\n */\n public sortsBefore(other: BridgeToken): boolean {\n invariant(this.chainId === other.chainId, 'CHAIN_IDS')\n invariant(this.address !== other.address, 'ADDRESSES')\n return this.address.toLowerCase() < other.address.toLowerCase()\n }\n\n /**\n * Return this token, which does not need to be wrapped\n */\n public get wrapped(): Token {\n return this\n }\n}\n","import {\n Ether, MATIC, BNB, OLT,\n} from '../entities'\nimport { ChainData } from './types'\n\nexport const supportedChains: ChainData[] = [\n // mainnets\n {\n name: 'Ethereum',\n shortName: 'eth',\n chain: 'ETH',\n network: 'ethereum',\n chainId: 1,\n networkId: '1',\n rpcURL: 'https://speedy-nodes-nyc.moralis.io/6be9c674e3a0ba73d6ba649d/eth/mainnet',\n explorerURL: 'https://etherscan.io',\n isTest: false,\n nativeCurrency: new Ether(1),\n defaultTargetChainId: 311752642,\n bridgeAddress: '0x337882C0f263D457704Bd52c5741d43F71F316c0',\n },\n {\n name: 'OneLedger',\n shortName: 'olt',\n chain: 'OLT',\n network: 'oneledger',\n chainId: 311752642,\n networkId: '311752642',\n rpcURL: 'https://mainnet-rpc.oneledger.network',\n explorerURL: 'https://mainnet-explorer.oneledger.network',\n isTest: false,\n nativeCurrency: new OLT(311752642),\n defaultTargetChainId: 1,\n bridgeAddress: '0xE9cB771A919ABe70612af5639E6b9c441688C600',\n },\n {\n name: 'BSC',\n shortName: 'bsc',\n chain: 'BSC',\n network: 'bsc',\n chainId: 56,\n networkId: '56',\n rpcURL: 'https://speedy-nodes-nyc.moralis.io/6be9c674e3a0ba73d6ba649d/bsc/mainnet',\n explorerURL: 'https://bscscan.com',\n isTest: false,\n nativeCurrency: new BNB(56),\n defaultTargetChainId: 311752642,\n bridgeAddress: '0x309bdec69FB76861192bFD56dbEC1212a4D3B191',\n },\n {\n name: 'Polygon',\n shortName: 'matic',\n chain: 'MATIC',\n network: 'matic',\n chainId: 137,\n networkId: '137',\n rpcURL: 'https://speedy-nodes-nyc.moralis.io/6be9c674e3a0ba73d6ba649d/polygon/mainnet',\n explorerURL: 'https://polygonscan.com',\n isTest: false,\n nativeCurrency: new MATIC(137),\n defaultTargetChainId: 311752642,\n bridgeAddress: '0x51Bf2FeAf9F72a546e86Bb8ce44705A55Ca881CA',\n },\n // testnets\n {\n name: 'Ropsten',\n shortName: 'rop',\n chain: 'ETH',\n network: 'ropsten',\n chainId: 3,\n networkId: '3',\n rpcURL: 'https://speedy-nodes-nyc.moralis.io/6be9c674e3a0ba73d6ba649d/eth/ropsten',\n explorerURL: 'https://ropsten.etherscan.io',\n isTest: true,\n nativeCurrency: new Ether(3),\n defaultTargetChainId: 4216137055,\n bridgeAddress: '0x319c42009f309e38501b52F4DBd317B927450883',\n },\n {\n name: 'Frankenstein',\n shortName: 'frank',\n chain: 'OLT',\n network: 'frankenstein',\n chainId: 4216137055,\n networkId: '4216137055',\n rpcURL: 'https://frankenstein-rpc.oneledger.network',\n explorerURL: 'https://frankenstein-explorer.oneledger.network',\n isTest: true,\n nativeCurrency: new OLT(4216137055),\n defaultTargetChainId: 3,\n bridgeAddress: '0x83Bc71C069774356469D1c79b43E346bf160757b',\n },\n {\n name: 'BSC Testnet',\n shortName: 'bsc_testnet',\n chain: 'BSC',\n network: 'bsc_testnet',\n chainId: 97,\n networkId: '97',\n rpcURL: 'https://speedy-nodes-nyc.moralis.io/6be9c674e3a0ba73d6ba649d/bsc/testnet',\n explorerURL: 'https://testnet.bscscan.com',\n isTest: true,\n nativeCurrency: new BNB(97),\n defaultTargetChainId: 4216137055,\n bridgeAddress: '0x3BE0E4a86545F123d8b46eECecCc205BbE57Eb99',\n },\n {\n name: 'Mumbai',\n shortName: 'mumbai',\n chain: 'MATIC',\n network: 'mumbai',\n chainId: 80001,\n networkId: '80001',\n rpcURL: 'https://speedy-nodes-nyc.moralis.io/6be9c674e3a0ba73d6ba649d/polygon/mumbai',\n explorerURL: 'https://mumbai.polygonscan.com',\n isTest: true,\n nativeCurrency: new MATIC(80001),\n defaultTargetChainId: 4216137055,\n bridgeAddress: '0x99d4Ab6632E703137b59a92169850e554cAAdEFF',\n },\n]\n","import { BigNumberish, ethers, ContractInterface } from 'ethers'\nimport { Contract } from '@ethersproject/contracts'\nimport { Provider, Web3Provider } from '@ethersproject/providers'\n\nimport localForage from 'localforage'\n\nimport { formatUnits } from 'ethers/lib/utils'\nimport { SYNDICATE_TOKEN_LIST_BASE_URI } from './constants'\nimport { ChainData } from './types'\nimport { supportedChains } from './chains'\nimport { Currency } from '../entities'\n\nexport function getChainData(chainId?: number): ChainData | undefined {\n const chainData = supportedChains.filter(\n (chain: ChainData) => chain.chainId === chainId,\n )[0]\n\n return chainData\n}\n\nexport function getShortAddress(address: string): string {\n return `${address.substring(0, 6)}...${address.substring(address.length - 4)}`\n}\n\nexport function prettyFormat(value: BigNumberish, unitName?: number): number {\n return +((+formatUnits(value, unitName)).toFixed(4))\n}\n\nexport function getTokenLogoURI(symbol: string): string {\n return `${SYNDICATE_TOKEN_LIST_BASE_URI}/assets/asset_${symbol}.svg`\n}\n\n/**\n * Validates an address and returns the parsed (checksummed) version of that address\n * @param address the unchecksummed hex address\n */\nexport function validateAndParseAddress(address: string): string {\n try {\n return ethers.utils.getAddress(address)\n } catch (error) {\n throw new Error(`${address} is not a valid address.`)\n }\n}\n\nexport const getContract = (\n address: string,\n abi: ContractInterface,\n provider: Provider | Web3Provider,\n): Contract => new Contract(address, abi, provider as Provider)\n\nexport function sleep(ms: number): Promise {\n // eslint-disable-next-line no-promise-executor-return\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\nexport function timeout(prom: Promise, time: number): Promise {\n // eslint-disable-next-line no-promise-executor-return\n return Promise.race([prom, new Promise((_r, rej) => setTimeout(rej, time))])\n}\n\nexport function getPriceForCurrency(currency: Currency, value: BigNumberish, price: number): number {\n const convertedValue = +formatUnits(value, currency.decimals)\n return +((convertedValue * price).toFixed(4))\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function createStorage(dbName: string): any {\n const db = localForage.createInstance({\n name: dbName,\n })\n return {\n db,\n getItem: db.getItem,\n setItem: db.setItem,\n removeItem: db.removeItem,\n }\n}\n","import { memo } from 'react'\n\nimport { styled, SxProps, Theme } from '@mui/material/styles'\nimport { Icon } from '@mui/material'\n\nconst Img = styled('img')(() => ({\n display: 'flex',\n height: 'inherit',\n width: 'inherit',\n}))\n\ninterface ImgIconProps {\n src?: string\n alt?: string\n height?: number | string\n width?: number | string\n sx?: SxProps\n}\n\nconst ImgIcon = memo(({\n width, height, alt = 'icon', ...restImgProps\n}: ImgIconProps): JSX.Element => (\n \n {alt}\n \n))\n\nImgIcon.displayName = 'ImgIcon'\n\nexport default ImgIcon\n","import { Button } from '@mui/material'\nimport KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'\nimport ImgIcon from '../icons/ImgIcon'\nimport { DEFAULT_TOKEN_SYMBOL } from '../../helpers/constants'\nimport { getTokenLogoURI } from '../../helpers/utilities'\n\ninterface TokenButtonProps {\n symbol?: string\n logoURI?: string\n disabled: boolean\n onClick?(): void\n}\n\nconst TokenButton = (\n {\n symbol, logoURI, disabled = false, onClick,\n }: TokenButtonProps,\n): JSX.Element => (\n \n }\n endIcon={}\n disabled={disabled}\n sx={{ textTransform: 'none' }}\n onClick={onClick}\n >\n {symbol ?? DEFAULT_TOKEN_SYMBOL}\n \n)\n\nexport default TokenButton\n","import { styled } from '@mui/material/styles'\nimport LoadingButton from '@mui/lab/LoadingButton'\n\nconst ColorizedButton = styled(LoadingButton)(({ theme }) => ({\n color: (theme.palette.mode === 'light') ? 'primary' : 'white',\n borderColor: (theme.palette.mode === 'light') ? 'primary' : 'white',\n '&:hover': {\n backgroundColor: (theme.palette.mode === 'light') ? 'primary' : '#ffffff14',\n },\n '& > .MuiButton-endIcon': {\n marginLeft: 0,\n },\n}))\n\nexport default ColorizedButton\n","import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'\n\nimport { useAppDispatch } from '../../app/hooks'\nimport { ModalType, openModal } from '../../features/modal/modalSlice'\nimport { getChainData } from '../../helpers/utilities'\nimport { BridgeDirectionName, selectDirection } from '../../features/bridge/bridgeSlice'\nimport ColorizedButton from './ColorizedButton'\n\ninterface BridgeChainProps {\n chainId?: number\n direction: BridgeDirectionName\n}\n\nconst BridgeChainButton = ({ chainId, direction }: BridgeChainProps): JSX.Element => {\n const dispatch = useAppDispatch()\n const chainData = getChainData(chainId)\n\n const handleClick = async () => {\n dispatch(selectDirection(direction))\n dispatch(openModal(ModalType.SELECT_BRIDGE_NETWORK))\n }\n return (\n : }\n onClick={handleClick}\n sx={{ fontSize: '0.875rem' }}\n >\n {chainData?.name ?? 'Select network'}\n \n )\n}\n\nexport default BridgeChainButton\n","import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n\ninterface ChainInfo {\n name: string\n chain: string\n network: string\n icon: string\n rpc: string[]\n faucets: string[]\n nativeCurrency: {\n name: string\n symbol: string\n decimals: string\n }\n infoURL: string\n shortName: string\n chainId: number\n networkId: number\n slip44?: number\n ens?: {\n registry: string\n }\n explorers: Array<{\n name: string\n url: string\n standard: string\n }>\n}\n\nconst chainListApiSlice = createApi({\n reducerPath: 'chainListApi',\n baseQuery: fetchBaseQuery({\n baseUrl: 'https://chainid.network',\n }),\n endpoints: (builder) => ({\n chainList: builder.query({\n query: () => ('/chains.json'),\n }),\n }),\n})\n\nexport const {\n useChainListQuery,\n} = chainListApiSlice\n\nexport default chainListApiSlice\n","import { useCallback, useState } from 'react'\nimport { useSnackbar } from 'notistack'\nimport * as Sentry from '@sentry/react'\n\nimport { ethers, BigNumber } from 'ethers'\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport { Currency } from '../entities'\nimport { CustomExternalProvider } from '../providers/utils'\nimport { sleep } from '../helpers/utilities'\nimport { useChainListQuery } from '../features/api/chainListApiSlice'\n\ninterface ContractPayload {\n address: string\n abi: ethers.ContractInterface\n method: string\n params?: Array\n}\n\ninterface TxPayload {\n from: string\n to?: string\n contract?: ContractPayload\n value?: BigNumber\n}\n\ninterface MetamaskError {\n code: number\n message: string\n}\n\ninterface MetaMaskAPI {\n isLoading: boolean\n isError: boolean\n error?: string\n addToken(currency: Currency): Promise\n switchNetwork(chainId: number): Promise\n callContract(request: TxPayload): Promise\n}\n\nasync function getContractData({\n address, abi, method, params = [],\n}: ContractPayload): Promise {\n const contract = new ethers.Contract(address, abi)\n const unsignedTx = await contract.populateTransaction[method](...params)\n return unsignedTx.data\n}\n\nconst useFetchMetamaskAPI = (provider?: Web3Provider): MetaMaskAPI => {\n const [error, setError] = useState()\n const [isLoading, setLoading] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n\n const { data: chainList = [] } = useChainListQuery()\n\n const ethereum = (provider) ? provider.provider as CustomExternalProvider : window.ethereum\n\n const getChain = useCallback(\n (chainId: number) => chainList.filter((chain) => chain.chainId === chainId)[0],\n [chainList],\n )\n\n const callContract = useCallback(async ({\n from,\n to: destination,\n value,\n contract,\n }: TxPayload): Promise => {\n setError(undefined)\n if (isLoading) return undefined\n\n let to: string | undefined\n let data: string | undefined\n\n try {\n setLoading(true)\n if (contract) {\n data = await getContractData(contract)\n to = contract.address\n } else {\n to = destination\n }\n const transactionParameters = {\n from,\n to,\n data,\n value: (value) ? `0x${value.toBigInt().toString(16)}` : undefined,\n }\n const txHash = await ethereum.request?.({\n method: 'eth_sendTransaction',\n params: [transactionParameters],\n })\n enqueueSnackbar(`Tx \"${txHash}\" has been submited!`, { variant: 'success' })\n return txHash\n } catch (e) {\n const errMsg = (e as Error).message\n enqueueSnackbar(errMsg, { variant: 'warning' })\n setError(errMsg)\n Sentry.captureException(e)\n return undefined\n } finally {\n setLoading(false)\n }\n }, [ethereum, enqueueSnackbar, isLoading])\n\n const switchNetwork = useCallback(async (chainId: number): Promise => {\n setError(undefined)\n if (!ethereum) {\n const errMsg = 'MetaMask has not been installed!'\n enqueueSnackbar(errMsg, { variant: 'warning' })\n setError(errMsg)\n return false\n }\n\n if (isLoading) return false\n\n const switchChain = getChain(chainId)\n if (!switchChain) {\n const errMsg = `Chain \"${chainId}\" not found, abort`\n enqueueSnackbar(errMsg, { variant: 'warning' })\n setError(errMsg)\n return false\n }\n\n const hexChainId = `0x${chainId.toString(16)}`\n try {\n setLoading(true)\n await ethereum.request?.({\n method: 'wallet_switchEthereumChain',\n params: [{ chainId: hexChainId }],\n })\n enqueueSnackbar(`\"${switchChain.name}\" connected`, { variant: 'success' })\n return true\n } catch (switchError) {\n let err = switchError as MetamaskError\n // This error code indicates that the chain has not been added to MetaMask.\n if (err.code === 4902 || err.code === -32603) {\n try {\n await ethereum.request?.({\n method: 'wallet_addEthereumChain',\n params: [{\n chainId: hexChainId,\n chainName: switchChain.name,\n nativeCurrency: {\n name: switchChain.nativeCurrency.name,\n symbol: switchChain.nativeCurrency.symbol,\n decimals: switchChain.nativeCurrency.decimals,\n },\n rpcUrls: [\n switchChain.rpc[0],\n ],\n blockExplorerUrls: [\n switchChain.explorers[0]?.url,\n ],\n iconUrls: [],\n }],\n })\n enqueueSnackbar(`\"${switchChain.name}\" connected`, { variant: 'success' })\n return true\n } catch (addError) {\n Sentry.captureException(addError)\n err = addError as MetamaskError\n }\n } else {\n Sentry.captureException(switchError)\n }\n enqueueSnackbar(err.message, { variant: 'warning' })\n setError(err.message)\n return false\n } finally {\n setLoading(false)\n }\n }, [ethereum, enqueueSnackbar, isLoading, getChain])\n\n const addToken = useCallback(async (currency: Currency): Promise => {\n setError(undefined)\n if (!ethereum) {\n enqueueSnackbar('MetaMask has not been installed!', { variant: 'warning' })\n return\n }\n // eslint-disable-next-line no-underscore-dangle\n let { chainId: currentChainId } = ethereum as unknown as { chainId: number }\n // NOTE: Sometimes it is hex, ugly(\n if (typeof currentChainId === 'string') {\n currentChainId = parseInt((currentChainId as string).slice(2), 16)\n }\n // in case token in another network, we should switch first\n if (currency.chainId !== currentChainId) {\n const success = await switchNetwork(currency.chainId)\n if (!success) {\n return\n }\n // should wait to show popup\n await sleep(1000)\n } else {\n if (isLoading) return\n setLoading(true)\n }\n\n try {\n // NOTE: should return success, but has a bug\n // https://github.com/MetaMask/metamask-extension/issues/12416#issuecomment-965096575\n // so skip the check on success right now\n await ethereum.request?.({\n method: 'wallet_watchAsset',\n params: {\n type: 'ERC20',\n options: {\n address: currency.address,\n symbol: currency.symbol,\n decimals: currency.decimals,\n image: currency.logoURI,\n },\n },\n })\n } catch (e) {\n const errMsg = (e as Error).message\n enqueueSnackbar(errMsg, { variant: 'warning' })\n setError(errMsg)\n Sentry.captureException(e)\n } finally {\n setLoading(false)\n }\n }, [ethereum, switchNetwork, enqueueSnackbar, isLoading])\n\n return {\n isError: !!error,\n isLoading,\n error,\n addToken,\n switchNetwork,\n callContract,\n }\n}\n\nexport default useFetchMetamaskAPI\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit'\nimport { persistReducer, Transform, createTransform } from 'redux-persist'\nimport { v4 as uuidv4 } from 'uuid'\nimport { BigNumber } from 'ethers'\nimport { encode, decode } from '@msgpack/msgpack'\n\nimport { Currency } from '../../entities'\nimport { SignedData } from '../api/cosignerApiSlice'\nimport { RootState } from '../../app/store'\nimport { createStorage } from '../../helpers/utilities'\n\nexport enum CrossChainTransferStatus {\n DEPOSIT_INITIATION = 0,\n COSIGNER_APPROVAL = 1,\n WITHDRAW_INITIATION = 2,\n DONE = 3,\n}\n\nexport enum LocalTxStatus {\n PENDING = -1,\n FAIL = 0,\n SUCCESS = 1,\n}\n\nexport const CrossChainTransferStatusList = Object.values(CrossChainTransferStatus).filter(\n (value) => typeof value !== 'string',\n) as CrossChainTransferStatus[]\n\ninterface BaseLocalTx {\n // local id\n id: string\n // wallet sender\n from: string\n // in case we will have support for destination address, let's use it rightaway\n to: string\n // amount to send\n value: BigNumber\n // time of create\n createdAt: number\n // time of update\n updatedAt: number\n}\n\ninterface DirectionProcessState {\n txHash?: string\n confirmations?: number\n currency: Currency\n bridgeAddress: string\n}\n\nexport interface CrossChainTx extends BaseLocalTx {\n // status of transaction\n status: CrossChainTransferStatus\n // deposit info about chain, currency and rest tx staff\n deposit: DirectionProcessState\n // withdraw info about chain, currency and rest tx staff\n withdraw: DirectionProcessState\n // API data from cosigner service\n signedData?: SignedData\n}\n\nexport interface LocalTx extends BaseLocalTx {\n txHash?: string\n confirmations?: number\n status: LocalTxStatus\n chainId: number\n abi?: unknown\n method: string\n params: Array\n}\n\ninterface InitTxPayload {\n value: BigNumber\n from: string\n to: string\n store?: {\n update: boolean\n }\n}\n\ninterface InitCrossChainTx extends InitTxPayload {\n status: CrossChainTransferStatus\n deposit: DirectionProcessState\n withdraw: DirectionProcessState\n}\n\ninterface InitLocalTx extends InitTxPayload {\n txHash?: string\n chainId: number\n status: LocalTxStatus\n abi?: unknown\n method: string\n params: Array\n}\n\ninterface UpdateData {\n txHash?: string\n confirmations?: number\n status?: CrossChainTransferStatus | LocalTxStatus\n force?: boolean\n}\n\ninterface TransactionState {\n current?: LocalTx | CrossChainTx\n txs: Array\n}\n\nconst initialState: TransactionState = {\n current: undefined,\n txs: [],\n}\n\nexport const isBridgeTx = (object: unknown): object is CrossChainTx => (\n (typeof object !== 'undefined') ? Object.prototype.hasOwnProperty.call(object, 'deposit') : false\n)\n\nconst stateUpdateCurrent = (state: TransactionState) => {\n if (state.current) {\n const current = { ...state.current }\n current.updatedAt = Math.floor(Date.now() / 1000)\n const index = state.txs.findIndex((tx) => tx.id === current.id)\n if (index !== -1) {\n state.txs[index] = current\n } else {\n state.txs.push(current)\n }\n }\n}\n\nconst generateInitTxPayload = () => ({\n id: uuidv4(),\n createdAt: Math.floor(Date.now() / 1000),\n updatedAt: Math.floor(Date.now() / 1000),\n})\n\nexport const transactionSlice = createSlice({\n name: 'transaction',\n initialState,\n reducers: {\n initializeTx: (state, action: PayloadAction) => {\n state.current = {\n ...generateInitTxPayload(),\n ...action.payload,\n }\n if (action.payload.store && action.payload.store.update) {\n stateUpdateCurrent(state)\n }\n },\n selectCurrent: (state, action: PayloadAction) => {\n const match = state.txs.find((tx) => tx.id === action.payload)\n if (\n (match && state.current && match.id !== state.current.id)\n || (match && !state.current)\n ) {\n state.current = match\n }\n },\n clearCurrent: (state) => {\n state.current = undefined\n },\n clearAllTxs: (state) => {\n state.current = undefined\n state.txs = []\n },\n updateCurrent: stateUpdateCurrent,\n clearTransfer: (state, action: PayloadAction) => {\n state.txs = state.txs.filter((tx) => tx.id === action.payload)\n stateUpdateCurrent(state)\n },\n updateStatus: (state, action: PayloadAction) => {\n if (!state.current || !isBridgeTx(state.current)) return\n state.current.status = action.payload\n stateUpdateCurrent(state)\n },\n updateSignedData: (state, action: PayloadAction) => {\n if (!state.current || !isBridgeTx(state.current)) return\n state.current.signedData = action.payload\n stateUpdateCurrent(state)\n },\n resetDepositTx: (state) => {\n if (!state.current || !isBridgeTx(state.current)) return\n state.current.deposit.txHash = undefined\n stateUpdateCurrent(state)\n },\n resetWithdrawTx: (state) => {\n if (!state.current || !isBridgeTx(state.current)) return\n state.current.withdraw.txHash = undefined\n stateUpdateCurrent(state)\n },\n updateDepositData: (state, action: PayloadAction) => {\n if (!state.current || !isBridgeTx(state.current)) return\n if (action.payload.txHash) {\n state.current.deposit.txHash = action.payload.txHash\n }\n if (action.payload.confirmations) {\n state.current.deposit.confirmations = action.payload.confirmations\n }\n if (action.payload.status) {\n state.current.status = action.payload.status as CrossChainTransferStatus\n }\n stateUpdateCurrent(state)\n },\n updateWithdrawData: (state, action: PayloadAction) => {\n if (!state.current || !isBridgeTx(state.current)) return\n if (action.payload.txHash) {\n state.current.withdraw.txHash = action.payload.txHash\n }\n if (action.payload.confirmations) {\n state.current.withdraw.confirmations = action.payload.confirmations\n }\n if (action.payload.status) {\n state.current.status = action.payload.status as CrossChainTransferStatus\n }\n stateUpdateCurrent(state)\n },\n updateLocalTxByHash: (state, action: PayloadAction) => {\n const index = state.txs\n .findIndex((tx) => (\n isBridgeTx(tx)\n ? false\n : tx.txHash === action.payload.txHash\n ))\n console.log('index', index)\n if (index !== -1) {\n const tx = state.txs[index] as LocalTx\n tx.status = action.payload.status as (LocalTxStatus) | LocalTxStatus.PENDING\n tx.confirmations = action.payload.confirmations\n state.txs[index] = tx\n }\n },\n },\n})\n\nexport const getAccountTransactions = (state: RootState): (CrossChainTx | LocalTx)[] => (\n state.transaction.txs\n .slice(0)\n .sort((tx1, tx2) => tx2.createdAt - tx1.createdAt)\n .filter((tx) => tx.from === state.wallet.account)\n)\n\nexport const getUnfinishedTxCount = (state: RootState): number => (\n state.transaction.txs\n .filter((tx) => (\n isBridgeTx(tx)\n ? tx.status !== CrossChainTransferStatus.DONE\n : tx.status === LocalTxStatus.PENDING\n ))\n .length\n)\n\nexport const getUnfinishedBridgeTx = (id: string) => (state: RootState): CrossChainTx | undefined => (\n state.transaction.txs\n .filter((tx) => isBridgeTx(tx) && tx.status !== CrossChainTransferStatus.DONE)\n .find((tx) => tx.id === id) as unknown as (CrossChainTx | undefined)\n)\n\nexport const getCurrentBridgeTx = (state: RootState): CrossChainTx | undefined => (\n isBridgeTx(state.transaction.current) ? state.transaction.current : undefined\n)\n\nexport const getTxByHash = (txHash?: string) => (state: RootState): CrossChainTx | LocalTx | undefined => (\n state.transaction.txs\n .find((tx) => (\n isBridgeTx(tx)\n ? tx.withdraw.txHash === txHash || tx.deposit.txHash === txHash\n : tx.txHash === txHash\n ))\n)\n\ninterface TxFilter {\n from?: string\n to?: string\n status?: LocalTxStatus\n method?: string\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\ntype FilterTx = Object & {\n [key: string]: unknown\n}\n\nconst filterSearch = (tx: LocalTx, filter: TxFilter): boolean => {\n let reduceState: boolean | undefined\n Object.keys(filter).forEach((key) => {\n const resTx = tx as unknown as FilterTx\n const resFilter = filter as unknown as FilterTx\n // eslint-disable-next-line no-prototype-builtins\n if (resFilter.hasOwnProperty(key)) {\n if (typeof reduceState === 'undefined') {\n reduceState = resTx[key] === resFilter[key]\n } else {\n reduceState = reduceState && resTx[key] === resFilter[key]\n }\n }\n })\n return (typeof reduceState === 'undefined') ? false : reduceState\n}\n\nexport const getLocalTxByFilter = (filter: TxFilter) => (state: RootState): LocalTx | undefined => (\n state.transaction.txs.find((tx) => !isBridgeTx(tx) && filterSearch(tx, filter)) as (LocalTx | undefined)\n)\n\nexport const {\n initializeTx,\n selectCurrent,\n updateCurrent,\n clearCurrent,\n clearAllTxs,\n clearTransfer,\n updateStatus,\n resetDepositTx,\n resetWithdrawTx,\n updateDepositData,\n updateWithdrawData,\n updateSignedData,\n updateLocalTxByHash,\n} = transactionSlice.actions\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst txMsgPackCompressor: Transform = createTransform(\n (state) => {\n const encoded = encode(state)\n return Array.from(encoded)\n },\n (state) => {\n if (!Array.isArray(state)) {\n console.error('txMsgPackCompressor: expected outbound state to be an array')\n return state\n }\n try {\n const decoded = decode(state)\n return decoded\n } catch (err) {\n console.error('txMsgPackCompressor: error while decompressing state', err)\n }\n return []\n },\n {\n whitelist: ['txs'],\n },\n)\n\nexport default persistReducer({\n key: transactionSlice.name,\n version: 2,\n storage: createStorage('syndicateDB'),\n blacklist: ['current'],\n transforms: [txMsgPackCompressor],\n}, transactionSlice.reducer)\n","import LoadingButton from '@mui/lab/LoadingButton'\n\nimport { Web3Provider } from '@ethersproject/providers'\nimport { Currency } from '../../entities'\nimport useFetchMetamaskAPI from '../../hooks/useFetchMetamaskAPI'\n\ninterface AddTokenButtonProps {\n provider: Web3Provider\n currency: Currency\n}\n\nconst AddTokenButton = ({ provider, currency }: AddTokenButtonProps): JSX.Element => {\n const { addToken, isLoading } = useFetchMetamaskAPI(provider)\n return (\n addToken(currency)}\n fullWidth\n sx={{ height: 30, fontSize: '0.7rem' }}\n style={{ textTransform: 'none' }}\n >\n Add to wallet\n \n )\n}\n\nexport default AddTokenButton\n","import { createApi, fakeBaseQuery } from '@reduxjs/toolkit/query/react'\n\nimport { ethers } from 'ethers'\nimport { Web3Provider, Provider } from '@ethersproject/providers'\nimport { providers } from '@0xsequence/multicall'\n\nimport { getContract, timeout } from '../../helpers/utilities'\n\ninterface Web3Error {\n code?: string\n message?: string\n}\n\ninterface RpcCall {\n readonly address?: string\n readonly abi?: ethers.ContractInterface\n readonly method: string\n readonly params?: Array\n}\n\ninterface Web3Request {\n readonly provider?: Web3Provider\n readonly request: T\n}\n\ninterface ExtraOptions {\n timeout: number\n}\n\nexport const rpcCall = async (provider: Provider, {\n address, abi, method, params = [],\n}: RpcCall, extraOptions: ExtraOptions): Promise => {\n const multiCallProvider = (provider instanceof providers.MulticallProvider)\n ? provider\n : new providers.MulticallProvider(provider)\n try {\n let future: Promise\n if (address && abi) {\n const contract = getContract(address, abi, multiCallProvider)\n future = contract.callStatic[method]?.(...params)\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n future = (multiCallProvider as { [index: string]: any })[method](...params)\n }\n const result = await timeout(future, extraOptions.timeout)\n return result\n } catch (error) {\n const web3Error = (typeof error !== undefined) ? (error as Web3Error) : undefined\n console.log('web3 rpcCall ERROR -', web3Error)\n return undefined\n }\n}\n\nexport const rpcCallBatch = async (\n provider: Provider,\n requests: Array,\n extraOptions: ExtraOptions,\n): Promise> => {\n const multiCallProvider = new providers.MulticallProvider(provider)\n return Promise.all(\n requests.map((request) => rpcCall(multiCallProvider, request, extraOptions)),\n )\n}\n\nconst web3ApiSlice = createApi({\n reducerPath: 'web3Api',\n baseQuery: fakeBaseQuery(),\n tagTypes: ['Network', 'Method', 'Contract', 'Result'],\n endpoints: (builder) => ({\n web3Request: builder.query>>({\n queryFn: async ({ provider, request }, baseQuery, extraOptions: ExtraOptions) => {\n if (!provider) {\n return { data: undefined }\n }\n if (!Array.isArray(request)) {\n const result = await rpcCall(provider, request, extraOptions)\n return { data: result }\n }\n\n const results = await rpcCallBatch(provider, request, extraOptions)\n return { data: results }\n },\n extraOptions: {\n timeout: 15_000,\n } as ExtraOptions,\n }),\n }),\n})\n\nexport const {\n useWeb3RequestQuery,\n useLazyWeb3RequestQuery,\n} = web3ApiSlice\n\nexport default web3ApiSlice\n","import { useMemo } from 'react'\n\nimport { Web3Provider } from '@ethersproject/providers'\nimport { BigNumber } from 'ethers'\n\nimport {\n useWeb3RequestQuery,\n} from '../features/api/web3ApiSlice'\nimport { Currency } from '../entities'\nimport IERC20ABI from '../abi/IERC20.abi.json'\n\ninterface FetchInfo {\n address: string\n currency: Currency\n}\n\ninterface FetchBalanceProps {\n provider: Web3Provider\n fetchInfo: FetchInfo | Array\n pollingInterval?: number\n}\n\ninterface FetchBalanceAction {\n data?: BigNumber | Array\n isSuccess: boolean\n isError: boolean\n isFetching: boolean\n isLoading: boolean\n}\n\nconst DefaultPollingInterval = 30_000\n\nconst prepareRequest = ({ address, currency }: FetchInfo) => ((currency.isNative) ? {\n method: 'getBalance',\n params: [address, 'latest'],\n} : {\n address: currency.address,\n abi: IERC20ABI,\n method: 'balanceOf',\n params: [address],\n})\n\nconst useFetchBalancePerCurrencies = ({\n provider, fetchInfo, pollingInterval = DefaultPollingInterval,\n}: FetchBalanceProps): FetchBalanceAction => {\n const request = useMemo(() => (Array.isArray(fetchInfo)\n ? fetchInfo.map((info) => prepareRequest(info))\n : prepareRequest(fetchInfo)), [fetchInfo])\n\n const { data, ...queryData } = useWeb3RequestQuery({\n provider,\n request,\n }, {\n pollingInterval,\n })\n\n const response = useMemo(() => {\n if (!data) return undefined\n\n return !Array.isArray(data) ? BigNumber.from(data) : data.map((value) => (\n value && BigNumber.from(value)\n )) as Array\n }, [data])\n\n return {\n data: response,\n ...queryData,\n }\n}\n\nexport default useFetchBalancePerCurrencies\n","import { SxProps, Theme } from '@mui/material/styles'\nimport Button from '@mui/material/Button'\nimport { ethers } from 'ethers'\n\nimport { useAppDispatch, useAppSelector } from '../../app/hooks'\nimport { setValue } from '../../features/bridge/bridgeSlice'\n\ninterface ButtonProps {\n isLoading?: boolean\n sx?: SxProps\n size?: 'small' | 'medium' | 'large'\n variant?: 'text' | 'outlined' | 'contained'\n color?: 'primary' | 'secondary' |\n 'inherit' | 'success' | 'error' | 'info' | 'warning'\n}\n\nconst SafeMaxButton = ({ isLoading, ...restProps }: ButtonProps): JSX.Element => {\n const dispatch = useAppDispatch()\n const value = useAppSelector((state) => state.bridge.balance)\n\n const disabled = isLoading || value.eq(ethers.constants.Zero)\n\n const addMax = async () => {\n if (disabled) return\n dispatch(setValue(value))\n }\n\n return (\n \n Max\n \n )\n}\n\nexport default SafeMaxButton\n","import React, { useEffect } from 'react'\nimport { styled } from '@mui/material/styles'\nimport Box from '@mui/material/Box'\nimport Grid from '@mui/material/Grid'\nimport TextField from '@mui/material/TextField'\nimport { Typography, CircularProgress } from '@mui/material'\n\nimport { formatUnits, parseUnits } from 'ethers/lib/utils'\nimport { useWeb3React, UnsupportedChainIdError } from '@web3-react/core'\nimport {\n Web3Provider,\n} from '@ethersproject/providers'\n\nimport { ethers } from 'ethers'\nimport { useAppDispatch, useAppSelector } from '../../app/hooks'\nimport { ModalType, openModal } from '../../features/modal/modalSlice'\nimport {\n BridgeDirectionName,\n selectDirection,\n setBalance,\n setValue,\n} from '../../features/bridge/bridgeSlice'\nimport { prettyFormat } from '../../helpers/utilities'\nimport TokenButton from '../buttons/TokenButton'\nimport BridgeChainButton from '../buttons/BridgeChainButton'\nimport { DEFAULT_TOKEN_SYMBOL } from '../../helpers/constants'\nimport AddTokenButton from '../buttons/AddTokenButton'\nimport { Currency } from '../../entities'\nimport useFetchBalancePerCurrencies from '../../hooks/useFetchBalancePerCurrencies'\nimport SafeMaxButton from '../buttons/SafeMaxButton'\n\nconst InputBox = styled(Box)(({ theme }) => ({\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n backgroundColor: (theme.palette.mode === 'light') ? '#f5f5f9' : '#393939',\n padding: theme.spacing(2),\n borderRadius: 16,\n}))\n\ninterface BridgeInputProps {\n labelName: string\n direction: BridgeDirectionName\n}\n\ninterface BalanceProps {\n account: string\n direction: BridgeDirectionName\n provider: Web3Provider\n currency: Currency\n}\n\nconst AccountBalance = ({\n account, direction, provider, currency,\n}: BalanceProps): JSX.Element => {\n const dispatch = useAppDispatch()\n\n const {\n data, isLoading, isFetching,\n } = useFetchBalancePerCurrencies({\n provider,\n fetchInfo: {\n address: account,\n currency,\n },\n })\n\n const balance = Array.isArray(data) ? data[0] : data\n\n // set direction balance for transfer purposes in global state\n // NOTE: should only used for source direction right now\n useEffect(() => {\n if (direction !== BridgeDirectionName.SOURCE) return\n dispatch(setBalance((balance) || ethers.constants.Zero))\n }, [dispatch, direction, balance])\n\n return (\n <>\n {(isLoading || isFetching) ? (\n \n \n \n ) : (\n \n {\n balance\n ? prettyFormat(balance, currency.decimals)\n : 0\n }\n \n )}\n \n {currency.symbol}\n \n {direction === BridgeDirectionName.SOURCE && (\n \n )}\n \n )\n}\n\nconst BridgeInput = (\n { labelName, direction }\n : BridgeInputProps,\n): JSX.Element => {\n const dispatch = useAppDispatch()\n const wallet = useAppSelector((state) => state.wallet)\n const bridgeDirection = useAppSelector((state) => state.bridge.directions[direction])\n const bridgeValue = bridgeDirection.value\n ? +formatUnits(bridgeDirection.value, bridgeDirection.currency?.decimals)\n : ''\n\n const { account, library: currentProvider, error } = useWeb3React()\n const {\n library: provider, active, chainId, connector,\n } = useWeb3React(direction)\n const isUnsupportedChainIdError = error instanceof UnsupportedChainIdError\n\n const handleTokenButton = () => {\n dispatch(selectDirection(direction))\n dispatch(openModal(ModalType.SELECT_BRIDGE_TOKEN))\n }\n\n const onInputChange = (event: React.ChangeEvent) => {\n let { value } = event.target\n value = +value >= 0 ? value : ''\n\n if (value.includes('-') || value.length > 32) return\n\n const splitedV = value.split('.')[1]\n if (splitedV && splitedV.length > 18) return\n\n if (!bridgeDirection.currency) return\n\n dispatch(setValue(value ? parseUnits(value, bridgeDirection.currency.decimals) : undefined))\n }\n\n // console.log(`BridgeInput: direction - ${direction}, info`, bridgeDirection)\n const disabled = !wallet.isAuthorized\n || typeof bridgeDirection?.chainId === 'undefined'\n || isUnsupportedChainIdError\n\n return (\n \n \n \n \n \n {labelName}\n \n {wallet.isAuthorized && (\n \n )}\n \n \n {active && chainId && account && provider && connector && bridgeDirection.currency ? (\n \n ) : (\n <>\n \n 0\n \n \n {DEFAULT_TOKEN_SYMBOL}\n \n \n )}\n \n \n \n \n \n \n \n \n \n \n {\n bridgeDirection?.currency\n && !bridgeDirection.currency.isNative\n && currentProvider\n ? (\n \n ) : (\n \n )\n }\n \n \n \n )\n}\n\nexport default BridgeInput\n","import { InjectedConnector } from '@web3-react/injected-connector'\nimport { NetworkConnector } from '@web3-react/network-connector'\n\nimport { supportedChains } from './chains'\nimport { DEFAULT_CHAIN_ID } from './constants'\n\nconst supportedChainIds = supportedChains.map((chain) => chain.chainId)\n\nexport const injected = new InjectedConnector({ supportedChainIds })\n\nexport const sourceNetwork = new NetworkConnector({\n urls: supportedChains.reduce((urls, chain) => {\n urls[chain.chainId] = chain.rpcURL\n return urls\n }, {} as { [chainId: number]: string }),\n defaultChainId: DEFAULT_CHAIN_ID,\n})\n\nexport const targetNetwork = new NetworkConnector({\n urls: supportedChains.reduce((urls, chain) => {\n urls[chain.chainId] = chain.rpcURL\n return urls\n }, {} as { [chainId: number]: string }),\n defaultChainId: supportedChains.filter((chain) => chain.chainId === DEFAULT_CHAIN_ID)[0].defaultTargetChainId,\n})\n\nexport const refetcher = new NetworkConnector({\n urls: supportedChains.reduce((urls, chain) => {\n urls[chain.chainId] = chain.rpcURL\n return urls\n }, {} as { [chainId: number]: string }),\n defaultChainId: DEFAULT_CHAIN_ID,\n})\n\nexport enum ConnectorNames {\n Injected = 'Injected',\n SourceNetwork = 'SourceNetwork',\n TargetNetwork = 'TargetNetwork',\n Refetcher = 'Refetcher'\n}\n\nexport const connectorsByName = {\n [ConnectorNames.Injected]: injected,\n [ConnectorNames.SourceNetwork]: sourceNetwork,\n [ConnectorNames.TargetNetwork]: targetNetwork,\n [ConnectorNames.Refetcher]: refetcher,\n}\n","import { ethers, BigNumber } from 'ethers'\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport { Currency } from '../entities'\nimport { useWeb3RequestQuery } from '../features/api/web3ApiSlice'\nimport { getChainData } from '../helpers/utilities'\n\nimport IERC20ABI from '../abi/IERC20.abi.json'\n\ninterface CheckAllowanceData {\n provider?: Web3Provider\n currency?: Currency\n account?: string\n}\n\ninterface AllowanceAction {\n allowance?: BigNumber\n isSkipped: boolean\n isMintable: boolean\n isRequired: boolean\n isSuccess: boolean\n isError: boolean\n isFetching: boolean\n isLoading: boolean\n}\n\n// TODO: Add DOMAIN_SEPARATOR check to prevent redundant transaction\nconst useCheckAllowance = ({\n provider, currency, account,\n}: CheckAllowanceData): AllowanceAction => {\n const chain = getChainData(currency?.chainId)\n const skip = (\n !currency\n || currency?.isNative\n || !provider\n || !chain\n || (!currency?.isNative && !account)\n )\n\n const { data: storageData, ...storageQueryData } = useWeb3RequestQuery({\n provider,\n request: {\n method: 'getStorageAt',\n params: [currency?.address, '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc', 'latest'],\n },\n }, {\n skip,\n })\n\n const implementation = (storageData) ? (storageData as string).substring(26) : ''\n\n const { data: allowanceData, ...allowanceQueryData } = useWeb3RequestQuery({\n provider,\n request: [\n {\n method: 'getCode',\n params: [implementation],\n },\n {\n address: currency?.address,\n abi: IERC20ABI,\n method: 'allowance',\n params: [account, chain?.bridgeAddress],\n },\n ],\n }, {\n skip: !implementation,\n pollingInterval: 15_000,\n })\n\n const [code, allowance] = (allowanceData)\n ? (allowanceData as [string | undefined, BigNumber | undefined])\n : [undefined, undefined]\n\n const funcSig = ethers.utils.keccak256(ethers.utils.toUtf8Bytes('mint(address,uint256)')).substring(2, 10)\n const isMintable = code ? (code as string).indexOf(funcSig) > 0 : false\n\n return {\n allowance,\n isMintable,\n isSkipped: skip || !implementation,\n isRequired: !currency?.isNative && !isMintable,\n isSuccess: storageQueryData.isSuccess && allowanceQueryData.isSuccess,\n isError: storageQueryData.isError || allowanceQueryData.isError,\n isFetching: storageQueryData.isFetching || allowanceQueryData.isFetching,\n isLoading: storageQueryData.isLoading || allowanceQueryData.isLoading,\n }\n}\n\nexport default useCheckAllowance\n","import { useMemo } from 'react'\n\nimport { Web3Provider, TransactionReceipt } from '@ethersproject/providers'\n\nimport { useWeb3RequestQuery } from '../features/api/web3ApiSlice'\n\ninterface FetchTransactionsProps {\n provider?: Web3Provider\n txHashes: Array\n pollingInterval?: number\n}\n\ninterface FetchTransactionsAction {\n data?: Array\n isSuccess: boolean\n isError: boolean\n isFetching: boolean\n isLoading: boolean\n}\n\nconst DefaultPollingInterval = 15_000\n\nconst prepareRequest = (txHash: string) => ({\n method: 'getTransactionReceipt',\n params: [txHash],\n})\n\nconst useFetchTransactions = ({\n provider,\n txHashes,\n pollingInterval = DefaultPollingInterval,\n}: FetchTransactionsProps): FetchTransactionsAction => {\n const request = useMemo(() => (txHashes.map((txHash) => prepareRequest(txHash))), [txHashes])\n\n const { data, ...queryData } = useWeb3RequestQuery({\n provider,\n request,\n }, {\n pollingInterval,\n skip: !request.length,\n })\n\n const response = useMemo(() => (!data ? [] : data as Array), [data])\n\n return {\n data: response,\n ...queryData,\n }\n}\n\nexport default useFetchTransactions\n","import { useEffect } from 'react'\nimport { useSnackbar } from 'notistack'\nimport { Web3Provider, TransactionReceipt } from '@ethersproject/providers'\n\nimport { useAppDispatch } from '../app/hooks'\nimport useFetchTransactions from './useFetchTransactions'\n\ninterface WatchData {\n provider?: Web3Provider\n txHash?: string\n confirmations?: number\n onSuccess(receipt: TransactionReceipt, confirmations: number): void\n onError(receipt: TransactionReceipt, confirmations: number): void\n}\n\nconst useWatchTx = ({\n provider, txHash, confirmations,\n onSuccess, onError,\n}: WatchData): void => {\n const { enqueueSnackbar } = useSnackbar()\n const dispatch = useAppDispatch()\n const { data } = useFetchTransactions({\n provider,\n txHashes: (txHash && !confirmations) ? [txHash] : [],\n })\n\n const receipt = !data ? null : data[0]\n\n useEffect(() => {\n if (!txHash || !receipt) return\n\n if (!receipt.status || receipt.status === 0) {\n enqueueSnackbar(`Tx \"${receipt.transactionHash}\" failed!`, { variant: 'warning' })\n onError(receipt, 1)\n return\n }\n\n // TODO: Add dynamic checking on confirmations\n onSuccess(receipt, 1)\n }, [txHash, confirmations, dispatch, receipt, enqueueSnackbar, onSuccess, onError])\n}\n\nexport default useWatchTx\n","import { useState, useEffect, useMemo } from 'react'\nimport { ethers } from 'ethers'\n\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport { useAppDispatch, useAppSelector } from '../app/hooks'\nimport useFetchMetamaskAPI from './useFetchMetamaskAPI'\nimport { sleep } from '../helpers/utilities'\nimport IERC20ABI from '../abi/IERC20.abi.json'\nimport useWatchTx from './useWatchTx'\nimport {\n getLocalTxByFilter, initializeTx, isBridgeTx, LocalTxStatus, updateLocalTxByHash,\n} from '../features/wallet/transactionSlice'\n\ninterface ApproveData {\n provider?: Web3Provider\n chainId: number\n account: string\n contract?: string\n addressToApprove?: string\n}\n\ninterface ApproveAction {\n approve(selectedChainId: number): Promise\n isLoading: boolean\n}\n\nconst useERC20Approve = ({\n provider, chainId, account, contract, addressToApprove,\n}: ApproveData): ApproveAction => {\n const dispatch = useAppDispatch()\n const [isLocked, setLock] = useState(false)\n const [currentTxHash, setTxHash] = useState()\n\n const { switchNetwork, callContract } = useFetchMetamaskAPI()\n\n const txFilter = useMemo(() => ({\n from: account,\n to: contract,\n status: LocalTxStatus.PENDING,\n method: 'approve',\n }), [account, contract])\n const currentState = useAppSelector(getLocalTxByFilter(txFilter))\n\n // hook to check for current selected contract, in case of another, reset\n useEffect(() => {\n if (!contract) return\n\n if (!currentState && currentTxHash) {\n setTxHash(undefined)\n }\n if (currentState && currentState.txHash && currentTxHash !== currentState.txHash) {\n setTxHash(currentState.txHash)\n }\n }, [currentState, currentTxHash, account, contract])\n\n useWatchTx({\n provider,\n txHash: isBridgeTx(currentState) ? undefined : currentState?.txHash,\n confirmations: isBridgeTx(currentState) ? undefined : currentState?.confirmations,\n onSuccess: (receipt, confirmations) => {\n dispatch(updateLocalTxByHash({ txHash: receipt.transactionHash, confirmations, status: LocalTxStatus.SUCCESS }))\n setTxHash(undefined)\n },\n onError: (receipt, confirmations) => {\n dispatch(updateLocalTxByHash({ txHash: receipt.transactionHash, confirmations, status: LocalTxStatus.FAIL }))\n setTxHash(undefined)\n },\n })\n\n const approve = async (selectedChainId: number): Promise => {\n if (!contract || !provider) return\n\n setLock(true)\n\n if (chainId !== selectedChainId) {\n const success = await switchNetwork(selectedChainId)\n if (!success) {\n setLock(false)\n return\n }\n await sleep(3000)\n }\n\n const txHash = await callContract({\n from: account,\n contract: {\n address: contract,\n abi: IERC20ABI,\n method: 'approve',\n params: [addressToApprove, ethers.constants.MaxUint256],\n },\n })\n if (txHash) {\n setTxHash(txHash)\n dispatch(initializeTx({\n txHash,\n chainId: selectedChainId,\n from: account,\n to: contract,\n value: ethers.constants.Zero,\n status: LocalTxStatus.PENDING,\n abi: IERC20ABI,\n method: 'approve',\n params: [addressToApprove, ethers.constants.MaxUint256],\n store: {\n update: true,\n },\n }))\n }\n setLock(false)\n }\n\n return {\n approve,\n isLoading: isLocked || currentState?.status === LocalTxStatus.PENDING,\n }\n}\n\nexport default useERC20Approve\n","import { useMemo } from 'react'\nimport * as Sentry from '@sentry/react'\n\nimport { useWeb3React } from '@web3-react/core'\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport { useAppDispatch, useAppSelector } from '../../app/hooks'\nimport { BridgeDirectionName, BridgeStatus } from '../../features/bridge/bridgeSlice'\nimport { CrossChainTransferStatus, initializeTx } from '../../features/wallet/transactionSlice'\nimport { ModalType, openModal } from '../../features/modal/modalSlice'\nimport ColorizedButton from './ColorizedButton'\n\nimport useCheckAllowance from '../../hooks/useCheckAllowance'\nimport useERC20Approve from '../../hooks/useERC20Approve'\n\ninterface ButtonProps {\n size?: 'small' | 'medium' | 'large'\n variant?: 'text' | 'outlined' | 'contained'\n color?: 'primary' | 'secondary' |\n 'inherit' | 'success' | 'error' | 'info' | 'warning'\n}\n\nconst BridgeTransferButton = (props: ButtonProps): JSX.Element => {\n const dispatch = useAppDispatch()\n const chainId = useAppSelector((state) => state.wallet.chainId)\n const account = useAppSelector((state) => state.wallet.account)\n const value = useAppSelector((state) => state.bridge.directions[BridgeDirectionName.SOURCE].value)\n const sourceCurrency = useAppSelector((state) => state.bridge.directions[BridgeDirectionName.SOURCE].currency)\n const targetCurrency = useAppSelector((state) => state.bridge.directions[BridgeDirectionName.TARGET].currency)\n const bridgeStatus = useAppSelector((state) => state.bridge.status)\n\n const { library: provider } = useWeb3React(BridgeDirectionName.SOURCE)\n\n const {\n allowance, isRequired, isSkipped, isLoading,\n } = useCheckAllowance({\n provider,\n currency: sourceCurrency,\n account,\n })\n\n const isApproved = (allowance && value) ? allowance.gte(value) : false\n\n const sourceBridgeAddress = sourceCurrency?.getBridged(targetCurrency?.chainId)?.originBridgeAddress\n const { approve, isLoading: isApproveLoading } = useERC20Approve({\n provider,\n chainId,\n account,\n contract: sourceCurrency?.address,\n addressToApprove: sourceBridgeAddress,\n })\n\n const onApprove = async () => {\n if (\n !sourceCurrency\n || !targetCurrency\n || !value\n ) {\n Sentry.captureMessage('Transfer button triggered, but not value and currency for this')\n return\n }\n\n await approve(sourceCurrency.chainId)\n }\n\n const onCrossChainTransfer = () => {\n if (\n !sourceCurrency\n || !targetCurrency\n || !value\n ) {\n Sentry.captureMessage('Transfer button triggered, but not value and currency for this')\n return\n }\n\n const targetBridgeAddress = targetCurrency.getBridged(sourceCurrency.chainId)?.originBridgeAddress\n if (\n !sourceBridgeAddress\n || !targetBridgeAddress\n ) {\n Sentry.captureMessage('Bridge not found during transfer click')\n return\n }\n\n dispatch(initializeTx({\n value,\n from: account,\n to: account,\n status: CrossChainTransferStatus.DEPOSIT_INITIATION,\n deposit: {\n currency: sourceCurrency,\n bridgeAddress: sourceBridgeAddress,\n },\n withdraw: {\n currency: targetCurrency,\n bridgeAddress: targetBridgeAddress,\n },\n }))\n dispatch(openModal(ModalType.BRIDGE_TRANSFER))\n }\n\n const { disabled, text } = useMemo(() => {\n switch (bridgeStatus) {\n case BridgeStatus.REQURED_AMOUNT:\n return {\n disabled: true,\n text: 'Enter amount',\n }\n case BridgeStatus.NOT_ENOUGH_BALANCE:\n return {\n disabled: true,\n text: 'Not enough balance',\n }\n case BridgeStatus.UNSUPPORTED_DIRECTION:\n return {\n disabled: true,\n text: 'Unsupported direction for bridge',\n }\n case BridgeStatus.READY:\n return {\n disabled: false,\n text: 'Transfer',\n }\n default:\n return {\n disabled: true,\n text: '-',\n }\n }\n }, [bridgeStatus])\n\n if (disabled) {\n return (\n \n {text}\n \n )\n }\n\n if (!isSkipped && isRequired && !isApproved) {\n return (\n \n Approve\n \n )\n }\n\n return (\n \n {text}\n \n )\n}\n\nexport default BridgeTransferButton\n","import axios, { AxiosError } from 'axios'\nimport { createApi, fakeBaseQuery } from '@reduxjs/toolkit/query/react'\nimport { TokenInfo, TokenList } from '@uniswap/token-lists'\n\nconst fetchTokens = async (url: string) => {\n try {\n console.log('Fetch tokens list on:', url)\n const result = await axios.get(url)\n return { data: result.data.tokens }\n } catch (axiosError) {\n const err = axiosError as AxiosError\n return {\n error: { status: err.response?.status, data: err.response?.data },\n }\n }\n}\n\nconst tokenListApiSlice = createApi({\n reducerPath: 'tokenListApi',\n baseQuery: fakeBaseQuery(),\n endpoints: (builder) => ({\n fetchTokens: builder.query({\n queryFn: async (urls) => {\n if (!Array.isArray(urls)) {\n return fetchTokens(urls)\n }\n\n const results = await Promise.all(\n urls.map((url) => fetchTokens(url)),\n )\n return results.reduce((store, result) => {\n if (!result.error) {\n result.data.forEach((responseToken) => {\n const index = store.data.findIndex((storedToken) => (\n storedToken.address.toLowerCase() === responseToken.address.toLowerCase()\n && storedToken.chainId === responseToken.chainId\n ))\n if (index === -1) {\n store.data.push(responseToken)\n } else {\n const bridgeInfo = responseToken.extensions?.bridgeInfo as unknown as {\n [chainId: string]: {\n tokenAddress: string,\n destBridgeAddress: string,\n originBridgeAddress: string\n }\n } | undefined\n if (bridgeInfo) {\n store.data[index] = responseToken\n }\n }\n })\n }\n return store\n }, { data: [] } as { data: TokenInfo[] })\n },\n }),\n }),\n})\n\nexport const {\n useFetchTokensQuery,\n} = tokenListApiSlice\n\nexport default tokenListApiSlice\n","import { useCallback, useMemo } from 'react'\nimport { ethers } from 'ethers'\nimport { TokenLink, BridgeToken, Currency } from '../entities'\nimport { useFetchTokensQuery } from '../features/api/tokenListApiSlice'\nimport { supportedChains } from '../helpers/chains'\nimport { DEFAULT_TOKEN_SYMBOL, SYNDICATE_TOKEN_LIST_BASE_URI } from '../helpers/constants'\n\nconst getNativeCurrency = (chainId: number) => supportedChains.filter(\n (chain) => chainId === chain.chainId,\n).map((chain) => chain.nativeCurrency)[0]\n\nconst matchToken = (currency: Currency, chainId: number, addressOrSymbol: string) => currency.chainId === chainId\n && (\n (addressOrSymbol.startsWith('0x') && addressOrSymbol.length === 42)\n ? currency.address.toLowerCase() === addressOrSymbol.toLowerCase()\n : currency.symbol === addressOrSymbol\n )\n\ninterface BridgeCurrencyAction {\n getDefaultCurrency(\n chainId: number,\n ): Currency | undefined\n\n getCurrency(\n chainId: number,\n addressOrSymbol?: string,\n ): Currency | undefined\n\n getLinkCurrency(\n sourceChainId: number,\n targetChainId: number,\n addressOrSymbol?: string,\n ): Currency | undefined\n\n bridgeCurrencies: Currency[]\n\n isLoading: boolean\n}\n\nconst useFetchBridgeCurrencies = (): BridgeCurrencyAction => {\n const { data: tokens = [], isLoading } = useFetchTokensQuery([\n `${SYNDICATE_TOKEN_LIST_BASE_URI}/syndicate.token-list.json`,\n `${SYNDICATE_TOKEN_LIST_BASE_URI}/syndicate-experimental.token-list.json`,\n ])\n\n const bridgeCurrencies = useMemo((): Currency[] => {\n if (isLoading) return []\n\n const currencies: BridgeToken[] = []\n\n const updateOrCreateToken = (bridgeToken: BridgeToken) => {\n const index = currencies.findIndex((currency) => matchToken(currency, bridgeToken.chainId, bridgeToken.address))\n if (index === -1) {\n currencies.push(bridgeToken)\n }\n }\n\n function getFromCache(chainId: number, address: string): BridgeToken | undefined {\n const crs = currencies.filter((currency) => matchToken(currency, chainId, address))\n if (crs.length) {\n return crs[0]\n }\n return undefined\n }\n\n tokens.forEach((token) => {\n const bridgeInfo = token.extensions?.bridgeInfo as unknown as {\n [chainId: string]: {\n tokenAddress: string,\n destBridgeAddress: string,\n originBridgeAddress: string\n }\n } | undefined\n if (!bridgeInfo) return\n\n const sourceToken = getFromCache(token.chainId, token.address) || new BridgeToken(\n token.chainId,\n token.address,\n token.decimals,\n token.symbol,\n token.name,\n token.logoURI,\n )\n Object.keys(bridgeInfo).forEach((chainId) => {\n const targetTokenLink: TokenLink = bridgeInfo[chainId]\n if (targetTokenLink.tokenAddress === ethers.constants.AddressZero) {\n const nativeToken: Currency | undefined = getNativeCurrency(+chainId)\n if (!nativeToken) {\n console.log(`Native token for chain \"${chainId}\" not found`)\n return\n }\n const sourceTokenLink: TokenLink = {\n tokenAddress: sourceToken.address,\n originBridgeAddress: targetTokenLink.destBridgeAddress,\n destBridgeAddress: targetTokenLink.originBridgeAddress,\n }\n const targetToken = getFromCache(nativeToken.chainId, nativeToken.address) || new BridgeToken(\n nativeToken.chainId,\n nativeToken.address,\n nativeToken.decimals,\n nativeToken.symbol,\n nativeToken.name,\n nativeToken.logoURI,\n )\n targetToken.addLink(sourceToken.chainId, sourceTokenLink)\n updateOrCreateToken(targetToken)\n }\n sourceToken.addLink(+chainId, targetTokenLink)\n })\n updateOrCreateToken(sourceToken)\n })\n return currencies\n }, [tokens, isLoading])\n\n const getCurrency = useCallback((\n chainId: number,\n addressOrSymbol: string = ethers.constants.AddressZero,\n ): Currency | undefined => bridgeCurrencies.filter(\n (token) => matchToken(token, chainId, addressOrSymbol),\n )[0], [bridgeCurrencies])\n\n const getLinkCurrency = useCallback((\n sourceChainId: number,\n targetChainId: number,\n addressOrSymbol: string = ethers.constants.AddressZero,\n ): Currency | undefined => {\n const sourceToken = getCurrency(sourceChainId, addressOrSymbol)\n if (!sourceToken) return undefined\n\n const link = sourceToken?.getBridged(targetChainId)\n if (!link) return undefined\n\n return getCurrency(targetChainId, link.tokenAddress)\n }, [getCurrency])\n\n const getDefaultCurrency = useCallback((\n chainId: number,\n ): Currency | undefined => bridgeCurrencies.filter(\n (currency) => currency.chainId === chainId && (\n currency.symbol === DEFAULT_TOKEN_SYMBOL\n // legacy solt support\n || currency.symbol === `s${DEFAULT_TOKEN_SYMBOL}`\n ),\n )[0], [bridgeCurrencies])\n\n return {\n getDefaultCurrency,\n getCurrency,\n getLinkCurrency,\n bridgeCurrencies,\n isLoading,\n }\n}\n\nexport default useFetchBridgeCurrencies\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit'\nimport { persistReducer } from 'redux-persist'\n\nimport { RootState } from '../../app/store'\nimport { createStorage } from '../../helpers/utilities'\n\ninterface BridgeConfig {\n useExperimental: boolean\n safeMax: boolean\n}\n\ninterface ThemeConfig {\n isDark: boolean\n}\n\ninterface SettingsState {\n bridge: BridgeConfig\n theme: ThemeConfig\n}\n\nconst initialState: SettingsState = {\n bridge: {\n useExperimental: false,\n safeMax: true,\n },\n theme: {\n isDark: true,\n },\n}\n\nexport const settingsSlice = createSlice({\n name: 'settings',\n initialState,\n reducers: {\n updateBridgeSettings: (state, action: PayloadAction) => {\n state.bridge = action.payload\n },\n updateThemeSettings: (state, action: PayloadAction) => {\n state.theme = action.payload\n },\n },\n})\n\nexport const getBridgeSettings = (state: RootState): BridgeConfig => state.settings.bridge\nexport const getThemeSettings = (state: RootState): ThemeConfig => state.settings.theme\n\nexport const {\n updateBridgeSettings,\n updateThemeSettings,\n} = settingsSlice.actions\n\nexport default persistReducer({\n key: settingsSlice.name,\n version: 1,\n storage: createStorage('syndicateDB'),\n}, settingsSlice.reducer)\n","import React, { useState } from 'react'\nimport { styled } from '@mui/material/styles'\nimport IconButton from '@mui/material/IconButton'\nimport Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip'\nimport Typography from '@mui/material/Typography'\nimport ClickAwayListener from '@mui/material/ClickAwayListener'\nimport SettingsIcon from '@mui/icons-material/Settings'\nimport FormGroup from '@mui/material/FormGroup'\nimport FormControlLabel from '@mui/material/FormControlLabel'\nimport Checkbox from '@mui/material/Checkbox'\nimport Box from '@mui/material/Box'\nimport { useAppDispatch, useAppSelector } from '../../app/hooks'\nimport { getBridgeSettings, updateBridgeSettings } from '../../features/settings/settingsSlice'\n\nconst HtmlTooltip = styled(({ className, ...props }: TooltipProps) => (\n \n))(({ theme }) => ({\n [`& .${tooltipClasses.tooltip}`]: {\n backgroundColor: (theme.palette.mode === 'light') ? '#f5f5f9' : '#1b1b1b',\n color: (theme.palette.mode === 'light') ? 'rgba(0, 0, 0, 0.87)' : 'white',\n maxWidth: 500,\n fontSize: theme.typography.pxToRem(12),\n border: `1px solid ${(theme.palette.mode === 'light') ? '#2b2b2b' : '#69f6d1'}`,\n borderRadius: 16,\n },\n}))\n\nconst SettingsCheckbox = styled(Checkbox)(({ theme }) => ({\n color: (theme.palette.mode === 'light') ? '#2b2b2b' : '#69f6d1',\n '&.Mui-checked': {\n color: (theme.palette.mode === 'light') ? '#2b2b2b' : '#69f6d1',\n },\n}))\n\nconst BridgeSettingsButton = (): JSX.Element => {\n const dispatch = useAppDispatch()\n const bridgeSettings = useAppSelector(getBridgeSettings)\n const [open, setOpen] = useState(false)\n\n const handleTooltipClose = () => {\n setOpen(false)\n }\n\n const handleTooltipOpen = () => {\n setOpen((prev) => !prev)\n }\n\n const handleUseExperimental = (event: React.ChangeEvent) => {\n dispatch(updateBridgeSettings({\n ...bridgeSettings,\n useExperimental: event.target.checked,\n }))\n }\n\n const handleSafeMax = (event: React.ChangeEvent) => {\n dispatch(updateBridgeSettings({\n ...bridgeSettings,\n safeMax: event.target.checked,\n }))\n }\n\n return (\n \n
\n \n Bridge Settings\n \n \n )}\n label={Use experimental feature?}\n />\n \n )}\n label={Safe max}\n />\n \n \n )}\n >\n \n \n \n \n
\n
\n )\n}\n\nexport default BridgeSettingsButton\n","import { Button } from '@mui/material'\n\nimport { useAppDispatch } from '../../app/hooks'\nimport { ModalType, openModal } from '../../features/modal/modalSlice'\n\ninterface ButtonProps {\n size?: 'small' | 'medium' | 'large'\n variant?: 'text' | 'outlined' | 'contained'\n color?: 'primary' | 'secondary' |\n 'inherit' | 'success' | 'error' | 'info' | 'warning'\n}\n\nconst ConnectButton = (\n props: ButtonProps,\n): JSX.Element => {\n const dispatch = useAppDispatch()\n const triggerModal = () => dispatch(openModal(ModalType.CONNECT))\n\n return (\n \n Connect wallet\n \n )\n}\n\nexport default ConnectButton\n","import { cloneElement } from 'react'\n\nimport { UnsupportedChainIdError, useWeb3React } from '@web3-react/core'\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport { useAppSelector } from '../../app/hooks'\nimport ConnectButton from './ConnectButton'\nimport ColorizedButton from './ColorizedButton'\n\ninterface DappWrapperProps {\n children: JSX.Element\n size?: 'small' | 'medium' | 'large'\n variant?: 'text' | 'outlined' | 'contained'\n color?: 'primary' | 'secondary' |\n 'inherit' | 'success' | 'error' | 'info' | 'warning'\n}\n\nconst SmartConnectorWrapperButton = ({ children, ...otherProps }: DappWrapperProps): JSX.Element => {\n const wallet = useAppSelector((state) => state.wallet)\n const { error } = useWeb3React()\n const isUnsupportedChainIdError = error instanceof UnsupportedChainIdError\n\n if (isUnsupportedChainIdError) {\n return (\n \n Unsupported network\n \n )\n }\n if (!wallet.isAuthorized) {\n return \n }\n return cloneElement(children, { ...otherProps })\n}\n\nexport default SmartConnectorWrapperButton\n","import { useState, useEffect } from 'react'\n\nimport { useTheme, Button } from '@mui/material'\nimport { styled } from '@mui/material/styles'\nimport Box from '@mui/material/Box'\nimport Paper from '@mui/material/Paper'\nimport Typography from '@mui/material/Typography'\nimport SwapVertIcon from '@mui/icons-material/SwapVert'\nimport Grid from '@mui/material/Grid'\nimport InfoOutlinedIcon from '@mui/icons-material/InfoOutlined'\n\nimport BridgeInput from '../inputs/BridgeInput'\nimport {\n BridgeDirectionName, setDualDirection, swapDirection,\n} from '../../features/bridge/bridgeSlice'\nimport { useAppSelector, useAppDispatch } from '../../app/hooks'\n\nimport BridgeTransferButton from '../buttons/BridgeTransferButton'\nimport useFetchBridgeCurrencies from '../../hooks/useFetchBridgeCurrencies'\nimport { getChainData } from '../../helpers/utilities'\nimport BridgeSettingsButton from '../buttons/BridgeSettingsButton'\nimport SmartConnectorWrapperButton from '../buttons/SmartConnectorWrapperButton'\n\nconst FormBox = styled(Paper)(({ theme }) => ({\n ...theme.typography.body2,\n padding: theme.spacing(4),\n textAlign: 'center',\n color: theme.palette.text.secondary,\n borderRadius: theme.spacing(2),\n boxShadow: '#33333333 0px 4px 21px',\n maxWidth: 500,\n width: 'calc(100vw - 1.8rem)',\n margin: theme.spacing(2),\n}))\n\nconst WarningPaper = styled(Paper)(({ theme }) => ({\n ...theme.typography.body2,\n textAlign: 'center',\n color: '#2e7a8a',\n border: 'solid 1px #2e7a8a',\n borderRadius: theme.spacing(2),\n boxShadow: '#33333333 0px 4px 21px',\n maxWidth: 500,\n width: 'calc(100vw - 1.8rem)',\n margin: theme.spacing(2),\n backgroundColor: '#5ef5cf',\n padding: theme.spacing(2),\n '& p': {\n fontSize: '.75rem',\n },\n}))\n\nconst Bridge = (): JSX.Element => {\n const theme = useTheme()\n const [initialized, setInitialized] = useState(false)\n const dispatch = useAppDispatch()\n const wallet = useAppSelector((state) => state.wallet)\n const {\n getDefaultCurrency, getLinkCurrency, isLoading,\n } = useFetchBridgeCurrencies()\n const chainData = getChainData(wallet.chainId)\n\n useEffect(() => {\n if (\n !chainData\n || !wallet.isAuthorized\n || isLoading\n || initialized\n ) return\n\n const sourceChainId = chainData.chainId\n const sourceCurrency = getDefaultCurrency(sourceChainId)\n\n const targetChainId = chainData.defaultTargetChainId\n const targetCurrency = getLinkCurrency(sourceChainId, targetChainId, sourceCurrency?.address)\n\n dispatch(setDualDirection({\n [BridgeDirectionName.SOURCE]: {\n chainId: sourceChainId,\n currency: sourceCurrency,\n },\n [BridgeDirectionName.TARGET]: {\n chainId: targetChainId,\n currency: targetCurrency,\n },\n }))\n setInitialized(true)\n }, [initialized, wallet, getDefaultCurrency, getLinkCurrency, chainData, isLoading, dispatch])\n\n const onSwapDirection = () => {\n dispatch(swapDirection())\n }\n\n return (\n \n \n \n \n \n \n \n \n Syndicate Bridge is an early stage product,\n we are NOT responsible for any loss during the transfers.\n \n \n PLEASE USE AT YOUR OWN RISK.\n \n \n \n \n \n \n Bridge\n {wallet.isAuthorized ? (\n \n ) : (\n \n Not connected\n \n )}\n \n \n \n }\n >\n Switch\n \n \n \n \n \n \n \n \n \n \n )\n}\n\nexport default Bridge\n","import { Navigate } from 'react-router-dom'\nimport Bridge from './components/pages/Bridge'\n\nconst Home = (): JSX.Element => \n\nconst baseRoutes = [\n {\n name: 'Home',\n disabled: false,\n path: '/',\n component: Home,\n },\n {\n name: 'Swap',\n disabled: true,\n path: '/swap',\n component: null,\n },\n {\n name: 'Pool',\n disabled: true,\n path: '/pool',\n component: null,\n },\n {\n name: 'Farm',\n disabled: true,\n path: '/farm',\n component: null,\n },\n {\n name: 'Bridge',\n disabled: false,\n path: '/bridge',\n component: Bridge,\n },\n {\n name: 'Stake',\n disabled: true,\n path: '/stake',\n component: null,\n },\n {\n name: 'Docs',\n disabled: false,\n path: 'https://docs.oneledger.io',\n component: null,\n },\n]\n\nexport default baseRoutes\n","import Button from '@mui/material/Button'\nimport LightModeIcon from '@mui/icons-material/LightMode'\nimport DarkModeIcon from '@mui/icons-material/DarkMode'\n\nimport { useAppDispatch, useAppSelector } from '../../app/hooks'\nimport { getThemeSettings, updateThemeSettings } from '../../features/settings/settingsSlice'\n\nconst ThemeButton = (): JSX.Element => {\n const dispatch = useAppDispatch()\n const themeSettings = useAppSelector(getThemeSettings)\n\n return (\n dispatch(updateThemeSettings({\n ...themeSettings,\n isDark: !themeSettings.isDark,\n }))}\n >\n {themeSettings.isDark ? (\n \n ) : (\n \n )}\n \n )\n}\n\nexport default ThemeButton\n","import { forwardRef } from 'react'\nimport { NavLink as RouterLink } from 'react-router-dom'\n\nimport { useTheme } from '@mui/material'\nimport Button from '@mui/material/Button'\nimport OpenInNewIcon from '@mui/icons-material/OpenInNew'\n\ninterface RouteButtonProps {\n name: string;\n disabled: boolean;\n path: string;\n onClick?(): void\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst NavLinkMui = forwardRef((props, ref) => {\n const theme = useTheme()\n const { ...otherProps } = props\n return (\n ((isActive) ? {\n color: (theme.palette.mode === 'light') ? 'white' : 'white',\n textDecoration: 'none',\n } : null)}\n />\n )\n})\n\nconst RouteButton = ({\n name, disabled, path, onClick,\n}: RouteButtonProps): JSX.Element | null => {\n if (path === '/' || disabled) return null\n\n const dprops = { sx: { my: 2, display: 'flex', fontWeight: 500 } }\n\n if (path.startsWith('http')) {\n const bprops = { sx: { ...dprops.sx, alignItems: 'flex-start', '& span': { margin: 0 } } }\n return (\n }\n {...bprops}\n >\n {name}\n \n )\n }\n const bprops = (disabled) ? {\n ...dprops,\n disableRipple: true,\n disableFocusRipple: true,\n disableElevation: true,\n } : {\n ...dprops,\n component: NavLinkMui,\n to: path,\n }\n\n return (\n \n {name}\n \n )\n}\n\nexport default RouteButton\n","export default __webpack_public_path__ + \"static/media/oneledger.5296149d.svg\";","import { useState } from 'react'\n\nimport AppBar from '@mui/material/AppBar'\nimport Box from '@mui/material/Box'\nimport Toolbar from '@mui/material/Toolbar'\nimport Button from '@mui/material/Button'\nimport ButtonGroup from '@mui/material/ButtonGroup'\nimport IconButton from '@mui/material/IconButton'\nimport Menu from '@mui/material/Menu'\nimport MenuIcon from '@mui/icons-material/Menu'\nimport Container from '@mui/material/Container'\nimport AltRouteRoundedIcon from '@mui/icons-material/AltRouteRounded'\nimport { useTheme } from '@mui/material'\nimport CircularProgress from '@mui/material/CircularProgress'\n\nimport { useWeb3React, UnsupportedChainIdError } from '@web3-react/core'\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport baseRoutes from '../routes'\nimport ImgIcon from './icons/ImgIcon'\nimport { useAppDispatch, useAppSelector } from '../app/hooks'\nimport ConnectButton from './buttons/ConnectButton'\nimport ThemeButton from './buttons/ThemeButton'\nimport { getChainData, getShortAddress } from '../helpers/utilities'\nimport { ModalType, openModal } from '../features/modal/modalSlice'\nimport { getUnfinishedTxCount } from '../features/wallet/transactionSlice'\nimport RouteButton from './buttons/RouteButton'\n\nimport OneLedgerSvg from '../assets/icons/oneledger.svg'\n\nconst LogoButton = (): JSX.Element => {\n const theme = useTheme()\n return (\n \n \n \n )\n}\n\nconst Navigation = (): JSX.Element => {\n const dispatch = useAppDispatch()\n const wallet = useAppSelector((state) => state.wallet)\n const [anchorElNav, setAnchorElNav] = useState(null)\n const { error } = useWeb3React()\n const isUnsupportedChainIdError = error instanceof UnsupportedChainIdError\n\n const unfinishedTxCount = useAppSelector(getUnfinishedTxCount)\n\n const handleOpenNavMenu = (event: React.MouseEvent) => (\n setAnchorElNav(event.currentTarget)\n )\n const handleCloseNavMenu = () => setAnchorElNav(null)\n\n const chainData = getChainData(wallet.chainId)\n\n const openUnsupportedModal = () => dispatch(openModal(ModalType.WRONG_NETWORK_MODAL))\n const openWalletModal = () => dispatch(openModal(ModalType.WALLET))\n\n return (\n \n \n \n \n \n \n \n \n \n {baseRoutes.map((route): JSX.Element | null => (\n \n ))}\n \n \n \n \n {baseRoutes.map((route): JSX.Element | null => (\n \n ))}\n \n button': { textTransform: 'none' } }}\n >\n {wallet.loaded && isUnsupportedChainIdError && (\n }\n color=\"error\"\n onClick={openUnsupportedModal}\n >\n Wrong network\n \n )}\n {\n wallet.loaded && wallet.isAuthorized && !isUnsupportedChainIdError && (\n <>\n \n {unfinishedTxCount ? (\n \n ) : (\n \n )}\n \n )\n }\n {wallet.loaded && !wallet.isAuthorized && !isUnsupportedChainIdError && (\n \n )}\n \n \n \n \n \n \n )\n}\n\nexport default Navigation\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit'\nimport { ethers } from 'ethers'\n\ninterface WalletState {\n chainId: number\n account: string\n loaded: boolean\n isAuthorized: boolean\n // when user manually deauthorize, metamask does not now anything\n // so some simulation should be added\n forcedExit: boolean\n}\n\ninterface AuthorizeData {\n chainId: number\n account: string\n}\n\nconst initialState: WalletState = {\n chainId: 1,\n account: ethers.constants.AddressZero,\n loaded: false,\n isAuthorized: false,\n forcedExit: false,\n}\n\nexport const walletSlice = createSlice({\n name: 'wallet',\n initialState,\n reducers: {\n setLoaded: (state, action: PayloadAction) => {\n state.loaded = action.payload\n },\n authorize: (state, action: PayloadAction) => {\n state.loaded = true\n state.isAuthorized = true\n state.chainId = action.payload.chainId\n state.account = action.payload.account\n },\n deauthorize: (state, action: PayloadAction) => {\n state.loaded = true\n state.isAuthorized = false\n if (typeof action.payload !== 'undefined') {\n state.forcedExit = action.payload\n }\n },\n deforceWallet: (state) => {\n state.forcedExit = false\n },\n },\n})\n\nexport const {\n setLoaded, authorize, deauthorize, deforceWallet,\n} = walletSlice.actions\n\nexport default walletSlice.reducer\n","import { ReactNode, useEffect } from 'react'\nimport CircularProgress from '@mui/material/CircularProgress'\nimport Container from '@mui/material/Container'\nimport Box from '@mui/material/Box'\n\nimport { useWeb3React, UnsupportedChainIdError } from '@web3-react/core'\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport { useAppSelector, useAppDispatch } from '../app/hooks'\nimport { setLoaded, authorize, deauthorize } from '../features/wallet/walletSlice'\nimport { injected } from '../helpers/connectors'\nimport { closeModal, ModalType, openModal } from '../features/modal/modalSlice'\n\nconst MetaMaskProvider = ({ children }: { children: ReactNode }): JSX.Element => {\n const {\n active: networkActive, account, chainId, error: networkError, activate: activateNetwork,\n } = useWeb3React()\n const isUnsupportedChainIdError = networkError instanceof UnsupportedChainIdError\n\n const { loaded: isLoaded, forcedExit } = useAppSelector((state) => state.wallet)\n const dispatch = useAppDispatch()\n\n const modalOpened = useAppSelector(\n (state) => Object.keys(state.modal).filter((key) => state.modal[key as unknown as ModalType] === true).length > 0,\n )\n const isUnsupportedModalOpened = useAppSelector(\n (state) => state.modal[ModalType.WRONG_NETWORK_MODAL],\n )\n\n useEffect(() => {\n if (isUnsupportedChainIdError && modalOpened) {\n dispatch(closeModal())\n dispatch(openModal(ModalType.WRONG_NETWORK_MODAL))\n } else if (!isUnsupportedChainIdError && isUnsupportedModalOpened) {\n dispatch(closeModal())\n }\n }, [modalOpened, dispatch, isUnsupportedChainIdError, isUnsupportedModalOpened])\n\n useEffect(() => {\n (async () => {\n if (forcedExit) return\n\n let isAuthorized = false\n try {\n isAuthorized = await injected.isAuthorized()\n } catch (e) {\n console.log('error in authorization', e)\n dispatch(setLoaded(true))\n return\n }\n\n console.log(\n 'Got MetaMask authorized',\n isAuthorized,\n 'account',\n account,\n 'chainId',\n chainId,\n 'networkActive',\n networkActive,\n 'networkError',\n networkError,\n )\n\n if (!isAuthorized) {\n dispatch(deauthorize())\n return\n }\n\n if (isAuthorized && !networkActive && !networkError) {\n try {\n await activateNetwork(injected)\n } catch (e) {\n console.log('error in activation', e)\n dispatch(deauthorize())\n }\n }\n\n if (isAuthorized && account && chainId) {\n dispatch(authorize({ account, chainId }))\n } else {\n dispatch(setLoaded(true))\n }\n })()\n }, [dispatch, account, chainId, activateNetwork, networkActive, networkError, forcedExit])\n if (isLoaded) {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}\n }\n return (\n \n \n \n \n \n )\n}\n\nexport default MetaMaskProvider\n","import { createWeb3ReactRoot } from '@web3-react/core'\nimport {\n ExternalProvider,\n JsonRpcFetchFunc,\n Web3Provider,\n} from '@ethersproject/providers'\nimport { ConnectorNames } from '../helpers/connectors'\n\n// monkey patch during this issue\n// comments from dev: no comments...\n// https://github.com/NoahZinsmeister/web3-react/issues/173\nconst originalFetch = window.fetch\nwindow.fetch = (url, opts): Promise => {\n if (opts?.body && opts.body.toString().includes('jsonrpc')) {\n opts.headers = opts.headers || {\n 'Content-Type': 'application/json',\n }\n }\n return originalFetch(url, opts)\n}\n\nexport interface CustomExternalProvider extends ExternalProvider {\n // extend request method to accept also array\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n request?: (request: { method: string, params?: Array | any }) => Promise\n}\n\ndeclare global {\n interface Window {\n ethereum: CustomExternalProvider;\n }\n}\n\nexport const getLibrary = (\n provider: CustomExternalProvider | JsonRpcFetchFunc,\n): Web3Provider => new Web3Provider(provider)\n\nexport const Web3SourceProvider = createWeb3ReactRoot(ConnectorNames.SourceNetwork)\nexport const Web3TargetProvider = createWeb3ReactRoot(ConnectorNames.TargetNetwork)\nexport const Web3RefetcherProvider = createWeb3ReactRoot(ConnectorNames.Refetcher)\n","import axios, { AxiosError } from 'axios'\nimport { createApi, fakeBaseQuery } from '@reduxjs/toolkit/query/react'\n\nimport { SYNDICATE_BOWL_BASE_URI } from '../../helpers/constants'\n\nenum ResponseMsgStatus {\n OK = 'OK',\n NOTOK = 'NOTOK',\n}\n\ninterface CosignerRequest {\n txHash: string\n sourceChainId: number\n targetChainId: number\n}\n\nexport interface SignedData {\n data: string\n signatures: Array\n}\n\ninterface CosignerResponse {\n status: ResponseMsgStatus\n msg?: string\n results?: Array\n}\n\nconst cosignerApiSlice = createApi({\n reducerPath: 'cosignerApi',\n baseQuery: fakeBaseQuery(),\n endpoints: (builder) => ({\n cosignerSignatures: builder.query({\n queryFn: async (request) => {\n try {\n const result = await axios.post(`${SYNDICATE_BOWL_BASE_URI}/cosign`, {\n tx_hash: request.txHash,\n source_chain_id: request.sourceChainId,\n target_chain_id: request.targetChainId,\n })\n if (result.data.status === ResponseMsgStatus.OK) {\n return { data: result.data.results }\n }\n return {\n error: { data: result.data.msg },\n }\n } catch (axiosError) {\n const err = axiosError as AxiosError\n return {\n error: { status: err.response?.status, data: err.response?.data },\n }\n }\n },\n }),\n }),\n})\n\nexport const {\n useCosignerSignaturesQuery,\n} = cosignerApiSlice\n\nexport default cosignerApiSlice\n","import { ReactNode, useEffect } from 'react'\n\nimport { useWeb3React, Web3ReactProvider } from '@web3-react/core'\nimport {\n Web3Provider,\n} from '@ethersproject/providers'\n\nimport {\n getLibrary, Web3SourceProvider, Web3TargetProvider,\n} from './utils'\nimport { BridgeDirectionName } from '../features/bridge/bridgeSlice'\nimport { useAppSelector } from '../app/hooks'\nimport { connectorsByName } from '../helpers/connectors'\n\ninterface Web3BridgeDirectionInjectorProps {\n direction: BridgeDirectionName\n children?: ReactNode\n}\n\nconst Web3BridgeDirectionInjector = ({ direction, children }: Web3BridgeDirectionInjectorProps): JSX.Element => {\n const directionChainId = useAppSelector((state) => state.bridge.directions[direction].chainId)\n\n const network = connectorsByName[direction]\n\n const {\n chainId, connector, active, activate, deactivate,\n } = useWeb3React(direction)\n\n useEffect(() => {\n if (chainId && directionChainId && chainId !== directionChainId) {\n console.log(`${direction} network swapped, changing \"${chainId}\" -> \"${directionChainId}\"...`)\n deactivate()\n }\n }, [directionChainId, chainId, connector, deactivate, direction])\n\n useEffect(() => {\n if (!directionChainId || (active && chainId)) return\n\n (async () => {\n console.log(`Activating ${direction} network...`)\n network.changeChainId(directionChainId)\n await activate(network, undefined, true)\n })()\n }, [directionChainId, active, activate, direction, chainId, network])\n\n return (\n // eslint-disable-next-line react/jsx-no-useless-fragment\n <>\n {children}\n \n )\n}\n\ninterface Web3BridgeNetworkInjectorProps {\n children?: ReactNode\n}\n\nconst Web3BridgeNetworkInjector = ({ children }: Web3BridgeNetworkInjectorProps): JSX.Element => (\n \n \n {children}\n \n \n)\n\ninterface ProviderProps {\n children?: ReactNode\n}\n\nconst BridgeProvider = ({ children }: ProviderProps): JSX.Element => (\n \n \n \n \n {children}\n \n \n \n \n)\n\nexport default BridgeProvider\n","import DialogTitle from '@mui/material/DialogTitle'\nimport IconButton from '@mui/material/IconButton'\nimport CloseIcon from '@mui/icons-material/Close'\n\nexport interface DialogTitleProps {\n id: string;\n children?: React.ReactNode;\n onClose?: () => void;\n}\n\nconst BootstrapDialogTitle = (props: DialogTitleProps): JSX.Element => {\n const { children, onClose, ...other } = props\n\n return (\n \n {children}\n {onClose ? (\n \n \n \n ) : null}\n \n )\n}\n\nexport default BootstrapDialogTitle\n","export default __webpack_public_path__ + \"static/media/MetaMaskIcon.02e3ec27.png\";","import Button from '@mui/material/Button'\nimport Typography from '@mui/material/Typography'\n\nimport MetaMaskIcon from '../../assets/icons/wallets/MetaMaskIcon.png'\n\ninterface ButtonProps {\n onClick?(): void\n}\n\nconst MetaMaskButton = ({ onClick }: ButtonProps): JSX.Element => (\n \n MetaMask\n \"MetaMask\"\n \n)\n\nexport default MetaMaskButton\n","import { useState, useEffect, useCallback } from 'react'\nimport LoadingButton from '@mui/lab/LoadingButton'\nimport { styled } from '@mui/material/styles'\nimport Dialog from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport Typography from '@mui/material/Typography'\nimport List from '@mui/material/List'\nimport ListItem from '@mui/material/ListItem'\nimport Paper from '@mui/material/Paper'\nimport Link from '@mui/material/Link'\nimport { orange, grey } from '@mui/material/colors'\n\nimport { useWeb3React } from '@web3-react/core'\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport { useAppDispatch, useAppSelector } from '../../app/hooks'\nimport { closeModal, ModalType } from '../../features/modal/modalSlice'\n\nimport { ConnectorNames, connectorsByName } from '../../helpers/connectors'\nimport { deforceWallet } from '../../features/wallet/walletSlice'\nimport BootstrapDialogTitle from './BootstrapDialogTitle'\nimport MetaMaskButton from '../buttons/MetaMaskButton'\n\nconst NotificationPaper = styled(Paper)(({ theme }) => ({\n backgroundColor: (theme.palette.mode === 'light') ? orange[700] : orange[700],\n border: `solid 1px ${orange[800]}`,\n padding: theme.spacing(2),\n color: orange[100],\n '& a': {\n color: orange[100],\n textDecorationColor: orange[100],\n },\n '& a:hover': {\n color: grey[800],\n textDecorationColor: grey[800],\n },\n}))\n\nconst ConnectModal = (): JSX.Element => {\n const dispatch = useAppDispatch()\n const open = useAppSelector((state) => state.modal[ModalType.CONNECT])\n\n const [connection, setConnection] = useState<{\n loading: boolean,\n connector: ConnectorNames | null,\n }>({\n loading: false,\n connector: null,\n })\n const { account, error, activate } = useWeb3React()\n\n const handleClose = useCallback(() => dispatch(closeModal()), [dispatch])\n\n useEffect(() => {\n if (error && connection.loading) {\n setConnection({\n ...connection,\n loading: false,\n })\n }\n }, [connection, error, setConnection])\n\n useEffect(() => {\n if (account && connection.loading) {\n setConnection({\n connector: null,\n loading: false,\n })\n handleClose()\n }\n }, [connection, account, setConnection, handleClose])\n\n const onConnect = (type: ConnectorNames) => async () => {\n setConnection({\n loading: true,\n connector: type,\n })\n dispatch(deforceWallet())\n await activate(connectorsByName[type])\n }\n\n return (\n \n \n Connect a wallet\n \n \n \n \n \n \n By connecting a wallet, you agree to OneLedger Technology Inc’\n {' '}\n \n Terms of Service\n \n \n \n \n {connection.loading ? (\n \n \n Initializing...\n \n \n ) : (\n // here will go other connections\n \n \n \n )}\n \n \n \n )\n}\n\nexport default ConnectModal\n","import React, { useState, useCallback, useMemo } from 'react'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\nimport { styled } from '@mui/material/styles'\nimport Dialog from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport List from '@mui/material/List'\nimport ListItem from '@mui/material/ListItem'\nimport Button from '@mui/material/Button'\nimport Box from '@mui/material/Box'\nimport Typography from '@mui/material/Typography'\nimport CircularProgress from '@mui/material/CircularProgress'\n\nimport { useWeb3React } from '@web3-react/core'\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport { useAppDispatch, useAppSelector } from '../../app/hooks'\nimport { closeModal, ModalType } from '../../features/modal/modalSlice'\n\nimport BootstrapDialogTitle from './BootstrapDialogTitle'\nimport ImgIcon from '../icons/ImgIcon'\nimport {\n BridgeDirectionName, selectDirection, setDualDirection,\n} from '../../features/bridge/bridgeSlice'\nimport useFetchBridgeCurrencies from '../../hooks/useFetchBridgeCurrencies'\nimport { Currency } from '../../entities'\nimport useFetchBalancePerCurrencies from '../../hooks/useFetchBalancePerCurrencies'\nimport { prettyFormat } from '../../helpers/utilities'\n\nconst SearchField = styled(TextField)(({ theme }) => ({\n padding: theme.spacing(2),\n '& fieldset': {\n borderRadius: 16,\n },\n}))\n\nconst SelectTokenButton = styled(Button)(({ theme }) => ({\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n}))\n\ninterface BridgeTokenModalProps {\n provider: Web3Provider\n account: string\n direction: BridgeDirectionName\n}\n\nconst InnerBridgeTokenModal = ({\n provider,\n account,\n direction,\n}: BridgeTokenModalProps): JSX.Element => {\n const [searchValue, setSearchValue] = useState('')\n\n const dispatch = useAppDispatch()\n const open = useAppSelector((state) => state.modal[ModalType.SELECT_BRIDGE_TOKEN])\n const bridgeDirections = useAppSelector((state) => state.bridge.directions)\n\n const { bridgeCurrencies, getLinkCurrency } = useFetchBridgeCurrencies()\n\n const bridgeDirection = bridgeDirections[direction]\n\n const currencies = useMemo(() => {\n const hcurs = bridgeCurrencies.filter((currency) => currency.chainId === bridgeDirection.chainId) || []\n return (searchValue)\n ? hcurs.filter((currency) => currency.name.toLowerCase().includes(searchValue.toLowerCase())\n || currency.symbol.toLowerCase().includes(searchValue.toLowerCase())\n || currency.address.toLowerCase() === searchValue.toLowerCase())\n : hcurs\n }, [bridgeCurrencies, bridgeDirection.chainId, searchValue])\n\n const reverse = (direction === BridgeDirectionName.SOURCE)\n ? BridgeDirectionName.TARGET\n : BridgeDirectionName.SOURCE\n\n const reverseDirection = useAppSelector(\n (state) => state.bridge.directions[reverse],\n )\n\n const handleClose = useCallback(() => {\n setSearchValue('')\n dispatch(selectDirection())\n dispatch(closeModal())\n }, [dispatch, setSearchValue])\n\n const { data, isLoading, isFetching } = useFetchBalancePerCurrencies({\n provider,\n fetchInfo: currencies.map((currency) => ({ address: account, currency })),\n pollingInterval: 60_000,\n })\n\n const balances = Array.isArray(data) ? data : [data]\n\n const onSearch = (event: React.ChangeEvent) => {\n setSearchValue(event.target.value)\n }\n\n const handleSelect = (currency: Currency) => () => {\n if (!reverseDirection.chainId) return\n const reverseCurrency = getLinkCurrency(currency.chainId, reverseDirection.chainId, currency.address)\n dispatch(setDualDirection({\n [direction]: {\n currency,\n },\n [reverse]: {\n currency: reverseCurrency,\n },\n }))\n handleClose()\n }\n\n return (\n \n \n Select a token\n \n \n \n \n \n {!currencies.length ? (\n \n \n No result found\n \n \n ) : (\n <>\n {currencies.map((currency, index): JSX.Element => {\n const balance = balances[index]\n return (\n \n \n \n \n {currency.symbol}\n \n \n )}\n >\n {(isLoading || isFetching) ? (\n \n ) : (\n // eslint-disable-next-line react/jsx-no-useless-fragment\n <>\n {balance ? prettyFormat(balance, currency.decimals) : 0}\n \n )}\n \n \n )\n })}\n \n )}\n \n \n \n \n )\n}\n\nconst BridgeTokenModal = (): JSX.Element | null => {\n const direction = useAppSelector((state) => state.bridge.selected)\n\n const { account } = useWeb3React()\n const { library: provider, active, chainId } = useWeb3React(direction)\n const open = useAppSelector((state) => state.modal[ModalType.SELECT_BRIDGE_TOKEN])\n\n if (active && chainId && direction && provider && account && open) {\n return \n }\n return null\n}\n\nexport default BridgeTokenModal\n","import React, { useCallback, useMemo } from 'react'\nimport Stack from '@mui/material/Stack'\nimport Dialog from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport List from '@mui/material/List'\nimport ListItem from '@mui/material/ListItem'\nimport Button from '@mui/material/Button'\n\nimport { useAppDispatch, useAppSelector } from '../../app/hooks'\nimport { closeModal, ModalType } from '../../features/modal/modalSlice'\n\nimport BootstrapDialogTitle from './BootstrapDialogTitle'\nimport ImgIcon from '../icons/ImgIcon'\nimport {\n BridgeDirectionName,\n selectDirection,\n setDualDirection,\n swapDirection,\n} from '../../features/bridge/bridgeSlice'\nimport { supportedChains } from '../../helpers/chains'\nimport { ChainData } from '../../helpers/types'\nimport useFetchBridgeCurrencies from '../../hooks/useFetchBridgeCurrencies'\nimport { getBridgeSettings } from '../../features/settings/settingsSlice'\n\nconst BridgeChainSelectModal = (): JSX.Element | null => {\n const dispatch = useAppDispatch()\n const open = useAppSelector((state) => state.modal[ModalType.SELECT_BRIDGE_NETWORK])\n const selected = useAppSelector((state) => state.bridge.selected)\n const bridgeSettings = useAppSelector(getBridgeSettings)\n const directions = useAppSelector((state) => state.bridge.directions)\n const reverseSelected = selected === BridgeDirectionName.SOURCE\n ? BridgeDirectionName.TARGET\n : BridgeDirectionName.SOURCE\n const reverseDirection = useAppSelector((state) => state.bridge.directions[reverseSelected])\n const {\n getCurrency, getLinkCurrency, getDefaultCurrency, isLoading,\n } = useFetchBridgeCurrencies()\n\n const handleClose = useCallback(() => {\n dispatch(selectDirection())\n dispatch(closeModal())\n }, [dispatch])\n\n const chains = useMemo(\n () => (!isLoading ? supportedChains.filter((chain) => (bridgeSettings.useExperimental || !chain.isTest)) : []),\n [bridgeSettings.useExperimental, isLoading],\n )\n\n if (!selected) return null\n\n const currentDirection = directions[selected]\n if (\n typeof currentDirection.currency === 'undefined'\n || typeof reverseDirection.currency === 'undefined'\n ) return null\n\n const handleSelect = (chain: ChainData) => () => {\n if (chain.chainId === reverseDirection.chainId) {\n dispatch(swapDirection())\n } else if (reverseDirection.chainId && chain.chainId !== currentDirection.chainId) {\n console.group('Switching chain currencies')\n // Take the same currency symbol from new chain\n let nominatedCurrency = getCurrency(chain.chainId, currentDirection.currency?.symbol)\n // if not found, then take a default for this chain\n if (!nominatedCurrency) {\n nominatedCurrency = getDefaultCurrency(chain.chainId)\n // NOTE: Should not occur, but in case, send error to sentry\n if (!nominatedCurrency) {\n throw new Error(`Currency for chain \"${chain.chainId}\" not set`)\n }\n console.log('Nominated selected as native')\n } else {\n console.log('Nominated token found')\n }\n // as we know current direction currency, let's find it is bridge equivalent\n let derivedCurrency = getLinkCurrency(\n chain.chainId,\n reverseDirection.chainId,\n currentDirection.currency?.symbol,\n )\n\n let derivedChainId = reverseDirection.chainId\n // if it is occured then let's fallback to another chain where it exists\n // to prevent errors\n // TODO: Maybe show wrong bridge direction to prevent confusion?\n // TODO: Maybe add snackbar msg that bridge does not have an equivalent?\n if (!derivedCurrency) {\n console.log('Derived chain not found')\n if (!nominatedCurrency.isNative) {\n // force set dfault currncy on nominator\n nominatedCurrency = getDefaultCurrency(chain.chainId)\n // NOTE: Should not occur, but in case, send error to sentry\n if (!nominatedCurrency) {\n throw new Error(`Currency for chain \"${chain.chainId}\" not set`)\n }\n console.log('Taking default currency for derived')\n } else {\n console.log('Keep the same nominated currency')\n }\n\n derivedChainId = chain.defaultTargetChainId\n derivedCurrency = getDefaultCurrency(derivedChainId)\n // Impossible, only if error in chain config\n if (!derivedCurrency) {\n throw new Error(`Currency for chain \"${derivedChainId}\" not set`)\n }\n } else {\n console.log('Derived chain found')\n }\n dispatch(setDualDirection({\n [selected]: {\n chainId: chain.chainId,\n currency: nominatedCurrency,\n },\n [reverseSelected]: {\n chainId: derivedChainId,\n currency: derivedCurrency,\n },\n }))\n console.groupEnd()\n }\n handleClose()\n }\n\n const buttonEnabled = (chain: ChainData) => {\n // matching chains always disabled as current selected for source\n if (selected === BridgeDirectionName.SOURCE && currentDirection.chainId === chain.chainId) {\n return false\n }\n // special for target - it should disable direction where no token on it\n if (selected === BridgeDirectionName.TARGET && !reverseDirection.currency?.getBridged(chain.chainId)) {\n return false\n }\n return true\n }\n\n return (\n \n \n {`Select ${selected === BridgeDirectionName.SOURCE ? 'source' : 'target'} network`}\n \n \n \n \n {chains.map((chain) => (\n \n ({\n justifyContent: 'space-between',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n textTransform: 'none',\n })}\n size=\"medium\"\n disabled={!buttonEnabled(chain)}\n onClick={handleSelect(chain)}\n endIcon={(\n \n )}\n >\n {chain.name}\n \n \n ))}\n \n \n \n \n )\n}\n\nexport default BridgeChainSelectModal\n","import { useCallback, useMemo } from 'react'\nimport LoadingButton from '@mui/lab/LoadingButton'\nimport Dialog from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport Typography from '@mui/material/Typography'\nimport List from '@mui/material/List'\nimport ListItem from '@mui/material/ListItem'\nimport Button from '@mui/material/Button'\n\nimport { useWeb3React } from '@web3-react/core'\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport { Stack } from '@mui/material'\nimport { useAppDispatch, useAppSelector } from '../../app/hooks'\nimport { closeModal, ModalType } from '../../features/modal/modalSlice'\n\nimport BootstrapDialogTitle from './BootstrapDialogTitle'\nimport { supportedChains } from '../../helpers/chains'\nimport ImgIcon from '../icons/ImgIcon'\nimport useFetchMetamaskAPI from '../../hooks/useFetchMetamaskAPI'\nimport { ChainData } from '../../helpers/types'\nimport { getBridgeSettings } from '../../features/settings/settingsSlice'\n\nconst WrongNetworkModal = (): JSX.Element => {\n const dispatch = useAppDispatch()\n const open = useAppSelector((state) => state.modal[ModalType.WRONG_NETWORK_MODAL])\n const bridgeSettings = useAppSelector(getBridgeSettings)\n\n const { library: provider } = useWeb3React()\n const { switchNetwork, isLoading } = useFetchMetamaskAPI(provider)\n\n const handleClose = useCallback(() => dispatch(closeModal()), [dispatch])\n\n const handleNetwork = (chain: ChainData) => () => {\n switchNetwork(chain.chainId)\n }\n\n const chains = useMemo(\n () => (!isLoading ? supportedChains.filter((chain) => (bridgeSettings.useExperimental || !chain.isTest)) : []),\n [bridgeSettings.useExperimental, isLoading],\n )\n\n return (\n \n \n Wrong network\n \n \n \n \n Please connect to the appropriate EVM network.\n \n \n {isLoading && (\n \n \n Network\n \n \n )}\n {chains.map((chain) => (\n \n \n )}\n >\n {chain.name}\n \n \n ))}\n \n \n \n \n )\n}\n\nexport default WrongNetworkModal\n","export default __webpack_public_path__ + \"static/media/mining.be7cfab8.svg\";","export default __webpack_public_path__ + \"static/media/moon-man.db6446af.svg\";","export default __webpack_public_path__ + \"static/media/connect.a132e882.svg\";","import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n\nconst API_KEY = '2cedecc4209201cfb6493f8c84c4adf725354954e144c9ca0d67b4ccbc594e6b'\n\nconst priceApiSlice = createApi({\n reducerPath: 'priceApi',\n baseQuery: fetchBaseQuery({\n baseUrl: 'https://min-api.cryptocompare.com',\n prepareHeaders: (headers) => {\n headers.set('Authorization', `Apikey ${API_KEY}`)\n return headers\n },\n }),\n endpoints: (builder) => ({\n fetchPrice: builder.query({\n query: (symbol) => ({\n url: `/data/price?fsym=${symbol}&tsyms=USD`,\n validateStatus: (response, result) => response.status === 200 && result?.Response !== 'Error',\n }),\n transformResponse: (response) => {\n const data = <{ [symbol: string]: number }>response\n return data[Object.keys(data)[0]]\n },\n }),\n }),\n})\n\nexport const {\n useFetchPriceQuery,\n} = priceApiSlice\n\nexport default priceApiSlice\n","import { Currency } from '../entities'\nimport { useFetchPriceQuery } from '../features/api/priceApiSlice'\nimport { DEFAULT_TOKEN_SYMBOL } from '../helpers/constants'\n\ninterface PriceCurrencyAction {\n price: number\n isLoading: boolean\n isError: boolean\n isFetching: boolean\n}\n\nconst useFetchPriceCurrency = (currency: Currency): PriceCurrencyAction => {\n const symbol = (currency.symbol === `s${DEFAULT_TOKEN_SYMBOL}`) ? DEFAULT_TOKEN_SYMBOL : currency.symbol\n const {\n data, isError, isLoading, isFetching,\n } = useFetchPriceQuery(symbol)\n\n return {\n price: data || 0,\n isError,\n isLoading,\n isFetching,\n }\n}\n\nexport default useFetchPriceCurrency\n","import { useMemo } from 'react'\n\nimport Typography from '@mui/material/Typography'\nimport CircularProgress from '@mui/material/CircularProgress'\n\nimport { BigNumber } from 'ethers'\n\nimport { Currency } from '../../entities'\nimport { getPriceForCurrency } from '../../helpers/utilities'\nimport useFetchPriceCurrency from '../../hooks/useFetchPriceCurrency'\n\ninterface PriceBoxProps {\n value: BigNumber\n currency: Currency\n}\n\nconst PriceBox = ({ value, currency }: PriceBoxProps): JSX.Element => {\n const { price, isLoading, isFetching } = useFetchPriceCurrency(currency)\n\n const convertedPrice = useMemo(\n () => ((!price) ? 0 : getPriceForCurrency(currency, value, price)),\n [currency, value, price],\n )\n\n return (\n
\n {(isLoading || isFetching) ? (\n \n \n \n ) : (\n {convertedPrice}\n )}\n
\n )\n}\n\nexport default PriceBox\n","import React, {\n useCallback, useMemo, useEffect, useState,\n} from 'react'\nimport LoadingButton from '@mui/lab/LoadingButton'\nimport Dialog from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport Typography from '@mui/material/Typography'\nimport Button from '@mui/material/Button'\nimport Stepper from '@mui/material/Stepper'\nimport Step from '@mui/material/Step'\nimport StepLabel from '@mui/material/StepLabel'\nimport Grid from '@mui/material/Grid'\nimport Box from '@mui/material/Box'\nimport CircularProgress from '@mui/material/CircularProgress'\n\nimport { useWeb3React } from '@web3-react/core'\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport { useAppDispatch, useAppSelector } from '../../app/hooks'\nimport { closeModal, ModalType } from '../../features/modal/modalSlice'\n\nimport BootstrapDialogTitle from './BootstrapDialogTitle'\nimport ImgIcon from '../icons/ImgIcon'\nimport useFetchMetamaskAPI from '../../hooks/useFetchMetamaskAPI'\nimport { BridgeDirectionName } from '../../features/bridge/bridgeSlice'\nimport IBridgeRouterABI from '../../abi/IBridgeRouter.abi.json'\nimport {\n clearCurrent,\n CrossChainTransferStatus,\n CrossChainTransferStatusList,\n CrossChainTx,\n getCurrentBridgeTx,\n resetDepositTx,\n resetWithdrawTx,\n updateDepositData,\n updateSignedData,\n updateStatus,\n updateWithdrawData,\n} from '../../features/wallet/transactionSlice'\nimport {\n getChainData, prettyFormat, sleep,\n} from '../../helpers/utilities'\nimport { ChainData } from '../../helpers/types'\n\nimport MiningSvg from '../../assets/icons/mining.svg'\nimport MoonManSvg from '../../assets/icons/moon-man.svg'\nimport ConnectSvg from '../../assets/icons/connect.svg'\nimport { useCosignerSignaturesQuery } from '../../features/api/cosignerApiSlice'\nimport PriceBox from '../boxes/PriceBox'\nimport useWatchTx from '../../hooks/useWatchTx'\n\ninterface ContentProps {\n state: CrossChainTx\n}\n\ninterface ContentWithProviderProps extends ContentProps {\n provider: Web3Provider\n lock: boolean\n setLock: React.Dispatch>\n}\n\nconst getEstMinutesDescription = (chain?: ChainData) => {\n switch (chain?.chainId) {\n case 311752642:\n case 4216137055:\n return '~15-20 seconds'\n default:\n return '~2-3 minutes'\n }\n}\n\nconst DepositContent = ({\n state, provider, lock, setLock,\n}: ContentWithProviderProps): JSX.Element => {\n const dispatch = useAppDispatch()\n const { callContract, switchNetwork } = useFetchMetamaskAPI()\n const chainId = useAppSelector((rState) => rState.wallet.chainId)\n const depositChain = getChainData(state.deposit.currency.chainId)\n const withdrawChain = getChainData(state.withdraw.currency.chainId)\n\n // deposit monitor\n useWatchTx({\n provider,\n txHash: state.deposit.txHash,\n confirmations: state.deposit.confirmations,\n onSuccess: (receipt, confirmations) => (\n dispatch(updateDepositData({\n confirmations,\n status: CrossChainTransferStatus.COSIGNER_APPROVAL,\n }))\n ),\n onError: () => (\n dispatch(resetDepositTx())\n ),\n })\n\n const handleDeposit = async () => {\n if (state.deposit.txHash || lock) return\n\n setLock(true)\n\n let txHash: string | undefined\n\n // TODO: Add account switch if tx from is not a current account\n if (chainId !== state.deposit.currency.chainId) {\n const success = await switchNetwork(state.deposit.currency.chainId)\n if (!success) {\n setLock(false)\n return\n }\n // MetaMask switch delay\n // TODO: Fix this\n await sleep(3000)\n }\n\n if (state.deposit.currency.isNative) {\n txHash = await callContract({\n from: state.from,\n value: state.value,\n contract: {\n address: state.deposit.bridgeAddress,\n abi: IBridgeRouterABI,\n method: 'enterETH',\n params: [state.withdraw.currency.chainId],\n },\n })\n } else {\n txHash = await callContract({\n from: state.from,\n contract: {\n address: state.deposit.bridgeAddress,\n abi: IBridgeRouterABI,\n method: 'enter',\n params: [state.deposit.currency.address, state.value, state.withdraw.currency.chainId],\n },\n })\n }\n if (txHash) {\n dispatch(updateDepositData({\n txHash,\n }))\n }\n setLock(false)\n }\n\n const descrText = 'Deposit your token to the bridge in order to get '\n + `${state.deposit.currency.isNative ? 'bridged' : 'native'} token on ${withdrawChain?.name} later`\n\n return (\n \n \n Initiate the deposit\n \n \n {lock ? (\n \n Initializing deposit transaction...\n \n ) : (\n \n {descrText}\n \n )}\n \n \n \n \n \n \n Amount\n \n {prettyFormat(state.value, state.deposit.currency.decimals)}\n {' '}\n {state.deposit.currency.symbol}\n \n \n \n USD Value\n \n \n \n \n {state.deposit.txHash ? (\n \n \n \n {`Awaiting confirmation from ${depositChain?.name}...`}\n \n \n ) : (\n }\n onClick={handleDeposit}\n >\n Deposit\n \n )}\n \n \n )\n}\n\nconst WithdrawContent = ({\n state, provider, lock, setLock,\n}: ContentWithProviderProps): JSX.Element => {\n const dispatch = useAppDispatch()\n const { callContract, switchNetwork } = useFetchMetamaskAPI()\n const chainId = useAppSelector((rState) => rState.wallet.chainId)\n const chain = getChainData(state.withdraw.currency.chainId)\n\n // withdraw monitor\n useWatchTx({\n provider,\n txHash: state.withdraw.txHash,\n confirmations: state.withdraw.confirmations,\n onSuccess: (receipt, confirmations) => (\n dispatch(updateDepositData({\n confirmations,\n status: CrossChainTransferStatus.DONE,\n }))\n ),\n onError: () => (\n dispatch(resetWithdrawTx())\n ),\n })\n\n const handleWithdraw = async () => {\n if (state.withdraw.txHash || lock || !state.signedData) return\n\n setLock(true)\n\n // TODO: Add account switch if tx from is not a current account\n if (chainId !== state.withdraw.currency.chainId) {\n const success = await switchNetwork(state.withdraw.currency.chainId)\n if (!success) {\n setLock(false)\n return\n }\n // MetaMask switch delay\n // TODO: Fix this\n await sleep(3000)\n }\n\n const txHash = await callContract({\n from: state.to,\n contract: {\n address: state.withdraw.bridgeAddress,\n abi: IBridgeRouterABI,\n method: 'exit',\n params: [state.signedData.data, state.signedData.signatures],\n },\n })\n if (txHash) {\n dispatch(updateWithdrawData({\n txHash,\n }))\n }\n setLock(false)\n }\n\n const descrText = 'Withdraw your '\n + `${state.withdraw.currency.isNative ? 'native' : 'bridge'} token directly into wallet on ${chain?.name}`\n\n return (\n \n \n Initiate the withdraw\n \n \n {lock ? (\n \n Initializing withdraw transaction...\n \n ) : (\n \n {descrText}\n \n )}\n \n \n \n \n \n \n Amount\n \n {prettyFormat(state.value, state.withdraw.currency.decimals)}\n {' '}\n {state.withdraw.currency.symbol}\n \n \n \n USD Value\n \n \n \n \n {state.withdraw.txHash ? (\n \n \n \n {`Awaiting confirmation from ${chain?.name}...`}\n \n \n ) : (\n }\n onClick={handleWithdraw}\n >\n Withdraw\n \n )}\n \n \n )\n}\n\nconst DoneContent = ({ state }: ContentProps): JSX.Element => {\n const dispatch = useAppDispatch()\n const handleClose = useCallback(() => {\n dispatch(clearCurrent())\n dispatch(closeModal())\n }, [dispatch])\n\n const sourceChain = getChainData(state.deposit.currency.chainId)\n const targetChain = getChainData(state.withdraw.currency.chainId)\n\n return (\n \n \n Cross-chain transfer completed\n \n \n \n {`Cross-chain transfer for ${prettyFormat(state.value, state.withdraw.currency.decimals)} `\n + `${state.withdraw.currency.symbol} from ${sourceChain?.name} to ${targetChain?.name} has been completed!`}\n \n \n \n \n \n \n \n Exit\n \n \n \n )\n}\n\nconst CosignerContent = ({ state }: ContentProps): JSX.Element => {\n const dispatch = useAppDispatch()\n\n const { data: results = [] } = useCosignerSignaturesQuery({\n txHash: state.deposit.txHash || '',\n sourceChainId: state.deposit.currency.chainId,\n targetChainId: state.withdraw.currency.chainId,\n }, {\n pollingInterval: 15_000,\n })\n\n const chain = getChainData(state.deposit.currency.chainId)\n\n // NOTE: Always taking first as UI tx not used for complex smart contract exec\n // so we ar sure that it is one\n const signedData = results[0]\n\n useEffect(() => {\n async function updateCosignData() {\n if (!signedData || state.signedData) return\n\n dispatch(updateSignedData(signedData))\n\n // TODO: bad, replace to anothr approach\n await sleep(2000)\n\n dispatch(updateStatus(CrossChainTransferStatus.WITHDRAW_INITIATION))\n }\n updateCosignData()\n }, [dispatch, signedData, state.signedData])\n\n return (\n \n \n Syndicate cosigners verification\n \n \n \n Сosiners protect the cross-chain transaction from fraud and\n are necessary for the successful confirmation of the deposit.\n This process could take\n {' '}\n {getEstMinutesDescription(chain)}\n {' '}\n before it considered final.\n \n \n \n \n \n \n {state.signedData ? (\n \n Signatures found\n \n ) : (\n \n Awaiting for signatures\n \n )}\n \n \n \n \n NOTE: this process required some minutes to get checkpoints, so it is safe to exit and resume later\n \n \n \n )\n}\n\nconst ProgressBarContent = (): JSX.Element => {\n const currentState = useAppSelector(getCurrentBridgeTx)\n\n const activeStep = currentState?.status || CrossChainTransferStatus.DEPOSIT_INITIATION\n\n const steps = useMemo(() => {\n if (!currentState) return []\n\n const sourceChain = getChainData(currentState.deposit.currency.chainId)\n const targetChain = getChainData(currentState.withdraw.currency.chainId)\n\n // should never occur, if happened, check currencies if they are correctly set\n if (!sourceChain || !targetChain) throw new Error('Chain names not found')\n\n return CrossChainTransferStatusList.map((status) => {\n switch (status) {\n case CrossChainTransferStatus.DEPOSIT_INITIATION:\n return `Initiate deposit on ${sourceChain.name}`\n case CrossChainTransferStatus.COSIGNER_APPROVAL:\n return 'Cosigners approval'\n case CrossChainTransferStatus.WITHDRAW_INITIATION:\n return `Initiate withdraw on ${targetChain.name}`\n case CrossChainTransferStatus.DONE:\n return 'Final'\n default:\n return 'Default'\n }\n })\n }, [currentState])\n\n return (\n \n {steps.map((label) => (\n \n {label}\n \n ))}\n \n )\n}\n\nconst BridgeTransferModal = (): JSX.Element => {\n const [lock, setLock] = useState(false)\n const dispatch = useAppDispatch()\n const open = useAppSelector((state) => state.modal[ModalType.BRIDGE_TRANSFER])\n const currentState = useAppSelector(getCurrentBridgeTx)\n\n // const { callContract } = useFetchMetamaskAPI()\n const { library: depositProvider } = useWeb3React(BridgeDirectionName.SOURCE)\n const { library: withdrawProvider } = useWeb3React(BridgeDirectionName.TARGET)\n\n const handleClose = useCallback(() => {\n if (lock) return\n dispatch(closeModal())\n dispatch(clearCurrent())\n }, [dispatch, lock])\n\n const stateContent = useMemo((): JSX.Element | null => {\n if (\n !currentState\n || !depositProvider\n || !withdrawProvider\n ) return null\n\n switch (currentState.status) {\n case CrossChainTransferStatus.DEPOSIT_INITIATION:\n return \n case CrossChainTransferStatus.COSIGNER_APPROVAL:\n return \n case CrossChainTransferStatus.WITHDRAW_INITIATION:\n return \n case CrossChainTransferStatus.DONE:\n return \n default:\n return null\n }\n }, [currentState, depositProvider, withdrawProvider, lock])\n\n return (\n \n \n \n \n \n {stateContent}\n \n \n )\n}\n\nexport default BridgeTransferModal\n","import { memo } from 'react'\nimport * as Sentry from '@sentry/react'\n\nimport Button from '@mui/material/Button'\nimport { useTheme } from '@mui/material'\nimport { SxProps, Theme } from '@mui/material/styles'\nimport PriorityHighIcon from '@mui/icons-material/PriorityHigh'\n\nimport { useAppDispatch, useAppSelector } from '../../app/hooks'\nimport { closeModal, ModalType, openModal } from '../../features/modal/modalSlice'\nimport { BridgeDirectionName, setDualDirection } from '../../features/bridge/bridgeSlice'\nimport { getUnfinishedBridgeTx, selectCurrent } from '../../features/wallet/transactionSlice'\nimport useFetchBridgeCurrencies from '../../hooks/useFetchBridgeCurrencies'\n\ninterface UnfinishedBridgeTxButtonProps {\n id: string\n onlyIcon?: boolean\n sx?: SxProps\n}\n\nconst UnfinishedBridgeTxButton = memo((\n { id, onlyIcon = true, sx }: UnfinishedBridgeTxButtonProps,\n): JSX.Element | null => {\n const theme = useTheme()\n const dispatch = useAppDispatch()\n const notFinishedTx = useAppSelector(getUnfinishedBridgeTx(id))\n const { bridgeCurrencies } = useFetchBridgeCurrencies()\n if (!notFinishedTx || !bridgeCurrencies) {\n return null\n }\n\n const depositCurrency = bridgeCurrencies.find((currency) => currency.equals(notFinishedTx.deposit.currency))\n const withdrawCurrency = bridgeCurrencies.find((currency) => currency.equals(notFinishedTx.withdraw.currency))\n\n if (!depositCurrency || !withdrawCurrency) {\n Sentry.captureMessage('Deposit/withdraw currency not found')\n return null\n }\n\n const resumeTx = () => {\n dispatch(closeModal())\n dispatch(setDualDirection({\n [BridgeDirectionName.SOURCE]: {\n chainId: notFinishedTx.deposit.currency.chainId,\n currency: depositCurrency,\n },\n [BridgeDirectionName.TARGET]: {\n chainId: notFinishedTx.withdraw.currency.chainId,\n currency: withdrawCurrency,\n },\n }))\n dispatch(selectCurrent(notFinishedTx.id))\n dispatch(openModal(ModalType.BRIDGE_TRANSFER))\n }\n\n if (onlyIcon) {\n return (\n \n )\n }\n\n return (\n \n Resume\n \n )\n})\n\nUnfinishedBridgeTxButton.displayName = 'UnfinishedBridgeTxButton'\n\nexport default UnfinishedBridgeTxButton\n","import React, {\n memo, useState, useEffect, useMemo, useCallback,\n} from 'react'\nimport { CopyToClipboard } from 'react-copy-to-clipboard'\n\nimport { CircularProgress, useTheme } from '@mui/material'\nimport Dialog from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport Typography from '@mui/material/Typography'\nimport Paper from '@mui/material/Paper'\nimport Grid from '@mui/material/Grid'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Link from '@mui/material/Link'\nimport ButtonGroup from '@mui/material/ButtonGroup'\nimport LaunchIcon from '@mui/icons-material/Launch'\nimport ContentCopyIcon from '@mui/icons-material/ContentCopy'\nimport CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'\nimport ErrorOutlineIcon from '@mui/icons-material/ErrorOutline'\n\nimport { useWeb3React } from '@web3-react/core'\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport { useAppDispatch, useAppSelector } from '../../app/hooks'\nimport { closeModal, ModalType } from '../../features/modal/modalSlice'\nimport { deauthorize } from '../../features/wallet/walletSlice'\nimport useFetchBridgeCurrencies from '../../hooks/useFetchBridgeCurrencies'\n\nimport { getChainData, getShortAddress, prettyFormat } from '../../helpers/utilities'\nimport BootstrapDialogTitle from './BootstrapDialogTitle'\nimport {\n clearAllTxs,\n CrossChainTransferStatus,\n CrossChainTx,\n getAccountTransactions,\n isBridgeTx,\n LocalTx,\n LocalTxStatus,\n} from '../../features/wallet/transactionSlice'\nimport { ChainData } from '../../helpers/types'\nimport UnfinishedBridgeTxButton from '../buttons/UnfinishedBridgeTxButton'\n\nconst CopyAddressLink = memo(({ address }: { address: string }): JSX.Element => {\n const [copied, setCopied] = useState(false)\n\n useEffect(() => {\n if (!copied) return undefined\n\n const id = setTimeout(() => setCopied(false), 500)\n return () => {\n clearTimeout(id)\n }\n }, [copied])\n\n const { text, startIcon } = useMemo(() => ((copied) ? {\n text: 'Copied',\n startIcon: ,\n } : {\n text: 'Copy address',\n startIcon: ,\n }), [copied])\n\n return (\n setCopied(true)}>\n \n {text}\n \n \n )\n})\nCopyAddressLink.displayName = 'CopyAddressLink'\n\nconst TxLink = ({ chain, txHash }: { chain: ChainData, txHash?: string }): JSX.Element => {\n if (!txHash) {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{chain.name}\n }\n\n return (\n \n {chain.name}\n \n )\n}\n\nconst BridgeTxBox = ({ tx }: { tx: CrossChainTx }): JSX.Element | null => {\n const depositChain = useMemo(() => getChainData(tx.deposit.currency.chainId), [tx.deposit.currency.chainId])\n const withdrawChain = useMemo(() => getChainData(tx.withdraw.currency.chainId), [tx.withdraw.currency.chainId])\n\n const statusBlock = useMemo(() => {\n switch (tx.status) {\n case CrossChainTransferStatus.DONE:\n return \n default:\n return \n }\n }, [tx.status])\n\n const resumeBlock = useMemo(() => {\n switch (tx.status) {\n case CrossChainTransferStatus.DONE:\n return null\n default:\n return (\n \n )\n }\n }, [tx.status, tx.id])\n if (!depositChain || !withdrawChain) return null\n\n return (\n \n \n \n {`Transfer ${prettyFormat(tx.value, tx.deposit.currency.decimals)} ${tx.deposit.currency.symbol} from `}\n \n {' to '}\n \n \n {resumeBlock}\n \n \n {statusBlock}\n \n \n )\n}\n\nconst LocalTxBox = ({ tx }: { tx: LocalTx }): JSX.Element | null => {\n const chain = useMemo(() => getChainData(tx.chainId), [tx.chainId])\n\n const { getCurrency } = useFetchBridgeCurrencies()\n\n const statusBlock = useMemo(() => {\n switch (tx.status) {\n case LocalTxStatus.FAIL:\n return \n case LocalTxStatus.SUCCESS:\n return \n case LocalTxStatus.PENDING:\n default:\n return \n }\n }, [tx.status])\n\n const textBlock = useMemo(() => {\n if (!chain) return null\n\n switch (tx.method) {\n case 'approve': {\n const currency = getCurrency(tx.chainId, tx.to)\n return (\n \n {`Approve ${currency?.symbol} on `}\n \n \n )\n }\n default:\n return null\n }\n }, [chain, getCurrency, tx.chainId, tx.method, tx.to, tx.txHash])\n\n return (\n \n \n {textBlock}\n \n \n {statusBlock}\n \n \n )\n}\n\nconst TransactionContent = (): JSX.Element => {\n const dispatch = useAppDispatch()\n const txs = useAppSelector(getAccountTransactions)\n const onClearAll = (event: React.MouseEvent) => {\n event.preventDefault()\n dispatch(clearAllTxs())\n }\n return (\n \n {!txs.length ? (\n \n Your transactions will appear here...\n \n ) : (\n <>\n \n Recent Transactions\n (clear all)\n \n \n {txs.map((tx) => (\n isBridgeTx(tx)\n ? \n : \n ))}\n \n \n )}\n \n )\n}\n\nconst WalletModal = (): JSX.Element => {\n const theme = useTheme()\n const dispatch = useAppDispatch()\n const open = useAppSelector((state) => state.modal[ModalType.WALLET])\n\n const { account, chainId } = useAppSelector((state) => state.wallet)\n const { deactivate } = useWeb3React()\n\n const chain = getChainData(chainId)\n\n const handleClose = useCallback(() => dispatch(closeModal()), [dispatch])\n const handleDisconnect = () => {\n dispatch(deauthorize(true))\n deactivate()\n handleClose()\n }\n\n return (\n \n \n Account\n \n \n \n {account && chain && (\n \n \n \n Connected with MetaMask\n \n \n Disconnect\n \n \n \n \n {getShortAddress(account)}\n \n \n \n \n }\n href={`${chain.explorerURL}/address/${account}`}\n sx={{\n textTransform: 'none',\n }}\n >\n View on Explorer\n \n \n \n )}\n \n \n \n \n \n \n )\n}\n\nexport default WalletModal\n","import ConnectModal from '../components/modals/ConnectModal'\nimport BridgeTokenModal from '../components/modals/BridgeTokenModal'\nimport BridgeChainSelectModal from '../components/modals/BridgeChainSelectModal'\nimport WrongNetworkModal from '../components/modals/WrongNetworkModal'\nimport BridgeTransferModal from '../components/modals/BridgeTransferModal'\nimport WalletModal from '../components/modals/WalletModal'\n\nconst ModalBaseline = (): JSX.Element => (\n <>\n \n \n \n \n \n \n \n)\n\nexport default ModalBaseline\n","import { ReactNode, useEffect } from 'react'\nimport useDeepCompareEffect from 'use-deep-compare-effect'\n\nimport * as Sentry from '@sentry/react'\nimport { useWeb3React } from '@web3-react/core'\nimport { Web3Provider } from '@ethersproject/providers'\n\nimport { ConnectorNames, connectorsByName } from '../helpers/connectors'\nimport { getLibrary, Web3RefetcherProvider } from './utils'\nimport { useAppDispatch, useAppSelector } from '../app/hooks'\nimport {\n getAccountTransactions, isBridgeTx, LocalTx, LocalTxStatus, updateLocalTxByHash,\n} from '../features/wallet/transactionSlice'\n\ninterface InjectorProps {\n children?: ReactNode\n}\n\nconst PollInterval = 15 * 1000 // sec\n\nconst InnerProvider = ({ children }: InjectorProps): JSX.Element => {\n const network = connectorsByName[ConnectorNames.Refetcher]\n\n const {\n chainId, active, activate, library: provider,\n } = useWeb3React(ConnectorNames.Refetcher)\n\n const dispatch = useAppDispatch()\n const txs = useAppSelector(\n (state) => getAccountTransactions(state)\n .filter((tx) => !isBridgeTx(tx) && tx.status === LocalTxStatus.PENDING),\n ) as LocalTx[]\n\n useEffect(() => {\n (async () => {\n if (active && chainId) return\n await activate(network, undefined, true)\n console.log('Refetcher provider connected')\n })()\n }, [active, chainId, activate, network])\n\n useDeepCompareEffect(() => {\n let timer: ReturnType\n\n const loop = async () => {\n for (let i = 0; i < txs.length; i += 1) {\n const tx = txs[i]\n // eslint-disable-next-line no-continue\n if (!tx.txHash) continue\n // eslint-disable-next-line no-continue\n if (tx.confirmations && tx.confirmations >= 1) continue\n\n network.changeChainId(tx.chainId)\n try {\n console.log(`Processing tx \"${tx.txHash}\" on chain \"${tx.chainId}\"...`)\n // eslint-disable-next-line no-await-in-loop\n const receipt = await provider?.getTransactionReceipt(tx.txHash)\n if (!receipt) {\n console.log(`Tx \"${tx.txHash}\" not finished, skipping...`)\n // eslint-disable-next-line no-continue\n continue\n }\n\n dispatch(updateLocalTxByHash({ txHash: tx.txHash, confirmations: 1, status: receipt.status }))\n console.log(`Tx \"${tx.txHash}\" processed`)\n } catch (e) {\n console.log(`Failed to process tx \"${tx.txHash}\" on chain \"${tx.chainId}\", error`, e)\n Sentry.captureException(e)\n }\n }\n timer = setTimeout(loop, PollInterval)\n }\n timer = setTimeout(loop, PollInterval)\n return () => {\n clearTimeout(timer)\n }\n }, [dispatch, network, provider, txs])\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}\n}\n\nconst RefetcherProvider = ({ children }: InjectorProps): JSX.Element => (\n \n \n {children}\n \n \n)\n\nexport default RefetcherProvider\n","import React from 'react'\nimport { SnackbarProvider } from 'notistack'\nimport { makeStyles } from '@mui/styles'\nimport { Theme } from '@mui/material'\nimport Fade from '@mui/material/Fade'\n\nconst useStyles = makeStyles((theme: Theme) => ({\n wrapped: {\n borderRadius: '16px!important',\n },\n variantSuccess: {\n color: (theme.palette.mode === 'light') ? 'white' : `${theme.palette.secondary.main}!important`,\n backgroundColor: `${theme.palette.primary.main}!important`,\n '& .MuiSvgIcon-root': {\n color: (theme.palette.mode === 'light') ? 'white' : `${theme.palette.secondary.main}!important`,\n },\n },\n variantError: {\n backgroundColor: `${theme.palette.error.main}!important`,\n '& .MuiSvgIcon-root': {\n color: 'white!important',\n },\n },\n variantInfo: {\n backgroundColor: `${theme.palette.info.main}!important`,\n '& .MuiSvgIcon-root': {\n color: 'white!important',\n },\n },\n variantWarning: {\n backgroundColor: `${theme.palette.warning.main}!important`,\n '& .MuiSvgIcon-root': {\n color: 'white!important',\n },\n },\n}))\n\nconst SnackbarWrappedProvider = ({ children }: { children?: React.ReactNode }): JSX.Element => {\n const classes = useStyles()\n // const notistackRef = React.createRef()\n\n // const onAction = useCallback((key: SnackbarKey): SnackbarAction => {\n // const onClickDismiss = () => {\n // notistackRef?.current?.closeSnackbar(key)\n // }\n\n // return (\n // \n // \n // \n // )\n // }, [notistackRef])\n\n return (\n \n {children}\n \n )\n}\n\nexport default SnackbarWrappedProvider\n","import { ThemeOptions } from '@mui/material'\nimport { grey } from '@mui/material/colors'\nimport darkScrollbar from '@mui/material/darkScrollbar'\n\nconst baseThemeOpts: ThemeOptions = {\n components: {\n MuiButton: {\n styleOverrides: {\n root: {\n borderRadius: 16,\n },\n },\n },\n MuiDialog: {\n styleOverrides: {\n paper: {\n borderRadius: 16,\n },\n },\n },\n MuiPaper: {\n styleOverrides: {\n root: {\n borderRadius: 16,\n },\n },\n },\n MuiButtonGroup: {\n styleOverrides: {\n root: {\n borderRadius: 16,\n },\n },\n },\n MuiAppBar: {\n styleOverrides: {\n root: {\n borderRadius: 0,\n },\n },\n },\n },\n}\n\nexport const LightThemeOpts: ThemeOptions = {\n palette: {\n mode: 'light',\n primary: {\n main: '#3b8c9e',\n },\n secondary: {\n main: grey[900],\n },\n },\n components: { ...baseThemeOpts.components },\n}\n\nexport const DarkThemeOpts: ThemeOptions = {\n palette: {\n mode: 'dark',\n primary: {\n main: grey[900],\n },\n secondary: {\n main: '#5ef5cf',\n },\n },\n components: {\n ...baseThemeOpts.components,\n MuiCssBaseline: {\n styleOverrides: {\n body: {\n ...darkScrollbar(),\n backgroundColor: '#5ef5cf',\n background: 'linear-gradient(0deg, #5ef5cf 0%, #272727 34%, #121212 67%)',\n },\n },\n },\n },\n}\n","import React from 'react'\nimport { Routes, Route } from 'react-router-dom'\nimport { ThemeProvider } from '@mui/material/styles'\nimport CssBaseline from '@mui/material/CssBaseline'\nimport { createTheme, responsiveFontSizes } from '@mui/material'\nimport Container from '@mui/material/Container'\n\nimport { useAppSelector } from './app/hooks'\nimport baseRoutes from './routes'\nimport Navigation from './components/Navigation'\nimport MetaMaskProvider from './providers/MetaMaskProvider'\nimport BridgeProvider from './providers/BridgeProvider'\nimport ModalBaseline from './providers/ModalBaseline'\nimport RefetcherProvider from './providers/RefetcherProvider'\nimport SnackbarWrappedProvider from './providers/SnackbarWrappedProvider'\nimport { DarkThemeOpts, LightThemeOpts } from './theme'\nimport { getThemeSettings } from './features/settings/settingsSlice'\n\nimport './App.css'\n\nconst App = (): JSX.Element => {\n const themeSettings = useAppSelector(getThemeSettings)\n const theme = responsiveFontSizes(createTheme((themeSettings.isDark) ? DarkThemeOpts : LightThemeOpts))\n\n return (\n \n \n \n \n \n \n \n \n {baseRoutes.map((route) => {\n const Component = route.component\n if (Component !== null) {\n return (\n \n \n \n )}\n />\n )\n }\n return null\n })}\n \n \n \n \n \n \n )\n}\n\nexport default App\n","import {\n configureStore, ThunkAction, AnyAction, Middleware, combineReducers,\n} from '@reduxjs/toolkit'\n\nimport bridgeSlice from '../features/bridge/bridgeSlice'\nimport modalSlice from '../features/modal/modalSlice'\nimport walletSlice from '../features/wallet/walletSlice'\nimport web3ApiSlice from '../features/api/web3ApiSlice'\nimport chainListApiSlice from '../features/api/chainListApiSlice'\nimport tokenListApiSlice from '../features/api/tokenListApiSlice'\nimport transactionSlice from '../features/wallet/transactionSlice'\nimport cosignerApiSlice from '../features/api/cosignerApiSlice'\nimport settingsSlice from '../features/settings/settingsSlice'\nimport priceApiSlice from '../features/api/priceApiSlice'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst middlewares: Array = [\n tokenListApiSlice.middleware,\n web3ApiSlice.middleware,\n chainListApiSlice.middleware,\n cosignerApiSlice.middleware,\n priceApiSlice.middleware,\n]\n/* eslint-disable global-require */\nif (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { logger }: { logger: Middleware } = require('redux-logger')\n middlewares.push(logger)\n}\n\n/* eslint-enable global-require */\nconst rootReducer = combineReducers({\n bridge: bridgeSlice,\n wallet: walletSlice,\n modal: modalSlice,\n transaction: transactionSlice,\n settings: settingsSlice,\n [tokenListApiSlice.reducerPath]: tokenListApiSlice.reducer,\n [web3ApiSlice.reducerPath]: web3ApiSlice.reducer,\n [chainListApiSlice.reducerPath]: chainListApiSlice.reducer,\n [cosignerApiSlice.reducerPath]: cosignerApiSlice.reducer,\n [priceApiSlice.reducerPath]: priceApiSlice.reducer,\n})\n\nexport const store = configureStore({\n reducer: rootReducer,\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false,\n // ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],\n }).concat(middlewares),\n devTools: process.env.NODE_ENV !== 'production',\n})\n\nexport type AppDispatch = typeof store.dispatch;\nexport type RootState = ReturnType;\nexport type AppThunk = ThunkAction<\n ReturnType,\n RootState,\n unknown,\n AnyAction\n>;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then((registration) => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch((error) => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then((response) => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then((registration) => {\n registration.unregister();\n })\n .catch((error) => {\n console.error(error.message);\n });\n }\n}\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport * as Sentry from '@sentry/react'\nimport { Integrations } from '@sentry/tracing'\nimport { Provider } from 'react-redux'\nimport { HashRouter } from 'react-router-dom'\nimport { persistStore } from 'redux-persist'\nimport { PersistGate } from 'redux-persist/integration/react'\n\nimport App from './App'\nimport { store } from './app/store'\nimport * as serviceWorker from './serviceWorker'\n\nconst persistor = persistStore(store)\n\nif (\n process.env.REACT_APP_SENTRY_DNS\n && process.env.REACT_APP_SENTRY_RELEASE\n) {\n console.log('Initializing Sentry...')\n Sentry.init({\n dsn: process.env.REACT_APP_SENTRY_DNS,\n integrations: [new Integrations.BrowserTracing()],\n\n // We recommend adjusting this value in production, or using tracesSampler\n // for finer control\n tracesSampleRate: 0.8,\n release: process.env.REACT_APP_SENTRY_RELEASE,\n })\n}\n\nReactDOM.render(\n \n \n \n \n \n \n \n \n ,\n document.getElementById('root'),\n)\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister()\n"],"sourceRoot":""}