├── .gitignore ├── .prettierignore ├── .prettierrc.json ├── .yarnclean ├── .yarnrc ├── LICENSE ├── README.md ├── craco.config.cjs ├── lerna.json ├── package.json ├── packages ├── common-resources │ ├── .babelrc │ ├── assets │ │ ├── coin │ │ │ ├── loopring.json │ │ │ └── loopring_431f2ed4.png │ │ ├── loading-1.gif │ │ └── loading.gif │ ├── index.ts │ ├── mail.html │ ├── package.json │ ├── scripts │ │ ├── .gitignore │ │ ├── READMD.md │ │ ├── get_imgs.py │ │ └── requirements.txt │ ├── static-resources │ │ ├── index.ts │ │ ├── src │ │ │ ├── constant │ │ │ │ ├── account.ts │ │ │ │ ├── chart.ts │ │ │ │ ├── firebase.ts │ │ │ │ ├── index.ts │ │ │ │ ├── loopring.ts │ │ │ │ ├── market.ts │ │ │ │ ├── miningOuterLinks.ts │ │ │ │ ├── networks.ts │ │ │ │ ├── notification.ts │ │ │ │ ├── proLayout.ts │ │ │ │ ├── router.ts │ │ │ │ ├── sagaStatus.ts │ │ │ │ ├── setting.ts │ │ │ │ ├── social.ts │ │ │ │ ├── table.ts │ │ │ │ ├── tokenConfig.ts │ │ │ │ ├── trade.ts │ │ │ │ ├── vendor.ts │ │ │ │ └── walletConnector.ts │ │ │ ├── error │ │ │ │ ├── errorMap.tsx │ │ │ │ └── index.ts │ │ │ ├── i18n │ │ │ │ ├── en_US │ │ │ │ │ ├── common.ts │ │ │ │ │ ├── error.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── landPage.ts │ │ │ │ │ ├── layout.ts │ │ │ │ │ ├── tables.ts │ │ │ │ │ └── webEarn.ts │ │ │ │ ├── index.ts │ │ │ │ └── zh_CN │ │ │ │ │ ├── common.ts │ │ │ │ │ ├── error.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── landPage.ts │ │ │ │ │ ├── layout.ts │ │ │ │ │ ├── tables.ts │ │ │ │ │ └── webEarn.ts │ │ │ ├── loopring-interface │ │ │ │ ├── CoinInterface.ts │ │ │ │ ├── FooterInterface.ts │ │ │ │ ├── HeaderInterface.ts │ │ │ │ ├── Investment.ts │ │ │ │ ├── VendorInterface.ts │ │ │ │ ├── WallectInterface.ts │ │ │ │ └── index.ts │ │ │ ├── svg │ │ │ │ ├── Icon.tsx │ │ │ │ ├── dropdownLogo.tsx │ │ │ │ ├── earnLogo.tsx │ │ │ │ ├── index.ts │ │ │ │ ├── network.tsx │ │ │ │ ├── redPacketScope.tsx │ │ │ │ ├── redPacketSvg.tsx │ │ │ │ └── shareReferral.tsx │ │ │ ├── themes │ │ │ │ ├── css │ │ │ │ │ ├── color-lib.ts │ │ │ │ │ ├── global.tsx │ │ │ │ │ └── reset.tsx │ │ │ │ ├── fonts │ │ │ │ │ └── english │ │ │ │ │ │ ├── DINCondensed │ │ │ │ │ │ ├── 363123_0_0.eot │ │ │ │ │ │ ├── 363123_0_0.svg │ │ │ │ │ │ ├── 363123_0_0.ttf │ │ │ │ │ │ ├── 363123_0_0.woff │ │ │ │ │ │ ├── 363123_0_0.woff2 │ │ │ │ │ │ ├── 363123_1_0.eot │ │ │ │ │ │ ├── 363123_1_0.svg │ │ │ │ │ │ ├── 363123_1_0.ttf │ │ │ │ │ │ ├── 363123_1_0.woff │ │ │ │ │ │ ├── 363123_1_0.woff2 │ │ │ │ │ │ ├── 363123_2_0.eot │ │ │ │ │ │ ├── 363123_2_0.svg │ │ │ │ │ │ ├── 363123_2_0.ttf │ │ │ │ │ │ ├── 363123_2_0.woff │ │ │ │ │ │ └── 363123_2_0.woff2 │ │ │ │ │ │ ├── Gilroy-Medium.ttf │ │ │ │ │ │ ├── Inter-Medium.ttf │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ └── Montserrat │ │ │ │ │ │ ├── Montserrat-Black.ttf │ │ │ │ │ │ ├── Montserrat-BlackItalic.ttf │ │ │ │ │ │ ├── Montserrat-Bold.ttf │ │ │ │ │ │ ├── Montserrat-BoldItalic.ttf │ │ │ │ │ │ ├── Montserrat-ExtraBold.ttf │ │ │ │ │ │ ├── Montserrat-ExtraBoldItalic.ttf │ │ │ │ │ │ ├── Montserrat-ExtraLight.ttf │ │ │ │ │ │ ├── Montserrat-ExtraLightItalic.ttf │ │ │ │ │ │ ├── Montserrat-Italic.ttf │ │ │ │ │ │ ├── Montserrat-Light.ttf │ │ │ │ │ │ ├── Montserrat-LightItalic.ttf │ │ │ │ │ │ ├── Montserrat-Medium.ttf │ │ │ │ │ │ ├── Montserrat-MediumItalic.ttf │ │ │ │ │ │ ├── Montserrat-Regular.ttf │ │ │ │ │ │ ├── Montserrat-SemiBold.ttf │ │ │ │ │ │ ├── Montserrat-SemiBoldItalic.ttf │ │ │ │ │ │ ├── Montserrat-Thin.ttf │ │ │ │ │ │ └── Montserrat-ThinItalic.ttf │ │ │ │ ├── globalSetup.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ └── overrides │ │ │ │ │ ├── muTheme.ts │ │ │ │ │ ├── overrides-date-pick.ts │ │ │ │ │ ├── overrides-mui.ts │ │ │ │ │ └── utils.ts │ │ │ └── utils │ │ │ │ ├── format_tools.ts │ │ │ │ ├── index.ts │ │ │ │ ├── log_tools.ts │ │ │ │ ├── makeDom.ts │ │ │ │ ├── obj_tools.ts │ │ │ │ ├── types.tsx │ │ │ │ └── util.ts │ │ └── types.d.ts │ ├── tsconfig.json │ └── tsconfig.tsbuildinfo ├── component-lib │ ├── .babelrc │ ├── .eslintignore │ ├── .eslintrc.json │ ├── .gitignore │ ├── .storybook │ │ ├── main.ts │ │ └── preview.tsx │ ├── .travis.yml │ ├── README.md │ ├── craco.config.cjs │ ├── package.json │ ├── public │ │ └── favicon.ico │ ├── rollup.config.js │ ├── src │ │ ├── components │ │ │ ├── basic-lib │ │ │ │ ├── Icon.stories.tsx │ │ │ │ ├── btns │ │ │ │ │ ├── BtnPercentage.tsx │ │ │ │ │ ├── Button.stories.tsx │ │ │ │ │ ├── Button.tsx │ │ │ │ │ ├── Interface.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── checkbox │ │ │ │ │ └── index.tsx │ │ │ │ ├── color.stories.tsx │ │ │ │ ├── display │ │ │ │ │ ├── SpaceBetweenBox.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── empty │ │ │ │ │ ├── Empty.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── form │ │ │ │ │ ├── Form.stories.tsx │ │ │ │ │ ├── hooks │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── useFocusRef.ts │ │ │ │ │ │ └── usePanelRef.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── input │ │ │ │ │ │ ├── CollectionInput.tsx │ │ │ │ │ │ ├── DatePicker.tsx │ │ │ │ │ │ ├── Default.tsx │ │ │ │ │ │ ├── InputButton.tsx │ │ │ │ │ │ ├── InputCode.tsx │ │ │ │ │ │ ├── InputCoin.tsx │ │ │ │ │ │ ├── InputMaxButton.tsx │ │ │ │ │ │ ├── InputMaxCoin.tsx │ │ │ │ │ │ ├── InputSearch.tsx │ │ │ │ │ │ ├── InputSelect.tsx │ │ │ │ │ │ ├── Interface.ts │ │ │ │ │ │ ├── TextareaWithCount.tsx │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── style.ts │ │ │ │ ├── index.tsx │ │ │ │ ├── lists │ │ │ │ │ ├── CoinList.tsx │ │ │ │ │ ├── CollectionItem.tsx │ │ │ │ │ ├── FileListItem.tsx │ │ │ │ │ ├── HeadMenuItem.tsx │ │ │ │ │ ├── HeadToolbar.tsx │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── List.stories.tsx │ │ │ │ │ ├── NFTList.tsx │ │ │ │ │ ├── Notification.tsx │ │ │ │ │ ├── SubMenuList.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── loading │ │ │ │ │ └── index.tsx │ │ │ │ ├── media │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── nftImage.tsx │ │ │ │ ├── panel │ │ │ │ │ ├── IPFSSourceUpload.tsx │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── Panel.stories.tsx │ │ │ │ │ ├── QRCodeUpload.tsx │ │ │ │ │ ├── SubMenu.tsx │ │ │ │ │ ├── SwitchPanel.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── popover │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── Popover.tsx │ │ │ │ │ ├── index.ts │ │ │ │ │ └── popover.stories.tsx │ │ │ │ ├── resource │ │ │ │ │ ├── hook │ │ │ │ │ │ └── useImage.ts │ │ │ │ │ └── index.tsx │ │ │ │ ├── table-pagination │ │ │ │ │ ├── TablePagination.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── tables │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── Table.tsx │ │ │ │ │ ├── components │ │ │ │ │ │ ├── Formatters │ │ │ │ │ │ │ ├── CellActionsFormatter.tsx │ │ │ │ │ │ │ ├── CellDepthFormatter.tsx │ │ │ │ │ │ │ ├── CellExpanderFormatter.tsx │ │ │ │ │ │ │ ├── ChildRowDeleteButton.tsx │ │ │ │ │ │ │ ├── ImageFormatter.tsx │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ │ ├── HeaderRenderers │ │ │ │ │ │ │ ├── SortableHeaderCell.tsx │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ │ └── RowRenders │ │ │ │ │ │ │ ├── RowDepthFormatter.tsx │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── hook │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── useClickOutside.ts │ │ │ │ │ │ ├── useCombinedRefs.ts │ │ │ │ │ │ ├── useFocusRef.ts │ │ │ │ │ │ └── useLatestFunc.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── table.stories.tsx │ │ │ │ └── tags │ │ │ │ │ ├── Tags.stories.tsx │ │ │ │ │ └── index.tsx │ │ │ ├── block │ │ │ │ ├── AmmCard.tsx │ │ │ │ ├── AmmPairDetail.tsx │ │ │ │ ├── AssetTitle.tsx │ │ │ │ ├── Block.stories.tsx │ │ │ │ ├── CollectionDetailView.tsx │ │ │ │ ├── CollectionMedia.tsx │ │ │ │ ├── DepthRaw.tsx │ │ │ │ ├── DownloadPanel.tsx │ │ │ │ ├── ETHStakingDetail.tsx │ │ │ │ ├── ErrorBlock.tsx │ │ │ │ ├── Interface.ts │ │ │ │ ├── LoadingBlock.tsx │ │ │ │ ├── MarketBlock.tsx │ │ │ │ ├── NotificationPanel.tsx │ │ │ │ ├── RedPacket.tsx │ │ │ │ ├── Referral.tsx │ │ │ │ ├── SettingPanel.tsx │ │ │ │ ├── ShareSocialPanel.tsx │ │ │ │ ├── TagIconList.tsx │ │ │ │ ├── TradeRace.tsx │ │ │ │ ├── TradeTitle.tsx │ │ │ │ ├── Vip.tsx │ │ │ │ ├── index.ts │ │ │ │ └── nftMedia.tsx │ │ │ ├── bottomRule │ │ │ │ └── index.tsx │ │ │ ├── carousel │ │ │ │ ├── Carousel.tsx │ │ │ │ ├── Interface.ts │ │ │ │ └── index.tsx │ │ │ ├── charts │ │ │ │ ├── constant.ts │ │ │ │ ├── doughnutChart │ │ │ │ │ ├── DoughnutChart.stories.tsx │ │ │ │ │ ├── DoughnutChart.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── index.tsx │ │ │ │ └── scaleAreaChart │ │ │ │ │ ├── APRChart │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── DepthChart │ │ │ │ │ ├── ScaleAreaChart.stories.tsx │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── KlineChart │ │ │ │ │ ├── KlineChart.stories.tsx │ │ │ │ │ ├── KlineChart.tsx │ │ │ │ │ ├── KlineChart_min.stories.tsx │ │ │ │ │ ├── data.ts │ │ │ │ │ ├── data_min.ts │ │ │ │ │ └── index.ts │ │ │ │ │ ├── ScaleAreaChart.tsx │ │ │ │ │ ├── TrendChart │ │ │ │ │ ├── ScaleAreaChart.stories.tsx │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── data.tsx │ │ │ │ │ └── index.ts │ │ │ ├── datetimerangepicker │ │ │ │ └── index.tsx │ │ │ ├── footer │ │ │ │ └── index.tsx │ │ │ ├── header │ │ │ │ ├── Header.tsx │ │ │ │ ├── Interface.ts │ │ │ │ ├── index.ts │ │ │ │ └── toolbar │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── WalletConnect.tsx │ │ │ │ │ └── index.tsx │ │ │ ├── index.tsx │ │ │ ├── layout │ │ │ │ ├── AmmDetail.stories.tsx │ │ │ │ ├── Error.stories.tsx │ │ │ │ ├── layer2.stories.tsx │ │ │ │ └── trade.stories.tsx │ │ │ ├── modal │ │ │ │ ├── ModalPanelBase.tsx │ │ │ │ ├── ModalPanels │ │ │ │ │ ├── AccountBase.tsx │ │ │ │ │ ├── AddAsset.tsx │ │ │ │ │ ├── BasicPanel.tsx │ │ │ │ │ ├── BridgePanel.tsx │ │ │ │ │ ├── CheckActiveStatus.tsx │ │ │ │ │ ├── CheckImportCollection.tsx │ │ │ │ │ ├── ClaimWithdraw.tsx │ │ │ │ │ ├── ClaimWithdrawPanel.tsx │ │ │ │ │ ├── CoinbaseSmartWalletModal.tsx │ │ │ │ │ ├── Connect.tsx │ │ │ │ │ ├── CreateAccount.tsx │ │ │ │ │ ├── CreateRedPacketPanel.tsx │ │ │ │ │ ├── DeployNFT.tsx │ │ │ │ │ ├── Deposit.tsx │ │ │ │ │ ├── DepositNFT.tsx │ │ │ │ │ ├── DepositPanel.tsx │ │ │ │ │ ├── DepositRecorder.tsx │ │ │ │ │ ├── Dual.tsx │ │ │ │ │ ├── EditContact.tsx │ │ │ │ │ ├── ExportAccount.tsx │ │ │ │ │ ├── FeeSelect.tsx │ │ │ │ │ ├── ForceWithdraw.tsx │ │ │ │ │ ├── ForceWithdrawPanel.tsx │ │ │ │ │ ├── HadAccount.tsx │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── MintNFT.tsx │ │ │ │ │ ├── ModalAccount.tsx │ │ │ │ │ ├── NoAccount.tsx │ │ │ │ │ ├── QRAddressPanel.tsx │ │ │ │ │ ├── RedPacket.tsx │ │ │ │ │ ├── SendAsset.tsx │ │ │ │ │ ├── SendNFTAsset.tsx │ │ │ │ │ ├── ThirdPanelReturn.tsx │ │ │ │ │ ├── Transfer.tsx │ │ │ │ │ ├── TransferPanel.tsx │ │ │ │ │ ├── TransferToTaikoAccount.tsx │ │ │ │ │ ├── TransferToTaikoAccountPanel.tsx │ │ │ │ │ ├── UnlockAccount.tsx │ │ │ │ │ ├── UpdateAccount.tsx │ │ │ │ │ ├── Vault.tsx │ │ │ │ │ ├── Withdraw.tsx │ │ │ │ │ ├── WithdrawPanel.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── QRCode │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── QRCode.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── RedPacketPanels │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── RedPacketModal.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── Vault │ │ │ │ │ ├── VaultBorrowPanel.tsx │ │ │ │ │ ├── VaultExitPanel.tsx │ │ │ │ │ ├── VaultJoinPanel.tsx │ │ │ │ │ ├── VaultLoanPanel.tsx │ │ │ │ │ ├── VaultRepayPanel.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── WalletConnect │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── ModalWalletConnect.tsx │ │ │ │ │ ├── ProviderMenu.tsx │ │ │ │ │ ├── WalletConnectQRCode.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── WalletPanels │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── LockWallet.tsx │ │ │ │ │ ├── ModalWallet.tsx │ │ │ │ │ ├── WalletApprove.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── accountList_new.stories.tsx │ │ │ │ ├── index.ts │ │ │ │ ├── setting │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── SettingFee.tsx │ │ │ │ │ └── index.ts │ │ │ │ └── walletList.stories.tsx │ │ │ ├── panel │ │ │ │ ├── FilterMarketsPanel.tsx │ │ │ │ ├── Panel.stories.tsx │ │ │ │ └── index.ts │ │ │ ├── provider.tsx │ │ │ ├── share │ │ │ │ ├── Interface.ts │ │ │ │ ├── components │ │ │ │ │ └── SocialButton.tsx │ │ │ │ └── index.tsx │ │ │ ├── styled.ts │ │ │ ├── tableList │ │ │ │ ├── QuoteTable │ │ │ │ │ ├── MarketDetail.tsx │ │ │ │ │ ├── MarketTable.tsx │ │ │ │ │ ├── QuoteTable.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── ammRecordTable │ │ │ │ │ ├── AmmRecordTable.stories.tsx │ │ │ │ │ ├── AmmRecordTable.tsx │ │ │ │ │ ├── Interface.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── ammTable │ │ │ │ │ ├── AmmTable.stories.tsx │ │ │ │ │ ├── AmmTable.tsx │ │ │ │ │ ├── components │ │ │ │ │ │ └── Filter.tsx │ │ │ │ │ ├── index.ts │ │ │ │ │ └── interface.ts │ │ │ │ ├── assetsTable │ │ │ │ │ ├── AssetsDefiTable.tsx │ │ │ │ │ ├── AssetsTable.tsx │ │ │ │ │ ├── VaultAssetsTable.tsx │ │ │ │ │ ├── VaultPositionsTable.tsx │ │ │ │ │ ├── assetsTable.stories.tsx │ │ │ │ │ ├── components │ │ │ │ │ │ ├── ActionMemo.tsx │ │ │ │ │ │ ├── CoinIcons.tsx │ │ │ │ │ │ ├── Filter.tsx │ │ │ │ │ │ └── modal.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── btradeSwapTable │ │ │ │ │ ├── BtradeSwapTable.tsx │ │ │ │ │ ├── Interface.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── defiTxsTable │ │ │ │ │ ├── DefiStakingTable.tsx │ │ │ │ │ ├── DefiStakingTxTable.tsx │ │ │ │ │ ├── DefiTxsTable.tsx │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── components │ │ │ │ │ │ └── ActionMemo.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── dualTable │ │ │ │ │ ├── DualTable.tsx │ │ │ │ │ ├── Interface.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── dualTxsTable │ │ │ │ │ ├── DualAssetTable.tsx │ │ │ │ │ ├── DualTxsTable.tsx │ │ │ │ │ ├── Interface.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ ├── investOverviewTable │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── InvestOverviewTable.tsx │ │ │ │ │ ├── components │ │ │ │ │ │ ├── Filter.tsx │ │ │ │ │ │ └── expends.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── myPoolTable │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── MyPoolTable.stories.tsx │ │ │ │ │ ├── MyPoolTable.tsx │ │ │ │ │ ├── components │ │ │ │ │ │ ├── ActionPop.tsx │ │ │ │ │ │ └── Filter.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── nftTable │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── TsNFTTable.tsx │ │ │ │ │ ├── components │ │ │ │ │ │ ├── Filter.tsx │ │ │ │ │ │ └── modal.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── orderHistoryTable │ │ │ │ │ ├── OrderHistoryTable.tsx │ │ │ │ │ ├── SingleOrderHistoryTable.tsx │ │ │ │ │ ├── components │ │ │ │ │ │ ├── Filter.tsx │ │ │ │ │ │ └── modal.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── poolsTable │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── PoolsTable.stories.tsx │ │ │ │ │ ├── PoolsTable.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── redPacketTable │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── RedPacketBlindBoxReceiveTable.tsx │ │ │ │ │ ├── RedPacketClaimTable.tsx │ │ │ │ │ ├── RedPacketReceiveTable.tsx │ │ │ │ │ ├── RedPacketRecodTable.tsx │ │ │ │ │ ├── index.ts │ │ │ │ │ └── textTooltip.tsx │ │ │ │ ├── rewardTable │ │ │ │ │ ├── ReferralsTable.tsx │ │ │ │ │ ├── RefundTable.tsx │ │ │ │ │ ├── RewardTable.tsx │ │ │ │ │ ├── RewardsTable.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── tableList.stories.tsx │ │ │ │ ├── taikoFarmingTable │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── TaikoFarmingPortfolioTable.tsx │ │ │ │ │ ├── TaikoTarmingTxRecordsTable.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── tradeNFTTable │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── TradeNFTTable.tsx │ │ │ │ │ ├── components │ │ │ │ │ │ └── Filter.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── tradeRaceTable │ │ │ │ │ ├── TradeRaceTable.tsx │ │ │ │ │ ├── TradeRaceTableConfig.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── tradeRroTable │ │ │ │ │ ├── TradePro.tsx │ │ │ │ │ ├── index.ts │ │ │ │ │ └── tradeTable.stories.tsx │ │ │ │ ├── tradeTable │ │ │ │ │ ├── TradeTable.tsx │ │ │ │ │ ├── components │ │ │ │ │ │ └── Filter.tsx │ │ │ │ │ ├── index.ts │ │ │ │ │ └── tradeTable.stories.tsx │ │ │ │ ├── transactionsTable │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── TransactionTable.tsx │ │ │ │ │ ├── components │ │ │ │ │ │ ├── Filter.tsx │ │ │ │ │ │ └── modal.tsx │ │ │ │ │ └── index.ts │ │ │ │ └── vaultTable │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── VaultTxTable.tsx │ │ │ │ │ └── index.ts │ │ │ ├── text-tooltip │ │ │ │ └── index.tsx │ │ │ ├── toast │ │ │ │ └── index.tsx │ │ │ └── tradePanel │ │ │ │ ├── Amm │ │ │ │ ├── AmmPanel.tsx │ │ │ │ ├── Interface.tsx │ │ │ │ └── index.ts │ │ │ │ ├── Deposit │ │ │ │ ├── DepositGroup.tsx │ │ │ │ ├── DepositTitle.tsx │ │ │ │ ├── Interface.tsx │ │ │ │ ├── VendorMenu.tsx │ │ │ │ └── index.ts │ │ │ │ ├── ExportAccount │ │ │ │ └── index.tsx │ │ │ │ ├── Interface.ts │ │ │ │ ├── ModalPanel.tsx │ │ │ │ ├── Panel.stories.tsx │ │ │ │ ├── Reset │ │ │ │ ├── ActiveAccountPanel.tsx │ │ │ │ ├── ConfirmationPanel.tsx │ │ │ │ ├── ResetPanel.tsx │ │ │ │ └── index.ts │ │ │ │ ├── Swap │ │ │ │ └── index.tsx │ │ │ │ ├── components │ │ │ │ ├── AddressType.tsx │ │ │ │ ├── AmmWrap │ │ │ │ │ ├── AmmDeposit.tsx │ │ │ │ │ ├── AmmWithdraw.tsx │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── styled.ts │ │ │ │ ├── BanxaConfirm.tsx │ │ │ │ ├── BasicACoinInput.tsx │ │ │ │ ├── BasicACoinTrade.tsx │ │ │ │ ├── BasicANFTTrade.tsx │ │ │ │ ├── CollectionAdvanceWrap.tsx │ │ │ │ ├── CollectionManageWrap.tsx │ │ │ │ ├── ContactSelection.tsx │ │ │ │ ├── CreateCollectionWrap.tsx │ │ │ │ ├── CreateRedPacketWrap.tsx │ │ │ │ ├── DeFiWrap │ │ │ │ │ ├── DeFiStackOneSideWrap.tsx │ │ │ │ │ ├── DeFiStackRedeemWrap.tsx │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── deFiWrap.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── DeployNFTWrap.tsx │ │ │ │ ├── DepositConfirm.tsx │ │ │ │ ├── DepositNFTWrap.tsx │ │ │ │ ├── DepositWrap.tsx │ │ │ │ ├── DualWrap │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── ModifyParameter.tsx │ │ │ │ │ ├── ModifySetting.tsx │ │ │ │ │ ├── dualDetail.tsx │ │ │ │ │ ├── dualWrap.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── ExportAccountWrap.tsx │ │ │ │ ├── ForceWithdrawConfirm.tsx │ │ │ │ ├── ForceWithdrawWrap.tsx │ │ │ │ ├── ImportCollectionWrap.tsx │ │ │ │ ├── ImportRedPacketWrap.tsx │ │ │ │ ├── Interface.ts │ │ │ │ ├── MintAdvanceNFTWrap.tsx │ │ │ │ ├── MintNFTBlock.tsx │ │ │ │ ├── MintNFTConfirm.tsx │ │ │ │ ├── RampConfirm.tsx │ │ │ │ ├── ResetWrap.tsx │ │ │ │ ├── Styled.ts │ │ │ │ ├── SwapWrap │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── SwapMenuList.tsx │ │ │ │ │ ├── SwapTradeWrap.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── TargetRedpacketWrap.tsx │ │ │ │ ├── TransferConfirm.tsx │ │ │ │ ├── TransferNFTBurn.tsx │ │ │ │ ├── TransferWrap.tsx │ │ │ │ ├── VaultWrap │ │ │ │ │ ├── Interface.ts │ │ │ │ │ ├── VaultBorrow.tsx │ │ │ │ │ ├── VaultJoin.tsx │ │ │ │ │ ├── VaultRepay.tsx │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── styled.ts │ │ │ │ │ └── utils.ts │ │ │ │ ├── WithdrawConfirm.tsx │ │ │ │ ├── WithdrawWrap.tsx │ │ │ │ ├── hook │ │ │ │ │ ├── BasicACoinPanelHook.tsx │ │ │ │ │ └── useAddressType.ts │ │ │ │ ├── index.ts │ │ │ │ └── tool │ │ │ │ │ ├── Dialogs.tsx │ │ │ │ │ ├── FeeList.tsx │ │ │ │ │ ├── Property.tsx │ │ │ │ │ ├── Refresh.tsx │ │ │ │ │ ├── SlippagePanel.tsx │ │ │ │ │ ├── ToolBarItems.tsx │ │ │ │ │ ├── TradeMenuList.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ └── tradePro │ │ │ │ ├── Interface.ts │ │ │ │ ├── hookCommon.tsx │ │ │ │ ├── index.ts │ │ │ │ ├── limitTrade.tsx │ │ │ │ ├── marketTrade.tsx │ │ │ │ └── stopLimitTrade.tsx │ │ ├── index.ts │ │ ├── react-app-env.d.ts │ │ ├── reportWebVitals.ts │ │ ├── setupTests.ts │ │ ├── sharedPages │ │ │ ├── VaultPage │ │ │ │ ├── components │ │ │ │ │ ├── DashBoardPanel.tsx │ │ │ │ │ ├── HomePanel.tsx │ │ │ │ │ ├── ModalWrap.tsx │ │ │ │ │ ├── TradePanel.tsx │ │ │ │ │ ├── VaultPageUI.tsx │ │ │ │ │ ├── VaultSwapView.tsx │ │ │ │ │ ├── modals.tsx │ │ │ │ │ └── useVaultSwapExtends.tsx │ │ │ │ ├── hooks │ │ │ │ │ ├── useModals.ts │ │ │ │ │ ├── useVaultDashBoard.tsx │ │ │ │ │ ├── useVaultMarket.ts │ │ │ │ │ ├── useVaultPage.ts │ │ │ │ │ └── useVaultSwap.ts │ │ │ │ ├── index.tsx │ │ │ │ ├── interface.ts │ │ │ │ └── utils.ts │ │ │ └── index.ts │ │ ├── static.ts │ │ ├── stores │ │ │ ├── index.ts │ │ │ └── reducer │ │ │ │ ├── modals │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ └── reducer.ts │ │ │ │ ├── settings │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ └── reducer.ts │ │ │ │ └── toggle │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ └── reducer.ts │ │ └── types │ │ │ └── lib.ts │ ├── tsconfig.json │ └── tsconfig.test.json ├── core │ ├── .babelrc │ ├── .eslintignore │ ├── .eslintrc.json │ ├── .gitignore │ ├── .travis.yml │ ├── README.md │ ├── package.json │ ├── rollup.config.js │ ├── src │ │ ├── TimeoutCheckProvider.tsx │ │ ├── abi │ │ │ ├── erc20ABI.ts │ │ │ ├── index.ts │ │ │ └── taikoDepositABI.ts │ │ ├── api_wrapper │ │ │ ├── index.ts │ │ │ └── wallet.ts │ │ ├── component │ │ │ ├── BtnConnect.tsx │ │ │ ├── NotificationItem.tsx │ │ │ ├── index.ts │ │ │ └── styled.ts │ │ ├── defs │ │ │ └── index.ts │ │ ├── hookConnect.tsx │ │ ├── hooks │ │ │ ├── common │ │ │ │ ├── index.ts │ │ │ │ ├── useAddrCheck.ts │ │ │ │ ├── useAllowances.ts │ │ │ │ ├── useBtnStatus.ts │ │ │ │ ├── useCollectionImport.ts │ │ │ │ ├── useCollectionManage.ts │ │ │ │ ├── useDebounce.ts │ │ │ │ ├── useGetOrderHistorys.ts │ │ │ │ ├── useHookBtn.ts │ │ │ │ ├── useInjectWeb3Modal.ts │ │ │ │ ├── useIsHebao.ts │ │ │ │ ├── useMarket.ts │ │ │ │ ├── useMyCollection.ts │ │ │ │ ├── useMyNFTCollection.ts │ │ │ │ ├── useNFT.tsx │ │ │ │ ├── useNotification.ts │ │ │ │ ├── usePairMatch.ts │ │ │ │ ├── useThrottle.ts │ │ │ │ ├── useToast.ts │ │ │ │ ├── useTrade.ts │ │ │ │ └── useUserWallets.ts │ │ │ ├── help │ │ │ │ ├── coinPairInit.ts │ │ │ │ ├── connectStatusCallback.tsx │ │ │ │ ├── formatPrice.ts │ │ │ │ ├── index.ts │ │ │ │ ├── makeCache.ts │ │ │ │ ├── makeDefiSideStaking.ts │ │ │ │ ├── makeDual.ts │ │ │ │ ├── makeInvest.ts │ │ │ │ ├── makeMarketTrend.ts │ │ │ │ ├── makeTickView.ts │ │ │ │ ├── makeUIAmmActivityMap.ts │ │ │ │ ├── makeWallet.ts │ │ │ │ ├── marketPairHelp.ts │ │ │ │ ├── marketRedPacket.ts │ │ │ │ ├── marketTable.ts │ │ │ │ ├── parseRabbitConfig.ts │ │ │ │ ├── providorConnect.ts │ │ │ │ ├── useAmmTotalValue.ts │ │ │ │ └── volumeToCount.ts │ │ │ ├── index.ts │ │ │ ├── rooters │ │ │ │ ├── index.ts │ │ │ │ └── useLocationChange.ts │ │ │ └── useractions │ │ │ │ ├── hookAmmCommon.ts │ │ │ │ ├── hookAmmExit.ts │ │ │ │ ├── hookAmmJoin.ts │ │ │ │ ├── hookSwap.ts │ │ │ │ ├── index.ts │ │ │ │ ├── useAccountModal.ts │ │ │ │ ├── useActiveAccount.ts │ │ │ │ ├── useBanxaConfirm.ts │ │ │ │ ├── useBtrade.ts │ │ │ │ ├── useCheckAccStatus.tsx │ │ │ │ ├── useClaimConfirm.ts │ │ │ │ ├── useCoinbaseWalletPassword.ts │ │ │ │ ├── useCollectionAdvanceMeta.ts │ │ │ │ ├── useContact.ts │ │ │ │ ├── useContactAdd.tsx │ │ │ │ ├── useCreateRedPacket.ts │ │ │ │ ├── useDefiTrade.ts │ │ │ │ ├── useDeposit.ts │ │ │ │ ├── useDualEdit.ts │ │ │ │ ├── useDualTrade.ts │ │ │ │ ├── useEditCollection.tsx │ │ │ │ ├── useExportAccount.ts │ │ │ │ ├── useForceWithdraw.ts │ │ │ │ ├── useNFTBurn.ts │ │ │ │ ├── useNFTDeploy.ts │ │ │ │ ├── useNFTDeposit.ts │ │ │ │ ├── useNFTMintAdvance.ts │ │ │ │ ├── useNFTTransfer.ts │ │ │ │ ├── useNFTWithdraw.ts │ │ │ │ ├── useRampConfirm.ts │ │ │ │ ├── useRedpacket.ts │ │ │ │ ├── useReset.ts │ │ │ │ ├── useStakeTrade.ts │ │ │ │ ├── useStakeTradeExit.ts │ │ │ │ ├── useStakingAprTrend.ts │ │ │ │ ├── useTaikoLock.ts │ │ │ │ ├── useTransfer.ts │ │ │ │ ├── useTransferToTaikoAccount.ts │ │ │ │ ├── useUpdateAccount.ts │ │ │ │ ├── useVendor.ts │ │ │ │ ├── useWithdraw.ts │ │ │ │ └── vault │ │ │ │ ├── index.ts │ │ │ │ ├── useAccountInfo.ts │ │ │ │ ├── useVaultBorrow.ts │ │ │ │ ├── useVaultJoin.ts │ │ │ │ ├── useVaultLoan.ts │ │ │ │ ├── useVaultRedeem.ts │ │ │ │ ├── useVaultRepay.ts │ │ │ │ └── utils.ts │ │ ├── index.ts │ │ ├── modal │ │ │ ├── AccountL1Modal │ │ │ │ ├── hook.tsx │ │ │ │ └── index.tsx │ │ │ ├── AccountModal │ │ │ │ ├── components │ │ │ │ │ ├── NFTDetail.tsx │ │ │ │ │ └── QRCodeScanner.tsx │ │ │ │ ├── hook.tsx │ │ │ │ └── index.tsx │ │ │ ├── AmmPoolModal │ │ │ │ ├── components │ │ │ │ │ ├── ammPanel.tsx │ │ │ │ │ ├── ammRecordPanel.tsx │ │ │ │ │ └── chartAndInfo.tsx │ │ │ │ ├── hooks.ts │ │ │ │ └── index.tsx │ │ │ ├── DualModal │ │ │ │ └── index.tsx │ │ │ ├── RedPacketModal │ │ │ │ ├── hook.tsx │ │ │ │ └── index.tsx │ │ │ ├── WalletModal │ │ │ │ └── index.tsx │ │ │ └── index.tsx │ │ ├── react-app-env.d.ts │ │ ├── reportWebVitals.ts │ │ ├── services │ │ │ ├── account │ │ │ │ ├── accountServices.ts │ │ │ │ ├── activateAccount.ts │ │ │ │ ├── checkAccount.ts │ │ │ │ ├── command.ts │ │ │ │ ├── index.ts │ │ │ │ ├── lockAccount.ts │ │ │ │ ├── networkUpdate.ts │ │ │ │ ├── resetAccount.ts │ │ │ │ ├── unlockAccount.ts │ │ │ │ └── useAccountHook.ts │ │ │ ├── banxa │ │ │ │ ├── banxaService.ts │ │ │ │ ├── index.tsx │ │ │ │ └── offFaitService.ts │ │ │ ├── claimServices │ │ │ │ ├── claimServices.ts │ │ │ │ └── index.ts │ │ │ ├── collectionServices │ │ │ │ ├── collectionService.ts │ │ │ │ └── index.ts │ │ │ ├── connect │ │ │ │ ├── index.ts │ │ │ │ └── useConnectHook.ts │ │ │ ├── depositServices │ │ │ │ ├── depositServices.ts │ │ │ │ └── index.ts │ │ │ ├── fee │ │ │ │ ├── index.ts │ │ │ │ └── useChargeFees.ts │ │ │ ├── index.ts │ │ │ ├── ipfs │ │ │ │ ├── index.ts │ │ │ │ ├── ipfsService.ts │ │ │ │ └── useIpfs.ts │ │ │ ├── mintServices │ │ │ │ ├── index.ts │ │ │ │ ├── mintService.ts │ │ │ │ ├── useNFTMeta.ts │ │ │ │ └── useNFTMint.ts │ │ │ ├── qrcodeServices │ │ │ │ ├── index.ts │ │ │ │ ├── qrCodeService.ts │ │ │ │ └── useQrcodeScan.ts │ │ │ ├── redpacket │ │ │ │ └── index.ts │ │ │ └── socket │ │ │ │ ├── hook │ │ │ │ ├── useL2CommonSocket.ts │ │ │ │ ├── useNotificationSocket.ts │ │ │ │ ├── useWalletLayer2Socket.ts │ │ │ │ └── useWalletLayer2WithNFTSocket.ts │ │ │ │ ├── index.ts │ │ │ │ ├── services │ │ │ │ ├── ammPoolService.ts │ │ │ │ ├── bookService.ts │ │ │ │ ├── btradeOrderbookService.ts │ │ │ │ ├── l2CommonService.ts │ │ │ │ ├── mixorderService.ts │ │ │ │ ├── mixtradeService.ts │ │ │ │ ├── notificationService.ts │ │ │ │ ├── orderbookService.ts │ │ │ │ ├── tickerService.ts │ │ │ │ ├── tradeService.ts │ │ │ │ └── walletLayer2Service.ts │ │ │ │ └── socketUtil.ts │ │ ├── storage │ │ │ └── index.ts │ │ ├── stores │ │ │ ├── Amm │ │ │ │ ├── AmmActivityMap │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ ├── reducer.ts │ │ │ │ │ └── saga.ts │ │ │ │ ├── AmmMap │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ ├── reducer.ts │ │ │ │ │ └── saga.ts │ │ │ │ └── index.ts │ │ │ ├── account │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── amount │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── config │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ └── reducer.ts │ │ │ ├── contacts │ │ │ │ ├── hooks.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── global │ │ │ │ └── actions.ts │ │ │ ├── index.ts │ │ │ ├── invest │ │ │ │ ├── BtradeMap │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ ├── reducer.ts │ │ │ │ │ └── saga.ts │ │ │ │ ├── DefiMap │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ ├── reducer.ts │ │ │ │ │ └── saga.ts │ │ │ │ ├── DualMap │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ ├── reducer.ts │ │ │ │ │ └── saga.ts │ │ │ │ ├── InvestTokenTypeMap │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ ├── reducer.ts │ │ │ │ │ └── saga.ts │ │ │ │ ├── StakingMap │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ ├── reducer.ts │ │ │ │ │ └── saga.ts │ │ │ │ ├── VaultMap │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ ├── reducer.ts │ │ │ │ │ └── saga.ts │ │ │ │ ├── VaultTicker │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ ├── reducer.ts │ │ │ │ │ └── saga.ts │ │ │ │ └── index.ts │ │ │ ├── localStore │ │ │ │ ├── coinbaseSmartWalletPersist │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── confirmation │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── favoriteMarket │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── favoriteVaultMarket │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── index.ts │ │ │ │ ├── layer1Store │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── reducer.ts │ │ │ │ │ └── saga.ts │ │ │ │ ├── nftRefresh │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── offRamp │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── onchainHashInfo │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── redPacket │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── tradeProSettings │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ │ └── walletInfo │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ ├── notify │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── redPacket │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── rootSaga.ts │ │ │ ├── router │ │ │ │ ├── amm │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── index.ts │ │ │ │ ├── modals │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── tradeBtrade │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── tradeDefi │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── tradeDual │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── tradeLite │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── tradePro │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ │ ├── tradeStake │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ │ └── tradeVault │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interface.ts │ │ │ │ │ └── reducer.ts │ │ │ ├── socket │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── system │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── targetRedpackt │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── ticker │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── token │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── tokenPrices │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── userRewards │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── vaultLayer2 │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── walletL2Collection │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── walletL2NFTCollection │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── walletLayer1 │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ ├── walletLayer2 │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ │ └── walletLayer2NFT │ │ │ │ ├── hook.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interface.ts │ │ │ │ ├── reducer.ts │ │ │ │ └── saga.ts │ │ ├── types.d.ts │ │ └── utils │ │ │ ├── .gitignore │ │ │ ├── AESMd5.ts │ │ │ ├── address.ts │ │ │ ├── addressTypeMap.ts │ │ │ ├── calculation.ts │ │ │ ├── coinbaseSmartWallet.ts │ │ │ ├── decimal.ts │ │ │ ├── dt_tools.ts │ │ │ ├── feeInfo.ts │ │ │ ├── formatter_tool.ts │ │ │ ├── genAvatar.ts │ │ │ ├── getStateFnState.ts │ │ │ ├── index.ts │ │ │ ├── makeMeta.ts │ │ │ ├── numberFormat.ts │ │ │ ├── promise.ts │ │ │ ├── readFileQrcode.ts │ │ │ ├── retry.ts │ │ │ ├── swap_utils.ts │ │ │ ├── tryFn.ts │ │ │ ├── validation.ts │ │ │ ├── waitForTx.ts │ │ │ └── web3_tools.ts │ ├── tsconfig.json │ └── tsconfig.test.json ├── web-bridge │ ├── .babelrc │ ├── .env.production │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── craco.config.js │ ├── electron-builder.env │ ├── generate-react-cli.json │ ├── jest.config.js │ ├── jest.setup.js │ ├── package.json │ ├── public │ │ ├── 363123_2_0.ttf │ │ ├── electron.js │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── manifest.json │ │ └── robots.txt │ ├── src │ │ ├── App.tsx │ │ ├── hook.ts │ │ ├── hookAccountInit.ts │ │ ├── index.tsx │ │ ├── layouts │ │ │ ├── footer │ │ │ │ └── index.tsx │ │ │ └── header │ │ │ │ ├── hook.tsx │ │ │ │ └── index.tsx │ │ ├── pages │ │ │ ├── DepositPage │ │ │ │ └── index.tsx │ │ │ ├── ErrorPage │ │ │ │ └── index.tsx │ │ │ └── LoadingPage │ │ │ │ └── index.tsx │ │ ├── react-app-env.d.ts │ │ ├── reportWebVitals.ts │ │ ├── routers │ │ │ └── index.tsx │ │ ├── setupTests.ts │ │ └── types.d.ts │ └── tsconfig.json ├── web-developer │ └── public │ │ ├── 363123_2_0.ttf │ │ ├── apple-touch-icon-precomposed.png │ │ ├── apple-touch-icon.png │ │ ├── badge.xml │ │ ├── browserconfig.xml │ │ ├── dark.css │ │ ├── developer.css │ │ ├── developer.css.map │ │ ├── developer.js │ │ ├── developer.scss │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-48x48.png │ │ ├── favicon.ico │ │ ├── favicon.png │ │ ├── footer.jsx │ │ ├── index.html │ │ ├── light.css │ │ ├── logo192.png │ │ ├── loopring.svg │ │ ├── loopringWhite.png │ │ ├── manifest.json │ │ ├── reset.css │ │ ├── robots.txt │ │ └── vercel.json ├── web-earn │ ├── .babelrc │ ├── .env.production │ ├── .eslintrc.json │ ├── .gitignore │ ├── ADD_NEW_CHAIN.md │ ├── README.md │ ├── craco.config.js │ ├── electron-builder.env │ ├── generate-react-cli.json │ ├── jest.config.js │ ├── jest.setup.js │ ├── package.json │ ├── public │ │ ├── 363123_2_0.ttf │ │ ├── apple-touch-icon-precomposed.png │ │ ├── apple-touch-icon.png │ │ ├── badge.xml │ │ ├── browserconfig.xml │ │ ├── electron.js │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-48x48.png │ │ ├── favicon.ico │ │ ├── favicon.png │ │ ├── index.html │ │ ├── logo192.png │ │ ├── loopring.svg │ │ ├── loopringWhite.png │ │ ├── manifest.json │ │ └── robots.txt │ ├── src │ │ ├── App.tsx │ │ ├── constant │ │ │ ├── index.ts │ │ │ ├── router.ts │ │ │ └── setting.ts │ │ ├── hook.ts │ │ ├── hookAccountInit.ts │ │ ├── index.tsx │ │ ├── layouts │ │ │ ├── footer │ │ │ │ └── index.tsx │ │ │ └── header │ │ │ │ ├── hook.tsx │ │ │ │ └── index.tsx │ │ ├── pages │ │ │ ├── AssetPage │ │ │ │ ├── AssetPanel │ │ │ │ │ ├── hook.ts │ │ │ │ │ └── index.tsx │ │ │ │ ├── HistoryPanel │ │ │ │ │ ├── hooks.ts │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── useDualAsset.tsx │ │ │ │ ├── RewardsPanel │ │ │ │ │ ├── hook.ts │ │ │ │ │ └── index.tsx │ │ │ │ └── index.tsx │ │ │ ├── BtradeSwapPage │ │ │ │ └── index.tsx │ │ │ ├── EarnPage │ │ │ │ └── index.tsx │ │ │ ├── ErrorPage │ │ │ │ └── index.tsx │ │ │ ├── IntroPage │ │ │ │ └── index.tsx │ │ │ ├── InvestPage │ │ │ │ ├── DeFiPanel │ │ │ │ │ ├── DeFiTradePanel.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── DualPanel │ │ │ │ │ ├── BeginnerMode.tsx │ │ │ │ │ ├── ChooseDualType.tsx │ │ │ │ │ ├── DualListPanel.tsx │ │ │ │ │ └── hook.ts │ │ │ │ ├── LeverageETHPanel │ │ │ │ │ ├── TradePanel.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── MyLiquidityPanel │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── interface.ts │ │ │ │ ├── OverviewPanel │ │ │ │ │ ├── hook.ts │ │ │ │ │ └── index.tsx │ │ │ │ ├── PoolsPanel │ │ │ │ │ ├── hook.ts │ │ │ │ │ └── index.tsx │ │ │ │ └── index.tsx │ │ │ ├── Layer2Page │ │ │ │ ├── ContactPanel │ │ │ │ │ ├── delete.tsx │ │ │ │ │ ├── history.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── ForcewithdrawPanel │ │ │ │ │ └── index.tsx │ │ │ │ ├── ReferralRewardsPanel │ │ │ │ │ ├── hook.ts │ │ │ │ │ └── index.tsx │ │ │ │ ├── SecurityPanel │ │ │ │ │ ├── hook.ts │ │ │ │ │ └── index.tsx │ │ │ │ ├── VipPanel │ │ │ │ │ ├── hooks.ts │ │ │ │ │ └── index.tsx │ │ │ │ └── index.tsx │ │ │ ├── LoadingPage │ │ │ │ └── index.tsx │ │ │ ├── MarkdownPage │ │ │ │ ├── index.tsx │ │ │ │ ├── investMarkdown.tsx │ │ │ │ └── notifyMarkdown.tsx │ │ │ ├── QuotePage │ │ │ │ ├── hook.ts │ │ │ │ ├── index.tsx │ │ │ │ └── useMaket.ts │ │ │ ├── TaikoLockPage │ │ │ │ ├── BannerPage.tsx │ │ │ │ ├── LogInToCleanLrTaiko.tsx │ │ │ │ ├── MintRedeemModal.tsx │ │ │ │ ├── PendingTxsModal.tsx │ │ │ │ ├── TaikoLockInput.tsx │ │ │ │ ├── TxSubmitModal.tsx │ │ │ │ └── index.tsx │ │ │ └── TradeRacePage │ │ │ │ ├── hook.ts │ │ │ │ ├── index.tsx │ │ │ │ ├── interface.ts │ │ │ │ ├── rank.tsx │ │ │ │ └── snow.css │ │ ├── react-app-env.d.ts │ │ ├── reportWebVitals.ts │ │ ├── routers │ │ │ └── index.tsx │ │ ├── setupTests.ts │ │ └── types.d.ts │ └── tsconfig.json ├── web-guardian │ ├── .babelrc │ ├── .env.production │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── craco.config.js │ ├── electron-builder.env │ ├── generate-react-cli.json │ ├── jest.config.js │ ├── jest.setup.js │ ├── package.json │ ├── public │ │ ├── 363123_2_0.ttf │ │ ├── electron.js │ │ ├── index.html │ │ ├── manifest.json │ │ └── robots.txt │ ├── src │ │ ├── App.tsx │ │ ├── common.ts │ │ ├── hook.ts │ │ ├── hookAccountInit.ts │ │ ├── index.tsx │ │ ├── layouts │ │ │ ├── footer │ │ │ │ └── index.tsx │ │ │ └── header │ │ │ │ ├── hook.tsx │ │ │ │ └── index.tsx │ │ ├── pages │ │ │ ├── ErrorPage │ │ │ │ └── index.tsx │ │ │ ├── LoadingPage │ │ │ │ └── index.tsx │ │ │ └── WalletPage │ │ │ │ ├── GuardianModal.tsx │ │ │ │ ├── WalletHistory.tsx │ │ │ │ ├── WalletProtector.tsx │ │ │ │ ├── WalletValidationInfo.tsx │ │ │ │ ├── hook.ts │ │ │ │ ├── index.tsx │ │ │ │ ├── modal │ │ │ │ └── index.tsx │ │ │ │ └── utils.ts │ │ ├── react-app-env.d.ts │ │ ├── reportWebVitals.ts │ │ ├── routers │ │ │ └── index.tsx │ │ ├── setupTests.ts │ │ └── types.d.ts │ └── tsconfig.json ├── web-home.zip ├── web-wallet │ └── public │ │ ├── 363123_2_0.ttf │ │ ├── apple-touch-icon-precomposed.png │ │ ├── apple-touch-icon.png │ │ ├── badge.xml │ │ ├── browserconfig.xml │ │ ├── electron.js │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-48x48.png │ │ ├── favicon.ico │ │ ├── favicon.png │ │ ├── footer.jsx │ │ ├── index.html │ │ ├── logo192.png │ │ ├── loopring.svg │ │ ├── loopringWhite.png │ │ ├── manifest.json │ │ ├── reset.css │ │ ├── robots.txt │ │ ├── wallet.css │ │ ├── wallet.js │ │ ├── wallet.scss │ │ ├── wallet_dark.css │ │ └── wallet_light.css └── webapp │ ├── .babelrc │ ├── .env.production │ ├── .eslintrc.json │ ├── .gitignore │ ├── ADD_NEW_CHAIN.md │ ├── README.md │ ├── craco.config.js │ ├── electron-builder.env │ ├── generate-react-cli.json │ ├── jest.config.js │ ├── jest.setup.js │ ├── package.json │ ├── public │ ├── 363123_2_0.ttf │ ├── NFT.webp │ ├── Redpack.webp │ ├── apple-touch-icon-precomposed.png │ ├── apple-touch-icon.png │ ├── badge.xml │ ├── bg-2.webp │ ├── bgio.webp │ ├── bgpro-dark.webp │ ├── bgpro-light.webp │ ├── browserconfig.xml │ ├── desktop_dark.webp │ ├── desktop_light.webp │ ├── electron.js │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon-48x48.png │ ├── favicon.ico │ ├── favicon.png │ ├── index.html │ ├── logo192.png │ ├── loopring.svg │ ├── loopringWhite.png │ ├── manifest.json │ ├── mobile_dark.webp │ ├── mobile_light.webp │ └── robots.txt │ ├── src │ ├── App.tsx │ ├── hook.ts │ ├── hookAccountInit.ts │ ├── index.tsx │ ├── layouts │ │ ├── footer │ │ │ └── index.tsx │ │ └── header │ │ │ ├── hook.tsx │ │ │ └── index.tsx │ ├── pages │ │ ├── AssetPage │ │ │ ├── AssetPanel │ │ │ │ ├── hook.ts │ │ │ │ └── index.tsx │ │ │ ├── HistoryPanel │ │ │ │ ├── hooks.ts │ │ │ │ ├── index.tsx │ │ │ │ └── useDualAsset.tsx │ │ │ ├── RewardsPanel │ │ │ │ ├── hook.ts │ │ │ │ └── index.tsx │ │ │ └── index.tsx │ │ ├── BtradeSwapPage │ │ │ └── index.tsx │ │ ├── ErrorPage │ │ │ └── index.tsx │ │ ├── FiatPage │ │ │ └── index.tsx │ │ ├── InvestPage │ │ │ ├── DeFiPanel │ │ │ │ ├── DeFiTradePanel.tsx │ │ │ │ └── index.tsx │ │ │ ├── DualPanel │ │ │ │ ├── BeginnerMode.tsx │ │ │ │ ├── ChooseDualType.tsx │ │ │ │ ├── DualListPanel.tsx │ │ │ │ └── hook.tsx │ │ │ ├── LeverageETHPanel │ │ │ │ ├── TradePanel.tsx │ │ │ │ └── index.tsx │ │ │ ├── MyLiquidityPanel │ │ │ │ ├── hook.ts │ │ │ │ ├── index.tsx │ │ │ │ └── interface.ts │ │ │ ├── OverviewPanel │ │ │ │ ├── hook.ts │ │ │ │ └── index.tsx │ │ │ ├── PoolsPanel │ │ │ │ ├── hook.ts │ │ │ │ └── index.tsx │ │ │ ├── StakePanel │ │ │ │ └── StackTradePanel.tsx │ │ │ └── index.tsx │ │ ├── LandPage │ │ │ ├── Card.tsx │ │ │ ├── HomePage.tsx │ │ │ ├── LandPage.tsx │ │ │ ├── WalletPage.tsx │ │ │ ├── coins.json │ │ │ ├── index.ts │ │ │ └── style.tsx │ │ ├── Layer2Page │ │ │ ├── ContactPanel │ │ │ │ ├── delete.tsx │ │ │ │ ├── history.tsx │ │ │ │ └── index.tsx │ │ │ ├── ForcewithdrawPanel │ │ │ │ └── index.tsx │ │ │ ├── Notification │ │ │ │ ├── hook.ts │ │ │ │ └── index.tsx │ │ │ ├── ReferralRewardsPanel │ │ │ │ ├── hook.ts │ │ │ │ └── index.tsx │ │ │ ├── SecurityPanel │ │ │ │ ├── hook.ts │ │ │ │ └── index.tsx │ │ │ ├── VipPanel │ │ │ │ ├── hooks.ts │ │ │ │ └── index.tsx │ │ │ └── index.tsx │ │ ├── LoadingPage │ │ │ └── index.tsx │ │ ├── MarkdownPage │ │ │ ├── index.tsx │ │ │ ├── investMarkdown.tsx │ │ │ └── notifyMarkdown.tsx │ │ ├── MiningPage │ │ │ ├── hook.ts │ │ │ └── index.tsx │ │ ├── NFTPage │ │ │ ├── CollectionPanel │ │ │ │ └── index.tsx │ │ │ ├── EditCollectionPanel │ │ │ │ ├── hook.ts │ │ │ │ └── index.tsx │ │ │ ├── ImportCollectionPanel │ │ │ │ ├── CollectionManage.tsx │ │ │ │ ├── ImportCollection.tsx │ │ │ │ └── index.tsx │ │ │ ├── MintNFTPanel │ │ │ │ ├── hook.ts │ │ │ │ ├── index.tsx │ │ │ │ └── metaNFTPanel.tsx │ │ │ ├── MyNFT │ │ │ │ ├── MyNFTCollectionList.tsx │ │ │ │ ├── MyNFTList.tsx │ │ │ │ ├── index.tsx │ │ │ │ └── useMyNFT.ts │ │ │ ├── NFTDeposit │ │ │ │ └── index.tsx │ │ │ ├── NFThistory │ │ │ │ ├── hookHistory.ts │ │ │ │ └── index.tsx │ │ │ ├── components │ │ │ │ ├── CollectionItemPanel.tsx │ │ │ │ ├── landingPanel.tsx │ │ │ │ ├── titleNFTMobile.tsx │ │ │ │ └── usePublicNFTs.ts │ │ │ └── index.tsx │ │ ├── ProTradePage │ │ │ ├── hookPro.ts │ │ │ ├── index.tsx │ │ │ ├── panel │ │ │ │ ├── chart │ │ │ │ │ ├── hook.ts │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── klineConfig.ts │ │ │ │ ├── index.ts │ │ │ │ ├── market │ │ │ │ │ └── index.tsx │ │ │ │ ├── orderTable │ │ │ │ │ └── index.tsx │ │ │ │ ├── spot │ │ │ │ │ ├── hookLimit.ts │ │ │ │ │ ├── hookMarket.ts │ │ │ │ │ ├── hookStopLimit.ts │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── stopLimit.tsx │ │ │ │ ├── toolbar │ │ │ │ │ ├── hook.ts │ │ │ │ │ └── index.tsx │ │ │ │ └── walletInfo │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── stopLimitInfo.tsx │ │ │ ├── proService.ts │ │ │ └── stopLimtPage.tsx │ │ ├── QuotePage │ │ │ ├── hook.ts │ │ │ ├── index.tsx │ │ │ └── useMaket.ts │ │ ├── RedPacketPage │ │ │ ├── CreateRedPacketPanel │ │ │ │ └── index.tsx │ │ │ ├── MyRedPacketPanel │ │ │ │ ├── hooks.ts │ │ │ │ └── index.tsx │ │ │ ├── RedPacketClaimPanel │ │ │ │ ├── hooks.ts │ │ │ │ └── index.tsx │ │ │ ├── RedPacketMarketPanel │ │ │ │ ├── hooks.ts │ │ │ │ └── index.tsx │ │ │ └── index.tsx │ │ ├── SwapPage │ │ │ └── index.tsx │ │ └── TradeRacePage │ │ │ ├── hook.ts │ │ │ ├── index.tsx │ │ │ ├── interface.ts │ │ │ ├── rank.tsx │ │ │ └── snow.css │ ├── react-app-env.d.ts │ ├── reportWebVitals.ts │ ├── routers │ │ └── index.tsx │ ├── setupTests.ts │ └── types.d.ts │ └── tsconfig.json ├── tsconfig.build.json ├── tsconfig.json └── yarn.lock /.prettierignore: -------------------------------------------------------------------------------- 1 | # Ignore artifacts: 2 | .idea/** 3 | .vscode/** 4 | /node_modules 5 | **/dist 6 | **/build 7 | **/node_modules 8 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "tabWidth": 2, 4 | "printWidth": 100, 5 | "singleQuote": true, 6 | "trailingComma": "all", 7 | "jsxSingleQuote": true, 8 | "bracketSpacing": true 9 | } 10 | -------------------------------------------------------------------------------- /.yarnclean: -------------------------------------------------------------------------------- 1 | # test directories 2 | __tests__ 3 | test 4 | tests 5 | powered-test 6 | 7 | # test exceptions 8 | !**/viem/**/test 9 | !**/viem/**/test/** 10 | 11 | # asset directories 12 | docs 13 | doc 14 | website 15 | images 16 | # assets 17 | 18 | # examples 19 | example 20 | examples 21 | 22 | # code coverage directories 23 | coverage 24 | .nyc_output 25 | 26 | # build scripts 27 | Makefile 28 | Gulpfile.js 29 | Gruntfile.js 30 | 31 | # configs 32 | appveyor.yml 33 | circle.yml 34 | codeship-services.yml 35 | codeship-steps.yml 36 | wercker.yml 37 | .tern-project 38 | .gitattributes 39 | .editorconfig 40 | .*ignore 41 | .eslintrc 42 | .jshintrc 43 | .flowconfig 44 | .documentup.json 45 | .yarn-metadata.json 46 | .travis.yml 47 | 48 | # misc 49 | *.md 50 | 51 | !@storybook/react/dist/esm/client/docs -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | sass_binary_site "https://npm.taobao.org/mirrors/node-sass/" 2 | phantomjs_cdnurl "https://npm.taobao.org/mirrors/phantomjs/" 3 | electron_mirror "https://npm.taobao.org/mirrors/electron/" 4 | electron_builder_binaries_mirror "https://mirrors.huaweicloud.com/electron-builder-binaries/" 5 | 6 | #registry "https://registry.npm.taobao.org" 7 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "independent", 3 | "npmClient": "yarn", 4 | "command": { 5 | "publish": { 6 | "ignoreChanges": [ 7 | "*.md" 8 | ] 9 | } 10 | }, 11 | "useWorkspaces": true, 12 | "packages": [ 13 | "packages/*" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/common-resources/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/typescript", 4 | [ 5 | "@babel/env", 6 | { 7 | "modules": false 8 | } 9 | ] 10 | ], 11 | "plugins": [ 12 | "@babel/plugin-proposal-class-properties" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/common-resources/assets/coin/loopring_431f2ed4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/assets/coin/loopring_431f2ed4.png -------------------------------------------------------------------------------- /packages/common-resources/assets/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/assets/loading-1.gif -------------------------------------------------------------------------------- /packages/common-resources/assets/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/assets/loading.gif -------------------------------------------------------------------------------- /packages/common-resources/index.ts: -------------------------------------------------------------------------------- 1 | export * from './static-resources' 2 | -------------------------------------------------------------------------------- /packages/common-resources/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@loopring-web/common-resources", 3 | "version": "1.0.0", 4 | "description": "Common package for code sharing", 5 | "main": "index.ts", 6 | "build": { 7 | "files": [ 8 | "build/**/*", 9 | "node_modules/**/*" 10 | ], 11 | "publish": { 12 | "provider": "custom", 13 | "repo": "https://github.com/Loopring/loopring-web-v2", 14 | "owner": "Loopring Dev Team" 15 | } 16 | }, 17 | "scripts": { 18 | "compile": "tsc -p tsconfig.json", 19 | "build": "tsdx build", 20 | "prepublishOnly": "NODE_ENV=production tsdx build" 21 | }, 22 | "devDependencies": { 23 | "tsc": "^2.0.4" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/common-resources/scripts/.gitignore: -------------------------------------------------------------------------------- 1 | output* 2 | *.zip 3 | *.rar 4 | *.tar* 5 | -------------------------------------------------------------------------------- /packages/common-resources/scripts/READMD.md: -------------------------------------------------------------------------------- 1 | require python 3.7+ 2 | 3 | pip install -r requirements.txt 4 | -------------------------------------------------------------------------------- /packages/common-resources/scripts/requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.24.0 2 | eth_utils==1.10.0 3 | pillow==8.3.2 4 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/index.ts: -------------------------------------------------------------------------------- 1 | import i18n from './src/i18n' 2 | export { i18n } 3 | export * from './src/svg' 4 | export * from './src/i18n' 5 | export * from './src/error' 6 | export * from './src/themes' 7 | export * from './src/constant' 8 | export * from './src/loopring-interface' 9 | export * from './src/utils' 10 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/constant/chart.ts: -------------------------------------------------------------------------------- 1 | export enum ChartType { 2 | Depth = 'Depth', 3 | Trend = 'Trend', 4 | Kline = 'Kline', 5 | } 6 | 7 | export enum ChartUnit { 8 | W1 = '1W', 9 | H1 = '1H', 10 | D1 = '1D', 11 | } 12 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/constant/firebase.ts: -------------------------------------------------------------------------------- 1 | export const firebaseIOConfig = { 2 | apiKey: 'AIzaSyC484SNh-OZWco7o1xUC4UGVGVf0yZU__s', 3 | authDomain: 'loopring-d0829.firebaseapp.com', 4 | projectId: 'loopring-d0829', 5 | storageBucket: 'loopring-d0829.appspot.com', 6 | messagingSenderId: '372617031978', 7 | appId: '1:372617031978:web:15a3f35c4adbd679dc6e53', 8 | measurementId: 'G-5TWTDQ8J7J', 9 | } 10 | 11 | export const firebaseBridgeConfig = { 12 | apiKey: 'AIzaSyC484SNh-OZWco7o1xUC4UGVGVf0yZU__s', 13 | authDomain: 'loopring-d0829.firebaseapp.com', 14 | projectId: 'loopring-d0829', 15 | storageBucket: 'loopring-d0829.appspot.com', 16 | messagingSenderId: '372617031978', 17 | appId: '1:372617031978:web:bcc50f63d79ef868dc6e53', 18 | measurementId: 'G-P4XEJ3CY0J', 19 | } 20 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/constant/index.ts: -------------------------------------------------------------------------------- 1 | export * from './walletConnector' 2 | export * from './setting' 3 | export * from './market' 4 | export * from './chart' 5 | export * from './trade' 6 | export * from './router' 7 | export * from './table' 8 | export * from './loopring' 9 | 10 | export * from './account' 11 | export * from './sagaStatus' 12 | export * from './proLayout' 13 | export * from './miningOuterLinks' 14 | export * from './notification' 15 | export * from './vendor' 16 | export * from './firebase' 17 | export * from './social' 18 | export { SUPPORTING_NETWORKS } from './networks' 19 | export { WITHDRAW_TOKEN_FILTER_LIST, mapSpecialTokenName } from './tokenConfig' 20 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/constant/market.ts: -------------------------------------------------------------------------------- 1 | export enum FloatTag { 2 | increase = 'increase', 3 | decrease = 'decrease', 4 | none = 'none', 5 | } 6 | 7 | export type MarketType = `${string}-${string}` 8 | export type AMMMarketType = `AMM-${string}-${string}` 9 | export type LPTokenType = `LP-${string}-${string}` 10 | 11 | export const PrecisionTree = { 12 | 1: '0.1', 13 | 2: '0.01', 14 | 3: '0.001', 15 | 4: '0.0001', 16 | 5: '0.00001', 17 | 6: '0.000001', 18 | 7: '0.0000001', 19 | 8: '0.00000001', 20 | 9: '0.000000001', 21 | 10: '0.0000000001', 22 | 11: '0.00000000001', 23 | 12: '0.000000000001', 24 | } 25 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/constant/miningOuterLinks.ts: -------------------------------------------------------------------------------- 1 | export const getMiningLinkList = (lan: string) => { 2 | if (lan === 'cn') { 3 | lan = 'zh' 4 | } 5 | return { 6 | 'BCDT-ETH': `https://loopring.io/#/embed/amm_mining_14_${lan}`, 7 | 'USDC-USDT': `https://loopring.io/#/embed/orderbook_mining_24_${lan}`, 8 | 'BKT-USDT': `https://loopring.io/#/embed/orderbook_mining_24_${lan}`, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/constant/networks.ts: -------------------------------------------------------------------------------- 1 | 2 | export const SUPPORTING_NETWORKS = process.env.REACT_APP_CHAIN_IDS!.split(',') 3 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/constant/sagaStatus.ts: -------------------------------------------------------------------------------- 1 | import { ErrorObject } from '../error' 2 | 3 | export enum SagaStatus { 4 | UNSET = 'UNSET', 5 | PENDING = 'PENDING', 6 | ERROR = 'ERROR', // success failed timeout is Done 7 | DONE = 'DONE', // success failed timeout is Done 8 | } 9 | 10 | export type StateBase = { 11 | status: SagaStatus 12 | errorMessage?: ErrorObject | null 13 | } 14 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/constant/table.ts: -------------------------------------------------------------------------------- 1 | export enum TableType { 2 | filter = 'filter', 3 | page = 'page', 4 | } 5 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/constant/tokenConfig.ts: -------------------------------------------------------------------------------- 1 | const SPECIAL_TOKEN_NAME_MAP = new Map( 2 | [ 3 | ['LRTAIKO', 'lrTAIKO'], 4 | ] 5 | ); 6 | 7 | 8 | export const WITHDRAW_TOKEN_FILTER_LIST = ['LRTAIKO'] 9 | 10 | export const mapSpecialTokenName = (original: string) => { 11 | return SPECIAL_TOKEN_NAME_MAP.get(original) || original 12 | } -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/i18n/en_US/index.ts: -------------------------------------------------------------------------------- 1 | import common from './common' 2 | import layout from './layout' 3 | import tables from './tables' 4 | import error from './error' 5 | import landPage from './landPage' 6 | import webEarn from './webEarn' 7 | export default { 8 | common, 9 | layout, 10 | tables, 11 | error, 12 | landPage, 13 | webEarn 14 | } 15 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/i18n/zh_CN/index.ts: -------------------------------------------------------------------------------- 1 | import common from './common' 2 | import layout from './layout' 3 | import tables from './tables' 4 | import error from './error' 5 | import landPage from './landPage' 6 | import webEarn from './webEarn' 7 | export default { 8 | common, 9 | layout, 10 | tables, 11 | error, 12 | landPage, 13 | webEarn 14 | } 15 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/loopring-interface/FooterInterface.ts: -------------------------------------------------------------------------------- 1 | export type FooterInterface = { 2 | linkName: string 3 | linkHref: string 4 | } 5 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/loopring-interface/HeaderInterface.ts: -------------------------------------------------------------------------------- 1 | export enum HeaderMenuTabStatus { 2 | hidden = 'hidden', 3 | disabled = 'disabled', 4 | default = 'default', 5 | } 6 | 7 | export interface HeaderMenuItemInterface { 8 | label: { 9 | icon?: any 10 | id: string 11 | style?: any 12 | description?: string 13 | i18nKey: string 14 | } 15 | handleListKeyDown?: (props?: any) => void 16 | child?: Array | { [key: string]: Array } 17 | router?: { path: string; [key: string]: any; pathName?: string } 18 | status?: keyof typeof HeaderMenuTabStatus 19 | extender?: JSX.Element | undefined 20 | logo?: { 21 | dark: string 22 | light: string 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/loopring-interface/Investment.ts: -------------------------------------------------------------------------------- 1 | import { InvestMapType } from '../constant' 2 | 3 | export type InvestAdvice = { 4 | type: InvestMapType 5 | banner: string 6 | titleI18n: string 7 | desI18n: string 8 | router: string 9 | notification: string 10 | enable: boolean 11 | project?: string 12 | market?: string 13 | } 14 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/loopring-interface/VendorInterface.ts: -------------------------------------------------------------------------------- 1 | import { VendorProviders } from '../constant/vendor' 2 | import { TradeBtnStatus } from '../constant' 3 | 4 | export interface VendorItem { 5 | key: VendorProviders 6 | svgIcon: string 7 | flag?: { 8 | startDate: number 9 | endDate: number 10 | tag?: string 11 | highLight?: string 12 | } 13 | btnStatus?: TradeBtnStatus 14 | handleSelect?: (event?: React.MouseEvent) => void 15 | } 16 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/loopring-interface/WallectInterface.ts: -------------------------------------------------------------------------------- 1 | import { ConnectProviders } from '@loopring-web/web3-provider' 2 | 3 | export enum WalletStatus { 4 | disabled = 'disabled', 5 | loading = 'loading', 6 | unlock = 'unlock', 7 | connect = 'connect', 8 | noAccount = 'noAccount', 9 | accountPending = 'accountPending', 10 | noNetwork = 'noNetwork', 11 | default = 'default', 12 | } 13 | 14 | export interface GatewayItem { 15 | key: keyof typeof ConnectProviders 16 | keyi18n: string 17 | imgSrc: string 18 | handleSelect?: (event?: React.MouseEvent) => void 19 | } 20 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/loopring-interface/index.ts: -------------------------------------------------------------------------------- 1 | export * from './CoinInterface' 2 | export * from './HeaderInterface' 3 | export * from './WallectInterface' 4 | export * from './VendorInterface' 5 | export * from './FooterInterface' 6 | export * from './Investment' 7 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/svg/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Icon' 2 | export * from './dropdownLogo' 3 | export * from './earnLogo' 4 | export * from './redPacketSvg' 5 | export * from './shareReferral' 6 | export * from './network' 7 | export * from './redPacketScope' 8 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_0_0.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_0_0.eot -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_0_0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_0_0.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_0_0.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_0_0.woff -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_0_0.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_0_0.woff2 -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_1_0.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_1_0.eot -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_1_0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_1_0.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_1_0.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_1_0.woff -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_1_0.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_1_0.woff2 -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_2_0.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_2_0.eot -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_2_0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_2_0.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_2_0.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_2_0.woff -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_2_0.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/DINCondensed/363123_2_0.woff2 -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Gilroy-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Gilroy-Medium.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Inter-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Inter-Medium.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Black.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-BlackItalic.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Bold.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-BoldItalic.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-ExtraBold.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-ExtraLight.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-ExtraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-ExtraLightItalic.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Italic.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Light.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-LightItalic.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Medium.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-MediumItalic.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Regular.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-SemiBold.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-Thin.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/common-resources/static-resources/src/themes/fonts/english/Montserrat/Montserrat-ThinItalic.ttf -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/themes/globalSetup.ts: -------------------------------------------------------------------------------- 1 | export const globalSetup = Object.freeze({ 2 | wait: 100, 3 | throttleWait: 3000, 4 | }) 5 | 6 | export const FORMAT_STRING_LEN = 10 7 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './types' 2 | export * from './util' 3 | export * from './log_tools' 4 | export * from './format_tools' 5 | export * from './obj_tools' 6 | export * from './makeDom' 7 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/utils/log_tools.ts: -------------------------------------------------------------------------------- 1 | let _myLog 2 | // @ts-ignore 3 | if (process.env.NODE_ENV !== 'production' || window?.___OhTrustDebugger___) { 4 | _myLog = console.log 5 | } else { 6 | // @ts-ignore 7 | _myLog = function (message?: any, ...optionalParams: any[]) {} 8 | } 9 | let _myError 10 | // @ts-ignore 11 | if (process.env.NODE_ENV !== 'production' || window?.___OhTrustDebugger___) { 12 | _myError = console.error 13 | } else { 14 | // @ts-ignore 15 | _myError = function (message?: any, ...optionalParams: any[]) {} 16 | } 17 | export const setMyLog = (___OhTrustDebugger___: boolean) => { 18 | if (___OhTrustDebugger___) { 19 | _myLog = console.log 20 | } 21 | } 22 | export const myLog = _myLog 23 | export const myError = _myError 24 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/utils/makeDom.ts: -------------------------------------------------------------------------------- 1 | export const htmlDecode = (input: string) => { 2 | const doc = new DOMParser().parseFromString(input, 'text/html')?.documentElement?.textContent 3 | return doc ?? '' 4 | } 5 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/utils/obj_tools.ts: -------------------------------------------------------------------------------- 1 | import { myLog } from './log_tools' 2 | 3 | export async function copyToClipBoard(text: string) { 4 | if (document.execCommand) { 5 | var textarea = document.createElement('textarea') 6 | document.body.appendChild(textarea) 7 | textarea.value = text 8 | textarea.select() 9 | document.execCommand('copy') 10 | document.body.removeChild(textarea) 11 | } 12 | 13 | if (navigator.clipboard) { 14 | await navigator.clipboard.writeText(text) 15 | } 16 | 17 | if ((window as any).clipboardData) { 18 | ;(window as any).clipboardData.setData('Text', text) 19 | 20 | myLog('clipboardData:', text) 21 | return true 22 | } 23 | return false 24 | } 25 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/src/utils/types.tsx: -------------------------------------------------------------------------------- 1 | type Values = T[keyof T] 2 | 3 | type Tuplize = Pick | number>> 4 | 5 | type _OneOf = Values<{ 6 | [K in keyof T]: T[K] & { 7 | [M in Values<{ [L in keyof Omit]: keyof T[L] }>]?: undefined 8 | } 9 | }> 10 | 11 | export type OneOf = _OneOf> 12 | 13 | export type Complete = { 14 | [P in keyof Required]: Pick extends Required> ? T[P] : T[P] | undefined 15 | } 16 | 17 | export type Required = { 18 | [P in keyof T]-?: T[P] 19 | } 20 | 21 | export type RequireOne = { 22 | [X in Exclude]?: T[X] 23 | } & { 24 | [P in K]-?: T[P] 25 | } 26 | 27 | // type Partial = { 28 | // [P in keyof T]?: T[P] 29 | // } 30 | -------------------------------------------------------------------------------- /packages/common-resources/static-resources/types.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare global { 4 | interface Window { 5 | __ChainIdExtends: any 6 | __MapChainId: any 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/common-resources/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "jsx": "react-jsx", 5 | "noUnusedLocals": true, 6 | "resolveJsonModule": true, 7 | "noUnusedParameters": true, 8 | "baseUrl": "./static-resources/src", 9 | "rootDir": "./static-resources" 10 | }, 11 | "include": [ 12 | "./static-resources/src", 13 | "./static-resources/src/**/*.json", 14 | "./static-resources/src/*" 15 | ], 16 | "exclude": [ 17 | "node_modules", 18 | "build", 19 | "dist", 20 | "example", 21 | "rollup.config.js" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /packages/component-lib/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/typescript", 4 | "@babel/preset-env", 5 | "@babel/preset-react", 6 | "@emotion/babel-preset-css-prop", 7 | [ 8 | "@babel/env", 9 | { 10 | "modules": false 11 | } 12 | ] 13 | ], 14 | "plugins": [ 15 | "@babel/plugin-proposal-class-properties" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /packages/component-lib/.eslintignore: -------------------------------------------------------------------------------- 1 | *.css 2 | *.scss 3 | *.svg -------------------------------------------------------------------------------- /packages/component-lib/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "react-hooks" 4 | ], 5 | "extends": [ 6 | "react-app" 7 | ], 8 | "overrides": [ 9 | { 10 | "files": [ 11 | "**/*.tsx", 12 | "**/*.ts" 13 | ], 14 | "rules": { 15 | "import/no-anonymous-default-export": "off", 16 | "@typescript-eslint/no-unused-vars": "off", 17 | "react-hooks/rules-of-hooks": "error", 18 | // 检查 Hook 的规则 19 | "react-hooks/exhaustive-deps": "warn" 20 | // 检查 effect 的依赖 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/component-lib/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # See https://help.github.com/ignore-files/ for more about ignoring files. 3 | 4 | # dependencies 5 | node_modules 6 | 7 | # builds 8 | build 9 | dist 10 | .rpt2_cache 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | .env.local 16 | .env.development.local 17 | .env.test.local 18 | .env.production.local 19 | .idea/** 20 | .vscode/** 21 | ./component-lib/** 22 | ./lib/** 23 | 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | src/assets 28 | storybook-static 29 | 30 | 31 | -------------------------------------------------------------------------------- /packages/component-lib/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 8 4 | env: 5 | - SKIP_PREFLIGHT_CHECK=true 6 | -------------------------------------------------------------------------------- /packages/component-lib/craco.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = require("../../craco.config.cjs") -------------------------------------------------------------------------------- /packages/component-lib/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/component-lib/public/favicon.ico -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/btns/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Button' 2 | export * from './Interface' 3 | export * from './BtnPercentage' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/display/SpaceBetweenBox.tsx: -------------------------------------------------------------------------------- 1 | import { Box, BoxProps } from '@mui/material' 2 | 3 | export type SpaceBetweenProps = { 4 | leftNode: React.ReactNode, 5 | rightNode: React.ReactNode 6 | } 7 | 8 | export default (props: BoxProps & SpaceBetweenProps) => { 9 | const { leftNode, rightNode, ...rest } = props 10 | 11 | return 12 | {leftNode} 13 | {rightNode} 14 | 15 | } 16 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/display/index.ts: -------------------------------------------------------------------------------- 1 | import SpaceBetweenBox from "./SpaceBetweenBox"; 2 | 3 | export { SpaceBetweenBox } 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/empty/index.ts: -------------------------------------------------------------------------------- 1 | import { EmptyDefault } from './Empty' 2 | 3 | export { EmptyDefault } 4 | export * from './Empty' 5 | 6 | // export default EmptyWallet; 7 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/form/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export * from './useFocusRef' 2 | export * from './usePanelRef' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/form/hooks/useFocusRef.ts: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export function useFocusRef({ 4 | value, 5 | shouldFocusOn, 6 | callback, 7 | }: { 8 | value?: any 9 | shouldFocusOn?: boolean | undefined 10 | // ref: React.RefObject, 11 | callback?: (prorps: { current: any }) => void 12 | }) { 13 | const ref = React.useRef(null) 14 | React.useEffect(() => { 15 | if (shouldFocusOn) { 16 | ref?.current?.focus() 17 | } 18 | callback && callback({ current: ref.current }) 19 | }, [value, shouldFocusOn]) 20 | return ref 21 | } 22 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/form/hooks/usePanelRef.ts: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export function usePanelRef({ 4 | callback, 5 | }: { 6 | callback?: (prorps: { current: any }) => void 7 | }) { 8 | const ref = React.useRef(null) 9 | React.useEffect(() => { 10 | if (ref.current) { 11 | callback && callback({ current: ref.current }) 12 | } 13 | }, []) 14 | return ref 15 | } 16 | 17 | // { 18 | // const ref = React.useRef(null); 19 | // React.useEffect(() => { 20 | // 21 | // callback && callback({current: ref.current}); 22 | // return ref 23 | // }, [height, width, callback]); 24 | // return ref; 25 | // } 26 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/form/index.ts: -------------------------------------------------------------------------------- 1 | export * from './input' 2 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/form/input/index.ts: -------------------------------------------------------------------------------- 1 | export * from './InputSelect' 2 | export * from './InputButton' 3 | export * from './DatePicker' 4 | export * from './Interface' 5 | export * from './Default' 6 | export * from './InputCoin' 7 | export * from './InputSearch' 8 | export * from './InputCode' 9 | export * from './CollectionInput' 10 | export * from './TextareaWithCount' 11 | export * from './InputMaxButton' 12 | export * from './InputMaxCoin' 13 | export { 14 | TextField, 15 | TextareaAutosizeStyled, 16 | InputSearchWrapperStyled, 17 | RadioGroupStyle, 18 | OutlinedInput, 19 | } from './style' 20 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './btns' 2 | export * from './form' 3 | export * from './lists' 4 | export * from './panel' 5 | export * from './tables' 6 | export * from './popover' 7 | export * from './resource' 8 | export * from './table-pagination' 9 | export * from './tags' 10 | export * from './media' 11 | export { SpaceBetweenBox } from './display' 12 | export { Loading } from './loading' 13 | export { CustomCheckBox } from './checkbox' 14 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/loading/index.tsx: -------------------------------------------------------------------------------- 1 | import { SoursURL } from '@loopring-web/common-resources' 2 | import { Box, BoxProps } from '@mui/material' 3 | 4 | export type LoadingProps = { 5 | size?: number 6 | withContainer?: boolean 7 | } 8 | 9 | export const Loading = (props: BoxProps & LoadingProps) => { 10 | const { size = 40, withContainer, ...rest } = props 11 | const loading = ( 12 | 19 | ) 20 | return withContainer ? ( 21 | 28 | {loading} 29 | 30 | ) : ( 31 | loading 32 | ) 33 | } -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/media/Interface.ts: -------------------------------------------------------------------------------- 1 | import { NFTWholeINFO } from '@loopring-web/common-resources' 2 | import { ReactEventHandler } from 'react' 3 | 4 | export type NftImageProps = { 5 | onError: ReactEventHandler 6 | } & Partial & 7 | Partial 8 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/media/index.ts: -------------------------------------------------------------------------------- 1 | export * from './nftImage' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/panel/Interface.ts: -------------------------------------------------------------------------------- 1 | export type PanelContent = { 2 | key: T 3 | element: JSX.Element 4 | toolBarItem: JSX.Element | undefined 5 | } 6 | export type SwitchPanelProps = { 7 | // swipedBy: T, 8 | index: number 9 | // defaultIndex: number, 10 | panelList: Array> 11 | size?: string 12 | className?: string 13 | // onChangeIndex?: (index: number,data:any) => void, 14 | // onTransitionEnd?: () => void, 15 | _height?: number | string 16 | _width?: number | string 17 | scrollDisabled?: boolean 18 | } 19 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/panel/SubMenu.tsx: -------------------------------------------------------------------------------- 1 | import styled from '@emotion/styled' 2 | import { List, ListProps } from '@mui/material' 3 | 4 | export const SubMenu = styled(List)` 5 | width: 100%; 6 | flex: 1; 7 | padding: ${({ theme }) => (theme.unit / 2) * 5}px 0; 8 | background-color: var(--color-box); 9 | border-radius: ${({ theme }) => theme.unit}px; 10 | &.color-light { 11 | background-color: initial; 12 | } 13 | ` as typeof List 14 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/popover/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Popover' 2 | 3 | export * from './Interface' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/resource/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './hook/useImage' 2 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/table-pagination/index.ts: -------------------------------------------------------------------------------- 1 | export * from './TablePagination' 2 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/tables/components/Formatters/ImageFormatter.tsx: -------------------------------------------------------------------------------- 1 | import styled from '@emotion/styled' 2 | 3 | const WrapperClassname = styled.div` 4 | display: flex; 5 | justify-content: space-around; 6 | ` 7 | 8 | const ImageCellClassname = styled.div` 9 | background: #efefef; 10 | background-size: 100%; 11 | display: inline-block; 12 | height: 28px; 13 | width: 28px; 14 | vertical-align: middle; 15 | background-position: center; 16 | ` 17 | 18 | interface Props { 19 | /** image url, used as background-image */ 20 | value: string 21 | } 22 | 23 | export function ImageFormatter({ value }: Props) { 24 | return ( 25 | 26 | 27 | 28 | ) 29 | } 30 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/tables/components/Formatters/index.ts: -------------------------------------------------------------------------------- 1 | // export * from './CellActionsFormatter'; 2 | export * from './ImageFormatter' 3 | export * from './CellExpanderFormatter' 4 | export * from './ChildRowDeleteButton' 5 | export * from './CellDepthFormatter' 6 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/tables/components/HeaderRenderers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './SortableHeaderCell' 2 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/tables/components/RowRenders/index.ts: -------------------------------------------------------------------------------- 1 | export * from './RowDepthFormatter' 2 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/tables/hook/index.ts: -------------------------------------------------------------------------------- 1 | export * from './useClickOutside' 2 | export * from './useCombinedRefs' 3 | export * from './useFocusRef' 4 | export * from './useLatestFunc' 5 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/tables/hook/useCombinedRefs.ts: -------------------------------------------------------------------------------- 1 | import { useCallback } from 'react' 2 | 3 | export function useCombinedRefs(...refs: readonly React.Ref[]) { 4 | return useCallback( 5 | (handle: T | null) => { 6 | for (const ref of refs) { 7 | if (typeof ref === 'function') { 8 | ref(handle) 9 | } else if (ref !== null) { 10 | // @ts-ignore 11 | ref.current = handle as any 12 | } 13 | } 14 | }, 15 | // eslint-disable-next-line react-hooks/exhaustive-deps 16 | refs, 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/tables/hook/useFocusRef.ts: -------------------------------------------------------------------------------- 1 | import { useLayoutEffect, useRef } from 'react' 2 | 3 | export function useFocusRef(isCellSelected: boolean | undefined) { 4 | const ref = useRef(null) 5 | useLayoutEffect(() => { 6 | if (!isCellSelected) return 7 | ref.current?.focus({ preventScroll: true }) 8 | }, [isCellSelected]) 9 | 10 | return ref 11 | } 12 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/tables/hook/useLatestFunc.ts: -------------------------------------------------------------------------------- 1 | import { useCallback, useEffect, useRef } from 'react' 2 | 3 | // https://reactjs.org/docs/hooks-faq.html#what-can-i-do-if-my-effect-dependencies-change-too-often 4 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 5 | export function useLatestFunc any>(fn: T) { 6 | const ref = useRef(fn) 7 | 8 | useEffect(() => { 9 | ref.current = fn 10 | }) 11 | 12 | return useCallback((...args: Parameters) => { 13 | ref.current(...args) 14 | }, []) 15 | } 16 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/basic-lib/tables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Table' 2 | export * from '../empty' 3 | export * from './components/RowRenders' 4 | export * from './components/HeaderRenderers' 5 | export * from './components/Formatters' 6 | export * from './Interface' 7 | export * from './hook' 8 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/block/ShareSocialPanel.tsx: -------------------------------------------------------------------------------- 1 | export const ShareSocialPanel = () => { 2 | return <> 3 | } 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/block/index.ts: -------------------------------------------------------------------------------- 1 | export * from './TradeTitle' 2 | export * from './Interface' 3 | // export * from '../modal/AccountInfo/AccountInfo' 4 | export * from './AssetTitle' 5 | export * from './MarketBlock' 6 | export * from './AmmCard' 7 | export * from './Vip' 8 | // export * from './styled' 9 | // export * as from './Styled' 10 | export * from './Interface' 11 | export * from './DepthRaw' 12 | export * from './TradeRace' 13 | export * from './nftMedia' 14 | export * from './AmmPairDetail' 15 | export * from './CollectionMedia' 16 | export * from './LoadingBlock' 17 | export * from './TagIconList' 18 | export * from './RedPacket' 19 | export * from './CollectionDetailView' 20 | export * from './Referral' 21 | export * from './ErrorBlock' 22 | export * from './ShareSocialPanel' 23 | export * from './ETHStakingDetail' 24 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/carousel/Interface.ts: -------------------------------------------------------------------------------- 1 | export type SocialButtonProps = { 2 | url: string 3 | /** Social Network Enum */ 4 | socialEnum: string 5 | /** Message to be shared */ 6 | message?: string 7 | /** Button size in pixels */ 8 | size?: number 9 | 10 | imageUrl?: string 11 | /** Function that sends share event to analytics */ 12 | sendShareEvent: () => void 13 | } 14 | export type CarouselItem = { imageUrl: string; size: [number, number], height?: number, width?: number } 15 | 16 | export type ShareProps = { 17 | /** Social Networks configuration */ 18 | social: SocialButtonProps 19 | size: number 20 | /** share URL title */ 21 | title: string 22 | /** Indcates if the component should render the Content Loader */ 23 | loading: boolean 24 | 25 | imageUrl: string 26 | /** Function that sends share event to analytics */ 27 | sendShareEvent: () => {} 28 | } 29 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/carousel/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './Interface' 2 | export * from './Carousel' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/charts/constant.ts: -------------------------------------------------------------------------------- 1 | export enum ChartType { 2 | Kline = 'Kline', 3 | Depth = 'Depth', 4 | Trend = 'Trend', 5 | } 6 | 7 | export enum timeUnit { 8 | W1 = '1W', 9 | H1 = '1H', 10 | D1 = '1D', 11 | } 12 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/charts/doughnutChart/index.ts: -------------------------------------------------------------------------------- 1 | export * from './DoughnutChart' 2 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/charts/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './scaleAreaChart' 2 | export * from './doughnutChart' 3 | export * from './constant' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/charts/scaleAreaChart/KlineChart/index.ts: -------------------------------------------------------------------------------- 1 | export * from './KlineChart' 2 | export * from './data' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/charts/scaleAreaChart/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ScaleAreaChart' 2 | export * from './data' 3 | export * from './KlineChart' 4 | export * from './APRChart' 5 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/header/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Header' 2 | export * from './Interface' 3 | export * from './toolbar' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/header/toolbar/Interface.ts: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { AccountFull } from '@loopring-web/common-resources' 3 | 4 | export enum WalletNotificationStatus { 5 | none = 'none', 6 | error = 'error', 7 | pending = 'pending', 8 | success = 'success', 9 | } 10 | 11 | export type WalletNotificationInterface = { 12 | // status: keyof typeof WalletNotificationStatus 13 | message: string 14 | handleClick?: (event: React.MouseEvent) => void 15 | } 16 | 17 | export type WalletConnectBtnProps = { 18 | NetWorkItems: JSX.Element | (() => JSX.Element) 19 | handleClick: (_e: React.MouseEvent) => void 20 | handleClickUnlock: (_e: React.MouseEvent) => void 21 | handleClickSignIn: (_e: React.MouseEvent) => void 22 | accountState: AccountFull 23 | isLayer1Only?: boolean 24 | isShowOnUnConnect: boolean 25 | } 26 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './basic-lib' 2 | export * from './tradePanel' 3 | export * from './tableList' 4 | export * from './header' 5 | export * from './footer' 6 | export * from './basic-lib/popover' 7 | export * from './modal' 8 | export * from './block' 9 | export * from './styled' 10 | export * from './charts' 11 | export * from './toast' 12 | export * from './bottomRule' 13 | export * from './provider' 14 | export * from './share' 15 | export * from './carousel' 16 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/modal/QRCode/index.ts: -------------------------------------------------------------------------------- 1 | export * from './QRCode' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/modal/RedPacketPanels/Interface.ts: -------------------------------------------------------------------------------- 1 | export enum RedPacketViewStep { 2 | QRCodePanel, 3 | OpenPanel, 4 | DetailPanel, 5 | TimeOutPanel, 6 | PreparePanel, 7 | OpenedPanel, 8 | RedPacketClock, 9 | BlindBoxDetail, 10 | Loading, 11 | } 12 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/modal/RedPacketPanels/index.ts: -------------------------------------------------------------------------------- 1 | export * from './RedPacketModal' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/modal/Vault/index.ts: -------------------------------------------------------------------------------- 1 | export * from './VaultJoinPanel' 2 | export * from './VaultExitPanel' 3 | export * from './VaultLoanPanel' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/modal/WalletConnect/Interface.ts: -------------------------------------------------------------------------------- 1 | import { GatewayItem } from '@loopring-web/common-resources' 2 | 3 | /** 4 | * @param handleSelect default hanldeSelect, if item have no private handleSelect function 5 | */ 6 | export interface ProviderMenuProps { 7 | termUrl: string 8 | NetWorkItems?: JSX.Element 9 | gatewayList: GatewayItem[] 10 | handleSelect?: (event: React.MouseEvent, key: string) => void 11 | providerName?: string 12 | status?: 'processing' 13 | } 14 | 15 | export enum WalletConnectStep { 16 | Provider, 17 | CommonProcessing, 18 | WalletConnectProcessing, 19 | WalletConnectQRCode, 20 | SuccessConnect, 21 | FailedConnect, 22 | RejectConnect, 23 | RejectSwitchNetwork, 24 | } 25 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/modal/WalletConnect/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ModalWalletConnect' 2 | export * from './Interface' 3 | export * from './WalletConnectQRCode' 4 | export * from './ProviderMenu' 5 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/modal/WalletPanels/Interface.ts: -------------------------------------------------------------------------------- 1 | export enum GuardianStep { 2 | LockAccount_WaitForAuth, 3 | LockAccount_User_Denied, 4 | LockAccount_Success, 5 | LockAccount_Failed, 6 | 7 | Approve_User_Denied, 8 | Approve_WaitForAuth, 9 | Approve_Success, 10 | Approve_Failed, 11 | Reject_User_Denied, 12 | Reject_WaitForAuth, 13 | Reject_Success, 14 | Reject_Failed, 15 | } 16 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/modal/WalletPanels/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Interface' 2 | export * from './LockWallet' 3 | export * from './ModalWallet' 4 | export * from './WalletApprove' 5 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/modal/setting/Interface.ts: -------------------------------------------------------------------------------- 1 | export type ModalSettingFeeProps = { 2 | open: boolean 3 | onClose: { 4 | bivarianceHack(event: {}, reason: 'backdropClick' | 'escapeKeyDown'): void 5 | }['bivarianceHack'] 6 | noClose?: boolean 7 | style?: any 8 | } 9 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/modal/setting/index.ts: -------------------------------------------------------------------------------- 1 | export * from './SettingFee' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/panel/index.ts: -------------------------------------------------------------------------------- 1 | export * from './FilterMarketsPanel' 2 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/share/Interface.ts: -------------------------------------------------------------------------------- 1 | import { SOCIAL_NAME_KEYS } from '@loopring-web/common-resources'; 2 | 3 | export type SocialButtonProps = { 4 | /** Social Network Enum */ 5 | socialEnum: SOCIAL_NAME_KEYS 6 | size?: number 7 | sendShareEvent: (key: SOCIAL_NAME_KEYS) => void 8 | } 9 | 10 | export type ShareProps = { 11 | social: { [key in Partial]: SocialButtonProps } 12 | size: number 13 | loading: boolean 14 | imageUrl: string 15 | direction?: 'row' | 'column' 16 | } 17 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/QuoteTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './MarketTable' 2 | export * from './QuoteTable' 3 | export * from './MarketDetail' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/ammRecordTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './AmmRecordTable' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/ammTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './AmmTable' 2 | export * from './interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/ammTable/interface.ts: -------------------------------------------------------------------------------- 1 | export enum AmmSideTypes { 2 | Exit = 'Exit', 3 | Join = 'Join', 4 | } 5 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/assetsTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './AssetsTable' 2 | export {VaultAssetsTable} from './VaultAssetsTable' 3 | export * from './AssetsDefiTable' 4 | export * from './components/Filter' 5 | export * from './components/CoinIcons' 6 | export { VaultPositionsTable } from './VaultPositionsTable' -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/btradeSwapTable/Interface.ts: -------------------------------------------------------------------------------- 1 | export enum BtradeSwapsType { 2 | Settled = 'Settled', 3 | Delivering = 'Delivering', 4 | Failed = 'Failed', 5 | Pending = 'Pending', 6 | Cancelled = 'Cancelled', 7 | } 8 | 9 | export type RawDataBtradeSwapsItem = { 10 | type: BtradeSwapsType 11 | fromAmount: string 12 | fromSymbol: string 13 | toAmount: string 14 | toSymbol: string 15 | fromFAmount: string 16 | toFAmount: string 17 | price: { 18 | key: string 19 | value: string 20 | from: string 21 | } 22 | feeAmount: string 23 | feeSymbol: string 24 | time: number 25 | filledPercent: string 26 | settledFromAmount: string 27 | settledToAmount: string 28 | fromAmountDisplay: string 29 | toAmountDisplay: string 30 | } 31 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/btradeSwapTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './BtradeSwapTable' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/defiTxsTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './DefiTxsTable' 2 | export * from './Interface' 3 | export * from './DefiStakingTable' 4 | export * from './DefiStakingTxTable' 5 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/dualTable/Interface.ts: -------------------------------------------------------------------------------- 1 | import { DualViewInfo } from '@loopring-web/common-resources' 2 | 3 | export type RawDataDualsItem = DualViewInfo 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/dualTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './DualTable' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/dualTxsTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './DualTxsTable' 2 | export * from './DualAssetTable' 3 | export * from './Interface' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/index.ts: -------------------------------------------------------------------------------- 1 | export * from './QuoteTable' 2 | export * from './orderHistoryTable' 3 | export * from './transactionsTable' 4 | export * from './transactionsTable/Interface' 5 | export * from './assetsTable' 6 | export * from './tradeTable' 7 | export * from './tradeRroTable' 8 | export * from './poolsTable' 9 | export * from './ammRecordTable' 10 | export * from './myPoolTable' 11 | export * from './ammTable' 12 | export * from './tradeRaceTable' 13 | export * from './nftTable' 14 | export * from './investOverviewTable' 15 | export * from './defiTxsTable' 16 | export * from './tradeNFTTable' 17 | export * from './dualTxsTable' 18 | export * from './dualTable' 19 | export * from './tradeRaceTable' 20 | export * from './redPacketTable' 21 | export * from './btradeSwapTable' 22 | export * from './rewardTable' 23 | export * from './vaultTable' 24 | export { TaikoTarmingTxRecordsTable } from './taikoFarmingTable' 25 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/investOverviewTable/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | ColumnKey as InvestColumnKey, 3 | DepartmentRow, 4 | InvestOverviewTableProps, 5 | RowInvest, 6 | } from './Interface' 7 | 8 | export * from './InvestOverviewTable' 9 | export type { InvestOverviewTableProps, RowInvest, DepartmentRow } 10 | export { InvestColumnKey } 11 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/myPoolTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './MyPoolTable' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/nftTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './TsNFTTable' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/orderHistoryTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './OrderHistoryTable' 2 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/poolsTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './PoolsTable' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/redPacketTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './RedPacketRecodTable' 2 | export * from './RedPacketClaimTable' 3 | export * from './RedPacketReceiveTable' 4 | export * from './Interface' 5 | export * from './RedPacketBlindBoxReceiveTable' 6 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/redPacketTable/textTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Tooltip } from '@mui/material' 2 | 3 | type TextTooltipProps = { 4 | tooltipTitle: string 5 | text: string 6 | } 7 | const TextTooltip = ({ tooltipTitle, text }: TextTooltipProps) => { 8 | return ( 9 | 10 | {text} 11 | 12 | ) 13 | } 14 | export default TextTooltip 15 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/rewardTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ReferralsTable' 2 | export * from './RewardTable' 3 | export * from './RefundTable' 4 | export * from './RewardsTable' 5 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/taikoFarmingTable/index.ts: -------------------------------------------------------------------------------- 1 | 2 | export * from './Interface' 3 | export { TaikoTarmingTxRecordsTable } from './TaikoTarmingTxRecordsTable' 4 | export { TaikoFarmingPortfolioTable } from './TaikoFarmingPortfolioTable' 5 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/tradeNFTTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './TradeNFTTable' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/tradeRaceTable/index.ts: -------------------------------------------------------------------------------- 1 | export { TradeRaceTable } from './TradeRaceTable' 2 | // export { TradeRaceTableConfig } from "./TradeRaceTableConfig"; 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/tradeRroTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './TradePro' 2 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/tradeTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './TradeTable' 2 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/transactionsTable/index.ts: -------------------------------------------------------------------------------- 1 | export * from './TransactionTable' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tableList/vaultTable/index.ts: -------------------------------------------------------------------------------- 1 | export { type VaultTxsTableProps, VaultTxTable, VaultCloseDetail } from './VaultTxTable' 2 | export { type RawDataVaultTxItem, VaultRecordType } from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/text-tooltip/index.tsx: -------------------------------------------------------------------------------- 1 | import { Tooltip } from '@mui/material' 2 | 3 | type TextTooltipProps = { 4 | tooltipTitle: string 5 | text: string 6 | } 7 | const TextTooltip = ({ tooltipTitle, text }: TextTooltipProps) => { 8 | return ( 9 | 10 | {text} 11 | 12 | ) 13 | } 14 | export default TextTooltip 15 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/Amm/index.ts: -------------------------------------------------------------------------------- 1 | export * from './AmmPanel' 2 | export * from './Interface' 3 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/Deposit/Interface.tsx: -------------------------------------------------------------------------------- 1 | import { DepositProps } from '../Interface' 2 | import { VendorMenuProps } from '../../modal' 3 | 4 | export enum DepositPanelType { 5 | Deposit = 0, 6 | ThirdPart = 1, 7 | } 8 | 9 | export type DepositGroupProps = { 10 | depositProps: DepositProps 11 | vendorMenuProps: VendorMenuProps 12 | tabIndex?: DepositPanelType 13 | // onTabChange: (value: DepositPanelType) => void; 14 | } 15 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/Deposit/index.ts: -------------------------------------------------------------------------------- 1 | export * from './DepositGroup' 2 | export * from './Interface' 3 | export * from '../../modal/ModalPanels/DepositPanel' 4 | export * from './DepositTitle' 5 | export * from './VendorMenu' 6 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/Reset/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ResetPanel' 2 | export * from './ActiveAccountPanel' 3 | export * from './ConfirmationPanel' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/components/AmmWrap/index.ts: -------------------------------------------------------------------------------- 1 | // this is a private component, only used in panel component 2 | // please do not export this index to global 3 | // export * from './Interface' 4 | export * from './Interface' 5 | export * from './AmmDeposit' 6 | export * from './AmmWithdraw' 7 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/components/AmmWrap/styled.ts: -------------------------------------------------------------------------------- 1 | import styled from '@emotion/styled' 2 | 3 | export const SvgStyled = styled.div` 4 | & svg { 5 | width: 24px; 6 | height: 24px; 7 | } 8 | ` 9 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/components/DeFiWrap/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './Interface' 2 | export * from './deFiWrap' 3 | export * from './DeFiStackOneSideWrap' 4 | export * from './DeFiStackRedeemWrap' 5 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/components/DualWrap/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './Interface' 2 | export * from './dualWrap' 3 | export * from './dualDetail' 4 | export * from './ModifySetting' 5 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/components/SwapWrap/index.ts: -------------------------------------------------------------------------------- 1 | // this is a private component, only used in panel component 2 | // please do not export this index to global 3 | 4 | // export * from './Interface' 5 | export * from './SwapTradeWrap' 6 | export * from './SwapMenuList' 7 | export * from './Interface' 8 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/components/VaultWrap/index.ts: -------------------------------------------------------------------------------- 1 | // this is a private component, only used in panel component 2 | // please do not export this index to global 3 | // export * from './Interface' 4 | export * from './Interface' 5 | export * from './VaultJoin' 6 | export * from './VaultBorrow' 7 | export * from './VaultRepay' 8 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/components/VaultWrap/styled.ts: -------------------------------------------------------------------------------- 1 | import styled from '@emotion/styled' 2 | 3 | export const SvgStyled = styled.div` 4 | & svg { 5 | width: 24px; 6 | height: 24px; 7 | } 8 | ` 9 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/components/VaultWrap/utils.ts: -------------------------------------------------------------------------------- 1 | export const marginLevelTypeToColor = (type: 'safe' | 'warning' | 'danger') => { 2 | return type === 'safe' 3 | ? 'var(--color-success)' 4 | : type === 'warning' 5 | ? 'var(--color-warning)' 6 | : 'var(--color-error)' 7 | } 8 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/components/index.ts: -------------------------------------------------------------------------------- 1 | // this is a private component, only used in panel component 2 | 3 | // please do not export this index to global 4 | export * from './DepositWrap' 5 | export * from './ResetWrap' 6 | export * from './WithdrawWrap' 7 | export * from './TransferWrap' 8 | export * from './TransferNFTBurn' 9 | export * from './SwapWrap' 10 | export * from './AmmWrap' 11 | export * from './VaultWrap' 12 | export * from './hook/BasicACoinPanelHook' 13 | export * from './tool' 14 | export * from './ExportAccountWrap' 15 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/components/tool/index.ts: -------------------------------------------------------------------------------- 1 | // this is a private component, only used in panel component 2 | // please do not export this index to global 3 | export * from './SlippagePanel' 4 | export * from './ToolBarItems' 5 | export * from './TradeMenuList' 6 | export * from '../SwapWrap/SwapMenuList' 7 | export * from './Dialogs' 8 | export * from '../../Deposit/DepositTitle' 9 | export * from '../../../basic-lib/form/input/CollectionInput' 10 | -------------------------------------------------------------------------------- /packages/component-lib/src/components/tradePanel/tradePro/index.ts: -------------------------------------------------------------------------------- 1 | export * from './limitTrade' 2 | export * from './marketTrade' 3 | export * from './stopLimitTrade' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @example 3 | * export const HeadMenuItem = withTranslation()(styled(({}:InterFaceProps & WithTranslation)=><>)`` 4 | * ) as React.ComponentType; 5 | */ 6 | 7 | export * from './stores' 8 | export * from './components' 9 | 10 | export * from './static' 11 | export {VaultPage, useGetVaultAssets, useVaultMarket} from './sharedPages' 12 | 13 | // export * from "./@loopring-web/common-resources"; 14 | -------------------------------------------------------------------------------- /packages/component-lib/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/component-lib/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals' 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry) 7 | getFID(onPerfEntry) 8 | getFCP(onPerfEntry) 9 | getLCP(onPerfEntry) 10 | getTTFB(onPerfEntry) 11 | }) 12 | } 13 | } 14 | 15 | export default reportWebVitals 16 | -------------------------------------------------------------------------------- /packages/component-lib/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom' 6 | -------------------------------------------------------------------------------- /packages/component-lib/src/sharedPages/VaultPage/index.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | import { 5 | useSettings, 6 | } from '@loopring-web/component-lib' 7 | import { useVaultPage } from './hooks/useVaultPage' 8 | import { VaultPageUI } from './components/VaultPageUI' 9 | export { useVaultMarket } from './hooks/useVaultMarket' 10 | export { useGetVaultAssets } from './hooks/useVaultDashBoard' 11 | 12 | export const VaultPage = () => { 13 | const props = useVaultPage() 14 | 15 | return ( 16 | 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /packages/component-lib/src/sharedPages/index.ts: -------------------------------------------------------------------------------- 1 | export {VaultPage, useGetVaultAssets, useVaultMarket} from './VaultPage' -------------------------------------------------------------------------------- /packages/component-lib/src/stores/index.ts: -------------------------------------------------------------------------------- 1 | export * from './reducer/settings' 2 | export * from './reducer/modals' 3 | export * from './reducer/toggle' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/stores/reducer/modals/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/stores/reducer/settings/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/stores/reducer/toggle/hook.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from 'react-redux' 2 | import { ToggleState } from './interface' 3 | import { updateToggleStatus } from './reducer' 4 | import React from 'react' 5 | 6 | export function useToggle() { 7 | const toggle: ToggleState = useSelector((state: any) => state.toggle) 8 | const dispatch = useDispatch() 9 | return { 10 | toggle, 11 | updateToggleStatus: React.useCallback(() => { 12 | dispatch(updateToggleStatus(undefined)) 13 | }, [dispatch]), 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/component-lib/src/stores/reducer/toggle/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './reducer' 3 | export * from './interface' 4 | -------------------------------------------------------------------------------- /packages/component-lib/src/types/lib.ts: -------------------------------------------------------------------------------- 1 | export type Without = { [P in Exclude]?: never } 2 | export type XOR = T | U extends { [key: string]: any } 3 | ? (Without & U) | (Without & T) 4 | : T | U 5 | 6 | // export type Omit = Pick> 7 | -------------------------------------------------------------------------------- /packages/component-lib/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "jsx": "react-jsx", 5 | "noUnusedLocals": true, 6 | "noUnusedParameters": true, 7 | "resolveJsonModule": true, 8 | "allowSyntheticDefaultImports": true, 9 | "baseUrl": "./src", 10 | "rootDir": "./src" 11 | }, 12 | "include": [ 13 | "src", 14 | "src/**/*.json", 15 | "src/*" 16 | ], 17 | "exclude": [ 18 | "node_modules", 19 | "build", 20 | "dist", 21 | "example", 22 | "rollup.config.js" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/component-lib/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | }, 6 | "include": [ 7 | "src", 8 | "src/**/*.json", 9 | "src/*" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /packages/core/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/typescript", 4 | "@babel/preset-env", 5 | "@babel/preset-react", 6 | "@emotion/babel-preset-css-prop", 7 | [ 8 | "@babel/env", 9 | { 10 | "modules": false 11 | } 12 | ] 13 | ], 14 | "plugins": [ 15 | "@babel/plugin-proposal-class-properties" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /packages/core/.eslintignore: -------------------------------------------------------------------------------- 1 | *.css 2 | *.scss 3 | *.svg -------------------------------------------------------------------------------- /packages/core/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "react-hooks" 4 | ], 5 | "extends": [ 6 | "react-app" 7 | ], 8 | "overrides": [ 9 | { 10 | "files": [ 11 | "**/*.tsx", 12 | "**/*.ts" 13 | ], 14 | "rules": { 15 | "import/no-anonymous-default-export": "off", 16 | "@typescript-eslint/no-unused-vars": "warn", 17 | "@typescript-eslint/ban-types": "off", 18 | "react-hooks/rules-of-hooks": "error", 19 | "react-hooks/exhaustive-deps": "warn" 20 | } 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /packages/core/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # See https://help.github.com/ignore-files/ for more about ignoring files. 3 | 4 | # dependencies 5 | node_modules 6 | 7 | # builds 8 | build 9 | dist 10 | .rpt2_cache 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | .env.local 16 | .env.development.local 17 | .env.test.local 18 | .env.production.local 19 | .idea/** 20 | .vscode/** 21 | ./lib/** 22 | 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | src/assets 27 | storybook-static 28 | 29 | 30 | -------------------------------------------------------------------------------- /packages/core/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 8 4 | env: 5 | - SKIP_PREFLIGHT_CHECK=true 6 | -------------------------------------------------------------------------------- /packages/core/src/abi/index.ts: -------------------------------------------------------------------------------- 1 | import erc20ABI from './erc20ABI' 2 | import taikoDepositABI from './taikoDepositABI' 3 | 4 | export { taikoDepositABI, erc20ABI } 5 | -------------------------------------------------------------------------------- /packages/core/src/api_wrapper/wallet.ts: -------------------------------------------------------------------------------- 1 | import { ContractType } from "@loopring-web/loopring-sdk"; 2 | import { LoopringAPI } from "./" 3 | 4 | export const getContractTypeByNetwork = async ( wallet: string ,network?: string) => { 5 | const res = await LoopringAPI.walletAPI!.getContractType({ 6 | wallet: wallet 7 | }) 8 | const data = (res.raw_data as any).data as ContractType[] 9 | if (network && data?.find(ele => ele.network === network)) { 10 | return data?.find(ele => ele.network === network); 11 | } else { 12 | return data && data[0] 13 | } 14 | } -------------------------------------------------------------------------------- /packages/core/src/component/index.ts: -------------------------------------------------------------------------------- 1 | export * from './BtnConnect' 2 | export * from './styled' 3 | export * from './NotificationItem' 4 | -------------------------------------------------------------------------------- /packages/core/src/defs/index.ts: -------------------------------------------------------------------------------- 1 | import * as sdk from '@loopring-web/loopring-sdk' 2 | 3 | export enum ActionResultCode { 4 | NoError, 5 | DataNotReady, 6 | GetAccError, 7 | GenEddsaKeyError, 8 | UpdateAccountError, 9 | } 10 | 11 | export type EddsaKey = { eddsaKey: any; accInfo?: sdk.AccountInfo } 12 | 13 | export const LAYOUT = { 14 | HEADER_HEIGHT: 64, 15 | FOOT_COMMON_HEIGHT: 48, 16 | } 17 | 18 | export const REFRESH_RATE = 1000 19 | 20 | export const DAYS = 30 21 | 22 | export const BIGO = sdk.toBig(0) 23 | 24 | export const MAPFEEBIPS = 63 25 | -------------------------------------------------------------------------------- /packages/core/src/hooks/common/index.ts: -------------------------------------------------------------------------------- 1 | export * from './useAddrCheck' 2 | export * from './useAllowances' 3 | export * from './useBtnStatus' 4 | export * from './usePairMatch' 5 | export * from './useToast' 6 | export * from './useTrade' 7 | export * from './useGetOrderHistorys' 8 | export * from './useHookBtn' 9 | export * from './useMyCollection' 10 | export * from './useMyNFTCollection' 11 | export * from './useCollectionManage' 12 | export * from './useCollectionImport' 13 | export * from './useNFT' 14 | export * from './useIsHebao' 15 | export * from './useNotification' 16 | export * from './useInjectWeb3Modal' 17 | export { useUserWallets } from './useUserWallets' 18 | export { useThrottle } from './useThrottle' 19 | export { useDebouncedCallback } from './useDebounce' 20 | export { useMarket } from './useMarket' -------------------------------------------------------------------------------- /packages/core/src/hooks/common/useThrottle.ts: -------------------------------------------------------------------------------- 1 | import _ from "lodash" 2 | import { useCallback, useEffect, useRef } from "react"; 3 | 4 | export function useThrottle(cb, delay) { 5 | const options = { leading: true, trailing: false }; // add custom lodash options 6 | const cbRef = useRef(cb); 7 | // use mutable ref to make useCallback/throttle not depend on `cb` dep 8 | useEffect(() => { cbRef.current = cb; }); 9 | return useCallback( 10 | _.throttle((...args) => cbRef.current(...args), delay, options), 11 | [delay] 12 | ); 13 | } -------------------------------------------------------------------------------- /packages/core/src/hooks/common/useToast.ts: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { TOASTOPEN, ToastType, TOSTOBJECT } from '@loopring-web/component-lib' 3 | 4 | export const useToast = (): TOSTOBJECT => { 5 | const [toastOpen, setToastOpen] = React.useState({ 6 | open: false, 7 | content: '', 8 | type: ToastType.info, 9 | }) 10 | 11 | const closeToast = React.useCallback(() => { 12 | setToastOpen((state) => { 13 | return { 14 | ...state, 15 | content: '', 16 | open: false, 17 | } 18 | }) 19 | }, [setToastOpen]) 20 | 21 | return { 22 | toastOpen, 23 | setToastOpen, 24 | closeToast, 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/core/src/hooks/help/formatPrice.ts: -------------------------------------------------------------------------------- 1 | import { getExistedMarket, toBig } from '@loopring-web/loopring-sdk' 2 | import { store } from '../../index' 3 | 4 | export function formatedVal(rawData: string, base: string, quote: string) { 5 | const { marketMap, marketArray } = store.getState().tokenMap 6 | 7 | if (!rawData || !base || !quote || !marketMap || !marketArray) { 8 | return '' 9 | } 10 | 11 | const { market } = getExistedMarket(marketArray, base, quote) 12 | const marketInfo = marketMap[market] 13 | 14 | const showVal = toBig(rawData).toFixed(marketInfo.precisionForPrice) 15 | 16 | return showVal 17 | } 18 | -------------------------------------------------------------------------------- /packages/core/src/hooks/help/index.ts: -------------------------------------------------------------------------------- 1 | export * from './coinPairInit' 2 | export * from './connectStatusCallback' 3 | export * from './makeCache' 4 | export * from './makeTickView' 5 | export * from './makeUIAmmActivityMap' 6 | export * from './makeWallet' 7 | export * from './marketTable' 8 | export * from './volumeToCount' 9 | export * from './useAmmTotalValue' 10 | export * from './marketPairHelp' 11 | export * from './makeInvest' 12 | export * from './makeDual' 13 | export * from './marketRedPacket' 14 | export * from './makeDefiSideStaking' 15 | export * from './providorConnect' 16 | export * from './makeMarketTrend' 17 | export {parseRabbitConfig, parseRabbitConfig2, networkById} from './parseRabbitConfig' 18 | -------------------------------------------------------------------------------- /packages/core/src/hooks/help/makeCache.ts: -------------------------------------------------------------------------------- 1 | import { store } from '../../index' 2 | import { setSlippage } from '@loopring-web/component-lib' 3 | 4 | type Cache = { 5 | customSlippage?: number 6 | } 7 | export const makeCache = (__cache__: Cache) => { 8 | if (typeof __cache__.customSlippage !== undefined) { 9 | store.dispatch(setSlippage(__cache__.customSlippage as number)) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/core/src/hooks/help/makeMarketTrend.ts: -------------------------------------------------------------------------------- 1 | export const makeMarketTrend = () => {} 2 | -------------------------------------------------------------------------------- /packages/core/src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export * from './common' 2 | export * from './help' 3 | export * from './useractions' 4 | export * from './rooters' 5 | -------------------------------------------------------------------------------- /packages/core/src/hooks/rooters/index.ts: -------------------------------------------------------------------------------- 1 | export * from './useLocationChange' 2 | -------------------------------------------------------------------------------- /packages/core/src/hooks/rooters/useLocationChange.ts: -------------------------------------------------------------------------------- 1 | import { useLocation } from 'react-router-dom' 2 | import { Location } from 'history' 3 | import React from 'react' 4 | 5 | const usePrevious = (value: Location): Location => { 6 | const ref = React.useRef>() 7 | React.useEffect(() => { 8 | ref.current = value 9 | }) 10 | return ref.current as Location 11 | } 12 | export const useLocationChange = ( 13 | action: (locatin: Location, prevLocation: Location) => void, 14 | ) => { 15 | const location = useLocation() 16 | const prevLocation = usePrevious(location) 17 | React.useEffect(() => { 18 | action(location, prevLocation) 19 | }, [location]) 20 | } 21 | -------------------------------------------------------------------------------- /packages/core/src/hooks/useractions/vault/index.ts: -------------------------------------------------------------------------------- 1 | export * from './useVaultJoin' 2 | export * from './useAccountInfo' 3 | export * from './useVaultRedeem' 4 | export * from './useVaultLoan' 5 | export * from './useVaultRepay' 6 | export * from './useVaultBorrow' 7 | -------------------------------------------------------------------------------- /packages/core/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './component' 2 | export * from './stores/index' 3 | export * from './stores/rootSaga' 4 | export * from './hookConnect' 5 | export * from './TimeoutCheckProvider' 6 | export * from './storage' 7 | export * from './services' 8 | export * from './defs' 9 | export * from './api_wrapper' 10 | export * from './utils' 11 | export * from './hooks' 12 | export * from './modal' 13 | export { erc20ABI, taikoDepositABI } from './abi' 14 | -------------------------------------------------------------------------------- /packages/core/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/core/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals' 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry) 7 | getFID(onPerfEntry) 8 | getFCP(onPerfEntry) 9 | getLCP(onPerfEntry) 10 | getTTFB(onPerfEntry) 11 | }) 12 | } 13 | } 14 | 15 | export default reportWebVitals 16 | -------------------------------------------------------------------------------- /packages/core/src/services/account/command.ts: -------------------------------------------------------------------------------- 1 | export enum AccountCommands { 2 | ErrorNetwork = 'ErrorNetwork', 3 | LockAccount = 'LockAccount', // clear private data 4 | NoAccount = 'NoAccount', // 5 | DepositingAccount = 'DepositingAccount', 6 | ErrorApproveToken = 'ErrorApproveToken', 7 | ErrorDepositSign = 'ErrorDepositSign', 8 | ProcessDeposit = 'ProcessDeposit', // two or one step 9 | SignAccount = 'SignAccount', //unlock or update account assgin 10 | SignDeniedByUser = 'SignDeniedByUser', 11 | ErrorSign = 'ErrorSign', 12 | ProcessSign = 'ProcessSign', 13 | ProcessAccountCheck = 'ProcessAccountCheck', 14 | AccountUnlocked = 'AccountUnlocked', 15 | } 16 | -------------------------------------------------------------------------------- /packages/core/src/services/account/index.ts: -------------------------------------------------------------------------------- 1 | export * from './accountServices' 2 | export * from './activateAccount' 3 | export * from './checkAccount' 4 | export * from './lockAccount' 5 | export * from './networkUpdate' 6 | export * from './resetAccount' 7 | export * from './unlockAccount' 8 | export * from './useAccountHook' 9 | export * from './command' 10 | -------------------------------------------------------------------------------- /packages/core/src/services/account/lockAccount.ts: -------------------------------------------------------------------------------- 1 | import { AccountStatus } from '@loopring-web/common-resources' 2 | import { accountServices } from './accountServices' 3 | import { resetSystemData } from './resetAccount' 4 | 5 | export function lockAccount() { 6 | accountServices.sendAccountLock() 7 | } 8 | 9 | export function goErrorNetWork() { 10 | accountServices.sendUpdateAccStatusAndReset(AccountStatus.ERROR_NETWORK) 11 | } 12 | 13 | // Do something clear the session storage related to Network 14 | export function cleanLayer2() { 15 | accountServices.sendUpdateAccStatusAndReset(AccountStatus.UN_CONNECT) 16 | resetSystemData() 17 | } 18 | -------------------------------------------------------------------------------- /packages/core/src/services/claimServices/claimServices.ts: -------------------------------------------------------------------------------- 1 | import { Subject } from 'rxjs' 2 | import { CLAIM_TYPE } from '@loopring-web/common-resources' 3 | 4 | export enum ClaimCommands { 5 | Success = 0, 6 | Failed = 1, 7 | } 8 | 9 | const subject = new Subject<{ 10 | status: ClaimCommands 11 | data?: { 12 | type: CLAIM_TYPE 13 | error?: any 14 | } 15 | }>() 16 | export const claimServices = { 17 | claimSuccess: ({ type }: { type: CLAIM_TYPE }) => { 18 | subject.next({ 19 | status: ClaimCommands.Success, 20 | data: { 21 | type, 22 | }, 23 | }) 24 | }, 25 | claimFailed: ({ type, error }: { type: CLAIM_TYPE; error: any }) => { 26 | subject.next({ 27 | status: ClaimCommands.Failed, 28 | data: { 29 | type, 30 | error, 31 | }, 32 | }) 33 | }, 34 | onSocket: () => subject.asObservable(), 35 | } 36 | -------------------------------------------------------------------------------- /packages/core/src/services/claimServices/index.ts: -------------------------------------------------------------------------------- 1 | export * from './claimServices' 2 | -------------------------------------------------------------------------------- /packages/core/src/services/collectionServices/index.ts: -------------------------------------------------------------------------------- 1 | export * from './collectionService' 2 | // export * from "./useCollectionContract"; 3 | // export * from "./useCollectionMeta"; 4 | -------------------------------------------------------------------------------- /packages/core/src/services/connect/index.ts: -------------------------------------------------------------------------------- 1 | export * from './useConnectHook' 2 | -------------------------------------------------------------------------------- /packages/core/src/services/depositServices/depositServices.ts: -------------------------------------------------------------------------------- 1 | import { Subject } from 'rxjs' 2 | 3 | export enum DepositCommands { 4 | DepsitERC20 = 0, 5 | DepsitNFT = 1, 6 | } 7 | 8 | const subject = new Subject<{ 9 | status: DepositCommands 10 | data?: { 11 | uniqueId?: string 12 | [key: string]: any 13 | } 14 | }>() 15 | export const depositServices = { 16 | depositERC20: () => { 17 | subject.next({ 18 | status: DepositCommands.DepsitERC20, 19 | data: { 20 | emptyData: false, 21 | }, 22 | }) 23 | }, 24 | depositNFT: () => { 25 | subject.next({ 26 | status: DepositCommands.DepsitNFT, 27 | data: { 28 | emptyData: false, 29 | }, 30 | }) 31 | }, 32 | onSocket: () => subject.asObservable(), 33 | } 34 | -------------------------------------------------------------------------------- /packages/core/src/services/depositServices/index.ts: -------------------------------------------------------------------------------- 1 | export * from './depositServices' 2 | -------------------------------------------------------------------------------- /packages/core/src/services/fee/index.ts: -------------------------------------------------------------------------------- 1 | export * from './useChargeFees' 2 | -------------------------------------------------------------------------------- /packages/core/src/services/index.ts: -------------------------------------------------------------------------------- 1 | export * from './account' 2 | export * from './connect' 3 | export * from './mintServices' 4 | export * from './collectionServices' 5 | export * from './depositServices' 6 | export * from './qrcodeServices' 7 | export * from './banxa' 8 | export * from './socket' 9 | export * from './ipfs' 10 | export * from './fee' 11 | export * from './claimServices' 12 | export * from './redpacket' 13 | -------------------------------------------------------------------------------- /packages/core/src/services/ipfs/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ipfsService' 2 | export * from './useIpfs' 3 | -------------------------------------------------------------------------------- /packages/core/src/services/mintServices/index.ts: -------------------------------------------------------------------------------- 1 | export * from './mintService' 2 | export * from './useNFTMint' 3 | export * from './useNFTMeta' 4 | -------------------------------------------------------------------------------- /packages/core/src/services/qrcodeServices/index.ts: -------------------------------------------------------------------------------- 1 | export * from './qrCodeService' 2 | export * from './useQrcodeScan' 3 | -------------------------------------------------------------------------------- /packages/core/src/services/redpacket/index.ts: -------------------------------------------------------------------------------- 1 | import { Subject } from 'rxjs' 2 | 3 | const subject = new Subject() 4 | export const redpacketService = { 5 | refresh: () => { 6 | subject.next() 7 | }, 8 | onRefresh: () => subject.asObservable(), 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/src/services/socket/index.ts: -------------------------------------------------------------------------------- 1 | export * from './socketUtil' 2 | export * from './hook/useWalletLayer2Socket' 3 | export * from './services/ammPoolService' 4 | export * from './services/tickerService' 5 | export * from './services/walletLayer2Service' 6 | export * from './services/bookService' 7 | export * from './services/mixorderService' 8 | export * from './services/orderbookService' 9 | export * from './services/tradeService' 10 | export * from './services/mixtradeService' 11 | export * from './hook/useWalletLayer2WithNFTSocket' 12 | export * from './services/btradeOrderbookService' 13 | export * from './services/notificationService' 14 | export * from './hook/useNotificationSocket' 15 | export * from './services/l2CommonService' 16 | export * from './hook/useL2CommonSocket' 17 | -------------------------------------------------------------------------------- /packages/core/src/services/socket/services/ammPoolService.ts: -------------------------------------------------------------------------------- 1 | import { Subject } from 'rxjs' 2 | 3 | export type AmmPoolMap = { 4 | [key in keyof R]: { pooled: [string, string]; lp: string } 5 | } 6 | // 7 | const subject = new Subject<{ 8 | ammPoolMap: AmmPoolMap<{ [key: string]: any }> 9 | }>() 10 | 11 | export const ammPoolService = { 12 | sendAmmPool: (ammPoolMap: AmmPoolMap<{ [key: string]: any }>) => subject.next({ ammPoolMap }), 13 | // clearMessages: () => subject.next(), 14 | onSocket: () => subject.asObservable(), 15 | } 16 | -------------------------------------------------------------------------------- /packages/core/src/services/socket/services/bookService.ts: -------------------------------------------------------------------------------- 1 | import { OrderDetail } from '@loopring-web/loopring-sdk' 2 | import { Subject } from 'rxjs' 3 | 4 | const subject = new Subject<{ bookMap: BookMap<{ [key: string]: any }> }>() 5 | 6 | export type BookMap = { 7 | [key in keyof R]: OrderDetail 8 | } 9 | // 10 | 11 | export const bookService = { 12 | sendBook: (bookMap: BookMap<{ [key: string]: any }>) => subject.next({ bookMap }), 13 | // clearMessages: () => subject.next(), 14 | onSocket: () => subject.asObservable(), 15 | } 16 | -------------------------------------------------------------------------------- /packages/core/src/services/socket/services/l2CommonService.ts: -------------------------------------------------------------------------------- 1 | import { Subject } from 'rxjs' 2 | import { WsL2Common } from '@loopring-web/loopring-sdk/src/defs/ws_defs' 3 | const subject = new Subject<{ nftDatas: string[] } | undefined>() 4 | 5 | export const l2CommonService = { 6 | sendUserUpdate: (props?: { data: WsL2Common } | undefined) => { 7 | subject.next(props ?? undefined) 8 | }, 9 | onSocket: () => subject.asObservable(), 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/src/services/socket/services/mixtradeService.ts: -------------------------------------------------------------------------------- 1 | import { Subject } from 'rxjs' 2 | import { MarketTradeInfo } from '@loopring-web/loopring-sdk' 3 | 4 | const subject = new Subject<{ mixtrades: MarketTradeInfo[] }>() 5 | 6 | export const mixtradeService = { 7 | sendMixtrade: (mixtrades: MarketTradeInfo[]) => { 8 | subject.next({ mixtrades: mixtrades }) 9 | }, 10 | // clearMessages: () => subject.next(), 11 | onSocket: () => subject.asObservable(), 12 | } 13 | -------------------------------------------------------------------------------- /packages/core/src/services/socket/services/notificationService.ts: -------------------------------------------------------------------------------- 1 | import { Subject } from 'rxjs' 2 | import * as sdk from '@loopring-web/loopring-sdk' 3 | 4 | // import { BasicListItem } from '@loopring-web/component-lib' 5 | 6 | // export type NotificationMap = { 7 | // [key in keyof R]: { pooled: [string, string]; lp: string } 8 | // } 9 | // 10 | const subject = new Subject<{ 11 | notification: sdk.UserNotification 12 | }>() 13 | 14 | export const notificationService = { 15 | sendNotification: (notification: sdk.UserNotification) => subject.next({ notification }), 16 | // clearMessages: () => subject.next(), 17 | onSocket: () => subject.asObservable(), 18 | } 19 | -------------------------------------------------------------------------------- /packages/core/src/services/socket/services/tradeService.ts: -------------------------------------------------------------------------------- 1 | import { Subject } from 'rxjs' 2 | import { MarketTradeInfo } from '@loopring-web/loopring-sdk' 3 | 4 | const subject = new Subject<{ trades: MarketTradeInfo[] }>() 5 | 6 | export const tradeService = { 7 | sendTrade: (trades: MarketTradeInfo[]) => { 8 | subject.next({ trades }) 9 | }, 10 | // clearMessages: () => subject.next(), 11 | onSocket: () => subject.asObservable(), 12 | } 13 | -------------------------------------------------------------------------------- /packages/core/src/services/socket/services/walletLayer2Service.ts: -------------------------------------------------------------------------------- 1 | import { Subject } from 'rxjs' 2 | const subject = new Subject<{ nftDatas: string[] } | undefined>() 3 | 4 | export const walletLayer2Service = { 5 | sendUserUpdate: (props?: { nftDatas: string[] } | undefined) => { 6 | subject.next(props ?? undefined) 7 | }, 8 | onSocket: () => subject.asObservable(), 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/src/stores/Amm/AmmActivityMap/hook.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from 'react-redux' 2 | import { AmmActivityMapStates } from './interface' 3 | import { getAmmActivityMap, statusUnset } from './reducer' 4 | import React from 'react' 5 | 6 | export function useAmmActivityMap(): AmmActivityMapStates & { 7 | getAmmActivityMap: () => void 8 | statusUnset: () => void 9 | } { 10 | const ammActivityMap: AmmActivityMapStates = useSelector((state: any) => state.amm.ammActivityMap) 11 | const dispatch = useDispatch() 12 | return { 13 | ...ammActivityMap, 14 | statusUnset: React.useCallback(() => dispatch(statusUnset(undefined)), [dispatch]), 15 | getAmmActivityMap: React.useCallback(() => dispatch(getAmmActivityMap(undefined)), [dispatch]), 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/core/src/stores/Amm/AmmMap/interface.ts: -------------------------------------------------------------------------------- 1 | import { AmmDetail, StateBase } from '@loopring-web/common-resources' 2 | import { AmmPoolInfoV3, LoopringMap } from '@loopring-web/loopring-sdk' 3 | 4 | export type GetAmmMapParams = { ammpools: LoopringMap } 5 | 6 | export type AmmDetailStore = AmmDetail 7 | export type AmmMap = { 8 | [key in keyof R]: AmmDetailStore 9 | } 10 | export type AmmMapStates = { 11 | ammMap: AmmMap 12 | ammArrayEnable: AmmDetailStore[] 13 | __timer__?: number 14 | } & StateBase 15 | -------------------------------------------------------------------------------- /packages/core/src/stores/Amm/index.ts: -------------------------------------------------------------------------------- 1 | import { combineReducers } from '@reduxjs/toolkit' 2 | 3 | import { ammMapSlice } from './AmmMap/reducer' 4 | import { ammActivityMapSlice } from './AmmActivityMap/reducer' 5 | import ammActivityMapSaga from './AmmActivityMap/saga' 6 | import { ammMapSaga } from './AmmMap/saga' 7 | import { fork } from 'redux-saga/effects' 8 | 9 | export const ammReducer = combineReducers({ 10 | ammMap: ammMapSlice.reducer, 11 | ammActivityMap: ammActivityMapSlice.reducer, 12 | }) 13 | export const ammForks = [ 14 | fork(ammActivityMapSaga), 15 | ...ammMapSaga, 16 | // fork(ammRecordSaga), 17 | // fork(ammTradesSaga) 18 | ] 19 | 20 | export * from './AmmMap/interface' 21 | export * from './AmmActivityMap/interface' 22 | export * from './AmmMap/hook' 23 | export * from './AmmActivityMap/hook' 24 | export * as ammMapReducer from './AmmMap/reducer' 25 | export * as ammActivityMapReducer from './AmmActivityMap/reducer' 26 | -------------------------------------------------------------------------------- /packages/core/src/stores/account/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * as accountReducer from './reducer' 3 | 4 | // export * from './method' 5 | -------------------------------------------------------------------------------- /packages/core/src/stores/amount/hook.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from 'react-redux' 2 | import { getAmount, resetAmount, statusUnset } from './reducer' 3 | import { AmountStates } from './interface' 4 | import React from 'react' 5 | 6 | export function useAmount(): AmountStates & { 7 | getAmount: ({ market }: { market: string }) => void 8 | statusUnset: () => void 9 | resetAmount: () => void 10 | } { 11 | const amountMap: AmountStates = useSelector((state: any) => state.amountMap) 12 | const dispatch = useDispatch() 13 | return { 14 | ...amountMap, 15 | resetAmount: React.useCallback(() => dispatch(resetAmount(undefined)), [dispatch]), 16 | statusUnset: React.useCallback(() => dispatch(statusUnset(undefined)), [dispatch]), 17 | getAmount: React.useCallback(({ market }) => dispatch(getAmount({ market })), [dispatch]), 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/core/src/stores/amount/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as amountReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/amount/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase } from '@loopring-web/common-resources' 2 | import * as sdk from '@loopring-web/loopring-sdk' 3 | 4 | //key is market or AMM-${market} 5 | export type Amount = { 6 | [key: string]: sdk.LoopringMap 7 | } 8 | export type TimerMap = { [key: string]: NodeJS.Timeout | -1 } 9 | /** 10 | * @amountMap is only update weh 11 | */ 12 | export type AmountStates = { 13 | amountMap?: Amount | undefined 14 | __timerMap__?: TimerMap 15 | } & StateBase 16 | -------------------------------------------------------------------------------- /packages/core/src/stores/config/hook.ts: -------------------------------------------------------------------------------- 1 | import { useSelector } from 'react-redux' 2 | import { Config } from './interface' 3 | import { RootState } from '../index' 4 | 5 | export const useConfig = (): Config => { 6 | const contacts: Config = useSelector((state: RootState) => state.config) 7 | return { 8 | ...contacts 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/src/stores/config/index.ts: -------------------------------------------------------------------------------- 1 | export type { Config, FastWithdrawConfig } from './interface' 2 | export * as configReducer from './reducer' 3 | export {useConfig} from './hook' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/config/interface.ts: -------------------------------------------------------------------------------- 1 | import { ForexMap, StateBase } from '@loopring-web/common-resources' 2 | import * as sdk from '@loopring-web/loopring-sdk' 3 | 4 | 5 | export type FastWithdrawConfig = { 6 | fromToNetworks: { 7 | [key in string]: Array 8 | }, 9 | networkExchanges: { 10 | [key in string]: string 11 | }, 12 | networkProtocols: { 13 | [key in string]: string 14 | }, 15 | networkL1Tokens: { 16 | [key in string]: { 17 | [key in string]: string 18 | } 19 | }, 20 | networkL2TokenIds: { 21 | [key in string]: Array 22 | }, 23 | networkL2AgentAddresses: { 24 | [key in string]: string 25 | }, 26 | networkL2AgentAccountIds: { 27 | [key in string]: number 28 | } 29 | } 30 | 31 | export type Config = { 32 | fastWithdrawConfig: FastWithdrawConfig | undefined 33 | } 34 | -------------------------------------------------------------------------------- /packages/core/src/stores/config/reducer.ts: -------------------------------------------------------------------------------- 1 | import { createSlice, PayloadAction, Slice } from '@reduxjs/toolkit' 2 | import { Config, FastWithdrawConfig } from './interface' 3 | 4 | const initialState: Config = { 5 | fastWithdrawConfig: undefined 6 | } 7 | export const configSlice: Slice = createSlice({ 8 | name: 'system', 9 | initialState, 10 | reducers: { 11 | updateFastWithdrawConfig(state, action: PayloadAction) { 12 | state.fastWithdrawConfig = action.payload 13 | }, 14 | }, 15 | }) 16 | export default configSlice 17 | export const { updateFastWithdrawConfig } = configSlice.actions 18 | -------------------------------------------------------------------------------- /packages/core/src/stores/contacts/hooks.ts: -------------------------------------------------------------------------------- 1 | import { updateContacts, reset, statusUnset } from './reducer' 2 | import { useDispatch, useSelector } from 'react-redux' 3 | import React from 'react' 4 | import { ContactsState } from './interface' 5 | import { RootState } from '../index' 6 | 7 | export const useContacts = (): ContactsState & { 8 | updateContacts: () => void 9 | reset: () => void 10 | statusUnset: () => void 11 | } => { 12 | const contacts: ContactsState = useSelector((state: RootState) => state.contacts) 13 | const dispatch = useDispatch() 14 | return { 15 | ...contacts, 16 | statusUnset: React.useCallback(() => dispatch(statusUnset(undefined)), [dispatch]), 17 | updateContacts: React.useCallback(() => dispatch(updateContacts({})), [dispatch]), 18 | reset: React.useCallback(() => dispatch(reset({})), [dispatch]), 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/core/src/stores/contacts/index.ts: -------------------------------------------------------------------------------- 1 | export * as contactsReducer from './reducer' 2 | export * from './hooks' 3 | export * from './interface' 4 | export * from './saga' 5 | 6 | // export * from './method' 7 | -------------------------------------------------------------------------------- /packages/core/src/stores/contacts/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase } from '@loopring-web/common-resources' 2 | import * as sdk from '@loopring-web/loopring-sdk' 3 | 4 | export type ContactsState = Pick & { 5 | __timer__: NodeJS.Timeout | -1 6 | } & StateBase 7 | -------------------------------------------------------------------------------- /packages/core/src/stores/global/actions.ts: -------------------------------------------------------------------------------- 1 | import { createAction } from '@reduxjs/toolkit' 2 | 3 | // fired once when the app reloads but before the app renders 4 | // allows any updates to be applied to store data loaded from localStorage 5 | export const updateVersion = createAction('global/updateVersion') 6 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/BtradeMap/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * as btradeReducer from './reducer' 3 | export * from './interface' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/BtradeMap/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase } from '@loopring-web/common-resources' 2 | import * as sdk from '@loopring-web/loopring-sdk' 3 | 4 | export type BtradeUIMap = { enabled: boolean | 'isFormLocal' } & Omit 5 | export type BtradeMap = { 6 | marketArray: string[] 7 | marketCoins: string[] 8 | marketMap: sdk.LoopringMap 9 | tradeMap: sdk.LoopringMap<{ tokenId: number; tradePairs: string[] }> 10 | } 11 | 12 | export type BtradeMapStates = BtradeMap & { 13 | __timer__?: number 14 | } & StateBase 15 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/DefiMap/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * as defiReducer from './reducer' 3 | export * from './interface' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/DefiMap/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase } from '@loopring-web/common-resources' 2 | import * as sdk from '@loopring-web/loopring-sdk' 3 | 4 | export type DefiMap = { 5 | marketArray: string[] 6 | marketCoins: string[] 7 | marketMap: sdk.LoopringMap 8 | marketLeverageArray: string[] 9 | marketLeverageCoins: string[] 10 | marketLeverageMap: sdk.LoopringMap 11 | } 12 | 13 | export type DefiMapStates = DefiMap & { 14 | __timer__?: number 15 | } & StateBase 16 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/DualMap/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * as dualReducer from './reducer' 3 | export * from './interface' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/DualMap/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase } from '@loopring-web/common-resources' 2 | import * as sdk from '@loopring-web/loopring-sdk' 3 | 4 | export type DualMap = { 5 | marketArray: string[] 6 | marketCoins: string[] 7 | marketMap: sdk.LoopringMap 8 | tradeMap: sdk.LoopringMap<{ tokenId: number; tokenList: string[]; quoteList }> 9 | } 10 | 11 | export type DualMapStates = DualMap & { 12 | __timer__?: number 13 | } & StateBase 14 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/InvestTokenTypeMap/hook.ts: -------------------------------------------------------------------------------- 1 | import { InvestTokenTypeMapStates } from './interface' 2 | import { useDispatch, useSelector } from 'react-redux' 3 | import { RootState } from '../../index' 4 | import React from 'react' 5 | import { getInvestTokenTypeMap, statusUnset } from './reducer' 6 | 7 | export const useInvestTokenTypeMap = (): InvestTokenTypeMapStates & { 8 | getInvestTokenTypeMap: () => void 9 | statusUnset: () => void 10 | } => { 11 | const investTokenTypeMap: InvestTokenTypeMapStates = useSelector( 12 | (state: RootState) => state.invest.investTokenTypeMap, 13 | ) 14 | const dispatch = useDispatch() 15 | return { 16 | ...investTokenTypeMap, 17 | statusUnset: React.useCallback(() => dispatch(statusUnset(undefined)), [dispatch]), 18 | getInvestTokenTypeMap: React.useCallback( 19 | () => dispatch(getInvestTokenTypeMap(undefined)), 20 | [dispatch], 21 | ), 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/InvestTokenTypeMap/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * as investTokenTypeMapReducer from './reducer' 3 | export * from './interface' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/InvestTokenTypeMap/interface.ts: -------------------------------------------------------------------------------- 1 | import { InvestDetail, InvestItem, InvestMapType, StateBase } from '@loopring-web/common-resources' 2 | 3 | //labelInvestType 4 | export const labelI18n = 'labelInvestType_' 5 | 6 | export type InvestTokenTypeMap = { 7 | [key: string]: { 8 | [key in InvestMapType]?: InvestItem 9 | } & { detail: InvestDetail } 10 | } 11 | 12 | export type InvestTokenTypeMapStates = { 13 | investTokenTypeMap: InvestTokenTypeMap 14 | } & StateBase 15 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/StakingMap/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * as stakingReducer from './reducer' 3 | export * from './interface' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/StakingMap/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase } from '@loopring-web/common-resources' 2 | import * as sdk from '@loopring-web/loopring-sdk' 3 | 4 | export type StakingMap = { 5 | marketArray: string[] 6 | marketCoins: string[] 7 | marketMap: sdk.LoopringMap 8 | } 9 | 10 | export type StakingMapStates = StakingMap & { 11 | __timer__?: number 12 | } & StateBase 13 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/VaultMap/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * as vaultReducer from './reducer' 3 | export * from './interface' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/VaultTicker/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as vaultTickerReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/invest/VaultTicker/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase, TickerNew } from '@loopring-web/common-resources' 2 | 3 | export type VaultTickerMap = { 4 | [key in keyof R]: TickerNew 5 | } 6 | export type VaultTickerStates = { 7 | vaultTickerMap: VaultTickerMap 8 | __timer__?: number 9 | } & StateBase 10 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/coinbaseSmartWalletPersist/hook.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from 'react-redux' 2 | import { persistStoreCoinbaseSmartWalletData } from './reducer' 3 | import React from 'react' 4 | import { RootState } from '../../index' 5 | import { CoinbaseSmartWalletPersist, CoinbaseSmartWalletPersistData } from './interface' 6 | 7 | export function useCoinbaseSmartWalletPersist() { 8 | const state: CoinbaseSmartWalletPersist = useSelector( 9 | (state: RootState) => state.localStore.coinbaseSmartWalletPersist, 10 | ) 11 | // const [shouldShow,setShouldShow] = React.useState(account._userOnModel) 12 | const dispatch = useDispatch() 13 | 14 | return { 15 | ...state, 16 | persistStoreCoinbaseSmartWalletData: React.useCallback( 17 | (data: CoinbaseSmartWalletPersistData) => { 18 | dispatch(persistStoreCoinbaseSmartWalletData(data)) 19 | }, 20 | [dispatch], 21 | ), 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/coinbaseSmartWalletPersist/index.ts: -------------------------------------------------------------------------------- 1 | import coinbaseSmartWalletPersistSlice from './reducer' 2 | export { persistStoreCoinbaseSmartWalletData } from './reducer' 3 | export { useCoinbaseSmartWalletPersist } from './hook' 4 | export { coinbaseSmartWalletPersistSlice } 5 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/coinbaseSmartWalletPersist/interface.ts: -------------------------------------------------------------------------------- 1 | import { ChainId } from "@loopring-web/loopring-sdk"; 2 | 3 | export interface CoinbaseSmartWalletPersist { 4 | data: CoinbaseSmartWalletPersistData[] 5 | } 6 | 7 | export interface CoinbaseSmartWalletPersistData { 8 | wallet: string; 9 | eddsaKey: { 10 | sk: string; 11 | formatedPx: string; 12 | formatedPy: string; 13 | keyPair: { 14 | publicKeyX: string; 15 | publicKeyY: string; 16 | secretKey: string; 17 | }; 18 | }; 19 | nonce: number 20 | chainId: ChainId 21 | updateAccountData: { 22 | updateAccountNotFinished: boolean 23 | json: string 24 | } 25 | eddsaKeyBackup: { 26 | backupNotFinished: boolean 27 | json: string 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/confirmation/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './reducer' 3 | export * from './interface' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/favoriteMarket/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/favoriteMarket/interface.ts: -------------------------------------------------------------------------------- 1 | export type FavoriteMarketStates = string[] 2 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/favoriteVaultMarket/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './reducer' 3 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/layer1Store/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './reducer' 3 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/nftRefresh/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './reducer' 3 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/offRamp/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './reducer' 3 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/onchainHashInfo/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './reducer' 3 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/redPacket/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './reducer' 3 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/tradeProSettings/hook.ts: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { useDispatch, useSelector } from 'react-redux' 3 | import { TradeProSettings } from './interface' 4 | import { updateHideOtherPairs } from './reducer' 5 | import { RootState } from '../../index' 6 | 7 | export const useTradeProSettings = () => { 8 | const tradeProSettings: TradeProSettings = useSelector( 9 | (state: RootState) => state.localStore.tradeProSettings, 10 | ) 11 | const dispatch = useDispatch() 12 | 13 | const updateIsHideOtherPairs = React.useCallback( 14 | ({ isHide }: { isHide: boolean }) => { 15 | dispatch(updateHideOtherPairs({ isHide })) 16 | }, 17 | [dispatch], 18 | ) 19 | 20 | return { 21 | tradeProSettings, 22 | updateIsHideOtherPairs, 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/tradeProSettings/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/tradeProSettings/interface.ts: -------------------------------------------------------------------------------- 1 | export interface TradeProSettings { 2 | hideOtherTradingPairs: boolean 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/tradeProSettings/reducer.ts: -------------------------------------------------------------------------------- 1 | import { createSlice, PayloadAction, Slice } from '@reduxjs/toolkit' 2 | import { SliceCaseReducers } from '@reduxjs/toolkit/src/createSlice' 3 | import { TradeProSettings } from './interface' 4 | 5 | const initialState: TradeProSettings = { 6 | hideOtherTradingPairs: false, 7 | } 8 | 9 | const tradeProSettingsSlice: Slice = createSlice< 10 | TradeProSettings, 11 | SliceCaseReducers, 12 | 'tradeProSettings' 13 | >({ 14 | name: 'tradeProSettings', 15 | initialState, 16 | reducers: { 17 | updateHideOtherPairs(state: TradeProSettings, action: PayloadAction<{ isHide: boolean }>) { 18 | const tradeProSettings = action.payload 19 | state.hideOtherTradingPairs = tradeProSettings.isHide 20 | }, 21 | }, 22 | }) 23 | 24 | export { tradeProSettingsSlice } 25 | export const { updateHideOtherPairs } = tradeProSettingsSlice.actions 26 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/walletInfo/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './reducer' 3 | export * from './interface' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/walletInfo/interface.ts: -------------------------------------------------------------------------------- 1 | export interface WalletInfo { 2 | walletTypeMap: { [key: string]: boolean } 3 | } 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/localStore/walletInfo/reducer.ts: -------------------------------------------------------------------------------- 1 | import { createSlice, PayloadAction, Slice } from '@reduxjs/toolkit' 2 | import { SliceCaseReducers } from '@reduxjs/toolkit/src/createSlice' 3 | import { WalletInfo } from './interface' 4 | 5 | const initialState: WalletInfo = { 6 | walletTypeMap: {}, 7 | } 8 | 9 | const walletInfoSlice: Slice = createSlice< 10 | WalletInfo, 11 | SliceCaseReducers, 12 | 'walletInfo' 13 | >({ 14 | name: 'walletInfo', 15 | initialState, 16 | reducers: { 17 | clearAll(state: WalletInfo) { 18 | state = initialState 19 | }, 20 | updateWallet(_state: WalletInfo, _action: PayloadAction<{ address: string; isHW: boolean }>) { 21 | // const walletInfo = action.payload 22 | // state.walletTypeMap[walletInfo.address] = walletInfo.isHW 23 | }, 24 | }, 25 | }) 26 | 27 | export { walletInfoSlice } 28 | export const { clearAll, updateWallet } = walletInfoSlice.actions 29 | -------------------------------------------------------------------------------- /packages/core/src/stores/notify/hook.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from 'react-redux' 2 | import { getNotify, statusUnset, getUserNotify, restUerNotify } from './reducer' 3 | import { NotifyStates } from './interface' 4 | import React from 'react' 5 | 6 | export function useNotify() { 7 | const notifyMap: NotifyStates = useSelector((state: any) => state.notifyMap) 8 | const dispatch = useDispatch() 9 | return { 10 | ...notifyMap, 11 | restUserNotify: React.useCallback(() => dispatch(restUerNotify(undefined)), [dispatch]), 12 | statusUnset: React.useCallback(() => dispatch(statusUnset(undefined)), [dispatch]), 13 | getNotify: React.useCallback(() => dispatch(getNotify(undefined)), [dispatch]), 14 | getUserNotify: React.useCallback(() => dispatch(getUserNotify(undefined)), [dispatch]), 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/src/stores/notify/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as notifyReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/notify/interface.ts: -------------------------------------------------------------------------------- 1 | import { Notify, StateBase } from '@loopring-web/common-resources' 2 | import * as sdk from '@loopring-web/loopring-sdk' 3 | 4 | /** 5 | * @notifyMap is only update 6 | */ 7 | export type NotifyStates = { 8 | notifyMap: Notify | undefined 9 | myNotifyMap: { 10 | items: sdk.UserNotification[] 11 | total: number | undefined 12 | unReads: number | undefined 13 | } 14 | } & StateBase 15 | -------------------------------------------------------------------------------- /packages/core/src/stores/redPacket/hook.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from 'react-redux' 2 | import { getRedPacketConfigs, statusUnset } from './reducer' 3 | import { RedPacketConfigStates } from './interface' 4 | import { CoinKey } from '@loopring-web/common-resources' 5 | import React from 'react' 6 | 7 | export function useRedPacketConfig(): RedPacketConfigStates & { 8 | updateRedPacketConfigs: (tickerKeys: Array>) => void 9 | statusUnset: () => void 10 | } { 11 | const redPacketConfigs = useSelector((state: any) => state.redPacketConfigs) 12 | const dispatch = useDispatch() 13 | return { 14 | ...redPacketConfigs, 15 | statusUnset: React.useCallback(() => dispatch(statusUnset(undefined)), [dispatch]), 16 | updateRedPacketConfigs: React.useCallback(() => dispatch(getRedPacketConfigs({})), [dispatch]), 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/core/src/stores/redPacket/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as tickerReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/redPacket/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase } from '@loopring-web/common-resources' 2 | 3 | export type RedPacketConfig = any 4 | export type RedPacketConfigStates = { 5 | redPacketConfigs: RedPacketConfig 6 | __timer__?: number 7 | } & StateBase 8 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/amm/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/index.ts: -------------------------------------------------------------------------------- 1 | export * from './tradeLite' 2 | export * from './amm' 3 | export * from './modals' 4 | export * from './tradePro' 5 | export * from './tradeDefi' 6 | export * from './tradeDual' 7 | export * from './tradeStake' 8 | export * from './tradeVault' 9 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/modals/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/tradeBtrade/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/tradeDefi/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/tradeDefi/interface.ts: -------------------------------------------------------------------------------- 1 | import { TradeDefi } from '@loopring-web/common-resources' 2 | 3 | export type TradeDefiStatus = { 4 | tradeDefi: TradeDefi 5 | __DAYS__: 30 6 | __SUBMIT_LOCK_TIMER__: 1000 7 | __TOAST_AUTO_CLOSE_TIMER__: 3000 8 | } 9 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/tradeDual/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/tradeDual/interface.ts: -------------------------------------------------------------------------------- 1 | import { DualCalcData, DualViewOrder } from '@loopring-web/common-resources' 2 | 3 | export type TradeDual = DualCalcData 4 | export type EditDual = { 5 | dualViewInfo: I 6 | tradeData: { 7 | isRenew: boolean 8 | renewTargetPrice?: string 9 | renewDuration?: number 10 | } 11 | } & I 12 | 13 | export type TradeDualStatus = { 14 | tradeDual: TradeDual 15 | editDual: EditDual 16 | __DAYS__: 30 17 | __SUBMIT_LOCK_TIMER__: 1000 18 | __TOAST_AUTO_CLOSE_TIMER__: 3000 19 | } 20 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/tradeLite/hook.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from 'react-redux' 2 | import { updatePageTradeLite } from './reducer' 3 | import { PageTradeLite, PageTradeLiteStatus } from './interface' 4 | import React from 'react' 5 | import { RequireOne } from '@loopring-web/common-resources' 6 | 7 | export function usePageTradeLite(): PageTradeLiteStatus & { 8 | updatePageTradeLite: (pageTradeLite: RequireOne) => void 9 | } { 10 | const pageTradeLiteStatus: PageTradeLiteStatus = useSelector( 11 | (state: any) => state._router_pageTradeLite, 12 | ) 13 | const dispatch = useDispatch() 14 | return { 15 | ...pageTradeLiteStatus, 16 | updatePageTradeLite: React.useCallback( 17 | (pageTradeLite: RequireOne) => { 18 | dispatch(updatePageTradeLite(pageTradeLite)) 19 | }, 20 | [dispatch], 21 | ), 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/tradeLite/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/tradePro/hook.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from 'react-redux' 2 | import { updatePageTradePro } from './reducer' 3 | import { PageTradePro, PageTradeProStatus } from './interface' 4 | import React from 'react' 5 | import { RequireOne } from '@loopring-web/common-resources' 6 | 7 | export function usePageTradePro(): PageTradeProStatus & { 8 | updatePageTradePro: (pageTradePro: RequireOne, 'market'>) => void 9 | } { 10 | const pageTradeProStatus: PageTradeProStatus = useSelector( 11 | (state: any) => state._router_pageTradePro, 12 | ) 13 | const dispatch = useDispatch() 14 | return { 15 | ...pageTradeProStatus, 16 | updatePageTradePro: React.useCallback( 17 | (pageTradePro: RequireOne, 'market'>) => { 18 | dispatch(updatePageTradePro(pageTradePro)) 19 | }, 20 | [dispatch], 21 | ), 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/tradePro/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/tradeStake/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/tradeStake/interface.ts: -------------------------------------------------------------------------------- 1 | import { RedeemStake, TradeStake } from '@loopring-web/common-resources' 2 | 3 | export type TradeStakeStatus = { 4 | tradeStake: TradeStake 5 | __DAYS__: 30 6 | __SUBMIT_LOCK_TIMER__: 1000 7 | __TOAST_AUTO_CLOSE_TIMER__: 3000 8 | } 9 | 10 | export type RedeemStakeStatus = { 11 | redeemStake: RedeemStake 12 | __DAYS__: 30 13 | __SUBMIT_LOCK_TIMER__: 1000 14 | __TOAST_AUTO_CLOSE_TIMER__: 3000 15 | } 16 | -------------------------------------------------------------------------------- /packages/core/src/stores/router/tradeVault/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/socket/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/system/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as systemReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/targetRedpackt/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as targetRedpacketReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/targetRedpackt/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase } from '@loopring-web/common-resources' 2 | import { LuckyTokenItemForReceive } from '@loopring-web/loopring-sdk' 3 | 4 | export type RedPacketConfig = any 5 | export type TargetRedPacketStates = { 6 | redPackets: LuckyTokenItemForReceive[] | undefined 7 | openedRedPackets: boolean 8 | showPopup: boolean 9 | __timer__?: number 10 | } & StateBase 11 | -------------------------------------------------------------------------------- /packages/core/src/stores/ticker/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as tickerReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/ticker/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase, Ticker } from '@loopring-web/common-resources' 2 | 3 | export type TickerMap = { 4 | [key in keyof R]: Ticker 5 | } 6 | export type TickerStates = { 7 | tickerMap: TickerMap 8 | __timer__?: number 9 | } & StateBase 10 | -------------------------------------------------------------------------------- /packages/core/src/stores/token/hook.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from 'react-redux' 2 | import { getTokenMap, statusUnset } from './reducer' 3 | import { GetTokenMapParams, TokenMapStates } from './interface' 4 | import React from 'react' 5 | import { PayloadAction } from '@reduxjs/toolkit' 6 | 7 | export function useTokenMap(): TokenMapStates & { 8 | getTokenMap: (props: PayloadAction>) => void 9 | statusUnset: () => void 10 | } { 11 | const tokenMap: TokenMapStates = useSelector((state: any) => state.tokenMap) 12 | const dispatch = useDispatch() 13 | 14 | return { 15 | ...tokenMap, 16 | statusUnset: React.useCallback(() => dispatch(statusUnset(undefined)), [dispatch]), 17 | getTokenMap: React.useCallback( 18 | (props: PayloadAction>) => dispatch(getTokenMap(props)), 19 | [dispatch], 20 | ), 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/src/stores/token/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as tokenReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/tokenPrices/hook.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from 'react-redux' 2 | import React from 'react' 3 | import { TokenPricesStates } from './interface' 4 | import { getTokenPrices, statusUnset } from './reducer' 5 | 6 | export const useTokenPrices = (): TokenPricesStates & { 7 | getTokenPrices: () => void 8 | statusUnset: () => void 9 | } => { 10 | const tokenPrices: TokenPricesStates = useSelector((state: any) => state.tokenPrices) 11 | const dispatch = useDispatch() 12 | return { 13 | ...tokenPrices, 14 | statusUnset: React.useCallback(() => dispatch(statusUnset(undefined)), [dispatch]), 15 | getTokenPrices: React.useCallback(() => dispatch(getTokenPrices(undefined)), [dispatch]), 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/core/src/stores/tokenPrices/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as tokenPriceReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/tokenPrices/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase } from '@loopring-web/common-resources' 2 | 3 | export type TokenPrices = { 4 | [key in keyof R]: number 5 | } 6 | 7 | export type TokenPricesStates = { 8 | tokenPrices: TokenPrices 9 | __timer__?: number 10 | __rawConfig__: any 11 | } & StateBase 12 | -------------------------------------------------------------------------------- /packages/core/src/stores/userRewards/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as useRewardReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/vaultLayer2/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as vaultLayer2Reducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/vaultLayer2/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase } from '@loopring-web/common-resources' 2 | import * as sdk from '@loopring-web/loopring-sdk' 3 | 4 | export type VaultLayer2Map = { 5 | [key in keyof R]: sdk.VaultBalance 6 | } 7 | 8 | export type VaultLayer2States = { 9 | vaultLayer2?: VaultLayer2Map | undefined 10 | vaultAccountInfo?: sdk.VaultAccountInfo | undefined 11 | activeInfo?: { 12 | hash: string 13 | isInActive: boolean 14 | } 15 | tokenFactors: { 16 | symbol: string 17 | factor: string 18 | }[] 19 | maxLeverage: string | undefined 20 | collateralTokens: { 21 | orderHash: string 22 | collateralTokenId: number 23 | collateralTokenAmount: string 24 | nftTokenId: number 25 | nftData: string 26 | }[] 27 | __timer__?: NodeJS.Timeout | -1 28 | } & StateBase 29 | -------------------------------------------------------------------------------- /packages/core/src/stores/walletL2Collection/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as walletL2CollectionReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/walletL2Collection/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase, CollectionMeta } from '@loopring-web/common-resources' 2 | 3 | export type WalletL2CollectionStates = { 4 | walletL2Collection: C[] 5 | legacyContract: string[] 6 | total: number 7 | page: number 8 | } & StateBase 9 | -------------------------------------------------------------------------------- /packages/core/src/stores/walletL2NFTCollection/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as walletL2NFTCollectionReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/walletL2NFTCollection/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase, CollectionMeta } from '@loopring-web/common-resources' 2 | 3 | export type WalletL2NFTCollectionStates = { 4 | walletL2NFTCollection: C[] 5 | total: number 6 | page: number 7 | } & StateBase 8 | -------------------------------------------------------------------------------- /packages/core/src/stores/walletLayer1/hook.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from 'react-redux' 2 | import { reset, statusUnset, updateWalletLayer1 } from './reducer' 3 | import { WalletLayer1States } from './interface' 4 | import React from 'react' 5 | 6 | export function useWalletLayer1(): WalletLayer1States & { 7 | updateWalletLayer1: () => void 8 | statusUnset: () => void 9 | resetLayer1: () => void 10 | } { 11 | const walletLayer1: WalletLayer1States = useSelector((state: any) => state.walletLayer1) 12 | const dispatch = useDispatch() 13 | 14 | return { 15 | ...walletLayer1, 16 | resetLayer1: React.useCallback(() => { 17 | dispatch(reset(undefined)) 18 | }, [dispatch]), 19 | statusUnset: React.useCallback(() => dispatch(statusUnset(undefined)), [dispatch]), 20 | updateWalletLayer1: React.useCallback( 21 | () => dispatch(updateWalletLayer1(undefined)), 22 | [dispatch], 23 | ), 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/core/src/stores/walletLayer1/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as walletLayer1Reducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/walletLayer1/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase, WalletCoin } from '@loopring-web/common-resources' 2 | 3 | export type WalletLayer1Map = { 4 | [key in keyof R]: WalletCoin 5 | } 6 | export type WalletLayer1States = { 7 | walletLayer1?: WalletLayer1Map | undefined 8 | } & StateBase 9 | -------------------------------------------------------------------------------- /packages/core/src/stores/walletLayer2/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as walletLayer2Reducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/walletLayer2/interface.ts: -------------------------------------------------------------------------------- 1 | import { StateBase } from '@loopring-web/common-resources' 2 | import * as loopring_defs from '@loopring-web/loopring-sdk' 3 | 4 | export type WalletLayer2Map = { 5 | [key in keyof R]: loopring_defs.UserBalanceInfo 6 | } 7 | 8 | export type WalletLayer2States = { 9 | walletLayer2?: WalletLayer2Map | undefined 10 | } & StateBase 11 | -------------------------------------------------------------------------------- /packages/core/src/stores/walletLayer2NFT/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hook' 2 | export * from './interface' 3 | export * as walletLayer2NFTReducer from './reducer' 4 | -------------------------------------------------------------------------------- /packages/core/src/stores/walletLayer2NFT/interface.ts: -------------------------------------------------------------------------------- 1 | import { CollectionMeta, MyNFTFilter, StateBase } from '@loopring-web/common-resources' 2 | import * as loopring_defs from '@loopring-web/loopring-sdk' 3 | 4 | export type WalletLayer2NFTMap = { 5 | [key in keyof R]: loopring_defs.UserBalanceInfo 6 | } 7 | 8 | export type WalletLayer2NFTStates = { 9 | collection: CollectionMeta | undefined 10 | walletLayer2NFT: loopring_defs.UserNFTBalanceInfo[] 11 | total: number 12 | page: number 13 | filter?: MyNFTFilter | undefined 14 | } & StateBase 15 | -------------------------------------------------------------------------------- /packages/core/src/types.d.ts: -------------------------------------------------------------------------------- 1 | import { LoopringSocket } from '@loopring-web/core' 2 | import { RampInstantSDK } from '@ramp-network/ramp-instant-sdk' 3 | 4 | declare global { 5 | interface Window { 6 | loopringSocket: InstanceType 7 | __renderReportCall__: () => void 8 | Banxa: any 9 | rampInstance: RampInstantSDK | undefined 10 | rampTransPromise: Promise<{ txHash: string }> | undefined 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/core/src/utils/.gitignore: -------------------------------------------------------------------------------- 1 | *.java 2 | -------------------------------------------------------------------------------- /packages/core/src/utils/AESMd5.ts: -------------------------------------------------------------------------------- 1 | import { AES, enc, MD5 } from "crypto-js" 2 | 3 | export const encryptAESMd5 = (password: string, data: string) => { 4 | const md5Password = MD5(password).toString() 5 | return AES.encrypt(data, md5Password).toString() 6 | } 7 | 8 | export const decryptAESMd5 = (password: string, encryptedData: string) => { 9 | const md5Password = MD5(password).toString() 10 | return AES.decrypt(encryptedData, md5Password).toString(enc.Utf8) 11 | } -------------------------------------------------------------------------------- /packages/core/src/utils/address.ts: -------------------------------------------------------------------------------- 1 | export const isSameEVMAddress = (address1: string, address2: string) => { 2 | return address1.toLowerCase() === address2.toLowerCase() 3 | } -------------------------------------------------------------------------------- /packages/core/src/utils/calculation.ts: -------------------------------------------------------------------------------- 1 | import Decimal from "decimal.js"; 2 | 3 | export const numberStringListSum = (list: string[]) => 4 | list.reduce((pre, cur) => pre.add(cur), new Decimal(0)).toFixed() 5 | -------------------------------------------------------------------------------- /packages/core/src/utils/coinbaseSmartWallet.ts: -------------------------------------------------------------------------------- 1 | import { ChainId } from "@loopring-web/loopring-sdk" 2 | import type { UserOperation } from 'permissionless'; 3 | import { createPublicClient } from 'viem'; 4 | import { CHAIN_ID_TO_VIEW_CHAIN } from "@loopring-web/common-resources"; 5 | import { http } from 'viem'; 6 | import { isWalletACoinbaseSmartWallet } from '@coinbase/onchainkit/wallet'; 7 | 8 | export const isCoinbaseSmartWallet = async (accAddress: string | undefined, chainId: ChainId) => { 9 | if (!accAddress) return false; 10 | const rpcURL = process.env[`REACT_APP_RPC_URL_${chainId}`] 11 | const res = await isWalletACoinbaseSmartWallet({ client:createPublicClient({ 12 | chain: CHAIN_ID_TO_VIEW_CHAIN.get(chainId), 13 | transport: http(rpcURL), 14 | }), userOp: { sender: accAddress } as UserOperation<'v0.6'> }) 15 | return res.isCoinbaseSmartWallet 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/src/utils/decimal.ts: -------------------------------------------------------------------------------- 1 | import Decimal from "decimal.js" 2 | 3 | export const getOptionalDecimal = (value: any) => { 4 | try { 5 | return new Decimal(value) 6 | } catch (e) { 7 | return undefined 8 | } 9 | } -------------------------------------------------------------------------------- /packages/core/src/utils/getStateFnState.ts: -------------------------------------------------------------------------------- 1 | 2 | export const getStateFnState = (setStateFn: React.Dispatch>) => { 3 | return new Promise(res => { 4 | return setStateFn(state => { 5 | res(state) 6 | return state 7 | }) 8 | }) 9 | } -------------------------------------------------------------------------------- /packages/core/src/utils/makeMeta.ts: -------------------------------------------------------------------------------- 1 | import { CollectionMeta, MakeMeta } from '@loopring-web/common-resources' 2 | 3 | export const makeMeta: MakeMeta = ({ 4 | collection, 5 | domain, 6 | }: { 7 | collection: CollectionMeta 8 | domain: string 9 | }) => { 10 | const metaDemo = { 11 | name: '`${NFT_NAME}`', 12 | description: '`${NFT_DESCRIPTION}`', 13 | image: 'ipfs://`${CID}`', 14 | animation_url: 'ipfs://`${CID}`', 15 | collection_metadata: `${domain}/${collection.contractAddress}`, 16 | royalty_percentage: '`[0..10] (int 0-10)`', 17 | attributes: [ 18 | { 19 | trait_type: '`${PROPERTIES_KEY}`', 20 | value: '`${VALUE}`', 21 | }, 22 | ], 23 | properties: { 24 | '`${PROPERTIES_KEY}`': '`${VALUE}`', 25 | }, 26 | } 27 | return { metaDemo } 28 | } 29 | -------------------------------------------------------------------------------- /packages/core/src/utils/promise.ts: -------------------------------------------------------------------------------- 1 | 2 | export const promiseAllSequently = async (promiseFns: (() => Promise)[]) => { 3 | let list = [] as any[] 4 | for (let index = 0; index < promiseFns.length; index++) { 5 | const fn = promiseFns[index]; 6 | const res = await fn().catch(e => { 7 | throw e 8 | }) 9 | list = list.concat(res) 10 | } 11 | return list 12 | } -------------------------------------------------------------------------------- /packages/core/src/utils/retry.ts: -------------------------------------------------------------------------------- 1 | export const withRetry = ( 2 | fn: (...args: Args) => Promise, 3 | maxRetries: number, 4 | delayMs?: number 5 | ): ((...args: Args) => Promise) => { 6 | const retryFn = async ( 7 | args: Args, 8 | retriesLeft: number, 9 | lastError?: Error | unknown 10 | ): Promise => { 11 | if (retriesLeft < 0 && lastError) { 12 | throw lastError; 13 | } 14 | 15 | try { 16 | return await fn(...args); 17 | } catch (err) { 18 | if (retriesLeft > 0) { 19 | if (delayMs) { 20 | await new Promise(resolve => setTimeout(resolve, delayMs)); 21 | } 22 | 23 | return retryFn(args, retriesLeft - 1, err); 24 | } 25 | 26 | throw err; 27 | } 28 | }; 29 | 30 | return async (...args: Args): Promise => { 31 | return retryFn(args, maxRetries); 32 | }; 33 | }; 34 | -------------------------------------------------------------------------------- /packages/core/src/utils/tryFn.ts: -------------------------------------------------------------------------------- 1 | export const tryFn = (tryCall: () => T, catchCall?: (e: any) => T, finallyCall?: () => void) => { 2 | try { 3 | return tryCall() 4 | } catch (e) { 5 | if (catchCall) { 6 | return catchCall(e) 7 | } else { 8 | throw e 9 | } 10 | } finally { 11 | if (finallyCall) { 12 | finallyCall() 13 | } 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/src/utils/waitForTx.ts: -------------------------------------------------------------------------------- 1 | import Web3 from 'web3' 2 | export const waitForTx = (web3: Web3, hash: string) => { 3 | return new Promise((res, rej) => { 4 | let subscription = web3.eth.subscribe('newBlockHeaders', async (error, event) => { 5 | if (error) { 6 | subscription.unsubscribe() 7 | rej(error) 8 | } 9 | const blockTxHashes = (await web3.eth.getBlock(event.hash)).transactions 10 | if (blockTxHashes.includes(hash)) { 11 | res(await web3.eth.getTransactionReceipt(hash)) 12 | subscription.unsubscribe() 13 | } 14 | }) 15 | }) 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "jsx": "react-jsx", 5 | "noUnusedLocals": true, 6 | "noUnusedParameters": true, 7 | "resolveJsonModule": true, 8 | "allowSyntheticDefaultImports": true, 9 | "baseUrl": "./src", 10 | "rootDir": "./src" 11 | }, 12 | "include": [ 13 | "src", 14 | "src/**/*.json", 15 | "src/*" 16 | ], 17 | "exclude": [ 18 | "node_modules", 19 | "build", 20 | "dist", 21 | "example", 22 | "rollup.config.js" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/core/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | }, 6 | "include": [ 7 | "src", 8 | "src/**/*.json", 9 | "src/*" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /packages/web-bridge/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", 5 | { 6 | "targets": { 7 | "node": "current" 8 | }, 9 | "loose": true 10 | } 11 | ], 12 | [ 13 | "@babel/preset-react", 14 | { 15 | "runtime": "automatic" 16 | } 17 | ] 18 | ], 19 | "plugins": [ 20 | "@babel/plugin-transform-typescript", 21 | "@babel/plugin-proposal-nullish-coalescing-operator", 22 | "@babel/plugin-proposal-optional-chaining" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/web-bridge/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "react-hooks" 4 | ], 5 | "extends": [ 6 | "react-app" 7 | ], 8 | "overrides": [ 9 | { 10 | "files": [ 11 | "**/*.tsx", 12 | "**/*.ts" 13 | ], 14 | "rules": { 15 | "import/no-anonymous-default-export": "off", 16 | "@typescript-eslint/no-unused-vars": "warn", 17 | "react-hooks/rules-of-hooks": "error", 18 | // 检查 Hook 的规则 19 | "react-hooks/exhaustive-deps": "warn" 20 | // 检查 effect 的依赖 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/web-bridge/craco.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require("../../craco.config.cjs") -------------------------------------------------------------------------------- /packages/web-bridge/electron-builder.env: -------------------------------------------------------------------------------- 1 | ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true 2 | -------------------------------------------------------------------------------- /packages/web-bridge/generate-react-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "usesTypeScript": true, 3 | "usesCssModule": true, 4 | "cssPreprocessor": "scss", 5 | "testLibrary": "Testing Library", 6 | "component": { 7 | "default": { 8 | "path": "src/components", 9 | "withLazy": false, 10 | "withStory": true, 11 | "withStyle": true, 12 | "withTest": true 13 | }, 14 | "page": { 15 | "path": "src/pages", 16 | "withLazy": true, 17 | "withStory": false, 18 | "withStyle": true, 19 | "withTest": true 20 | }, 21 | "layout": { 22 | "path": "src/layout", 23 | "withLazy": false, 24 | "withStory": false, 25 | "withStyle": false, 26 | "withTest": true 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/web-bridge/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: 'node', 3 | 4 | setupFilesAfterEnv: ['./jest.setup.js'], 5 | } 6 | -------------------------------------------------------------------------------- /packages/web-bridge/jest.setup.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 2 | 3 | jest.setTimeout(30000) 4 | -------------------------------------------------------------------------------- /packages/web-bridge/public/363123_2_0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-bridge/public/363123_2_0.ttf -------------------------------------------------------------------------------- /packages/web-bridge/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-bridge/public/favicon.ico -------------------------------------------------------------------------------- /packages/web-bridge/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Loopring L2", 3 | "name": "Loopring - Ethereum Layer2", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /packages/web-bridge/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /packages/web-bridge/src/layouts/footer/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { FOOTER_LIST_MAP, MEDIA_LIST } from '@loopring-web/common-resources' 3 | import { Footer as FooterUI } from '@loopring-web/component-lib' 4 | import _ from 'lodash' 5 | 6 | const linkListMap = _.cloneDeep(FOOTER_LIST_MAP) 7 | const mediaList = _.cloneDeep(MEDIA_LIST) 8 | export const Footer = () => { 9 | return ( 10 | 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /packages/web-bridge/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | // window.__loopringEnv__ = process.env; 3 | -------------------------------------------------------------------------------- /packages/web-bridge/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals' 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry) 7 | getFID(onPerfEntry) 8 | getFCP(onPerfEntry) 9 | getLCP(onPerfEntry) 10 | getTTFB(onPerfEntry) 11 | }) 12 | } 13 | } 14 | 15 | export default reportWebVitals 16 | -------------------------------------------------------------------------------- /packages/web-bridge/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom' 6 | -------------------------------------------------------------------------------- /packages/web-bridge/src/types.d.ts: -------------------------------------------------------------------------------- 1 | import { RampInstantSDK } from '@ramp-network/ramp-instant-sdk' 2 | import '@google/model-viewer' 3 | import { ModelViewerElement } from '@google/model-viewer' 4 | 5 | declare module '*.html' { 6 | const value: string 7 | export default value 8 | } 9 | 10 | declare global { 11 | interface Window { 12 | loopringSocket: InstanceType 13 | __renderReportCall__: () => void 14 | rampInstance: RampInstantSDK | undefined 15 | } 16 | 17 | namespace JSX { 18 | interface IntrinsicElements { 19 | 'model-viewer': MyElementAttributes 20 | } 21 | 22 | interface MyElementAttributes { 23 | src: string 24 | 'auto-rotate': any 25 | 'camera-controls': any 26 | 'ar-modes': any 27 | 'touch-action': any 28 | 'shadow-intensity': any 29 | poster?: string 30 | 31 | [key: string]: any 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/web-bridge/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "src/", 5 | "rootDir": "." 6 | }, 7 | "include": [ 8 | "src", 9 | "src/*", 10 | "src/**/*.json" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /packages/web-developer/public/363123_2_0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-developer/public/363123_2_0.ttf -------------------------------------------------------------------------------- /packages/web-developer/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-developer/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /packages/web-developer/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-developer/public/apple-touch-icon.png -------------------------------------------------------------------------------- /packages/web-developer/public/badge.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 19 | -------------------------------------------------------------------------------- /packages/web-developer/public/dark.css: -------------------------------------------------------------------------------- 1 | @import 'reset.css'; 2 | 3 | html { 4 | --color-global-Bg: var(--dark); 5 | --color-primary: #446eff; 6 | --color-primary-hover: var(--light900); 7 | --color-primary-pressed: #2d49b2; 8 | --color-disable: #343754; 9 | --color-text-primary: var(--light); 10 | --color-border: var(--light900); 11 | --color-divide: var(--dark800); 12 | --color-border-hover: var(--color-primary); 13 | --color-text-Secondary: var(--light500); 14 | --color-text-third: var(--dark400); 15 | --color-text-Button: var(--light); 16 | --color-text-ButtonSelect: var(--light); 17 | --color-text-Disable: var(--light) 45; 18 | --color-box: var(--dark900); 19 | --color-logo: var(--light); 20 | } 21 | -------------------------------------------------------------------------------- /packages/web-developer/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-developer/public/favicon-16x16.png -------------------------------------------------------------------------------- /packages/web-developer/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-developer/public/favicon-32x32.png -------------------------------------------------------------------------------- /packages/web-developer/public/favicon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-developer/public/favicon-48x48.png -------------------------------------------------------------------------------- /packages/web-developer/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-developer/public/favicon.ico -------------------------------------------------------------------------------- /packages/web-developer/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-developer/public/favicon.png -------------------------------------------------------------------------------- /packages/web-developer/public/light.css: -------------------------------------------------------------------------------- 1 | @import 'reset.css'; 2 | 3 | html { 4 | --color-global-Bg: var(--light900); 5 | --color-primary: #446eff; 6 | --color-primary-hover: var(--light900) 20; 7 | --color-primary-pressed: #2d49b2; 8 | --color-disable: #343754; 9 | --color-text-primary: var(--dark); 10 | --color-border: var(--dark900); 11 | --color-divide: var(--light500); 12 | --color-border-hover: var(--color-primary); 13 | --color-text-Secondary: var(--dark500); 14 | --color-text-third: var(--light400); 15 | --color-text-Button: var(--dark); 16 | --color-text-ButtonSelect: var(--dark); 17 | --color-text-Disable: var(--dark) 25; 18 | --color-box: var(--light); 19 | --color-logo: #446eff; 20 | } 21 | -------------------------------------------------------------------------------- /packages/web-developer/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-developer/public/logo192.png -------------------------------------------------------------------------------- /packages/web-developer/public/loopring.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/web-developer/public/loopringWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-developer/public/loopringWhite.png -------------------------------------------------------------------------------- /packages/web-developer/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Loopring L2", 3 | "name": "Loopring - Ethereum Layer2", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /packages/web-developer/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /packages/web-developer/public/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "redirects": [ 3 | { "source": "/en", "destination": "https://docs.loopring.io", "permanent": false } 4 | ] 5 | } -------------------------------------------------------------------------------- /packages/web-earn/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/react", 5 | { 6 | "runtime": "automatic", 7 | "loose": true 8 | } 9 | ], 10 | [ 11 | "@babel/preset-react", 12 | { 13 | "runtime": "automatic" 14 | } 15 | ] 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /packages/web-earn/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "react-hooks" 4 | ], 5 | "extends": [ 6 | "react-app" 7 | ], 8 | "overrides": [ 9 | { 10 | "files": [ 11 | "**/*.tsx", 12 | "**/*.ts" 13 | ], 14 | "rules": { 15 | "import/no-anonymous-default-export": "off", 16 | "@typescript-eslint/no-unused-vars": "warn", 17 | "react-hooks/rules-of-hooks": "warn", 18 | // 检查 Hook 的规则 19 | "react-hooks/exhaustive-deps": "warn" 20 | // 检查 effect 的依赖 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/web-earn/craco.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require("../../craco.config.cjs") -------------------------------------------------------------------------------- /packages/web-earn/electron-builder.env: -------------------------------------------------------------------------------- 1 | ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true 2 | -------------------------------------------------------------------------------- /packages/web-earn/generate-react-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "usesTypeScript": true, 3 | "usesCssModule": true, 4 | "cssPreprocessor": "scss", 5 | "testLibrary": "Testing Library", 6 | "component": { 7 | "default": { 8 | "path": "src/components", 9 | "withLazy": false, 10 | "withStory": true, 11 | "withStyle": true, 12 | "withTest": true 13 | }, 14 | "page": { 15 | "path": "src/pages", 16 | "withLazy": true, 17 | "withStory": false, 18 | "withStyle": true, 19 | "withTest": true 20 | }, 21 | "layout": { 22 | "path": "src/layout", 23 | "withLazy": false, 24 | "withStory": false, 25 | "withStyle": false, 26 | "withTest": true 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/web-earn/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: 'node', 3 | 4 | setupFilesAfterEnv: ['./jest.setup.js'], 5 | } 6 | -------------------------------------------------------------------------------- /packages/web-earn/jest.setup.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 2 | 3 | jest.setTimeout(30000) 4 | -------------------------------------------------------------------------------- /packages/web-earn/public/363123_2_0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-earn/public/363123_2_0.ttf -------------------------------------------------------------------------------- /packages/web-earn/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-earn/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /packages/web-earn/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-earn/public/apple-touch-icon.png -------------------------------------------------------------------------------- /packages/web-earn/public/badge.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 19 | -------------------------------------------------------------------------------- /packages/web-earn/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-earn/public/favicon-16x16.png -------------------------------------------------------------------------------- /packages/web-earn/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-earn/public/favicon-32x32.png -------------------------------------------------------------------------------- /packages/web-earn/public/favicon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-earn/public/favicon-48x48.png -------------------------------------------------------------------------------- /packages/web-earn/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-earn/public/favicon.ico -------------------------------------------------------------------------------- /packages/web-earn/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-earn/public/favicon.png -------------------------------------------------------------------------------- /packages/web-earn/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-earn/public/logo192.png -------------------------------------------------------------------------------- /packages/web-earn/public/loopring.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/web-earn/public/loopringWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-earn/public/loopringWhite.png -------------------------------------------------------------------------------- /packages/web-earn/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Loopring L2", 3 | "name": "Loopring - Ethereum Layer2", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /packages/web-earn/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /packages/web-earn/src/constant/index.ts: -------------------------------------------------------------------------------- 1 | export * from 'routers' 2 | -------------------------------------------------------------------------------- /packages/web-earn/src/constant/setting.ts: -------------------------------------------------------------------------------- 1 | import { IsMobile } from "@loopring-web/common-resources" 2 | 3 | 4 | export const RowEarnConfig = { 5 | rowHeight: IsMobile.any() ? 48 : 72, 6 | rowHeaderHeight: IsMobile.any() ? 48 : 44, 7 | minHeight: 350 8 | } -------------------------------------------------------------------------------- /packages/web-earn/src/pages/InvestPage/MyLiquidityPanel/interface.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-earn/src/pages/InvestPage/MyLiquidityPanel/interface.ts -------------------------------------------------------------------------------- /packages/web-earn/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | // window.__loopringEnv__ = process.env; 3 | -------------------------------------------------------------------------------- /packages/web-earn/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals' 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry) 7 | getFID(onPerfEntry) 8 | getFCP(onPerfEntry) 9 | getLCP(onPerfEntry) 10 | getTTFB(onPerfEntry) 11 | }) 12 | } 13 | } 14 | 15 | export default reportWebVitals 16 | -------------------------------------------------------------------------------- /packages/web-earn/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom' 6 | -------------------------------------------------------------------------------- /packages/web-earn/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "src/", 5 | "rootDir": ".", 6 | "noEmit": true 7 | }, 8 | "include": [ 9 | "src", 10 | "src/*", 11 | "src/**/*.json", 12 | "src/types.d.ts" 13 | ], 14 | "awesomeTypescriptLoaderOptions": { 15 | "useCache": true, 16 | "transpileOnly": true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/web-guardian/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", 5 | { 6 | "targets": { 7 | "node": "current" 8 | }, 9 | "loose": true 10 | } 11 | ], 12 | [ 13 | "@babel/preset-react", 14 | { 15 | "runtime": "automatic" 16 | } 17 | ] 18 | ], 19 | "plugins": [ 20 | "@babel/plugin-transform-typescript", 21 | "@babel/plugin-proposal-nullish-coalescing-operator", 22 | "@babel/plugin-proposal-optional-chaining" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/web-guardian/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "@typescript-eslint/parser", 3 | "plugins": [ 4 | "react-hooks", 5 | "@typescript-eslint" 6 | ], 7 | "extends": [ 8 | "react-app" 9 | ], 10 | "overrides": [ 11 | { 12 | "files": [ 13 | "**/*.tsx", 14 | "**/*.ts" 15 | ], 16 | "rules": { 17 | "import/no-anonymous-default-export": "off", 18 | "@typescript-eslint/no-unused-vars": "warn", 19 | "react-hooks/rules-of-hooks": "error", 20 | // 检查 Hook 的规则 21 | "react-hooks/exhaustive-deps": "warn" 22 | // 检查 effect 的依赖 23 | } 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /packages/web-guardian/craco.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require("../../craco.config.cjs") -------------------------------------------------------------------------------- /packages/web-guardian/electron-builder.env: -------------------------------------------------------------------------------- 1 | ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true 2 | -------------------------------------------------------------------------------- /packages/web-guardian/generate-react-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "usesTypeScript": true, 3 | "usesCssModule": true, 4 | "cssPreprocessor": "scss", 5 | "testLibrary": "Testing Library", 6 | "component": { 7 | "default": { 8 | "path": "src/components", 9 | "withLazy": false, 10 | "withStory": true, 11 | "withStyle": true, 12 | "withTest": true 13 | }, 14 | "page": { 15 | "path": "src/pages", 16 | "withLazy": true, 17 | "withStory": false, 18 | "withStyle": true, 19 | "withTest": true 20 | }, 21 | "layout": { 22 | "path": "src/layout", 23 | "withLazy": false, 24 | "withStory": false, 25 | "withStyle": false, 26 | "withTest": true 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/web-guardian/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: 'node', 3 | 4 | setupFilesAfterEnv: ['./jest.setup.js'], 5 | } 6 | -------------------------------------------------------------------------------- /packages/web-guardian/jest.setup.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 2 | 3 | jest.setTimeout(30000) 4 | -------------------------------------------------------------------------------- /packages/web-guardian/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Loopring L2", 3 | "name": "Loopring - Ethereum Layer2", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /packages/web-guardian/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /packages/web-guardian/src/common.ts: -------------------------------------------------------------------------------- 1 | import * as sdk from '@loopring-web/loopring-sdk' 2 | export type ChainId = number | sdk.ChainId 3 | -------------------------------------------------------------------------------- /packages/web-guardian/src/layouts/footer/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { FOOTER_LIST_MAP, MEDIA_LIST } from '@loopring-web/common-resources' 3 | import { Footer as FooterUI } from '@loopring-web/component-lib' 4 | import _ from 'lodash' 5 | 6 | const linkListMap = _.cloneDeep(FOOTER_LIST_MAP) 7 | const mediaList = _.cloneDeep(MEDIA_LIST) 8 | export const Footer = () => { 9 | return ( 10 | 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /packages/web-guardian/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | // window.__loopringEnv__ = process.env; 3 | -------------------------------------------------------------------------------- /packages/web-guardian/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals' 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry) 7 | getFID(onPerfEntry) 8 | getFCP(onPerfEntry) 9 | getLCP(onPerfEntry) 10 | getTTFB(onPerfEntry) 11 | }) 12 | } 13 | } 14 | 15 | export default reportWebVitals 16 | -------------------------------------------------------------------------------- /packages/web-guardian/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom' 6 | -------------------------------------------------------------------------------- /packages/web-guardian/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "src/", 5 | "rootDir": "." 6 | }, 7 | "include": [ 8 | "src", 9 | "src/*", 10 | "src/**/*.json" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /packages/web-home.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-home.zip -------------------------------------------------------------------------------- /packages/web-wallet/public/363123_2_0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-wallet/public/363123_2_0.ttf -------------------------------------------------------------------------------- /packages/web-wallet/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-wallet/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /packages/web-wallet/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-wallet/public/apple-touch-icon.png -------------------------------------------------------------------------------- /packages/web-wallet/public/badge.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 19 | -------------------------------------------------------------------------------- /packages/web-wallet/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-wallet/public/favicon-16x16.png -------------------------------------------------------------------------------- /packages/web-wallet/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-wallet/public/favicon-32x32.png -------------------------------------------------------------------------------- /packages/web-wallet/public/favicon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-wallet/public/favicon-48x48.png -------------------------------------------------------------------------------- /packages/web-wallet/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-wallet/public/favicon.ico -------------------------------------------------------------------------------- /packages/web-wallet/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-wallet/public/favicon.png -------------------------------------------------------------------------------- /packages/web-wallet/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-wallet/public/logo192.png -------------------------------------------------------------------------------- /packages/web-wallet/public/loopring.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/web-wallet/public/loopringWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/web-wallet/public/loopringWhite.png -------------------------------------------------------------------------------- /packages/web-wallet/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Loopring L2", 3 | "name": "Loopring - Ethereum Layer2", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /packages/web-wallet/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /packages/web-wallet/public/wallet_dark.css: -------------------------------------------------------------------------------- 1 | @import 'reset.css'; 2 | 3 | html { 4 | --color-global-Bg: var(--dark); 5 | --color-primary: #446eff; 6 | --color-primary-hover: var(--light900); 7 | --color-primary-pressed: #2d49b2; 8 | --color-disable: #343754; 9 | --color-text-primary: var(--light); 10 | --color-border: var(--light900); 11 | --color-divide: var(--dark800); 12 | --color-border-hover: var(--color-primary); 13 | --color-text-Secondary: var(--light500); 14 | --color-text-third: var(--dark400); 15 | --color-text-Button: var(--light); 16 | --color-text-ButtonSelect: var(--light); 17 | --color-text-Disable: var(--light) 45; 18 | --color-box: var(--dark900); 19 | --color-logo: var(--light); 20 | } 21 | -------------------------------------------------------------------------------- /packages/web-wallet/public/wallet_light.css: -------------------------------------------------------------------------------- 1 | @import 'reset.css'; 2 | 3 | html { 4 | --color-global-Bg: var(--light900); 5 | --color-primary: #446eff; 6 | --color-primary-hover: var(--light900) 20; 7 | --color-primary-pressed: #2d49b2; 8 | --color-disable: #343754; 9 | --color-text-primary: var(--dark); 10 | --color-border: var(--dark900); 11 | --color-divide: var(--light500); 12 | --color-border-hover: var(--color-primary); 13 | --color-text-Secondary: var(--dark500); 14 | --color-text-third: var(--light400); 15 | --color-text-Button: var(--dark); 16 | --color-text-ButtonSelect: var(--dark); 17 | --color-text-Disable: var(--dark) 25; 18 | --color-box: var(--light); 19 | --color-logo: #446eff; 20 | } 21 | -------------------------------------------------------------------------------- /packages/webapp/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/react", 5 | { 6 | "runtime": "automatic", 7 | "loose": true 8 | } 9 | ], 10 | [ 11 | "@babel/preset-react", 12 | { 13 | "runtime": "automatic" 14 | } 15 | ] 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /packages/webapp/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "react-hooks" 4 | ], 5 | "extends": [ 6 | "react-app" 7 | ], 8 | "overrides": [ 9 | { 10 | "files": [ 11 | "**/*.tsx", 12 | "**/*.ts" 13 | ], 14 | "rules": { 15 | "import/no-anonymous-default-export": "off", 16 | "@typescript-eslint/no-unused-vars": "warn", 17 | "@typescript-eslint/ban-types": "off", 18 | "react-hooks/rules-of-hooks": "warn", 19 | // 检查 Hook 的规则 20 | "react-hooks/exhaustive-deps": "warn" 21 | // 检查 effect 的依赖 22 | } 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /packages/webapp/craco.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require("../../craco.config.cjs") -------------------------------------------------------------------------------- /packages/webapp/electron-builder.env: -------------------------------------------------------------------------------- 1 | ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true 2 | -------------------------------------------------------------------------------- /packages/webapp/generate-react-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "usesTypeScript": true, 3 | "usesCssModule": true, 4 | "cssPreprocessor": "scss", 5 | "testLibrary": "Testing Library", 6 | "component": { 7 | "default": { 8 | "path": "src/components", 9 | "withLazy": false, 10 | "withStory": true, 11 | "withStyle": true, 12 | "withTest": true 13 | }, 14 | "page": { 15 | "path": "src/pages", 16 | "withLazy": true, 17 | "withStory": false, 18 | "withStyle": true, 19 | "withTest": true 20 | }, 21 | "layout": { 22 | "path": "src/layout", 23 | "withLazy": false, 24 | "withStory": false, 25 | "withStyle": false, 26 | "withTest": true 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/webapp/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: 'node', 3 | 4 | setupFilesAfterEnv: ['./jest.setup.js'], 5 | } 6 | -------------------------------------------------------------------------------- /packages/webapp/jest.setup.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 2 | 3 | jest.setTimeout(30000) 4 | -------------------------------------------------------------------------------- /packages/webapp/public/363123_2_0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/363123_2_0.ttf -------------------------------------------------------------------------------- /packages/webapp/public/NFT.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/NFT.webp -------------------------------------------------------------------------------- /packages/webapp/public/Redpack.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/Redpack.webp -------------------------------------------------------------------------------- /packages/webapp/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /packages/webapp/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/apple-touch-icon.png -------------------------------------------------------------------------------- /packages/webapp/public/badge.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 19 | -------------------------------------------------------------------------------- /packages/webapp/public/bg-2.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/bg-2.webp -------------------------------------------------------------------------------- /packages/webapp/public/bgio.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/bgio.webp -------------------------------------------------------------------------------- /packages/webapp/public/bgpro-dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/bgpro-dark.webp -------------------------------------------------------------------------------- /packages/webapp/public/bgpro-light.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/bgpro-light.webp -------------------------------------------------------------------------------- /packages/webapp/public/desktop_dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/desktop_dark.webp -------------------------------------------------------------------------------- /packages/webapp/public/desktop_light.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/desktop_light.webp -------------------------------------------------------------------------------- /packages/webapp/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/favicon-16x16.png -------------------------------------------------------------------------------- /packages/webapp/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/favicon-32x32.png -------------------------------------------------------------------------------- /packages/webapp/public/favicon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/favicon-48x48.png -------------------------------------------------------------------------------- /packages/webapp/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/favicon.ico -------------------------------------------------------------------------------- /packages/webapp/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/favicon.png -------------------------------------------------------------------------------- /packages/webapp/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/logo192.png -------------------------------------------------------------------------------- /packages/webapp/public/loopring.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/webapp/public/loopringWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/loopringWhite.png -------------------------------------------------------------------------------- /packages/webapp/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Loopring L2", 3 | "name": "Loopring - Ethereum Layer2", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /packages/webapp/public/mobile_dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/mobile_dark.webp -------------------------------------------------------------------------------- /packages/webapp/public/mobile_light.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Loopring/loopring-web-v2/20619c90cfc5669ffbea327ff4dc152086fe41ee/packages/webapp/public/mobile_light.webp -------------------------------------------------------------------------------- /packages/webapp/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /packages/webapp/src/pages/InvestPage/MyLiquidityPanel/interface.ts: -------------------------------------------------------------------------------- 1 | export type Tab = 'pools' | 'lido' | 'staking' | 'dual' -------------------------------------------------------------------------------- /packages/webapp/src/pages/LandPage/index.ts: -------------------------------------------------------------------------------- 1 | export * from './LandPage' 2 | export * from './WalletPage' 3 | export * from './HomePage' 4 | export { LandBtn } from './style' 5 | -------------------------------------------------------------------------------- /packages/webapp/src/pages/NFTPage/ImportCollectionPanel/CollectionManage.tsx: -------------------------------------------------------------------------------- 1 | import { CollectionMeta } from '@loopring-web/common-resources' 2 | import { CollectionManageWrap } from '@loopring-web/component-lib' 3 | import { useCollectionManage } from '@loopring-web/core' 4 | 5 | export const CollectionManage = ({ collection }: { collection: CollectionMeta }) => { 6 | const props = useCollectionManage({ collection }) 7 | return 8 | } 9 | -------------------------------------------------------------------------------- /packages/webapp/src/pages/NFTPage/ImportCollectionPanel/ImportCollection.tsx: -------------------------------------------------------------------------------- 1 | import { ImportCollectionWrap } from '@loopring-web/component-lib' 2 | import { CollectionMeta } from '@loopring-web/common-resources' 3 | import { useCollectionImport } from '@loopring-web/core' 4 | 5 | export const ImportCollection = () => { 6 | const props = useCollectionImport() 7 | 8 | return 9 | } 10 | -------------------------------------------------------------------------------- /packages/webapp/src/pages/ProTradePage/panel/index.ts: -------------------------------------------------------------------------------- 1 | export * from './toolbar' 2 | export * from './walletInfo' 3 | export * from './chart' 4 | export * from './market' 5 | export * from './spot' 6 | export * from './orderTable' 7 | -------------------------------------------------------------------------------- /packages/webapp/src/pages/ProTradePage/panel/toolbar/hook.ts: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { LoopringAPI } from '@loopring-web/core' 3 | 4 | export const useToolbar = () => { 5 | const [ammPoolBalances, setAmmPoolBalances] = React.useState([]) 6 | 7 | const getAmmPoolBalances = React.useCallback(async () => { 8 | if (LoopringAPI.ammpoolAPI) { 9 | const response = await LoopringAPI.ammpoolAPI.getAmmPoolBalances() 10 | const fomattedRes = response.raw_data.map((o) => ({ 11 | ...o, 12 | poolName: o.poolName.replace('AMM-', ''), 13 | })) 14 | setAmmPoolBalances(fomattedRes) 15 | } 16 | }, []) 17 | 18 | React.useEffect(() => { 19 | getAmmPoolBalances() 20 | }, []) 21 | 22 | return { 23 | ammPoolBalances, 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/webapp/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | // window.__loopringEnv__ = process.env; 3 | -------------------------------------------------------------------------------- /packages/webapp/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals' 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry) 7 | getFID(onPerfEntry) 8 | getFCP(onPerfEntry) 9 | getLCP(onPerfEntry) 10 | getTTFB(onPerfEntry) 11 | }) 12 | } 13 | } 14 | 15 | export default reportWebVitals 16 | -------------------------------------------------------------------------------- /packages/webapp/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom' 6 | -------------------------------------------------------------------------------- /packages/webapp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "src/", 5 | "rootDir": ".", 6 | "noEmit": true 7 | }, 8 | "include": [ 9 | "src", 10 | "src/*", 11 | "src/**/*.json", 12 | "src/types.d.ts" 13 | ], 14 | "awesomeTypescriptLoaderOptions": { 15 | "useCache": true, 16 | "transpileOnly": true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "paths": { 6 | "@loopring-web/webapp": [ 7 | "./packages/webapp/src" 8 | ], 9 | "@loopring-web/webapp/*": [ 10 | "./packages/webapp/src/*" 11 | ], 12 | "@loopring-web/web-bridge": [ 13 | "./packages/web-bridge/src" 14 | ], 15 | "@loopring-web/web-bridge/*": [ 16 | "./packages/web-bridge/src/*" 17 | ] 18 | } 19 | }, 20 | "include": [ 21 | "**/*" 22 | ], 23 | "exclude": [ 24 | "node_modules", 25 | "dist", 26 | "../*.stories.*", 27 | "docs" 28 | ] 29 | } 30 | --------------------------------------------------------------------------------