@luxexchange/lx 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.depcheckrc +26 -0
- package/.eslintignore +4 -0
- package/.eslintrc.js +79 -0
- package/LLM.md +145 -0
- package/babel.config.js +39 -0
- package/env.d.ts +15 -0
- package/eslint_rules/i18n.js +44 -0
- package/eslint_rules/no-redux-modals.js +54 -0
- package/jest-package-mocks.js +38 -0
- package/openapitools.json +7 -0
- package/package.json +170 -0
- package/project.json +76 -0
- package/src/abis/argent-wallet-contract.json +61 -0
- package/src/abis/eip_2612.json +20 -0
- package/src/abis/eip_2612.ts +20 -0
- package/src/abis/ens-public-resolver.json +816 -0
- package/src/abis/ens-registrar.json +422 -0
- package/src/abis/erc1155.json +335 -0
- package/src/abis/erc20.json +108 -0
- package/src/abis/erc20_bytes32.json +30 -0
- package/src/abis/erc721.json +352 -0
- package/src/abis/fee-on-transfer-detector.json +133 -0
- package/src/abis/governor-bravo.json +1046 -0
- package/src/abis/lux-nft-airdrop-claim.json +218 -0
- package/src/abis/permit2.json +87 -0
- package/src/abis/permit2.ts +73 -0
- package/src/abis/weth.json +279 -0
- package/src/components/AmountInput/AmountInput.test.tsx +141 -0
- package/src/components/AmountInput/AmountInput.tsx +157 -0
- package/src/components/AmountInput/useTextWidth.tsx +90 -0
- package/src/components/AmountInput/utils/numericInputEnforcer.ts +6 -0
- package/src/components/AmountInput/utils/parseValue.ts +57 -0
- package/src/components/AmountInput/utils/replaceSeparators.ts +22 -0
- package/src/components/AnimatedNumber/AnimatedNumber.native.tsx +475 -0
- package/src/components/AnimatedNumber/AnimatedNumber.tsx +53 -0
- package/src/components/AnimatedNumber/AnimatedNumber.web.tsx +141 -0
- package/src/components/AnimatedNumber/TopAndBottomGradient.native.tsx +32 -0
- package/src/components/AnimatedNumber/TopAndBottomGradient.tsx +5 -0
- package/src/components/AnimatedNumber/TopAndBottomGradient.web.tsx +23 -0
- package/src/components/BaseCard/BaseCard.test.tsx +271 -0
- package/src/components/BaseCard/BaseCard.tsx +239 -0
- package/src/components/BaseCard/__snapshots__/BaseCard.test.tsx.snap +196 -0
- package/src/components/BatchedTransactions/CarouselControls.tsx +85 -0
- package/src/components/BridgedAsset/BridgedAssetModal.tsx +239 -0
- package/src/components/BridgedAsset/BridgedAssetTDPSection.tsx +49 -0
- package/src/components/BridgedAsset/WormholeModal.tsx +173 -0
- package/src/components/ConfirmSwapModal/ProgressIndicator.tsx +232 -0
- package/src/components/ConfirmSwapModal/steps/Approve.tsx +73 -0
- package/src/components/ConfirmSwapModal/steps/LP.tsx +60 -0
- package/src/components/ConfirmSwapModal/steps/Permit.tsx +85 -0
- package/src/components/ConfirmSwapModal/steps/SpinningBorderIcon.native.tsx +54 -0
- package/src/components/ConfirmSwapModal/steps/SpinningBorderIcon.tsx +15 -0
- package/src/components/ConfirmSwapModal/steps/SpinningBorderIcon.web.tsx +59 -0
- package/src/components/ConfirmSwapModal/steps/StepRowSkeleton.tsx +224 -0
- package/src/components/ConfirmSwapModal/steps/Swap.tsx +78 -0
- package/src/components/ConfirmSwapModal/steps/SwapTXPlanStepRow.tsx +175 -0
- package/src/components/ConfirmSwapModal/steps/Wrap.tsx +41 -0
- package/src/components/ConfirmSwapModal/types.ts +8 -0
- package/src/components/ConfirmSwapModal/useSecondsUntilDeadline.tsx +48 -0
- package/src/components/CurrencyInputPanel/AmountInputPresets/AmountInputPresets.tsx +51 -0
- package/src/components/CurrencyInputPanel/AmountInputPresets/PresetAmountButton.tsx +216 -0
- package/src/components/CurrencyInputPanel/AmountInputPresets/types.ts +8 -0
- package/src/components/CurrencyInputPanel/AmountInputPresets/utils.ts +8 -0
- package/src/components/CurrencyInputPanel/CurrencyInputPanel.tsx +234 -0
- package/src/components/CurrencyInputPanel/CurrencyInputPanelBalance.tsx +43 -0
- package/src/components/CurrencyInputPanel/CurrencyInputPanelHeader.tsx +87 -0
- package/src/components/CurrencyInputPanel/CurrencyInputPanelInput.tsx +242 -0
- package/src/components/CurrencyInputPanel/CurrencyInputPanelValue.tsx +100 -0
- package/src/components/CurrencyInputPanel/DefaultTokenOptions/DefaultTokenOptions.tsx +34 -0
- package/src/components/CurrencyInputPanel/DefaultTokenOptions/TokenIcon.tsx +94 -0
- package/src/components/CurrencyInputPanel/DefaultTokenOptions/TokenOptions/TokenOptionItem/TokenOptionItem.native.tsx +17 -0
- package/src/components/CurrencyInputPanel/DefaultTokenOptions/TokenOptions/TokenOptionItem/TokenOptionItem.tsx +6 -0
- package/src/components/CurrencyInputPanel/DefaultTokenOptions/TokenOptions/TokenOptionItem/TokenOptionItem.web.tsx +35 -0
- package/src/components/CurrencyInputPanel/DefaultTokenOptions/TokenOptions/TokenOptionItem/types.ts +9 -0
- package/src/components/CurrencyInputPanel/DefaultTokenOptions/TokenOptions/TokenOptions.tsx +58 -0
- package/src/components/CurrencyInputPanel/DefaultTokenOptions/TokenOptions/useSendSelectCurrencyEvent.tsx +37 -0
- package/src/components/CurrencyInputPanel/DefaultTokenOptions/constants.ts +19 -0
- package/src/components/CurrencyInputPanel/SelectTokenButton.tsx +86 -0
- package/src/components/CurrencyInputPanel/TokenRate.tsx +49 -0
- package/src/components/CurrencyInputPanel/hooks/useCurrencyInputFontSize.ts +53 -0
- package/src/components/CurrencyInputPanel/hooks/useIndicativeQuoteTextDisplay.ts +56 -0
- package/src/components/CurrencyInputPanel/hooks/useInputFocusSync/types.ts +11 -0
- package/src/components/CurrencyInputPanel/hooks/useInputFocusSync/useInputFocusSync.native.ts +36 -0
- package/src/components/CurrencyInputPanel/hooks/useInputFocusSync/useInputFocusSync.ts +6 -0
- package/src/components/CurrencyInputPanel/hooks/useInputFocusSync/useInputFocusSync.web.ts +6 -0
- package/src/components/CurrencyInputPanel/hooks/useRefetchAnimationStyle.native.ts +42 -0
- package/src/components/CurrencyInputPanel/hooks/useRefetchAnimationStyle.ts +14 -0
- package/src/components/CurrencyInputPanel/hooks/useRefetchAnimationStyle.web.ts +68 -0
- package/src/components/CurrencyInputPanel/types.tsx +61 -0
- package/src/components/CurrencyLogo/CurrencyLogo.test.tsx +50 -0
- package/src/components/CurrencyLogo/CurrencyLogo.tsx +38 -0
- package/src/components/CurrencyLogo/LogoWithTxStatus.test.tsx +291 -0
- package/src/components/CurrencyLogo/LogoWithTxStatus.tsx +282 -0
- package/src/components/CurrencyLogo/NetworkLogo.test.tsx +54 -0
- package/src/components/CurrencyLogo/NetworkLogo.tsx +89 -0
- package/src/components/CurrencyLogo/NetworkLogoWarning.tsx +44 -0
- package/src/components/CurrencyLogo/SplitLogo.test.tsx +120 -0
- package/src/components/CurrencyLogo/SplitLogo.tsx +127 -0
- package/src/components/CurrencyLogo/TokenLogo.test.tsx +146 -0
- package/src/components/CurrencyLogo/TokenLogo.tsx +164 -0
- package/src/components/CurrencyLogo/__snapshots__/CurrencyLogo.test.tsx.snap +90 -0
- package/src/components/CurrencyLogo/__snapshots__/LogoWithTxStatus.test.tsx.snap +130 -0
- package/src/components/CurrencyLogo/__snapshots__/NetworkLogo.test.tsx.snap +69 -0
- package/src/components/CurrencyLogo/__snapshots__/SplitLogo.test.tsx.snap +91 -0
- package/src/components/CurrencyLogo/__snapshots__/TokenLogo.test.tsx.snap +58 -0
- package/src/components/ExpandoRow/ExpandoRow.test.tsx +75 -0
- package/src/components/ExpandoRow/ExpandoRow.tsx +40 -0
- package/src/components/ExpandoRow/__snapshots__/ExpandoRow.test.tsx.snap +127 -0
- package/src/components/IconCloud/CloudItem.tsx +252 -0
- package/src/components/IconCloud/IconCloud.tsx +118 -0
- package/src/components/IconCloud/utils.ts +21 -0
- package/src/components/InlineWarningCard/InlineWarningCard.tsx +133 -0
- package/src/components/MicroConfirmation.tsx +25 -0
- package/src/components/MultichainTokenDetails/MultichainAddressList.test.tsx +90 -0
- package/src/components/MultichainTokenDetails/MultichainAddressList.tsx +82 -0
- package/src/components/MultichainTokenDetails/MultichainExplorerList.test.tsx +46 -0
- package/src/components/MultichainTokenDetails/MultichainExplorerList.tsx +63 -0
- package/src/components/MultichainTokenDetails/MultichainOptionRow.test.tsx +41 -0
- package/src/components/MultichainTokenDetails/MultichainOptionRow.tsx +87 -0
- package/src/components/MultichainTokenDetails/MultichainScrollableList.tsx +98 -0
- package/src/components/MultichainTokenDetails/__snapshots__/MultichainExplorerList.test.tsx.snap +150 -0
- package/src/components/MultichainTokenDetails/__snapshots__/MultichainOptionRow.test.tsx.snap +49 -0
- package/src/components/MultichainTokenDetails/useOrderedMultichainEntries.test.ts +53 -0
- package/src/components/MultichainTokenDetails/useOrderedMultichainEntries.ts +22 -0
- package/src/components/ReceiveQRCode/ReceiveQRCode.tsx +189 -0
- package/src/components/ReceiveQRCode/constants.ts +5 -0
- package/src/components/RelativeChange/RelativeChange.test.tsx +44 -0
- package/src/components/RelativeChange/RelativeChange.tsx +72 -0
- package/src/components/RelativeChange/__snapshots__/RelativeChange.test.tsx.snap +110 -0
- package/src/components/RoutingDiagram/RoutingDiagram.tsx +264 -0
- package/src/components/RoutingDiagram/RoutingLabel.tsx +42 -0
- package/src/components/TokenSelector/CrosschainSwapsPromoBanner.tsx +51 -0
- package/src/components/TokenSelector/TokenSelector.tsx +423 -0
- package/src/components/TokenSelector/TokenSelectorList.tsx +267 -0
- package/src/components/TokenSelector/UnsupportedChainedActionsBanner.tsx +68 -0
- package/src/components/TokenSelector/constants.ts +3 -0
- package/src/components/TokenSelector/filter.test.ts +98 -0
- package/src/components/TokenSelector/filter.ts +131 -0
- package/src/components/TokenSelector/hooks/useAddToSearchHistory.ts +81 -0
- package/src/components/TokenSelector/hooks/useAllCommonBaseCurrencies.ts +126 -0
- package/src/components/TokenSelector/hooks/useCommonTokensOptions.ts +75 -0
- package/src/components/TokenSelector/hooks/useCommonTokensOptionsWithFallback.ts +66 -0
- package/src/components/TokenSelector/hooks/useCurrencies.ts +39 -0
- package/src/components/TokenSelector/hooks/useCurrencyInfosToTokenOptions.ts +94 -0
- package/src/components/TokenSelector/hooks/useFavoriteCurrencies.ts +32 -0
- package/src/components/TokenSelector/hooks/useFavoriteTokensOptions.ts +57 -0
- package/src/components/TokenSelector/hooks/useLuxTokensOptions.ts +97 -0
- package/src/components/TokenSelector/hooks/usePortfolioBalancesForAddressById.ts +29 -0
- package/src/components/TokenSelector/hooks/usePortfolioTokenOptions.ts +74 -0
- package/src/components/TokenSelector/hooks/useRecentlySearchedTokens.ts +44 -0
- package/src/components/TokenSelector/hooks/useTokenSectionsForEmptySearch.tsx +42 -0
- package/src/components/TokenSelector/hooks/useTokenSectionsForSearchResults.ts +155 -0
- package/src/components/TokenSelector/hooks/useTrendingTokensCurrencyInfos.ts +30 -0
- package/src/components/TokenSelector/hooks/useTrendingTokensOptions.ts +47 -0
- package/src/components/TokenSelector/hooks.test.ts +1170 -0
- package/src/components/TokenSelector/items/tokens/SuggestedToken.tsx +61 -0
- package/src/components/TokenSelector/items/tokens/TokenCard.tsx +79 -0
- package/src/components/TokenSelector/lists/HorizontalTokenList/HorizontalTokenList.native.tsx +63 -0
- package/src/components/TokenSelector/lists/HorizontalTokenList/HorizontalTokenList.tsx +18 -0
- package/src/components/TokenSelector/lists/HorizontalTokenList/HorizontalTokenList.web.tsx +74 -0
- package/src/components/TokenSelector/lists/TokenSelectorEmptySearchList.tsx +47 -0
- package/src/components/TokenSelector/lists/TokenSelectorSearchResultsList.tsx +79 -0
- package/src/components/TokenSelector/lists/TokenSelectorSendList.tsx +149 -0
- package/src/components/TokenSelector/lists/TokenSelectorSwapList.tsx +224 -0
- package/src/components/TokenSelector/types.ts +30 -0
- package/src/components/TokenSelector/utils.test.tsx +46 -0
- package/src/components/TokenSelector/utils.tsx +147 -0
- package/src/components/TransactionDetailsTooltip.tsx +151 -0
- package/src/components/ViewGestureHandler/ViewGestureHandler.native.tsx +6 -0
- package/src/components/ViewGestureHandler/ViewGestureHandler.tsx +6 -0
- package/src/components/ViewGestureHandler/ViewGestureHandler.web.tsx +5 -0
- package/src/components/WarningMessage/WarningMessage.tsx +33 -0
- package/src/components/accounts/AddressDisplay.tsx +251 -0
- package/src/components/accounts/DisplayNameText.test.tsx +34 -0
- package/src/components/accounts/DisplayNameText.tsx +44 -0
- package/src/components/accounts/__snapshots__/DisplayNameText.test.tsx.snap +103 -0
- package/src/components/activity/ActivityListEmptyState.tsx +43 -0
- package/src/components/activity/details/InfoRow.tsx +18 -0
- package/src/components/activity/details/TransactionDetailsContent.tsx +83 -0
- package/src/components/activity/details/TransactionDetailsHeader.tsx +72 -0
- package/src/components/activity/details/TransactionDetailsHeaderLogo.tsx +313 -0
- package/src/components/activity/details/TransactionDetailsInfoRows.tsx +422 -0
- package/src/components/activity/details/TransactionDetailsModal.test.tsx +168 -0
- package/src/components/activity/details/TransactionDetailsModal.tsx +65 -0
- package/src/components/activity/details/TransactionDetailsOverview.tsx +151 -0
- package/src/components/activity/details/TransactionParticipantDisplay.tsx +18 -0
- package/src/components/activity/details/TransactionParticipantRow.tsx +72 -0
- package/src/components/activity/details/__snapshots__/TransactionDetailsModal.test.tsx.snap +385 -0
- package/src/components/activity/details/plan/PlanDetailsView.tsx +204 -0
- package/src/components/activity/details/plan/PlanStepItem.tsx +236 -0
- package/src/components/activity/details/plan/ResumePlanButton.tsx +59 -0
- package/src/components/activity/details/transactions/ApproveTransactionDetails.tsx +77 -0
- package/src/components/activity/details/transactions/AuctionTransactionDetails.tsx +48 -0
- package/src/components/activity/details/transactions/BridgeTransactionDetails.tsx +53 -0
- package/src/components/activity/details/transactions/LiquidityTransactionDetails.tsx +100 -0
- package/src/components/activity/details/transactions/NftTransactionDetails.test.tsx +58 -0
- package/src/components/activity/details/transactions/NftTransactionDetails.tsx +103 -0
- package/src/components/activity/details/transactions/OffRampPendingSupportCard.tsx +31 -0
- package/src/components/activity/details/transactions/OffRampTransactionDetails.tsx +42 -0
- package/src/components/activity/details/transactions/OnRampTransactionDetails.tsx +61 -0
- package/src/components/activity/details/transactions/PlanTransactionDetails.tsx +118 -0
- package/src/components/activity/details/transactions/SwapTransactionDetails.test.tsx +89 -0
- package/src/components/activity/details/transactions/SwapTransactionDetails.tsx +89 -0
- package/src/components/activity/details/transactions/TransferTransactionDetails.test.tsx +113 -0
- package/src/components/activity/details/transactions/TransferTransactionDetails.tsx +118 -0
- package/src/components/activity/details/transactions/WrapTransactionDetails.tsx +31 -0
- package/src/components/activity/details/transactions/__snapshots__/NftTransactionDetails.test.tsx.snap +53 -0
- package/src/components/activity/details/transactions/__snapshots__/SwapTransactionDetails.test.tsx.snap +85 -0
- package/src/components/activity/details/transactions/__snapshots__/TransferTransactionDetails.test.tsx.snap +28 -0
- package/src/components/activity/details/transactions/utilityComponents.tsx +115 -0
- package/src/components/activity/details/types.ts +54 -0
- package/src/components/activity/general/TransactionSummaryTitle.tsx +41 -0
- package/src/components/activity/generateActivityItemRenderer.ts +115 -0
- package/src/components/activity/hooks/useFormattedCurrencyAmountAndUSDValue.ts +50 -0
- package/src/components/activity/hooks/useFormattedTime.ts +34 -0
- package/src/components/activity/hooks/useOnRetrySwap.ts +27 -0
- package/src/components/activity/hooks/useTokenDetailsNavigation.ts +25 -0
- package/src/components/activity/summaries/ApproveSummaryItem.tsx +62 -0
- package/src/components/activity/summaries/BridgeSummaryItem.tsx +84 -0
- package/src/components/activity/summaries/LiquiditySummaryItem.tsx +119 -0
- package/src/components/activity/summaries/NFTApproveSummaryItem.tsx +24 -0
- package/src/components/activity/summaries/NFTMintSummaryItem.tsx +24 -0
- package/src/components/activity/summaries/NFTSummaryItem.tsx +49 -0
- package/src/components/activity/summaries/NFTTradeSummaryItem.tsx +20 -0
- package/src/components/activity/summaries/OffRampTransferSummaryItem.tsx +49 -0
- package/src/components/activity/summaries/OnRampTransferSummaryItem.tsx +99 -0
- package/src/components/activity/summaries/PlanSummaryItem.tsx +97 -0
- package/src/components/activity/summaries/ReceiveSummaryItem.tsx +25 -0
- package/src/components/activity/summaries/SendSummaryItem.tsx +25 -0
- package/src/components/activity/summaries/SwapSummaryItem.tsx +84 -0
- package/src/components/activity/summaries/TransactionSummaryLayout.tsx +194 -0
- package/src/components/activity/summaries/TransferTokenSummaryItem.tsx +152 -0
- package/src/components/activity/summaries/UnknownSummaryItem.tsx +58 -0
- package/src/components/activity/summaries/WCSummaryItem.tsx +36 -0
- package/src/components/activity/summaries/WithdrawSummaryItem.tsx +71 -0
- package/src/components/activity/summaries/WrapSummaryItem.tsx +68 -0
- package/src/components/activity/types.ts +37 -0
- package/src/components/activity/utils.ts +86 -0
- package/src/components/appearance/ThemeToggle.tsx +51 -0
- package/src/components/badge/Badge.tsx +47 -0
- package/src/components/banners/ExcludedNetworkBanner.tsx +41 -0
- package/src/components/banners/InformationBanner.tsx +29 -0
- package/src/components/banners/LuxWrapped2025Banner/LuxWrapped2025Banner.native.tsx +85 -0
- package/src/components/banners/LuxWrapped2025Banner/LuxWrapped2025Banner.tsx +6 -0
- package/src/components/banners/LuxWrapped2025Banner/LuxWrapped2025Banner.web.tsx +182 -0
- package/src/components/banners/LuxWrapped2025Banner/types.ts +5 -0
- package/src/components/banners/LuxWrapped2025Card/LuxWrapped2025Card.native.tsx +69 -0
- package/src/components/banners/LuxWrapped2025Card/LuxWrapped2025Card.tsx +6 -0
- package/src/components/banners/LuxWrapped2025Card/LuxWrapped2025Card.web.tsx +104 -0
- package/src/components/banners/LuxWrapped2025Card/types.ts +3 -0
- package/src/components/banners/TestnetModeBanner.tsx +52 -0
- package/src/components/banners/shared/SharedSnowflakeComponents.native.tsx +198 -0
- package/src/components/banners/shared/SharedSnowflakeComponents.tsx +52 -0
- package/src/components/banners/shared/SharedSnowflakeComponents.web.tsx +124 -0
- package/src/components/banners/shared/utils.ts +5 -0
- package/src/components/buttons/PasteButton.test.tsx +18 -0
- package/src/components/buttons/PasteButton.tsx +62 -0
- package/src/components/buttons/__snapshots__/PasteButton.test.tsx.snap +83 -0
- package/src/components/cards/image.tsx +32 -0
- package/src/components/chains/BlockExplorerIcon.tsx +26 -0
- package/src/components/charts/utils.ts +42 -0
- package/src/components/dapps/DappIconPlaceholder.tsx +27 -0
- package/src/components/dialog/Dialog.native.tsx +122 -0
- package/src/components/dialog/Dialog.test.tsx +246 -0
- package/src/components/dialog/Dialog.tsx +11 -0
- package/src/components/dialog/Dialog.web.tsx +138 -0
- package/src/components/dialog/DialogButtons.tsx +60 -0
- package/src/components/dialog/DialogContent.tsx +81 -0
- package/src/components/dialog/DialogProps.tsx +46 -0
- package/src/components/dialog/GetHelpButtonUI.tsx +33 -0
- package/src/components/dialog/GetHelpHeader.native.tsx +22 -0
- package/src/components/dialog/GetHelpHeader.tsx +16 -0
- package/src/components/dialog/GetHelpHeader.web.tsx +26 -0
- package/src/components/dialog/GetHelpHeaderContent.tsx +54 -0
- package/src/components/dialog/hooks/useDialogVisibility.test.ts +296 -0
- package/src/components/dialog/hooks/useDialogVisibility.ts +131 -0
- package/src/components/dropdowns/ActionSheetDropdown.test.tsx +124 -0
- package/src/components/dropdowns/ActionSheetDropdown.tsx +468 -0
- package/src/components/dropdowns/__snapshots__/ActionSheetDropdown.test.tsx.snap +25 -0
- package/src/components/gas/NetworkCostTooltip.tsx +79 -0
- package/src/components/gas/NetworkFee.test.tsx +36 -0
- package/src/components/gas/NetworkFee.tsx +122 -0
- package/src/components/gas/NetworkFeeWarning.tsx +145 -0
- package/src/components/gas/__snapshots__/NetworkFee.test.tsx.snap +251 -0
- package/src/components/gating/CacheConfig.tsx +28 -0
- package/src/components/gating/DynamicConfigDropdown.tsx +98 -0
- package/src/components/gating/GatingButton.tsx +11 -0
- package/src/components/gating/GatingOverrides.tsx +262 -0
- package/src/components/gating/Rows.tsx +103 -0
- package/src/components/gating/dynamicConfigOverrides.tsx +75 -0
- package/src/components/input/TextInput.tsx +43 -0
- package/src/components/lists/NoResultsFound.tsx +19 -0
- package/src/components/lists/OnchainItemList/OnchainItemList.native.tsx +102 -0
- package/src/components/lists/OnchainItemList/OnchainItemList.tsx +39 -0
- package/src/components/lists/OnchainItemList/OnchainItemList.web.tsx +348 -0
- package/src/components/lists/OnchainItemList/processSectionsToRows.test.tsx +181 -0
- package/src/components/lists/OnchainItemList/processSectionsToRows.ts +57 -0
- package/src/components/lists/OnchainItemList/types.ts +31 -0
- package/src/components/lists/SectionHeader.tsx +137 -0
- package/src/components/lists/SelectorBaseList.tsx +131 -0
- package/src/components/lists/items/OptionItem.tsx +161 -0
- package/src/components/lists/items/nfts/NFTCollectionOptionItem.tsx +38 -0
- package/src/components/lists/items/nfts/useNftSearchResultsToNftCollectionOptions.tsx +43 -0
- package/src/components/lists/items/pools/PoolOptionItem.tsx +100 -0
- package/src/components/lists/items/pools/PoolOptionItemContextMenu.tsx +116 -0
- package/src/components/lists/items/pools/usePoolSearchResultsToPoolOptions.tsx +60 -0
- package/src/components/lists/items/pools/usePoolStatsToPoolOptions.tsx +107 -0
- package/src/components/lists/items/tokens/TokenOptionItem.tsx +338 -0
- package/src/components/lists/items/tokens/TokenOptionItemContextMenu.tsx +274 -0
- package/src/components/lists/items/types.ts +74 -0
- package/src/components/lists/items/wallets/ENSAddressOptionItem.tsx +62 -0
- package/src/components/lists/items/wallets/UnitagOptionItem.tsx +39 -0
- package/src/components/lists/items/wallets/WalletBaseOptionItem.tsx +28 -0
- package/src/components/lists/items/wallets/WalletByAddressOptionItem.tsx +55 -0
- package/src/components/lists/items/wallets/WalletOptionItemContextMenu.tsx +56 -0
- package/src/components/lists/items/wallets/useFavoriteWalletOptions.tsx +21 -0
- package/src/components/lists/items/wallets/utils.test.ts +19 -0
- package/src/components/lists/items/wallets/utils.ts +16 -0
- package/src/components/lists/utils.tsx +43 -0
- package/src/components/logos/PoweredByBlockaid.tsx +33 -0
- package/src/components/menus/ContextMenu.native.tsx +338 -0
- package/src/components/menus/ContextMenu.tsx +66 -0
- package/src/components/menus/ContextMenu.web.test.tsx +133 -0
- package/src/components/menus/ContextMenu.web.tsx +174 -0
- package/src/components/menus/ContextMenuContent.tsx +100 -0
- package/src/components/menus/ContextMenuV2.native.tsx +338 -0
- package/src/components/menus/ContextMenuV2.tsx +66 -0
- package/src/components/menus/ContextMenuV2.web.test.tsx +133 -0
- package/src/components/menus/ContextMenuV2.web.tsx +184 -0
- package/src/components/menus/__snapshots__/ContextMenu.web.test.tsx.snap +34 -0
- package/src/components/menus/hooks/useContextMenuTracking.ts +51 -0
- package/src/components/menus/types.ts +5 -0
- package/src/components/misc/ActionCard.tsx +84 -0
- package/src/components/misc/GenericHeader.tsx +63 -0
- package/src/components/misc/IndicativeLoadingWrapper.tsx +14 -0
- package/src/components/misc/Scrollbar.native.tsx +59 -0
- package/src/components/misc/Scrollbar.tsx +12 -0
- package/src/components/misc/Scrollbar.web.tsx +99 -0
- package/src/components/modals/ActionSheetModal.tsx +94 -0
- package/src/components/modals/BottomSheetContext.tsx +52 -0
- package/src/components/modals/HandleBar.native.tsx +41 -0
- package/src/components/modals/HandleBar.tsx +15 -0
- package/src/components/modals/HandleBar.web.tsx +6 -0
- package/src/components/modals/InfoLinkModal.tsx +97 -0
- package/src/components/modals/Modal.native.tsx +449 -0
- package/src/components/modals/Modal.tsx +26 -0
- package/src/components/modals/Modal.web.tsx +119 -0
- package/src/components/modals/ModalProps.tsx +60 -0
- package/src/components/modals/PaginatedModals.tsx +66 -0
- package/src/components/modals/ScrollLock.native.tsx +13 -0
- package/src/components/modals/ScrollLock.tsx +13 -0
- package/src/components/modals/ScrollLock.web.tsx +53 -0
- package/src/components/modals/WarningModal/WarningInfo.tsx +102 -0
- package/src/components/modals/WarningModal/WarningModal.tsx +295 -0
- package/src/components/modals/WarningModal/getAlertColor.ts +42 -0
- package/src/components/modals/WarningModal/types.ts +83 -0
- package/src/components/modals/modalConstants.tsx +31 -0
- package/src/components/modals/useBottomSheetSafeKeyboard.native.tsx +43 -0
- package/src/components/modals/useBottomSheetSafeKeyboard.tsx +9 -0
- package/src/components/modals/useBottomSheetSafeKeyboard.web.tsx +6 -0
- package/src/components/network/NetworkFilter.test.tsx +31 -0
- package/src/components/network/NetworkFilter.tsx +75 -0
- package/src/components/network/NetworkOption.tsx +71 -0
- package/src/components/network/NetworkPile/NetworkPile.test.tsx +98 -0
- package/src/components/network/NetworkPile/NetworkPile.tsx +130 -0
- package/src/components/network/NetworkPile/NetworkPileLayouts.tsx +159 -0
- package/src/components/network/NetworkPile/__snapshots__/NetworkPile.test.tsx.snap +984 -0
- package/src/components/network/NetworkPill.test.tsx +20 -0
- package/src/components/network/NetworkPill.tsx +42 -0
- package/src/components/network/SupportedNetworkLogosModal.tsx +100 -0
- package/src/components/network/__snapshots__/NetworkFilter.test.tsx.snap +67 -0
- package/src/components/network/__snapshots__/NetworkPill.test.tsx.snap +76 -0
- package/src/components/network/hooks.tsx +35 -0
- package/src/components/nfts/NFTTransfer.tsx +20 -0
- package/src/components/nfts/NFTViewer.tsx +106 -0
- package/src/components/nfts/NftView.tsx +63 -0
- package/src/components/nfts/NftViewWithContextMenu.tsx +64 -0
- package/src/components/nfts/NftsList.native.tsx +199 -0
- package/src/components/nfts/NftsList.tsx +62 -0
- package/src/components/nfts/NftsList.web.tsx +330 -0
- package/src/components/nfts/NftsListEmptyState.tsx +43 -0
- package/src/components/nfts/NftsListHeader.tsx +111 -0
- package/src/components/nfts/ShowNFTModal.tsx +56 -0
- package/src/components/nfts/constants.ts +4 -0
- package/src/components/nfts/hooks/useNftListRenderData.ts +100 -0
- package/src/components/nfts/types.ts +16 -0
- package/src/components/notifications/ModalNotification.tsx +115 -0
- package/src/components/notifications/ModalTemplate.tsx +309 -0
- package/src/components/notifications/NotificationToast.native.tsx +109 -0
- package/src/components/notifications/NotificationToast.tsx +12 -0
- package/src/components/notifications/NotificationToast.web.tsx +78 -0
- package/src/components/notifications/NotificationToastContent.tsx +197 -0
- package/src/components/notifications/iconUtils.ts +10 -0
- package/src/components/notifications/notifications/ChangeAssetVisibilityNotification.tsx +26 -0
- package/src/components/notifications/notifications/CopiedNotification.tsx +47 -0
- package/src/components/notifications/notifications/SuccessNotification.tsx +11 -0
- package/src/components/pill/NewTag.tsx +39 -0
- package/src/components/pill/Pill.test.tsx +13 -0
- package/src/components/pill/Pill.tsx +54 -0
- package/src/components/pill/PillMultiToggle.tsx +121 -0
- package/src/components/pill/__snapshots__/Pill.test.tsx.snap +55 -0
- package/src/components/portfolio/EmptyTokensList.tsx +49 -0
- package/src/components/portfolio/HiddenTokensRow.tsx +33 -0
- package/src/components/portfolio/PortfolioEmptyState.tsx +201 -0
- package/src/components/portfolio/TokenBalanceItem.tsx +176 -0
- package/src/components/portfolio/TokenBalanceItemContextMenu.native.tsx +147 -0
- package/src/components/portfolio/TokenBalanceItemContextMenu.tsx +21 -0
- package/src/components/portfolio/TokenBalanceItemContextMenu.web.tsx +74 -0
- package/src/components/portfolio/TokenBalanceListWeb.tsx +276 -0
- package/src/components/reporting/ReportModal.tsx +128 -0
- package/src/components/reporting/ReportPoolDataModal.tsx +105 -0
- package/src/components/reporting/ReportTokenDataModal.tsx +101 -0
- package/src/components/reporting/ReportTokenIssueModal.tsx +132 -0
- package/src/components/reporting/input.tsx +28 -0
- package/src/components/text/LearnMoreLink.test.tsx +22 -0
- package/src/components/text/LearnMoreLink.tsx +51 -0
- package/src/components/text/__snapshots__/LearnMoreLink.test.tsx.snap +29 -0
- package/src/components/tokens/TokensListEmptyState.tsx +43 -0
- package/src/components/tooltip/InfoTooltip.native.tsx +7 -0
- package/src/components/tooltip/InfoTooltip.tsx +7 -0
- package/src/components/tooltip/InfoTooltip.web.tsx +78 -0
- package/src/components/tooltip/InfoTooltipProps.ts +16 -0
- package/src/components/transactions/requests/ContentRow.tsx +30 -0
- package/src/components/warnings/WarningIcon.tsx +41 -0
- package/src/components/warnings/utils.ts +82 -0
- package/src/config.ts +3 -0
- package/src/constants/addresses.ts +43 -0
- package/src/constants/misc.ts +14 -0
- package/src/constants/pools.ts +3 -0
- package/src/constants/routing.ts +372 -0
- package/src/constants/tokens.ts +693 -0
- package/src/constants/transactions.ts +13 -0
- package/src/constants/urls.ts +248 -0
- package/src/constants/web3.ts +28 -0
- package/src/contexts/LuxContext.tsx +210 -0
- package/src/contexts/UrlContext.native.tsx +36 -0
- package/src/contexts/UrlContext.tsx +21 -0
- package/src/contexts/UrlContext.web.tsx +55 -0
- package/src/data/apiClients/SharedPersistQueryClientProvider.tsx +24 -0
- package/src/data/apiClients/blockaidApi/BlockaidApiClient.ts +14 -0
- package/src/data/apiClients/constants.ts +1 -0
- package/src/data/apiClients/createLuxFetchClient.ts +33 -0
- package/src/data/apiClients/createPersister.native.ts +30 -0
- package/src/data/apiClients/createPersister.test.ts +154 -0
- package/src/data/apiClients/createPersister.ts +6 -0
- package/src/data/apiClients/createPersister.web.ts +35 -0
- package/src/data/apiClients/dataApi/DataApiClient.ts +11 -0
- package/src/data/apiClients/dataApiService/dataApiQueries.ts +30 -0
- package/src/data/apiClients/dataApiService/listTopPools.ts +39 -0
- package/src/data/apiClients/dataApiService/listTopTokens.ts +39 -0
- package/src/data/apiClients/forApi/ForApiClient.ts +47 -0
- package/src/data/apiClients/jupiterApi/JupiterFetchClient.ts +14 -0
- package/src/data/apiClients/liquidityService/AuctionMutationClient.ts +10 -0
- package/src/data/apiClients/liquidityService/LiquidityServiceClient.ts +10 -0
- package/src/data/apiClients/liquidityService/base.ts +19 -0
- package/src/data/apiClients/liquidityService/liquidityQueries.ts +224 -0
- package/src/data/apiClients/luxApi/LuxApiClient.ts +32 -0
- package/src/data/apiClients/luxApi/useGasFeeQuery.ts +66 -0
- package/src/data/apiClients/luxApi/useTrmScreenQuery.ts +18 -0
- package/src/data/apiClients/sharedDehydrateOptions.ts +28 -0
- package/src/data/apiClients/tradingApi/LuxGatewayClient.ts +293 -0
- package/src/data/apiClients/tradingApi/TradingApiClient.test.ts +586 -0
- package/src/data/apiClients/tradingApi/TradingApiClient.ts +227 -0
- package/src/data/apiClients/tradingApi/TradingApiSessionClient.ts +73 -0
- package/src/data/apiClients/tradingApi/dex/client.ts +195 -0
- package/src/data/apiClients/tradingApi/dex/hooks.ts +403 -0
- package/src/data/apiClients/tradingApi/dex/index.ts +9 -0
- package/src/data/apiClients/tradingApi/dex/types.ts +334 -0
- package/src/data/apiClients/tradingApi/useCheckApprovalQuery.ts +28 -0
- package/src/data/apiClients/tradingApi/useTradingApiIndicativeQuoteQuery.ts +70 -0
- package/src/data/apiClients/tradingApi/useTradingApiQuoteQuery.ts +40 -0
- package/src/data/apiClients/tradingApi/useTradingApiSwapQuery.ts +69 -0
- package/src/data/apiClients/tradingApi/useTradingApiSwappableTokensQuery.ts +91 -0
- package/src/data/apiClients/tradingApi/useWalletCheckDelegationQuery.ts +36 -0
- package/src/data/apiClients/tradingApi/useWalletEncode7702Query.ts +32 -0
- package/src/data/apiClients/tradingApi/utils/getTradeSettingsDeadline.ts +7 -0
- package/src/data/apiClients/tradingApi/utils/tradingApiSwappableTokenToCurrencyInfo.ts +44 -0
- package/src/data/apiClients/unitagsApi/UnitagsApiClient.ts +21 -0
- package/src/data/apiClients/unitagsApi/useResetUnitagsQueries.ts +19 -0
- package/src/data/apiClients/unitagsApi/useUnitagsAddressQuery.ts +51 -0
- package/src/data/apiClients/unitagsApi/useUnitagsClaimEligibilityQuery.ts +28 -0
- package/src/data/apiClients/unitagsApi/useUnitagsUsernameQuery.ts +22 -0
- package/src/data/balances/hooks/useBalances.ts +31 -0
- package/src/data/balances/hooks/useCrossChainBalances.ts +59 -0
- package/src/data/balances/utils.test.ts +66 -0
- package/src/data/balances/utils.tsx +79 -0
- package/src/data/cache.ts +167 -0
- package/src/data/gchain/client.ts +764 -0
- package/src/data/gchain/hooks.ts +368 -0
- package/src/data/gchain/index.ts +124 -0
- package/src/data/gchain/useLuxBalance.ts +101 -0
- package/src/data/getVersionHeader.native.ts +5 -0
- package/src/data/getVersionHeader.ts +5 -0
- package/src/data/getVersionHeader.web.ts +10 -0
- package/src/data/graphql/lux-data-api/fragments.ts +67 -0
- package/src/data/links.ts +147 -0
- package/src/data/rest/auctions/AuctionServiceClient.ts +8 -0
- package/src/data/rest/auctions/auctionQueries.ts +183 -0
- package/src/data/rest/auctions/base.ts +5 -0
- package/src/data/rest/auctions/queryTypes.ts +16 -0
- package/src/data/rest/auctions/useExitBidAndClaimTokensMutation.ts +61 -0
- package/src/data/rest/auctions/useExitBidPositionMutation.ts +53 -0
- package/src/data/rest/auctions/useSubmitBidMutation.ts +41 -0
- package/src/data/rest/auctions/useVerifyWallet.ts +120 -0
- package/src/data/rest/base.ts +45 -0
- package/src/data/rest/buildAccountAddressesByPlatform.test.ts +202 -0
- package/src/data/rest/buildAccountAddressesByPlatform.ts +49 -0
- package/src/data/rest/conversionTracking/constants.ts +136 -0
- package/src/data/rest/conversionTracking/tracking.test.ts +34 -0
- package/src/data/rest/conversionTracking/tracking.ts +99 -0
- package/src/data/rest/conversionTracking/types.ts +29 -0
- package/src/data/rest/conversionTracking/useConversionProxy.ts +23 -0
- package/src/data/rest/conversionTracking/useConversionTracking.ts +171 -0
- package/src/data/rest/conversionTracking/utils.ts +81 -0
- package/src/data/rest/embeddedWallet/requests.ts +70 -0
- package/src/data/rest/exploreStats.ts +26 -0
- package/src/data/rest/getPools.ts +14 -0
- package/src/data/rest/getPoolsRewards.ts +14 -0
- package/src/data/rest/getPortfolio.test.ts +192 -0
- package/src/data/rest/getPortfolio.ts +336 -0
- package/src/data/rest/getPortfolioChart.ts +64 -0
- package/src/data/rest/getPosition.ts +13 -0
- package/src/data/rest/getPositions.ts +113 -0
- package/src/data/rest/listTransactions.ts +145 -0
- package/src/data/rest/luxGateway.ts +295 -0
- package/src/data/rest/portfolioBalanceOverrides.ts +243 -0
- package/src/data/rest/protocolStats.ts +19 -0
- package/src/data/rest/searchTokensAndPools.ts +146 -0
- package/src/data/rest/tokenRankings.ts +62 -0
- package/src/data/rest/transformPortfolioToMultichain.test.ts +362 -0
- package/src/data/rest/transformPortfolioToMultichain.ts +82 -0
- package/src/data/solanaConnection/getSolanaParsedTokenAccountsByOwnerQueryOptions.ts +97 -0
- package/src/declarations.d.ts +6 -0
- package/src/dialog-preferences/DialogPreferencesService.ts +47 -0
- package/src/dialog-preferences/implementations/createDialogPreferencesService.test.ts +178 -0
- package/src/dialog-preferences/implementations/createDialogPreferencesService.ts +64 -0
- package/src/dialog-preferences/index.ts +8 -0
- package/src/dialog-preferences/types.ts +5 -0
- package/src/domains/repositories.ts +13 -0
- package/src/domains/services.ts +21 -0
- package/src/entities/assets.ts +25 -0
- package/src/extension/messagePassing/messageChannels.ts +40 -0
- package/src/extension/messagePassing/messageTypes.ts +8 -0
- package/src/extension/messagePassing/platform.ts +16 -0
- package/src/extension/messagePassing/types/requests.ts +40 -0
- package/src/extension/useIsChromeWindowFocused.ts +58 -0
- package/src/features/accounts/AccountIcon.tsx +92 -0
- package/src/features/accounts/reportBalancesForAnalytics.ts +60 -0
- package/src/features/accounts/store/hooks.ts +32 -0
- package/src/features/accounts/store/types/Account.ts +15 -0
- package/src/features/accounts/store/types/AccountsState.ts +65 -0
- package/src/features/accounts/store/types/Connector.ts +94 -0
- package/src/features/accounts/store/types/README.md +81 -0
- package/src/features/accounts/store/types/Session.ts +60 -0
- package/src/features/accounts/store/types/Wallet.ts +36 -0
- package/src/features/accounts/store/utils/accounts.ts +15 -0
- package/src/features/accounts/store/utils/addresses.ts +27 -0
- package/src/features/accounts/store/utils/connection.ts +40 -0
- package/src/features/accounts/store/utils/createAccountsStoreContextProvider.tsx +84 -0
- package/src/features/accounts/store/utils/createUseAccountsStore.ts +25 -0
- package/src/features/accounts/store/utils/flexibleInput.ts +13 -0
- package/src/features/accounts/store/utils/wallets.test.ts +305 -0
- package/src/features/accounts/store/utils/wallets.ts +85 -0
- package/src/features/accounts/types.ts +35 -0
- package/src/features/accounts/useOnchainDisplayName.tsx +76 -0
- package/src/features/activity/extract/conversion.test.ts +680 -0
- package/src/features/activity/extract/conversionRest.test.ts +1287 -0
- package/src/features/activity/extract/extractDEXOrderDetails.ts +95 -0
- package/src/features/activity/extract/extractFiatOnRampTransactionDetails.ts +175 -0
- package/src/features/activity/extract/extractOnChainTransactionDetails.ts +144 -0
- package/src/features/activity/extract/extractPlanDetails.ts +191 -0
- package/src/features/activity/extract/extractPlanResponseDetails.ts +188 -0
- package/src/features/activity/extract/extractPlanUtils.ts +174 -0
- package/src/features/activity/extract/extractRestDEXOrderDetails.ts +102 -0
- package/src/features/activity/extract/extractRestFiatOnRampDetails.ts +86 -0
- package/src/features/activity/extract/extractTransactionDetails.ts +127 -0
- package/src/features/activity/extract/statusMappers.ts +129 -0
- package/src/features/activity/formatTransactionsByDate.ts +105 -0
- package/src/features/activity/hooks/useActivityData.test.tsx +559 -0
- package/src/features/activity/hooks/useActivityData.tsx +165 -0
- package/src/features/activity/hooks/useFormattedTransactionDataForActivity.test.ts +331 -0
- package/src/features/activity/hooks/useFormattedTransactionDataForActivity.ts +300 -0
- package/src/features/activity/hooks/useMergeLocalAndRemoteTransactions.test.ts +563 -0
- package/src/features/activity/hooks/useMergeLocalAndRemoteTransactions.ts +292 -0
- package/src/features/activity/hooks/useNetworkFee.ts +35 -0
- package/src/features/activity/hooks/useOpenLimitOrders.ts +47 -0
- package/src/features/activity/hooks/useSyncRemotePlans.ts +59 -0
- package/src/features/activity/hooks/useTransactionActions.tsx +389 -0
- package/src/features/activity/parse/parseApproveTransaction.ts +71 -0
- package/src/features/activity/parse/parseAuctionTransaction.ts +72 -0
- package/src/features/activity/parse/parseBridgingTransaction.ts +117 -0
- package/src/features/activity/parse/parseExecuteTransaction.ts +112 -0
- package/src/features/activity/parse/parseLiquidityTransaction.ts +144 -0
- package/src/features/activity/parse/parseMintTransaction.ts +118 -0
- package/src/features/activity/parse/parseOnRampTransaction.ts +118 -0
- package/src/features/activity/parse/parseReceiveTransaction.ts +163 -0
- package/src/features/activity/parse/parseSendTransaction.ts +145 -0
- package/src/features/activity/parse/parseTradeTransaction.ts +406 -0
- package/src/features/activity/parse/parseUnknownTransaction.ts +32 -0
- package/src/features/activity/parseRestResponse.ts +184 -0
- package/src/features/activity/utils/extractDappInfo.ts +38 -0
- package/src/features/activity/utils/getTransactionSummaryTitle.ts +318 -0
- package/src/features/activity/utils/remote.ts +136 -0
- package/src/features/activity/utils/swapInfo.ts +49 -0
- package/src/features/address/avatar.ts +35 -0
- package/src/features/address/color.ts +35 -0
- package/src/features/address/types.ts +8 -0
- package/src/features/address/useIsSmartContractAddress.tsx +74 -0
- package/src/features/address/utils.ts +12 -0
- package/src/features/appearance/hooks.tsx +85 -0
- package/src/features/appearance/slice.ts +30 -0
- package/src/features/appearance/types.ts +1 -0
- package/src/features/appearance/useColorScheme.native.ts +1 -0
- package/src/features/appearance/useColorScheme.ts +6 -0
- package/src/features/appearance/useColorScheme.web.ts +87 -0
- package/src/features/auth/types.ts +1 -0
- package/src/features/behaviorHistory/selectors.ts +30 -0
- package/src/features/behaviorHistory/slice.ts +161 -0
- package/src/features/bridging/constants.ts +84 -0
- package/src/features/bridging/hooks/chains.ts +59 -0
- package/src/features/bridging/hooks/tokens.ts +224 -0
- package/src/features/capabilities/caip25/constants.ts +13 -0
- package/src/features/capabilities/caip25/types.ts +70 -0
- package/src/features/capabilities/caip25/utils.ts +17 -0
- package/src/features/chains/chainInfo.test.ts +117 -0
- package/src/features/chains/chainInfo.ts +141 -0
- package/src/features/chains/evm/defaults.ts +9 -0
- package/src/features/chains/evm/info/arbitrum.ts +93 -0
- package/src/features/chains/evm/info/avalanche.ts +91 -0
- package/src/features/chains/evm/info/base.ts +91 -0
- package/src/features/chains/evm/info/blast.ts +82 -0
- package/src/features/chains/evm/info/bnb.ts +81 -0
- package/src/features/chains/evm/info/celo.ts +86 -0
- package/src/features/chains/evm/info/hanzo.ts +93 -0
- package/src/features/chains/evm/info/lux.ts +254 -0
- package/src/features/chains/evm/info/mainnet.ts +203 -0
- package/src/features/chains/evm/info/monad.ts +90 -0
- package/src/features/chains/evm/info/optimism.ts +88 -0
- package/src/features/chains/evm/info/pars.ts +93 -0
- package/src/features/chains/evm/info/polygon.ts +91 -0
- package/src/features/chains/evm/info/soneium.ts +91 -0
- package/src/features/chains/evm/info/spc.ts +93 -0
- package/src/features/chains/evm/info/unichain.ts +146 -0
- package/src/features/chains/evm/info/worldchain.ts +87 -0
- package/src/features/chains/evm/info/xlayer.ts +81 -0
- package/src/features/chains/evm/info/zksync.ts +76 -0
- package/src/features/chains/evm/info/zoo.ts +170 -0
- package/src/features/chains/evm/info/zora.ts +76 -0
- package/src/features/chains/evm/rpc.ts +84 -0
- package/src/features/chains/evm/tokens.test.ts +220 -0
- package/src/features/chains/evm/tokens.ts +23 -0
- package/src/features/chains/gasDefaults.ts +37 -0
- package/src/features/chains/hooks/useEnabledChains.ts +55 -0
- package/src/features/chains/hooks/useFeatureFlaggedChainIds.ts +47 -0
- package/src/features/chains/hooks/useNewChainIds.ts +18 -0
- package/src/features/chains/hooks/useOrderedChainIds.ts +19 -0
- package/src/features/chains/hooks/useSupportedChainId.ts +35 -0
- package/src/features/chains/logos.tsx +65 -0
- package/src/features/chains/svm/defaults.ts +3 -0
- package/src/features/chains/svm/info/solana.ts +79 -0
- package/src/features/chains/types.ts +171 -0
- package/src/features/chains/utils.test.ts +224 -0
- package/src/features/chains/utils.ts +365 -0
- package/src/features/dappRequests/types.ts +87 -0
- package/src/features/dappRequests/utils.test.ts +81 -0
- package/src/features/dappRequests/utils.ts +36 -0
- package/src/features/dataApi/balances/balances.ts +369 -0
- package/src/features/dataApi/balances/balancesRest.test.ts +183 -0
- package/src/features/dataApi/balances/balancesRest.ts +366 -0
- package/src/features/dataApi/balances/toPortfolioMultichainBalance.test.ts +263 -0
- package/src/features/dataApi/balances/toPortfolioMultichainBalance.ts +142 -0
- package/src/features/dataApi/balances/utils.test.ts +64 -0
- package/src/features/dataApi/balances/utils.ts +44 -0
- package/src/features/dataApi/listTransactions/listTransactions.test.ts +182 -0
- package/src/features/dataApi/listTransactions/listTransactions.ts +174 -0
- package/src/features/dataApi/searchPools.ts +58 -0
- package/src/features/dataApi/searchTokens.ts +73 -0
- package/src/features/dataApi/tokenDetails/useTokenDetailsData.ts +94 -0
- package/src/features/dataApi/tokenDetails/useTokenSpotPriceCentralized.ts +9 -0
- package/src/features/dataApi/tokenDetails/useTokenSpotPriceWrapper.ts +13 -0
- package/src/features/dataApi/tokenProjects/tokenProjects.test.tsx +44 -0
- package/src/features/dataApi/tokenProjects/tokenProjects.ts +34 -0
- package/src/features/dataApi/tokenProjects/utils/tokenProjectToCurrencyInfos.test.ts +59 -0
- package/src/features/dataApi/tokenProjects/utils/tokenProjectToCurrencyInfos.ts +52 -0
- package/src/features/dataApi/types.ts +103 -0
- package/src/features/dataApi/utils/buildCurrency.test.ts +66 -0
- package/src/features/dataApi/utils/buildCurrency.ts +117 -0
- package/src/features/dataApi/utils/currencyIdToContractInput.test.ts +39 -0
- package/src/features/dataApi/utils/currencyIdToContractInput.ts +23 -0
- package/src/features/dataApi/utils/getCurrencySafetyInfo.ts +145 -0
- package/src/features/dataApi/utils/gqlTokenToCurrencyInfo.test.ts +39 -0
- package/src/features/dataApi/utils/gqlTokenToCurrencyInfo.ts +44 -0
- package/src/features/dataApi/utils/usePersistedError.test.ts +80 -0
- package/src/features/dataApi/utils/usePersistedError.ts +19 -0
- package/src/features/ens/api.ts +127 -0
- package/src/features/ens/constants.ts +1 -0
- package/src/features/ens/useENS.ts +61 -0
- package/src/features/favorites/selectors.ts +20 -0
- package/src/features/favorites/slice.test.ts +52 -0
- package/src/features/favorites/slice.ts +87 -0
- package/src/features/favorites/useSelectHasTokenFavorited.ts +12 -0
- package/src/features/favorites/useToggleFavoriteCallback.tsx +34 -0
- package/src/features/favorites/useToggleWatchedWalletCallback.ts +26 -0
- package/src/features/fiatCurrency/constants.ts +53 -0
- package/src/features/fiatCurrency/conversion.ts +172 -0
- package/src/features/fiatCurrency/hooks/useFormatChartFiatDelta.ts +31 -0
- package/src/features/fiatCurrency/hooks.ts +167 -0
- package/src/features/fiatCurrency/priceChart/formatters/shared/types.ts +37 -0
- package/src/features/fiatCurrency/priceChart/formatters/shared/utils.ts +93 -0
- package/src/features/fiatCurrency/priceChart/formatters/stablecoinFormatter.ts +84 -0
- package/src/features/fiatCurrency/priceChart/formatters/standardFormatter.ts +88 -0
- package/src/features/fiatCurrency/priceChart/priceChartConversion.test.ts +1203 -0
- package/src/features/fiatCurrency/priceChart/priceChartConversion.ts +42 -0
- package/src/features/fiatOnRamp/EdgeFade/EdgeFade.native.tsx +21 -0
- package/src/features/fiatOnRamp/EdgeFade/EdgeFade.test.tsx +62 -0
- package/src/features/fiatOnRamp/EdgeFade/EdgeFade.tsx +6 -0
- package/src/features/fiatOnRamp/EdgeFade/EdgeFade.web.tsx +21 -0
- package/src/features/fiatOnRamp/EdgeFade/__snapshots__/EdgeFade.test.tsx.snap +116 -0
- package/src/features/fiatOnRamp/FORQuoteItem.tsx +111 -0
- package/src/features/fiatOnRamp/FiatOnRampConnectingView.native.tsx +84 -0
- package/src/features/fiatOnRamp/FiatOnRampConnectingView.tsx +11 -0
- package/src/features/fiatOnRamp/FiatOnRampConnectingView.web.tsx +56 -0
- package/src/features/fiatOnRamp/FiatOnRampCountryPicker.tsx +58 -0
- package/src/features/fiatOnRamp/PaymentMethodFilter/PaymentMethodFilter.native.tsx +41 -0
- package/src/features/fiatOnRamp/PaymentMethodFilter/PaymentMethodFilter.test.tsx +165 -0
- package/src/features/fiatOnRamp/PaymentMethodFilter/PaymentMethodFilter.tsx +6 -0
- package/src/features/fiatOnRamp/PaymentMethodFilter/PaymentMethodFilter.web.tsx +51 -0
- package/src/features/fiatOnRamp/PaymentMethodFilter/__snapshots__/PaymentMethodFilter.test.tsx.snap +243 -0
- package/src/features/fiatOnRamp/PaymentMethodFilter/utils.tsx +160 -0
- package/src/features/fiatOnRamp/SelectTokenButton.tsx +77 -0
- package/src/features/fiatOnRamp/TokenSelectorBalanceDisplay.tsx +72 -0
- package/src/features/fiatOnRamp/UnsupportedTokenModal.tsx +45 -0
- package/src/features/fiatOnRamp/api.ts +7 -0
- package/src/features/fiatOnRamp/constants.ts +56 -0
- package/src/features/fiatOnRamp/hooks/useFiatOnRampQueries.ts +324 -0
- package/src/features/fiatOnRamp/hooks.ts +408 -0
- package/src/features/fiatOnRamp/types.ts +139 -0
- package/src/features/fiatOnRamp/useCexTransferProviders.ts +17 -0
- package/src/features/fiatOnRamp/utils.test.ts +483 -0
- package/src/features/fiatOnRamp/utils.ts +227 -0
- package/src/features/forceUpgrade/hooks/useForceUpgradeStatus.ts +9 -0
- package/src/features/forceUpgrade/hooks/useForceUpgradeTranslations.ts +14 -0
- package/src/features/gas/adjustGasFee.ts +144 -0
- package/src/features/gas/hooks/useCancellationGasFeeInfo.test.ts +170 -0
- package/src/features/gas/hooks/useCancellationGasFeeInfo.ts +154 -0
- package/src/features/gas/hooks/useMaxAmountSpend.test.ts +220 -0
- package/src/features/gas/hooks/useMaxAmountSpend.ts +113 -0
- package/src/features/gas/hooks/usePlanCancellationGasFeeInfo.ts +142 -0
- package/src/features/gas/hooks.ts +323 -0
- package/src/features/gas/utils/cancel.test.ts +239 -0
- package/src/features/gas/utils/cancel.ts +198 -0
- package/src/features/gas/utils.test.ts +74 -0
- package/src/features/gas/utils.ts +289 -0
- package/src/features/gating/StatsigProviderWrapper.tsx +71 -0
- package/src/features/gating/statsigBaseConfig.ts +10 -0
- package/src/features/gating/typeGuards.ts +23 -0
- package/src/features/gating/useSyncStatsigUserIdentifiers.ts +70 -0
- package/src/features/language/LocalizationContext.tsx +58 -0
- package/src/features/language/constants.ts +359 -0
- package/src/features/language/formatter.ts +76 -0
- package/src/features/language/hooks.tsx +304 -0
- package/src/features/language/localizedDayjs.ts +106 -0
- package/src/features/language/navigatorLocale.ts +49 -0
- package/src/features/language/utils.ts +8 -0
- package/src/features/nfts/constants.ts +5 -0
- package/src/features/nfts/hooks/useGroupNftsByVisibility.ts +58 -0
- package/src/features/nfts/hooks/useNFT.ts +31 -0
- package/src/features/nfts/hooks/useNavigateToNftExplorerLink.ts +7 -0
- package/src/features/nfts/hooks/useNftContextMenuItems.tsx +266 -0
- package/src/features/nfts/types.ts +22 -0
- package/src/features/nfts/utils.test.ts +257 -0
- package/src/features/nfts/utils.ts +128 -0
- package/src/features/notifications/constants.ts +20 -0
- package/src/features/notifications/hooks/useNotificationLifecycle.ts +81 -0
- package/src/features/notifications/slice/hooks.ts +18 -0
- package/src/features/notifications/slice/selectors.ts +46 -0
- package/src/features/notifications/slice/slice.ts +82 -0
- package/src/features/notifications/slice/types.ts +267 -0
- package/src/features/passkey/PasskeyManagementModal.tsx +84 -0
- package/src/features/passkey/PasskeysHelpModal.tsx +130 -0
- package/src/features/passkey/constants.ts +1 -0
- package/src/features/passkey/embeddedWallet.ts +431 -0
- package/src/features/passkey/hooks/useEmbeddedWalletBaseUrl.ts +12 -0
- package/src/features/passkey/hooks/useGetPasskeyAuthStatus.ts +25 -0
- package/src/features/passkey/passkey.native.ts +9 -0
- package/src/features/passkey/passkey.ts +9 -0
- package/src/features/passkey/passkey.web.ts +20 -0
- package/src/features/passkey/utils.native.ts +3 -0
- package/src/features/passkey/utils.ts +5 -0
- package/src/features/passkey/utils.web.ts +28 -0
- package/src/features/platforms/types/Platform.ts +4 -0
- package/src/features/platforms/types/PlatformSpecificAddress.ts +11 -0
- package/src/features/platforms/utils/addresses.ts +35 -0
- package/src/features/platforms/utils/chains.ts +21 -0
- package/src/features/portfolio/PortfolioBalance/PortfolioBalance.tsx +96 -0
- package/src/features/portfolio/TokenBalanceListContext.tsx +169 -0
- package/src/features/portfolio/api.ts +256 -0
- package/src/features/portfolio/balances/hooks/useTokenContextMenuOptions.ts +299 -0
- package/src/features/portfolio/portfolioUpdates/constants.ts +3 -0
- package/src/features/portfolio/portfolioUpdates/fetchOnChainBalances.test.ts +197 -0
- package/src/features/portfolio/portfolioUpdates/fetchOnChainBalances.ts +249 -0
- package/src/features/portfolio/portfolioUpdates/getCurrenciesWithExpectedUpdates.ts +82 -0
- package/src/features/portfolio/portfolioUpdates/getInstantTokenBalanceUpdateApolloLink.ts +343 -0
- package/src/features/portfolio/portfolioUpdates/refetchGQLQueriesViaOnchainOverrideVariantSaga.ts +278 -0
- package/src/features/portfolio/portfolioUpdates/refetchQueriesSaga.ts +15 -0
- package/src/features/portfolio/portfolioUpdates/rest/fetchOnChainBalancesRest.test.ts +326 -0
- package/src/features/portfolio/portfolioUpdates/rest/fetchOnChainBalancesRest.ts +338 -0
- package/src/features/portfolio/portfolioUpdates/rest/refetchRestQueriesViaOnchainOverrideVariantSaga.test.ts +322 -0
- package/src/features/portfolio/portfolioUpdates/rest/refetchRestQueriesViaOnchainOverrideVariantSaga.ts +308 -0
- package/src/features/portfolio/slice/selectors.ts +18 -0
- package/src/features/portfolio/slice/slice.test.ts +183 -0
- package/src/features/portfolio/slice/slice.ts +115 -0
- package/src/features/portfolio/types.ts +9 -0
- package/src/features/prices/TokenPriceContext.tsx +62 -0
- package/src/features/providers/FlashbotsCommon.ts +117 -0
- package/src/features/providers/FlashbotsRpcClient.test.ts +336 -0
- package/src/features/providers/FlashbotsRpcClient.ts +173 -0
- package/src/features/providers/FlashbotsRpcProvider.test.ts +90 -0
- package/src/features/providers/FlashbotsRpcProvider.ts +149 -0
- package/src/features/providers/createEthersProvider.ts +46 -0
- package/src/features/providers/createViemClient.ts +81 -0
- package/src/features/providers/getSolanaConnection.ts +8 -0
- package/src/features/providers/observability/InstrumentedJsonRpcProvider.ts +52 -0
- package/src/features/providers/observability/createObservableTransport.ts +44 -0
- package/src/features/providers/observability/extractProviderName.ts +43 -0
- package/src/features/providers/observability/rpcObserver.ts +73 -0
- package/src/features/providers/rpcUrlSelector.ts +81 -0
- package/src/features/providers/webForNudgeProvider.tsx +52 -0
- package/src/features/reporting/reports.ts +196 -0
- package/src/features/repositories.ts +28 -0
- package/src/features/search/ClearRecentSearchesButton.tsx +24 -0
- package/src/features/search/SearchHistoryResult.ts +95 -0
- package/src/features/search/SearchModal/SearchModalList.tsx +341 -0
- package/src/features/search/SearchModal/SearchModalNoQueryList.tsx +70 -0
- package/src/features/search/SearchModal/SearchModalResultsList.tsx +255 -0
- package/src/features/search/SearchModal/analytics/SearchContext.tsx +18 -0
- package/src/features/search/SearchModal/analytics/analytics.test.ts +228 -0
- package/src/features/search/SearchModal/analytics/analytics.ts +122 -0
- package/src/features/search/SearchModal/constants.ts +4 -0
- package/src/features/search/SearchModal/hooks/useFilterCallbacks.ts +70 -0
- package/src/features/search/SearchModal/hooks/useRecentlySearchedOptions.tsx +166 -0
- package/src/features/search/SearchModal/hooks/useSectionsForNoQuerySearch.tsx +159 -0
- package/src/features/search/SearchModal/hooks/useWalletSearchResults.tsx +169 -0
- package/src/features/search/SearchModal/types.ts +10 -0
- package/src/features/search/SearchTextInput.tsx +257 -0
- package/src/features/search/searchHistorySlice.test.ts +168 -0
- package/src/features/search/searchHistorySlice.ts +70 -0
- package/src/features/search/selectSearchHistory.ts +6 -0
- package/src/features/search/utils.ts +15 -0
- package/src/features/services.ts +81 -0
- package/src/features/settings/balances/PortfolioBalanceSettingsContent.tsx +110 -0
- package/src/features/settings/constants.ts +41 -0
- package/src/features/settings/hooks.test.ts +80 -0
- package/src/features/settings/hooks.ts +41 -0
- package/src/features/settings/saga.ts +18 -0
- package/src/features/settings/selectors.ts +19 -0
- package/src/features/settings/slice.test.ts +28 -0
- package/src/features/settings/slice.ts +81 -0
- package/src/features/settings/storage/StorageSettingsContent.test.tsx +89 -0
- package/src/features/settings/storage/StorageSettingsContent.tsx +253 -0
- package/src/features/settings/storage/__snapshots__/StorageSettingsContent.test.tsx.snap +193 -0
- package/src/features/settings/useHapticFeedback/types.ts +22 -0
- package/src/features/settings/useHapticFeedback/useHapticFeedback.native.ts +45 -0
- package/src/features/settings/useHapticFeedback/useHapticFeedback.ts +6 -0
- package/src/features/settings/useHapticFeedback/useHapticFeedback.web.ts +11 -0
- package/src/features/smartWallet/banner/NetworkCostBanner.tsx +38 -0
- package/src/features/smartWallet/delegation/createTradingApiDelegationRepository.ts +65 -0
- package/src/features/smartWallet/delegation/delegation.test.ts +174 -0
- package/src/features/smartWallet/delegation/delegation.ts +118 -0
- package/src/features/smartWallet/delegation/delegationRepository.ts +21 -0
- package/src/features/smartWallet/delegation/effects.test.ts +206 -0
- package/src/features/smartWallet/delegation/effects.ts +81 -0
- package/src/features/smartWallet/delegation/hooks/useSetActiveChainId.ts +11 -0
- package/src/features/smartWallet/delegation/hooks/useUpdateDelegateState.ts +10 -0
- package/src/features/smartWallet/delegation/isDelegatedEOA.test.ts +63 -0
- package/src/features/smartWallet/delegation/isDelegatedEOA.ts +37 -0
- package/src/features/smartWallet/delegation/slice.ts +85 -0
- package/src/features/smartWallet/delegation/types.ts +12 -0
- package/src/features/smartWallet/mismatch/MismatchAccountEffects.tsx +38 -0
- package/src/features/smartWallet/mismatch/MismatchContext.tsx +76 -0
- package/src/features/smartWallet/mismatch/hooks.ts +229 -0
- package/src/features/smartWallet/mismatch/mismatch.test.ts +66 -0
- package/src/features/smartWallet/mismatch/mismatch.ts +109 -0
- package/src/features/smartWallet/mismatch/queryOptions.ts +42 -0
- package/src/features/smartWallet/mismatch/useMakeAccountMismatchQueryOptions.ts +23 -0
- package/src/features/smartWallet/mismatch/useOnDisconnectEffect.native.tsx +1 -0
- package/src/features/smartWallet/mismatch/useOnDisconnectEffect.tsx +5 -0
- package/src/features/smartWallet/mismatch/useOnDisconnectEffect.web.tsx +26 -0
- package/src/features/telemetry/Trace.tsx +60 -0
- package/src/features/telemetry/constants/extension.ts +28 -0
- package/src/features/telemetry/constants/features.ts +78 -0
- package/src/features/telemetry/constants/index.ts +8 -0
- package/src/features/telemetry/constants/interface.ts +71 -0
- package/src/features/telemetry/constants/lux.ts +25 -0
- package/src/features/telemetry/constants/mobile.ts +36 -0
- package/src/features/telemetry/constants/sessions.ts +12 -0
- package/src/features/telemetry/constants/trace/element.ts +330 -0
- package/src/features/telemetry/constants/trace/index.ts +4 -0
- package/src/features/telemetry/constants/trace/modal.ts +234 -0
- package/src/features/telemetry/constants/trace/page.ts +37 -0
- package/src/features/telemetry/constants/trace/section.ts +42 -0
- package/src/features/telemetry/constants/wallet.ts +70 -0
- package/src/features/telemetry/send.native.ts +28 -0
- package/src/features/telemetry/send.ts +18 -0
- package/src/features/telemetry/send.web.ts +31 -0
- package/src/features/telemetry/types.ts +1320 -0
- package/src/features/telemetry/user.ts +100 -0
- package/src/features/telemetry/utils/logExperimentQualifyingEvent.ts +9 -0
- package/src/features/testnets/TestnetModeModal.tsx +47 -0
- package/src/features/timing/selectors.ts +3 -0
- package/src/features/timing/slice.ts +31 -0
- package/src/features/tokens/SolanaToken.test.ts +76 -0
- package/src/features/tokens/SolanaToken.ts +48 -0
- package/src/features/tokens/getCurrencyAmount.test.ts +120 -0
- package/src/features/tokens/getCurrencyAmount.ts +85 -0
- package/src/features/tokens/stablecoin.ts +29 -0
- package/src/features/tokens/useCurrencyInfo.ts +110 -0
- package/src/features/tokens/warnings/TokenWarningCard.tsx +129 -0
- package/src/features/tokens/warnings/TokenWarningFlagsTable.tsx +142 -0
- package/src/features/tokens/warnings/TokenWarningModal.tsx +403 -0
- package/src/features/tokens/warnings/WarningInfoModalContainer.tsx +11 -0
- package/src/features/tokens/warnings/hooks/useBlockaidFeeComparisonAnalytics.ts +62 -0
- package/src/features/tokens/warnings/hooks/useWarningModalCurrenciesDismissed.ts +60 -0
- package/src/features/tokens/warnings/safetyUtils.test.ts +605 -0
- package/src/features/tokens/warnings/safetyUtils.ts +458 -0
- package/src/features/tokens/warnings/slice/hooks.ts +104 -0
- package/src/features/tokens/warnings/slice/selectors.ts +17 -0
- package/src/features/tokens/warnings/slice/slice.ts +91 -0
- package/src/features/tokens/warnings/slice/types.ts +34 -0
- package/src/features/tokens/warnings/types.ts +14 -0
- package/src/features/transactions/TransactionDetails/EstimatedTime.tsx +29 -0
- package/src/features/transactions/TransactionDetails/ExpectedFailureBanner.tsx +45 -0
- package/src/features/transactions/TransactionDetails/ExpectedSpeed.tsx +19 -0
- package/src/features/transactions/TransactionDetails/FeeOnTransferFee.tsx +50 -0
- package/src/features/transactions/TransactionDetails/ListSeparatorToggle.tsx +41 -0
- package/src/features/transactions/TransactionDetails/SlippageEdit.tsx +50 -0
- package/src/features/transactions/TransactionDetails/SwapFee.tsx +115 -0
- package/src/features/transactions/TransactionDetails/SwapReviewTokenWarningCard.tsx +77 -0
- package/src/features/transactions/TransactionDetails/TransactionDetails.tsx +200 -0
- package/src/features/transactions/TransactionDetails/TransactionWarning.tsx +19 -0
- package/src/features/transactions/TransactionDetails/UnichainPoweredMessage.tsx +27 -0
- package/src/features/transactions/TransactionDetails/UserReceiveAmount.tsx +33 -0
- package/src/features/transactions/TransactionDetails/modals/FeeOnTransferWarning.tsx +104 -0
- package/src/features/transactions/TransactionDetails/modals/SwapFeeWarning.tsx +72 -0
- package/src/features/transactions/TransactionDetails/types.ts +25 -0
- package/src/features/transactions/TransactionDetails/utils/getFeeSeverity.ts +41 -0
- package/src/features/transactions/TransactionDetails/utils/getRelevantTokenWarningSeverity.ts +22 -0
- package/src/features/transactions/TransactionDetails/utils/getShouldDisplayTokenWarningCard.ts +63 -0
- package/src/features/transactions/cancel/cancelMultipleOrders.test.ts +386 -0
- package/src/features/transactions/cancel/cancelMultipleOrders.ts +226 -0
- package/src/features/transactions/cancel/cancelOrderFactory.test.ts +327 -0
- package/src/features/transactions/cancel/cancelOrderFactory.ts +161 -0
- package/src/features/transactions/cancel/getCancelOrderTxRequest.ts +39 -0
- package/src/features/transactions/cancel/validation.test.ts +99 -0
- package/src/features/transactions/cancel/validation.ts +57 -0
- package/src/features/transactions/components/DecimalPadInput/DecimalPad.native.tsx +306 -0
- package/src/features/transactions/components/DecimalPadInput/DecimalPad.tsx +7 -0
- package/src/features/transactions/components/DecimalPadInput/DecimalPad.web.tsx +7 -0
- package/src/features/transactions/components/DecimalPadInput/DecimalPadInput.tsx +386 -0
- package/src/features/transactions/components/DecimalPadInput/types.ts +18 -0
- package/src/features/transactions/components/InsufficientNativeTokenWarning/BridgeTokenButton.tsx +65 -0
- package/src/features/transactions/components/InsufficientNativeTokenWarning/BuyNativeTokenButton.tsx +72 -0
- package/src/features/transactions/components/InsufficientNativeTokenWarning/InsufficientNativeTokenBaseComponent.tsx +91 -0
- package/src/features/transactions/components/InsufficientNativeTokenWarning/InsufficientNativeTokenWarning.tsx +165 -0
- package/src/features/transactions/components/InsufficientNativeTokenWarning/constants.ts +3 -0
- package/src/features/transactions/components/InsufficientNativeTokenWarning/useInsufficientNativeTokenWarning.tsx +176 -0
- package/src/features/transactions/components/TransactionModal/TransactionModal.native.tsx +207 -0
- package/src/features/transactions/components/TransactionModal/TransactionModal.tsx +17 -0
- package/src/features/transactions/components/TransactionModal/TransactionModal.web.tsx +59 -0
- package/src/features/transactions/components/TransactionModal/TransactionModalContext.tsx +108 -0
- package/src/features/transactions/components/TransactionModal/TransactionModalProps.tsx +23 -0
- package/src/features/transactions/components/TransactionModal/TransactionModalUpdateLogger.tsx +17 -0
- package/src/features/transactions/components/cancel/CancelConfirmationView.tsx +178 -0
- package/src/features/transactions/components/settings/TransactionSettings.tsx +138 -0
- package/src/features/transactions/components/settings/TransactionSettingsButton.tsx +96 -0
- package/src/features/transactions/components/settings/TransactionSettingsButtonWithSlippage.tsx +84 -0
- package/src/features/transactions/components/settings/TransactionSettingsModal/TransactionSettingsModal.tsx +11 -0
- package/src/features/transactions/components/settings/TransactionSettingsModal/TransactionSettingsModalContent/TransactionSettingsModalContent.tsx +144 -0
- package/src/features/transactions/components/settings/TransactionSettingsModal/TransactionSettingsModalContent/TransactionSettingsRow.tsx +91 -0
- package/src/features/transactions/components/settings/TransactionSettingsModal/TransactionSettingsModalInterface.tsx +47 -0
- package/src/features/transactions/components/settings/TransactionSettingsModal/TransactionSettingsModalWallet.tsx +45 -0
- package/src/features/transactions/components/settings/TransactionSettingsModal/types.ts +9 -0
- package/src/features/transactions/components/settings/ViewOnlyButton.tsx +29 -0
- package/src/features/transactions/components/settings/hooks/useTransactionSettingsWithSlippage.ts +64 -0
- package/src/features/transactions/components/settings/settingsConfigurations/deadline/Deadline/Deadline.native.tsx +16 -0
- package/src/features/transactions/components/settings/settingsConfigurations/deadline/Deadline/Deadline.tsx +18 -0
- package/src/features/transactions/components/settings/settingsConfigurations/deadline/Deadline/Deadline.web.tsx +26 -0
- package/src/features/transactions/components/settings/settingsConfigurations/deadline/DeadlineControl.tsx +83 -0
- package/src/features/transactions/components/settings/settingsConfigurations/deadline/DeadlineWarning.tsx +19 -0
- package/src/features/transactions/components/settings/settingsConfigurations/deadline/useDeadlineSettings.ts +95 -0
- package/src/features/transactions/components/settings/settingsConfigurations/slippage/Slippage/Slippage.native.tsx +15 -0
- package/src/features/transactions/components/settings/settingsConfigurations/slippage/Slippage/Slippage.tsx +18 -0
- package/src/features/transactions/components/settings/settingsConfigurations/slippage/Slippage/Slippage.web.tsx +27 -0
- package/src/features/transactions/components/settings/settingsConfigurations/slippage/SlippageControl/SlippageControl.native.tsx +30 -0
- package/src/features/transactions/components/settings/settingsConfigurations/slippage/SlippageControl/SlippageControl.tsx +10 -0
- package/src/features/transactions/components/settings/settingsConfigurations/slippage/SlippageControl/SlippageControl.web.tsx +165 -0
- package/src/features/transactions/components/settings/settingsConfigurations/slippage/SlippageControl/types.ts +3 -0
- package/src/features/transactions/components/settings/settingsConfigurations/slippage/SlippageWarning.tsx +31 -0
- package/src/features/transactions/components/settings/settingsConfigurations/slippage/useSlippageSettings.ts +220 -0
- package/src/features/transactions/components/settings/stores/TransactionSettingsModalStore/TransactionSettingsModalStoreContext.tsx +10 -0
- package/src/features/transactions/components/settings/stores/TransactionSettingsModalStore/TransactionSettingsModalStoreContextProvider.tsx +28 -0
- package/src/features/transactions/components/settings/stores/TransactionSettingsModalStore/createTransactionSettingsModalStore.ts +106 -0
- package/src/features/transactions/components/settings/stores/TransactionSettingsModalStore/useTransactionSettingsModalStore.ts +50 -0
- package/src/features/transactions/components/settings/stores/transactionSettingsStore/LPTransactionSettingsStoreContextProvider.tsx +15 -0
- package/src/features/transactions/components/settings/stores/transactionSettingsStore/SwapTransactionSettingsStoreContextProvider.tsx +6 -0
- package/src/features/transactions/components/settings/stores/transactionSettingsStore/TransactionSettingsStoreContext.ts +22 -0
- package/src/features/transactions/components/settings/stores/transactionSettingsStore/TransactionSettingsStoreContextProvider.tsx +49 -0
- package/src/features/transactions/components/settings/stores/transactionSettingsStore/createTransactionSettingsAutoSlippageToleranceStore.tsx +37 -0
- package/src/features/transactions/components/settings/stores/transactionSettingsStore/createTransactionSettingsStore.test.ts +28 -0
- package/src/features/transactions/components/settings/stores/transactionSettingsStore/createTransactionSettingsStore.ts +80 -0
- package/src/features/transactions/components/settings/stores/transactionSettingsStore/useTransactionSettingsStore.ts +79 -0
- package/src/features/transactions/components/settings/types.ts +42 -0
- package/src/features/transactions/components/settings/utils.ts +31 -0
- package/src/features/transactions/errors.ts +308 -0
- package/src/features/transactions/hooks/useErroredQueuedOrder.ts +52 -0
- package/src/features/transactions/hooks/useGetCanSignPermits.ts +14 -0
- package/src/features/transactions/hooks/useGetSwapDelegationAddress.ts +16 -0
- package/src/features/transactions/hooks/useIsCancelable.ts +130 -0
- package/src/features/transactions/hooks/useIsQueuedTransaction.ts +44 -0
- package/src/features/transactions/hooks/useParsedTransactionWarnings.tsx +98 -0
- package/src/features/transactions/hooks/usePendingTransactions.ts +45 -0
- package/src/features/transactions/hooks/usePollingIntervalByChain.ts +27 -0
- package/src/features/transactions/hooks/useSelectTransaction.tsx +22 -0
- package/src/features/transactions/hooks/useSuccessfulSwapCompleted.ts +59 -0
- package/src/features/transactions/hooks/useTokenAndFiatDisplayAmounts.tsx +82 -0
- package/src/features/transactions/hooks/useUSDCPrice.ts +125 -0
- package/src/features/transactions/hooks/useUSDCPriceCentralized.ts +77 -0
- package/src/features/transactions/hooks/useUSDCPriceWrapper.ts +34 -0
- package/src/features/transactions/hooks/useUSDTokenUpdater.ts +77 -0
- package/src/features/transactions/liquidity/steps/collectFees.ts +13 -0
- package/src/features/transactions/liquidity/steps/collectFeesSteps.ts +11 -0
- package/src/features/transactions/liquidity/steps/collectIncentiveRewards.ts +5 -0
- package/src/features/transactions/liquidity/steps/collectIncentiveRewardsSteps.ts +3 -0
- package/src/features/transactions/liquidity/steps/decreaseLiquiditySteps.ts +21 -0
- package/src/features/transactions/liquidity/steps/decreasePosition.ts +19 -0
- package/src/features/transactions/liquidity/steps/generateLPTransactionSteps.test.ts +362 -0
- package/src/features/transactions/liquidity/steps/generateLPTransactionSteps.ts +178 -0
- package/src/features/transactions/liquidity/steps/increaseLiquiditySteps.ts +81 -0
- package/src/features/transactions/liquidity/steps/increasePosition.ts +206 -0
- package/src/features/transactions/liquidity/steps/migrate.ts +72 -0
- package/src/features/transactions/liquidity/steps/migrationSteps.ts +48 -0
- package/src/features/transactions/liquidity/types.ts +187 -0
- package/src/features/transactions/liquidity/utils.ts +87 -0
- package/src/features/transactions/modals/BlockedAddressModal.tsx +20 -0
- package/src/features/transactions/modals/BlockedAddressWarning.tsx +33 -0
- package/src/features/transactions/modals/CompatibleAddressModal.tsx +91 -0
- package/src/features/transactions/modals/HiddenTokenInfoModal.tsx +39 -0
- package/src/features/transactions/modals/LowNativeBalanceModal.tsx +62 -0
- package/src/features/transactions/modals/MaxBalanceInfoModal.tsx +72 -0
- package/src/features/transactions/modals/ViewOnlyModal.tsx +28 -0
- package/src/features/transactions/selectors.ts +315 -0
- package/src/features/transactions/send/types.ts +18 -0
- package/src/features/transactions/signing.ts +29 -0
- package/src/features/transactions/slice.test.ts +959 -0
- package/src/features/transactions/slice.ts +370 -0
- package/src/features/transactions/steps/approve.ts +31 -0
- package/src/features/transactions/steps/permit2Signature.ts +17 -0
- package/src/features/transactions/steps/permit2Transaction.ts +34 -0
- package/src/features/transactions/steps/revoke.ts +30 -0
- package/src/features/transactions/steps/types.ts +154 -0
- package/src/features/transactions/steps/wrap.ts +17 -0
- package/src/features/transactions/swap/SwapFlow/CurrentScreen.native.tsx +70 -0
- package/src/features/transactions/swap/SwapFlow/CurrentScreen.tsx +10 -0
- package/src/features/transactions/swap/SwapFlow/CurrentScreen.web.tsx +60 -0
- package/src/features/transactions/swap/SwapFlow/SwapFlow.tsx +84 -0
- package/src/features/transactions/swap/analytics.test.ts +183 -0
- package/src/features/transactions/swap/analytics.ts +585 -0
- package/src/features/transactions/swap/components/AcrossRoutingInfo.tsx +91 -0
- package/src/features/transactions/swap/components/BridgingCurrencyRow.tsx +53 -0
- package/src/features/transactions/swap/components/CrossChainCurrencyRow.tsx +53 -0
- package/src/features/transactions/swap/components/EstimatedBridgeTime.tsx +66 -0
- package/src/features/transactions/swap/components/MaxSlippageRow/MaxSlippageRow.tsx +81 -0
- package/src/features/transactions/swap/components/MaxSlippageRow/SlippageInfo/SlippageInfo.tsx +81 -0
- package/src/features/transactions/swap/components/MaxSlippageRow/SlippageInfo/SlippageInfoCaption.tsx +116 -0
- package/src/features/transactions/swap/components/MaxSlippageRow/SlippageInfo/types.ts +8 -0
- package/src/features/transactions/swap/components/MaxSlippageRow/SlippageInfo/useFormatSlippageAmount.ts +26 -0
- package/src/features/transactions/swap/components/PriceImpactRow/MarketPriceImpactWarning.tsx +84 -0
- package/src/features/transactions/swap/components/PriceImpactRow/PriceImpactRow.tsx +45 -0
- package/src/features/transactions/swap/components/PriceImpactRow/usePriceImpact.test.ts +93 -0
- package/src/features/transactions/swap/components/PriceImpactRow/usePriceImpact.ts +26 -0
- package/src/features/transactions/swap/components/README.md +24 -0
- package/src/features/transactions/swap/components/RoutingInfo/AcrossRoutingInfo.tsx +91 -0
- package/src/features/transactions/swap/components/RoutingInfo/ChainedRoutingInfo.tsx +142 -0
- package/src/features/transactions/swap/components/RoutingInfo/RoutingHopInfo.tsx +120 -0
- package/src/features/transactions/swap/components/RoutingInfo/RoutingInfo.tsx +30 -0
- package/src/features/transactions/swap/components/RoutingInfo.tsx +120 -0
- package/src/features/transactions/swap/components/SwapArrowButton.tsx +43 -0
- package/src/features/transactions/swap/components/SwapFormButton/SwapFormButton.tsx +70 -0
- package/src/features/transactions/swap/components/SwapFormButton/SwapFormButtonTrace.tsx +38 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useBridgingModalActions.ts +28 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useCurrenciesWithBridgingWarnings.ts +36 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useCurrenciesWithProtectionWarnings.ts +38 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useIsAmountSelectionInvalid.ts +11 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useIsBlockingWithCustomMessage.ts +19 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useIsMissingPlatformWallet.ts +12 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useIsPortfolioZero.ts +10 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useIsSwapButtonDisabled.ts +66 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useIsTokenSelectionInvalid.ts +10 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useIsTradeIndicative.ts +12 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useIsWrongWalletPlatform.ts +15 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useOnReviewPress.ts +99 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useSwapFormButtonColors.ts +76 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useSwapFormButtonHooks.test.ts +620 -0
- package/src/features/transactions/swap/components/SwapFormButton/hooks/useSwapFormButtonText.ts +90 -0
- package/src/features/transactions/swap/components/SwapFormSettings/SlippageWarningModal.tsx +50 -0
- package/src/features/transactions/swap/components/SwapFormSettings/SwapFormSettings.tsx +92 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/RoutingMethodPreference/RoutingMethodPreference.tsx +15 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/RoutingMethodPreference/RoutingMethodPreferenceControl.tsx +28 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/RoutingMethodPreference/RoutingMethodPreferenceScreen.tsx +89 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/TradeRoutingPreference/DEXInfo.tsx +55 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/TradeRoutingPreference/TradeRoutingPreference.tsx +15 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/TradeRoutingPreference/TradeRoutingPreferenceControl.tsx +39 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/TradeRoutingPreference/TradeRoutingPreferenceScreen.tsx +473 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/TradeRoutingPreference/V4HooksInfo.tsx +43 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/TradeRoutingPreference/isDefaultTradeRouteOptions.ts +17 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/slippage/Slippage/Slippage.native.tsx +19 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/slippage/Slippage/Slippage.tsx +21 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/slippage/Slippage/Slippage.web.tsx +10 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/slippage/SlippageControl/SlippageControl.native.tsx +11 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/slippage/SlippageControl/SlippageControl.tsx +9 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/slippage/SlippageControl/SlippageControl.web.tsx +11 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/slippage/SlippageScreenNative.tsx +203 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/slippageUpdate/SlippageUpdate.native.tsx +7 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/slippageUpdate/SlippageUpdate.tsx +11 -0
- package/src/features/transactions/swap/components/SwapFormSettings/settingsConfigurations/slippageUpdate/SlippageUpdate.web.tsx +11 -0
- package/src/features/transactions/swap/components/SwapRateRatio.tsx +77 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/AnimatedTokenFlip.native.tsx +121 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/AnimatedTokenFlip.tsx +16 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/AnimatedTokenFlip.web.tsx +136 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/FlashblocksConfirmButton.tsx +104 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/GradientContainer.native.tsx +120 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/GradientContainer.tsx +11 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/GradientContainer.web.tsx +128 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/StyledTokenLogo.tsx +32 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/UnichainInstantBalanceModal.tsx +150 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/constants.ts +28 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/getOutputAmountFromSwapLogAndFormData.ts/constants.ts +40 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/getOutputAmountFromSwapLogAndFormData.ts/getOutputAmountFromSwapLogAndFormData.ts +137 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/getOutputAmountFromSwapLogAndFormData.ts/utils.ts +181 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/hooks/receiptFetching/useFetchReceipt.ts +95 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/hooks/receiptFetching/useReceiptFailureHandler.ts +57 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/hooks/receiptFetching/useReceiptSuccessHandler.ts +207 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/hooks/receiptFetching/utils.ts +125 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/hooks/useActualCompletionTime.tsx +48 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/hooks/useActualSwapOutput.tsx +70 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/hooks/useBackgroundColor.tsx +9 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/hooks/useClearFlashblocksSwapNotifications.ts +51 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/hooks/useCurrentFlashblocksTransaction.tsx +29 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/hooks/useInstantReceiptOutput.tsx +83 -0
- package/src/features/transactions/swap/components/UnichainInstantBalanceModal/utils.ts +91 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormCurrencyInputPanel.tsx +103 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormCurrencyOutputPanel.tsx +106 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormDecimalPad/SwapFormDecimalPad.native.tsx +264 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormDecimalPad/SwapFormDecimalPad.tsx +5 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormDecimalPad/SwapFormDecimalPad.web.tsx +3 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormHeader/SwapFormHeader.native.tsx +23 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormHeader/SwapFormHeader.tsx +5 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormHeader/SwapFormHeader.web.tsx +38 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreen.tsx +118 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/ExpandableRows.tsx +101 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenDetails.native.tsx +12 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenDetails.tsx +5 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenDetails.web.tsx +39 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/ExactOutputUnavailableWarningRow.tsx +57 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/GasAndWarningRows/GasAndWarningRows.native.tsx +183 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/GasAndWarningRows/GasAndWarningRows.tsx +5 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/GasAndWarningRows/GasAndWarningRows.web.tsx +60 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/GasAndWarningRows/SwapWarningModal.tsx +46 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/GasAndWarningRows/TradeInfoRow/CanonicalBridgeLinkBanner.tsx +29 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/GasAndWarningRows/TradeInfoRow/GasInfoRow.test.tsx +152 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/GasAndWarningRows/TradeInfoRow/GasInfoRow.tsx +68 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/GasAndWarningRows/TradeInfoRow/TradeInfoRow.tsx +92 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/GasAndWarningRows/TradeInfoRow/TradeWarning.tsx +40 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/GasAndWarningRows/TradeInfoRow/useDebouncedTrade.ts +21 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/GasAndWarningRows/types.ts +11 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/GasAndWarningRows/useDebouncedGasInfo.ts +70 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormScreenDetails/SwapFormScreenFooter/SwapFormScreenFooter.tsx +65 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormTooltips/AcrossRoutingTooltip.tsx +12 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormTooltips/BestRouteTooltip.tsx +82 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormTooltips/FeeDetailsTooltip.tsx +67 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormTooltips/LargePriceDifferenceTooltip.tsx +17 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormTooltips/MaxSlippageTooltip.tsx +144 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormTooltips/YouReceiveDetailsTooltip.tsx +96 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormWarningModals/BridgingModal.tsx +86 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapFormWarningModals/SwapFormWarningModals.tsx +113 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapTokenSelector/SwapTokenSelector.tsx +60 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapTokenSelector/hooks/useChainId.ts +36 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwapTokenSelector/hooks/useHideTokenSelector.ts +21 -0
- package/src/features/transactions/swap/form/SwapFormScreen/SwitchCurrenciesButton.tsx +63 -0
- package/src/features/transactions/swap/form/SwapFormScreen/WalletRestoreButton.tsx +41 -0
- package/src/features/transactions/swap/form/SwapFormScreen/YouReceiveDetails/SwapDetailsRow.tsx +169 -0
- package/src/features/transactions/swap/form/SwapFormScreen/YouReceiveDetails/YouReceiveDetails.native.tsx +5 -0
- package/src/features/transactions/swap/form/SwapFormScreen/YouReceiveDetails/YouReceiveDetails.tsx +12 -0
- package/src/features/transactions/swap/form/SwapFormScreen/YouReceiveDetails/YouReceiveDetails.web.tsx +413 -0
- package/src/features/transactions/swap/form/SwapFormScreen/hooks/useCurrencyInputFocusedStyle.ts +19 -0
- package/src/features/transactions/swap/form/hooks/useDecimalPadControlledField.ts +15 -0
- package/src/features/transactions/swap/form/hooks/useOnSelectCurrency.ts +245 -0
- package/src/features/transactions/swap/form/hooks/useSwapNetworkChangeEffect.test.ts +91 -0
- package/src/features/transactions/swap/form/hooks/useSwapPrefilledState.ts +118 -0
- package/src/features/transactions/swap/form/hooks/useSyncFiatAndTokenAmountUpdater.test.tsx +226 -0
- package/src/features/transactions/swap/form/hooks/useSyncFiatAndTokenAmountUpdater.tsx +84 -0
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/SwapFormScreenStoreContext.ts +4 -0
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/SwapFormScreenStoreContextProvider.tsx +268 -0
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/createSwapFormScreenStore.ts +83 -0
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/devUtils.ts +65 -0
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/hooks/useChainIdsChangeEffect.test.ts +227 -0
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/hooks/useChainIdsChangeEffect.ts +82 -0
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/hooks/useSwapNetworkChangeEffect.ts +53 -0
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/hooks/useTemporaryExactOutputUnavailableWarning.ts +44 -0
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/hooks/useUpdateSwapFormOnMountIfExactOutputWillFail.ts +17 -0
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/useSwapFormScreenCallbacks.test.ts +178 -0
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/useSwapFormScreenCallbacks.ts +267 -0
- package/src/features/transactions/swap/form/stores/swapFormScreenStore/useSwapFormScreenStore.ts +23 -0
- package/src/features/transactions/swap/form/stores/swapFormWarningStore/SwapFormWarningStoreContext.ts +4 -0
- package/src/features/transactions/swap/form/stores/swapFormWarningStore/SwapFormWarningStoreContextProvider.tsx +9 -0
- package/src/features/transactions/swap/form/stores/swapFormWarningStore/createSwapFormWarningStore.ts +57 -0
- package/src/features/transactions/swap/form/stores/swapFormWarningStore/useSwapFormWarningStore.ts +30 -0
- package/src/features/transactions/swap/form/utils.test.ts +73 -0
- package/src/features/transactions/swap/form/utils.ts +17 -0
- package/src/features/transactions/swap/hooks/useEthAsErc20DEXQualifyingEvent.ts +244 -0
- package/src/features/transactions/swap/hooks/useFeeOnTransferAmount.ts +76 -0
- package/src/features/transactions/swap/hooks/useIsUnichainFlashblocksEnabled.ts +135 -0
- package/src/features/transactions/swap/hooks/useMostRecentSwapTx.ts +15 -0
- package/src/features/transactions/swap/hooks/useNeedsBridgedAssetWarning.ts +71 -0
- package/src/features/transactions/swap/hooks/usePriceDifference.test.ts +127 -0
- package/src/features/transactions/swap/hooks/usePriceDifference.ts +55 -0
- package/src/features/transactions/swap/hooks/usePriceUXEnabled.ts +11 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/getBalanceWarning.test.ts +96 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/getBalanceWarning.ts +39 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/getFormIncompleteWarning.test.ts +127 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/getFormIncompleteWarning.ts +26 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/getPriceImpactWarning.test.ts +94 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/getPriceImpactWarning.ts +51 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/getSwapWarningFromError.ts +73 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/getTokenBlockedWarning.test.ts +126 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/getTokenBlockedWarning.ts +30 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/useNeedsBridgingWarning.ts +10 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/useNeedsLowNativeBalanceWarning.ts +18 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/useParsedActivePlanWarnings.test.ts +255 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/useParsedActivePlanWarnings.ts +234 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/usePrefilledNeedsTokenProtectionWarning.ts +87 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/useSwapWarnings.test.ts +168 -0
- package/src/features/transactions/swap/hooks/useSwapWarnings/useSwapWarnings.tsx +132 -0
- package/src/features/transactions/swap/hooks/useTrade/createGetQuoteRequestArgs.ts +72 -0
- package/src/features/transactions/swap/hooks/useTrade/logging.ts +142 -0
- package/src/features/transactions/swap/hooks/useTrade/parseQuoteCurrencies.ts +39 -0
- package/src/features/transactions/swap/hooks/useTrade/useIndicativeTradeQuery.ts +20 -0
- package/src/features/transactions/swap/hooks/useTrade/useIndicativeTradeServiceQueryOptions.ts +36 -0
- package/src/features/transactions/swap/hooks/useTrade/useTradeQuery.ts +46 -0
- package/src/features/transactions/swap/hooks/useTrade/useTradeServiceQueryOptions.ts +39 -0
- package/src/features/transactions/swap/hooks/useTrade.ts +81 -0
- package/src/features/transactions/swap/hooks/useTradeFromExistingPlan.ts +104 -0
- package/src/features/transactions/swap/hooks/useV4SwapEnabled.ts +25 -0
- package/src/features/transactions/swap/orders.ts +6 -0
- package/src/features/transactions/swap/plan/intermediaryState/useCanResumePlan.ts +53 -0
- package/src/features/transactions/swap/plan/intermediaryState/useIntermediaryPlanState.ts +90 -0
- package/src/features/transactions/swap/plan/intermediaryState/useIntermediaryPlanStateDescriptor.ts +73 -0
- package/src/features/transactions/swap/plan/intermediaryState/useResumePlanMutation.ts +112 -0
- package/src/features/transactions/swap/plan/planPollingUtils.ts +197 -0
- package/src/features/transactions/swap/plan/planSaga.test.ts +526 -0
- package/src/features/transactions/swap/plan/planSaga.ts +600 -0
- package/src/features/transactions/swap/plan/planSagaUtils.ts +399 -0
- package/src/features/transactions/swap/plan/planStepAnalytics.ts +127 -0
- package/src/features/transactions/swap/plan/planStepTransformer.ts +95 -0
- package/src/features/transactions/swap/plan/planWatcherSaga.ts +150 -0
- package/src/features/transactions/swap/plan/prefetchedPlanStore.ts +86 -0
- package/src/features/transactions/swap/plan/priceChangeDetection.test.ts +146 -0
- package/src/features/transactions/swap/plan/slippage.test.ts +124 -0
- package/src/features/transactions/swap/plan/slippage.ts +36 -0
- package/src/features/transactions/swap/plan/types.ts +158 -0
- package/src/features/transactions/swap/plan/utils.test.ts +97 -0
- package/src/features/transactions/swap/plan/utils.ts +271 -0
- package/src/features/transactions/swap/plan/watchPlanStepSaga.ts +146 -0
- package/src/features/transactions/swap/review/SwapDetails/AcceptNewQuoteRow.tsx +101 -0
- package/src/features/transactions/swap/review/SwapDetails/MarketPriceImpactWarningModal.tsx +84 -0
- package/src/features/transactions/swap/review/SwapDetails/SwapDetails.tsx +164 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/SwapErrorScreen.tsx +104 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/SwapReviewFooter/DelayedSubmissionText.tsx +33 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/SwapReviewFooter/PendingSwapButton.native.tsx +163 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/SwapReviewFooter/PendingSwapButton.tsx +16 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/SwapReviewFooter/PendingSwapButton.web.tsx +160 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/SwapReviewFooter/SubmitSwapButton.tsx +268 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/SwapReviewFooter/SwapReviewFooter.tsx +143 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/SwapReviewLoadingView.tsx +17 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/SwapReviewScreen.tsx +189 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/SwapReviewSwapDetails.tsx +80 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/SwapReviewWarningModal.tsx +40 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/SwapReviewWrapTransactionDetails.tsx +39 -0
- package/src/features/transactions/swap/review/SwapReviewScreen/TransactionAmountsReview.tsx +219 -0
- package/src/features/transactions/swap/review/hooks/useAcceptedTrade.ts +66 -0
- package/src/features/transactions/swap/review/hooks/useActivePlanStatus.ts +31 -0
- package/src/features/transactions/swap/review/hooks/useCreateSwapReviewCallbacks.tsx +271 -0
- package/src/features/transactions/swap/review/hooks/usePrepareSwapTransactionEffect.ts +41 -0
- package/src/features/transactions/swap/review/hooks/useSwapOnPrevious.tsx +45 -0
- package/src/features/transactions/swap/review/hooks/useTokenApprovalInfo.test.ts +176 -0
- package/src/features/transactions/swap/review/hooks/useTokenApprovalInfo.ts +190 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/bridge/bridgeSwapTxAndGasInfoService.ts +25 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/chained/chainedActionTxSwapAndGasInfoService.ts +114 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/classic/classicSwapTxAndGasInfoService.ts +30 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/constants.ts +18 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/dex/dexSwapTxAndGasInfoService.ts +19 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/dex/utils.test.tsx +28 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/dex/utils.ts +69 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/evm/evmSwapInstructionsService.ts +147 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/evm/evmSwapRepository.ts +78 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/evm/hooks.ts +40 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/evm/logging.ts +46 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/evm/utils.ts +70 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/hooks.ts +335 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/svm/solanaSwapTxAndGasInfoService.ts +36 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/swapTxAndGasInfoService.ts +37 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/utils.test.ts +385 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/utils.ts +511 -0
- package/src/features/transactions/swap/review/services/swapTxAndGasInfoService/wrap/wrapTxAndGasInfoService.ts +25 -0
- package/src/features/transactions/swap/review/stores/activePlan/ActivePlanUpdater.ts +117 -0
- package/src/features/transactions/swap/review/stores/activePlan/activePlanStore.test.ts +123 -0
- package/src/features/transactions/swap/review/stores/activePlan/activePlanStore.ts +153 -0
- package/src/features/transactions/swap/review/stores/activePlan/usePopulateSwapFlowWithPlan.ts +45 -0
- package/src/features/transactions/swap/review/stores/swapReviewCallbacksStore/SwapReviewCallbacksStoreContext.ts +6 -0
- package/src/features/transactions/swap/review/stores/swapReviewCallbacksStore/SwapReviewCallbacksStoreContextProvider.tsx +90 -0
- package/src/features/transactions/swap/review/stores/swapReviewCallbacksStore/createSwapReviewCallbacksStore.ts +26 -0
- package/src/features/transactions/swap/review/stores/swapReviewCallbacksStore/useSwapReviewCallbacksStore.ts +24 -0
- package/src/features/transactions/swap/review/stores/swapReviewStore/SwapReviewContext.ts +4 -0
- package/src/features/transactions/swap/review/stores/swapReviewStore/SwapReviewStoreContextProvider.tsx +24 -0
- package/src/features/transactions/swap/review/stores/swapReviewStore/SyncActivePlanEffects.tsx +63 -0
- package/src/features/transactions/swap/review/stores/swapReviewStore/createSwapReviewStore.ts +52 -0
- package/src/features/transactions/swap/review/stores/swapReviewStore/useSwapReviewStore.ts +52 -0
- package/src/features/transactions/swap/review/stores/swapReviewTransactionStore/SwapReviewTransactionStoreContext.ts +6 -0
- package/src/features/transactions/swap/review/stores/swapReviewTransactionStore/SwapReviewTransactionStoreContextProvider.tsx +121 -0
- package/src/features/transactions/swap/review/stores/swapReviewTransactionStore/createSwapReviewTransactionStore.ts +53 -0
- package/src/features/transactions/swap/review/stores/swapReviewTransactionStore/useSwapReviewTransactionStore.ts +72 -0
- package/src/features/transactions/swap/review/stores/swapReviewWarningStore/SwapReviewWarningStoreContext.ts +4 -0
- package/src/features/transactions/swap/review/stores/swapReviewWarningStore/SwapReviewWarningStoreContextProvider.tsx +10 -0
- package/src/features/transactions/swap/review/stores/swapReviewWarningStore/createSwapReviewWarningStore.ts +43 -0
- package/src/features/transactions/swap/review/stores/swapReviewWarningStore/useSwapReviewWarningStore.ts +32 -0
- package/src/features/transactions/swap/services/executeSwapService.ts +83 -0
- package/src/features/transactions/swap/services/hooks/useExecuteSwap.ts +66 -0
- package/src/features/transactions/swap/services/hooks/usePrepareSwap.ts +95 -0
- package/src/features/transactions/swap/services/hooks/useWarningService.ts +48 -0
- package/src/features/transactions/swap/services/prepareSwapService.ts +212 -0
- package/src/features/transactions/swap/services/tradeService/evmTradeService.ts +218 -0
- package/src/features/transactions/swap/services/tradeService/svmTradeService.ts +93 -0
- package/src/features/transactions/swap/services/tradeService/tradeRepository.test.ts +224 -0
- package/src/features/transactions/swap/services/tradeService/tradeRepository.ts +99 -0
- package/src/features/transactions/swap/services/tradeService/tradeService.ts +50 -0
- package/src/features/transactions/swap/services/tradeService/transformations/buildQuoteRequest.ts +180 -0
- package/src/features/transactions/swap/services/tradeService/transformations/estimateGas.ts +9 -0
- package/src/features/transactions/swap/services/tradeService/transformations/transformQuoteToTrade.ts +64 -0
- package/src/features/transactions/swap/services/warningService.ts +11 -0
- package/src/features/transactions/swap/state/selectors.ts +5 -0
- package/src/features/transactions/swap/state/slice.ts +31 -0
- package/src/features/transactions/swap/steps/classicSteps.ts +58 -0
- package/src/features/transactions/swap/steps/dexSteps.ts +27 -0
- package/src/features/transactions/swap/steps/signOrder.ts +35 -0
- package/src/features/transactions/swap/steps/swap.ts +74 -0
- package/src/features/transactions/swap/stores/swapDependenciesStore/SwapDependenciesStoreContext.ts +4 -0
- package/src/features/transactions/swap/stores/swapDependenciesStore/SwapDependenciesStoreContextProvider.tsx +45 -0
- package/src/features/transactions/swap/stores/swapDependenciesStore/createSwapDependenciesStore.ts +48 -0
- package/src/features/transactions/swap/stores/swapDependenciesStore/useSwapDependenciesStore.ts +33 -0
- package/src/features/transactions/swap/stores/swapFormStore/SwapFormStoreContext.ts +4 -0
- package/src/features/transactions/swap/stores/swapFormStore/SwapFormStoreContextProvider.tsx +350 -0
- package/src/features/transactions/swap/stores/swapFormStore/createSwapFormStore.ts +163 -0
- package/src/features/transactions/swap/stores/swapFormStore/hooks/useDebouncedSwapFormAmounts.ts +45 -0
- package/src/features/transactions/swap/stores/swapFormStore/hooks/useDefaultSwapFormState.ts +39 -0
- package/src/features/transactions/swap/stores/swapFormStore/hooks/useDerivedSwapInfo.ts +196 -0
- package/src/features/transactions/swap/stores/swapFormStore/hooks/useFreezeWhileSubmitting.test.ts +310 -0
- package/src/features/transactions/swap/stores/swapFormStore/hooks/useFreezeWhileSubmitting.ts +21 -0
- package/src/features/transactions/swap/stores/swapFormStore/hooks/useOnToggleIsFiatMode.ts +68 -0
- package/src/features/transactions/swap/stores/swapFormStore/hooks/useOpenOutputSelectorOnPrefilledStateChange.ts +24 -0
- package/src/features/transactions/swap/stores/swapFormStore/hooks/useUpdateSwapFormFromPrefilledCurrencies.ts +30 -0
- package/src/features/transactions/swap/stores/swapFormStore/types.ts +73 -0
- package/src/features/transactions/swap/stores/swapFormStore/useSwapFormStore.ts +42 -0
- package/src/features/transactions/swap/stores/swapTxStore/SwapTxStoreContext.ts +4 -0
- package/src/features/transactions/swap/stores/swapTxStore/SwapTxStoreContextProvider.tsx +23 -0
- package/src/features/transactions/swap/stores/swapTxStore/createSwapTxStore.ts +33 -0
- package/src/features/transactions/swap/stores/swapTxStore/hooks/usePermit2Signature.ts +44 -0
- package/src/features/transactions/swap/stores/swapTxStore/hooks/useTransactionRequestInfo.test.ts +170 -0
- package/src/features/transactions/swap/stores/swapTxStore/hooks/useTransactionRequestInfo.ts +191 -0
- package/src/features/transactions/swap/stores/swapTxStore/useSwapTxStore.ts +24 -0
- package/src/features/transactions/swap/types/BlockingTradeError.ts +14 -0
- package/src/features/transactions/swap/types/derivedSwapInfo.ts +33 -0
- package/src/features/transactions/swap/types/getTradingApiSwapFee.test.ts +171 -0
- package/src/features/transactions/swap/types/getTradingApiSwapFee.ts +59 -0
- package/src/features/transactions/swap/types/solana.test.ts +235 -0
- package/src/features/transactions/swap/types/solana.ts +177 -0
- package/src/features/transactions/swap/types/swapCallback.ts +32 -0
- package/src/features/transactions/swap/types/swapHandlers.ts +50 -0
- package/src/features/transactions/swap/types/swapTxAndGasInfo.ts +248 -0
- package/src/features/transactions/swap/types/trade.test.ts +102 -0
- package/src/features/transactions/swap/types/trade.ts +921 -0
- package/src/features/transactions/swap/types/wrapCallback.ts +18 -0
- package/src/features/transactions/swap/utils/SwapEventTimestampTracker.test.ts +40 -0
- package/src/features/transactions/swap/utils/SwapEventTimestampTracker.ts +65 -0
- package/src/features/transactions/swap/utils/asset.ts +15 -0
- package/src/features/transactions/swap/utils/chainedActions.ts +34 -0
- package/src/features/transactions/swap/utils/format.ts +7 -0
- package/src/features/transactions/swap/utils/formatPriceImpact.test.ts +86 -0
- package/src/features/transactions/swap/utils/formatPriceImpact.ts +10 -0
- package/src/features/transactions/swap/utils/gas.test.ts +148 -0
- package/src/features/transactions/swap/utils/gas.ts +37 -0
- package/src/features/transactions/swap/utils/generateSwapTransactionSteps.test.ts +267 -0
- package/src/features/transactions/swap/utils/generateSwapTransactionSteps.ts +91 -0
- package/src/features/transactions/swap/utils/getAmountsFromTrade.ts +37 -0
- package/src/features/transactions/swap/utils/getExactOutputWillFail.test.ts +147 -0
- package/src/features/transactions/swap/utils/getExactOutputWillFail.ts +61 -0
- package/src/features/transactions/swap/utils/getIdForQuote.ts +10 -0
- package/src/features/transactions/swap/utils/getPriceImpact.test.ts +187 -0
- package/src/features/transactions/swap/utils/getPriceImpact.ts +60 -0
- package/src/features/transactions/swap/utils/getSwapFeeUsd.ts +46 -0
- package/src/features/transactions/swap/utils/getTradeAmounts.ts +50 -0
- package/src/features/transactions/swap/utils/maybeLogFirstSwapAction.ts +18 -0
- package/src/features/transactions/swap/utils/protocols.test.ts +367 -0
- package/src/features/transactions/swap/utils/protocols.ts +150 -0
- package/src/features/transactions/swap/utils/routing.ts +140 -0
- package/src/features/transactions/swap/utils/styleHelpers.ts +22 -0
- package/src/features/transactions/swap/utils/trade.test.ts +168 -0
- package/src/features/transactions/swap/utils/trade.ts +264 -0
- package/src/features/transactions/swap/utils/tradingApi.test.ts +189 -0
- package/src/features/transactions/swap/utils/tradingApi.ts +593 -0
- package/src/features/transactions/swap/utils/wrap.test.ts +35 -0
- package/src/features/transactions/swap/utils/wrap.ts +28 -0
- package/src/features/transactions/toucan/steps/submitBid.ts +5 -0
- package/src/features/transactions/toucan/steps/withdrawBidAndClaimTokens.ts +5 -0
- package/src/features/transactions/types/baseDerivedInfo.ts +18 -0
- package/src/features/transactions/types/transactionDetails.ts +831 -0
- package/src/features/transactions/types/transactionRequests.ts +14 -0
- package/src/features/transactions/types/transactionState.ts +70 -0
- package/src/features/transactions/types/utils.ts +131 -0
- package/src/features/transactions/types/wrap.ts +5 -0
- package/src/features/transactions/utils/dex.utils.test.ts +95 -0
- package/src/features/transactions/utils/dex.utils.ts +135 -0
- package/src/features/transactions/utils/permit2.ts +43 -0
- package/src/features/transactions/utils/receipt.test.ts +64 -0
- package/src/features/transactions/utils/receipt.ts +73 -0
- package/src/features/trm/hooks.ts +22 -0
- package/src/features/unitags/ClaimUnitagContent.tsx +450 -0
- package/src/features/unitags/UnitagInfoModal.tsx +75 -0
- package/src/features/unitags/UnitagName.test.tsx +12 -0
- package/src/features/unitags/UnitagName.tsx +74 -0
- package/src/features/unitags/__snapshots__/UnitagName.test.tsx.snap +70 -0
- package/src/features/unitags/avatars.ts +82 -0
- package/src/features/unitags/constants.ts +5 -0
- package/src/features/unitags/fileUtils.native.ts +72 -0
- package/src/features/unitags/fileUtils.ts +13 -0
- package/src/features/unitags/fileUtils.web.ts +104 -0
- package/src/features/unitags/hooks/useCanClaimUnitagName.test.ts +78 -0
- package/src/features/unitags/hooks/useCanClaimUnitagName.ts +81 -0
- package/src/features/unitags/hooks/useClaimUnitag.ts +92 -0
- package/src/features/unitags/utils.ts +31 -0
- package/src/features/visibility/hooks/useIsActivityHidden.ts +7 -0
- package/src/features/visibility/hooks/usePositionVisibilityCheck.ts +31 -0
- package/src/features/visibility/hooks/useTokenVisibility.ts +20 -0
- package/src/features/visibility/selectors.ts +16 -0
- package/src/features/visibility/slice.ts +69 -0
- package/src/features/visibility/utils.ts +21 -0
- package/src/features/visibility/visibility.test.ts +295 -0
- package/src/features/wallet/contexts/WalletProvider.tsx +34 -0
- package/src/features/wallet/hooks/useWallet.ts +8 -0
- package/src/features/wallet/services/IWalletService.ts +6 -0
- package/src/features/wallet/services/createEVMWalletService.ts +40 -0
- package/src/features/wallet/services/createWalletService.ts +19 -0
- package/src/features/wallet/types/AccountDetails.ts +25 -0
- package/src/features/wallet/types/Wallet.ts +6 -0
- package/src/features/wallet/types/WalletMeta.ts +5 -0
- package/src/hooks/useAppInsets.test.tsx +59 -0
- package/src/hooks/useAppInsets.tsx +24 -0
- package/src/hooks/useIsKeyboardOpen.test.ts +97 -0
- package/src/hooks/useSnowflakeAnimation.ts +482 -0
- package/src/i18n/changeLanguage.tsx +25 -0
- package/src/i18n/i18n-setup-interface.tsx +85 -0
- package/src/i18n/i18n-setup.tsx +95 -0
- package/src/i18n/index.ts +10 -0
- package/src/i18n/index.web-app.ts +11 -0
- package/src/i18n/locales/@types/i18next.ts +13 -0
- package/src/i18n/locales/source/en-US.json +2922 -0
- package/src/i18n/locales/source/en-US_old.json +21 -0
- package/src/i18n/locales/translations/es-ES.json +2919 -0
- package/src/i18n/locales/translations/fil-PH.json +2919 -0
- package/src/i18n/locales/translations/fr-FR.json +2919 -0
- package/src/i18n/locales/translations/id-ID.json +2919 -0
- package/src/i18n/locales/translations/ja-JP.json +2919 -0
- package/src/i18n/locales/translations/ko-KR.json +2919 -0
- package/src/i18n/locales/translations/nl-NL.json +2919 -0
- package/src/i18n/locales/translations/pt-BR.json +2310 -0
- package/src/i18n/locales/translations/pt-PT.json +2919 -0
- package/src/i18n/locales/translations/ru-RU.json +2919 -0
- package/src/i18n/locales/translations/tr-TR.json +2919 -0
- package/src/i18n/locales/translations/vi-VN.json +2919 -0
- package/src/i18n/locales/translations/zh-CN.json +2919 -0
- package/src/i18n/locales/translations/zh-TW.json +2919 -0
- package/src/i18n/shared.ts +1 -0
- package/src/i18n/utils.test.ts +112 -0
- package/src/i18n/utils.ts +70 -0
- package/src/index.ts +7 -0
- package/src/react-native-dotenv.d.ts +42 -0
- package/src/state/README.md +3 -0
- package/src/state/createAppStateResetter.test.ts +118 -0
- package/src/state/createAppStateResetter.ts +95 -0
- package/src/state/createSafeMigration.test.ts +119 -0
- package/src/state/createSafeMigration.ts +84 -0
- package/src/state/index.ts +5 -0
- package/src/state/luxMigrationTests.ts +71 -0
- package/src/state/luxMigrations.test.ts +423 -0
- package/src/state/luxMigrations.ts +266 -0
- package/src/state/luxReducer.ts +48 -0
- package/src/state/oldTypes.ts +94 -0
- package/src/tamagui.d.ts +40 -0
- package/src/test/fixtures/account.ts +19 -0
- package/src/test/fixtures/events.ts +5 -0
- package/src/test/fixtures/gql/activities/index.ts +91 -0
- package/src/test/fixtures/gql/activities/nfts.ts +31 -0
- package/src/test/fixtures/gql/activities/swap.ts +21 -0
- package/src/test/fixtures/gql/activities/tokens.ts +50 -0
- package/src/test/fixtures/gql/amounts.ts +31 -0
- package/src/test/fixtures/gql/assets/constants.ts +30 -0
- package/src/test/fixtures/gql/assets/index.ts +3 -0
- package/src/test/fixtures/gql/assets/nfts.ts +60 -0
- package/src/test/fixtures/gql/assets/tokens.ts +194 -0
- package/src/test/fixtures/gql/history.ts +70 -0
- package/src/test/fixtures/gql/index.ts +7 -0
- package/src/test/fixtures/gql/misc.ts +19 -0
- package/src/test/fixtures/gql/portfolio.ts +38 -0
- package/src/test/fixtures/gql/transactions.ts +34 -0
- package/src/test/fixtures/index.ts +4 -0
- package/src/test/fixtures/lib/ethers.ts +47 -0
- package/src/test/fixtures/lib/index.ts +3 -0
- package/src/test/fixtures/lib/netinfo.ts +29 -0
- package/src/test/fixtures/lib/sdk.ts +14 -0
- package/src/test/fixtures/permit.ts +19 -0
- package/src/test/fixtures/testIDs.ts +303 -0
- package/src/test/fixtures/tradingApi.ts +16 -0
- package/src/test/fixtures/transactions/swap.ts +269 -0
- package/src/test/fixtures/wallet/addresses.ts +1 -0
- package/src/test/fixtures/wallet/balances.ts +89 -0
- package/src/test/fixtures/wallet/currencies.ts +93 -0
- package/src/test/fixtures/wallet/index.ts +3 -0
- package/src/test/fixtures/wallet/transactions/fixtures.ts +205 -0
- package/src/test/fixtures/wallet/transactions/helpers.ts +116 -0
- package/src/test/fixtures/wallet/transactions/index.ts +2 -0
- package/src/test/fixtures/wallet/walletConnect.ts +18 -0
- package/src/test/mockFn.ts +39 -0
- package/src/test/mocks/gql/index.ts +1 -0
- package/src/test/mocks/gql/mocks.ts +90 -0
- package/src/test/mocks/gql/provider.tsx +49 -0
- package/src/test/mocks/gql/resolvers.ts +19 -0
- package/src/test/mocks/index.ts +2 -0
- package/src/test/mocks/locale.ts +114 -0
- package/src/test/mocks/mockSharedPersistQueryClientProvider.tsx +12 -0
- package/src/test/mocks/uniqueId.ts +5 -0
- package/src/test/render.tsx +189 -0
- package/src/test/shared.ts +9 -0
- package/src/test/test-utils.ts +6 -0
- package/src/test/utils/array.ts +31 -0
- package/src/test/utils/factory.ts +142 -0
- package/src/test/utils/index.ts +4 -0
- package/src/test/utils/random.ts +37 -0
- package/src/test/utils/resolvers.ts +142 -0
- package/src/test-shorthands.ts +14 -0
- package/src/types/RenderPassReport.ts +57 -0
- package/src/types/currency.ts +6 -0
- package/src/types/limits.ts +6 -0
- package/src/types/onboarding.ts +18 -0
- package/src/types/screens/extension.ts +50 -0
- package/src/types/screens/interface.ts +7 -0
- package/src/types/screens/mobile.ts +124 -0
- package/src/types/sharing.ts +6 -0
- package/src/types/walletConnect.ts +143 -0
- package/src/types/widgets.ts +9 -0
- package/src/utils/addresses.test.ts +65 -0
- package/src/utils/addresses.ts +213 -0
- package/src/utils/approvals.test.ts +40 -0
- package/src/utils/approvals.ts +13 -0
- package/src/utils/balances.ts +14 -0
- package/src/utils/clipboard.native.ts +71 -0
- package/src/utils/clipboard.ts +34 -0
- package/src/utils/cloud-backup/getCloudProviderName.native.ts +12 -0
- package/src/utils/cloud-backup/getCloudProviderName.ts +8 -0
- package/src/utils/colors.test.ts +31 -0
- package/src/utils/colors.tsx +127 -0
- package/src/utils/createTransactionId.ts +5 -0
- package/src/utils/currency.test.ts +40 -0
- package/src/utils/currency.ts +97 -0
- package/src/utils/currencyId.test.ts +130 -0
- package/src/utils/currencyId.ts +221 -0
- package/src/utils/datadog.native.ts +5 -0
- package/src/utils/datadog.ts +5 -0
- package/src/utils/datadog.web.ts +159 -0
- package/src/utils/isWSOL.test.ts +38 -0
- package/src/utils/isWSOL.ts +17 -0
- package/src/utils/link.native.ts +9 -0
- package/src/utils/link.ts +9 -0
- package/src/utils/link.web.ts +7 -0
- package/src/utils/linking.test.ts +61 -0
- package/src/utils/linking.ts +300 -0
- package/src/utils/number.test.ts +44 -0
- package/src/utils/number.ts +17 -0
- package/src/utils/polling.test.ts +118 -0
- package/src/utils/polling.ts +86 -0
- package/src/utils/routingDiagram/routingProviders/jupiterRoutingProvider.test.ts +241 -0
- package/src/utils/routingDiagram/routingProviders/jupiterRoutingProvider.ts +128 -0
- package/src/utils/routingDiagram/routingProviders/luxRoutingProvider.test.ts +450 -0
- package/src/utils/routingDiagram/routingProviders/luxRoutingProvider.ts +127 -0
- package/src/utils/routingDiagram/routingRegistry.ts +58 -0
- package/src/utils/routingDiagram/types.ts +35 -0
- package/src/utils/saga.ts +275 -0
- package/src/utils/search/doesTokenMatchSearchTerm.test.ts +419 -0
- package/src/utils/search/doesTokenMatchSearchTerm.ts +37 -0
- package/src/utils/search/getPossibleChainMatchFromSearchWord.test.ts +437 -0
- package/src/utils/search/getPossibleChainMatchFromSearchWord.ts +47 -0
- package/src/utils/search/parseChainFromTokenSearchQuery.test.ts +138 -0
- package/src/utils/search/parseChainFromTokenSearchQuery.ts +70 -0
- package/src/utils/useKeyboardLayout.android.test.ts +70 -0
- package/src/utils/useKeyboardLayout.ios.test.ts +87 -0
- package/src/utils/useKeyboardLayout.native.ts +42 -0
- package/src/utils/useKeyboardLayout.ts +7 -0
- package/src/utils/useKeyboardLayout.web.ts +6 -0
- package/src/utils/usePlatformBasedFetchPolicy.ts +19 -0
- package/src/utils/usePlatformBasedValue.native.ts +5 -0
- package/src/utils/usePlatformBasedValue.ts +33 -0
- package/tsconfig.eslint.json +6 -0
- package/tsconfig.json +43 -0
- package/vitest-package-mocks.ts +76 -0
- package/vitest-setup.ts +246 -0
- package/vitest.config.ts +86 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { SwapTypeTransactionInfo } from '@luxexchange/lx/src/components/activity/details/types'
|
|
2
|
+
import { CurrencyInfo } from '@luxexchange/lx/src/features/dataApi/types'
|
|
3
|
+
import { LocalizationContextState } from '@luxexchange/lx/src/features/language/LocalizationContext'
|
|
4
|
+
import { getCurrencyAmount, ValueType } from '@luxexchange/lx/src/features/tokens/getCurrencyAmount'
|
|
5
|
+
import { getAmountsFromTrade } from '@luxexchange/lx/src/features/transactions/swap/utils/getAmountsFromTrade'
|
|
6
|
+
import { BridgeTransactionInfo } from '@luxexchange/lx/src/features/transactions/types/transactionDetails'
|
|
7
|
+
import { NumberType } from '@luxfi/utilities/src/format/types'
|
|
8
|
+
|
|
9
|
+
export function getFormattedSwapRatio({
|
|
10
|
+
typeInfo,
|
|
11
|
+
inputCurrency,
|
|
12
|
+
outputCurrency,
|
|
13
|
+
formatter,
|
|
14
|
+
}: {
|
|
15
|
+
typeInfo: SwapTypeTransactionInfo | BridgeTransactionInfo
|
|
16
|
+
inputCurrency: CurrencyInfo
|
|
17
|
+
outputCurrency: CurrencyInfo
|
|
18
|
+
formatter: LocalizationContextState
|
|
19
|
+
}): string {
|
|
20
|
+
const { inputCurrencyAmountRaw, outputCurrencyAmountRaw } = getAmountsFromTrade(typeInfo)
|
|
21
|
+
|
|
22
|
+
const inputCurrencyAmount = getCurrencyAmount({
|
|
23
|
+
value: inputCurrencyAmountRaw,
|
|
24
|
+
valueType: ValueType.Raw,
|
|
25
|
+
currency: inputCurrency.currency,
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const outputCurrencyAmount = getCurrencyAmount({
|
|
29
|
+
value: outputCurrencyAmountRaw,
|
|
30
|
+
valueType: ValueType.Raw,
|
|
31
|
+
currency: outputCurrency.currency,
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const inputExactAmount = inputCurrencyAmount ? parseFloat(inputCurrencyAmount.toExact()) : 0
|
|
35
|
+
const outputExactAmount = outputCurrencyAmount ? parseFloat(outputCurrencyAmount.toExact()) : 0
|
|
36
|
+
|
|
37
|
+
const outputMoreValuable = inputExactAmount > outputExactAmount // If there are more input tokens per output token, then output token is worth more
|
|
38
|
+
const swapRate = outputMoreValuable ? inputExactAmount / outputExactAmount : outputExactAmount / inputExactAmount
|
|
39
|
+
const higherValueSymbol = outputMoreValuable ? outputCurrency.currency.symbol : inputCurrency.currency.symbol
|
|
40
|
+
const lowerValueSymbol = outputMoreValuable ? inputCurrency.currency.symbol : outputCurrency.currency.symbol
|
|
41
|
+
|
|
42
|
+
const formattedSwapRate = formatter.formatNumberOrString({
|
|
43
|
+
value: swapRate,
|
|
44
|
+
type: NumberType.TokenTx,
|
|
45
|
+
})
|
|
46
|
+
const formattedLine = '1 ' + higherValueSymbol + ' = ' + formattedSwapRate + ' ' + lowerValueSymbol
|
|
47
|
+
|
|
48
|
+
return formattedLine
|
|
49
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useUnitagsAddressQuery } from '@luxexchange/lx/src/data/apiClients/unitagsApi/useUnitagsAddressQuery'
|
|
2
|
+
import { useENSAvatar } from '@luxexchange/lx/src/features/ens/api'
|
|
3
|
+
import { Platform } from '@luxexchange/lx/src/features/platforms/types/Platform'
|
|
4
|
+
import { getValidAddress } from '@luxexchange/lx/src/utils/addresses'
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* Fetches avatar for address, in priority uses: unitag avatar, ens avatar, undefined
|
|
8
|
+
* Note that this hook is used instead of just useENSAvatar because our implementation
|
|
9
|
+
* of useENSAvatar checks for reverse name resolution which Unitags does not support.
|
|
10
|
+
* Chose to do this because even if we used useENSAvatar without reverse name resolution,
|
|
11
|
+
* there is more latency because it has to go to the contract via CCIP-read first.
|
|
12
|
+
*/
|
|
13
|
+
export function useAvatar(address: string | undefined): {
|
|
14
|
+
avatar: string | undefined
|
|
15
|
+
loading: boolean
|
|
16
|
+
} {
|
|
17
|
+
// TODO(WEB-8012): Update to support Solana
|
|
18
|
+
const validated = getValidAddress({ address, platform: Platform.EVM })
|
|
19
|
+
const { data: ensAvatar, isLoading: ensLoading } = useENSAvatar(validated)
|
|
20
|
+
const { data: unitag, isLoading: unitagLoading } = useUnitagsAddressQuery({
|
|
21
|
+
params: validated ? { address: validated } : undefined,
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const unitagAvatar = unitag?.metadata?.avatar
|
|
25
|
+
|
|
26
|
+
if (unitagAvatar) {
|
|
27
|
+
return { avatar: unitagAvatar, loading: false }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (ensAvatar) {
|
|
31
|
+
return { avatar: ensAvatar, loading: false }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return { avatar: undefined, loading: ensLoading || unitagLoading }
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useMemo } from 'react'
|
|
2
|
+
import { getUniconColors, passesContrast, useExtractedColors, useIsDarkMode, useSporeColors } from '@luxfi/ui/src'
|
|
3
|
+
import { useAvatar } from '@luxexchange/lx/src/features/address/avatar'
|
|
4
|
+
|
|
5
|
+
export function useAddressColorProps(address: Address): string {
|
|
6
|
+
const colors = useSporeColors()
|
|
7
|
+
const isDarkMode = useIsDarkMode()
|
|
8
|
+
const { color: uniconColor } = getUniconColors(address, isDarkMode) as { color: string }
|
|
9
|
+
const { avatar, loading: avatarLoading } = useAvatar(address)
|
|
10
|
+
const { colors: avatarColors } = useExtractedColors(avatar)
|
|
11
|
+
const hasAvatar = !!avatar && !avatarLoading
|
|
12
|
+
|
|
13
|
+
const smartColor: string = useMemo<string>(() => {
|
|
14
|
+
const contrastThreshold = 3 // WCAG AA standard for contrast
|
|
15
|
+
const backgroundColor = colors.surface2.val // replace with your actual background color
|
|
16
|
+
|
|
17
|
+
if (hasAvatar && avatarColors?.primary) {
|
|
18
|
+
if (passesContrast({ color: avatarColors.primary, backgroundColor, contrastThreshold })) {
|
|
19
|
+
return avatarColors.primary
|
|
20
|
+
}
|
|
21
|
+
if (avatarColors.base && passesContrast({ color: avatarColors.base, backgroundColor, contrastThreshold })) {
|
|
22
|
+
return avatarColors.base
|
|
23
|
+
}
|
|
24
|
+
if (avatarColors.detail && passesContrast({ color: avatarColors.detail, backgroundColor, contrastThreshold })) {
|
|
25
|
+
return avatarColors.detail
|
|
26
|
+
}
|
|
27
|
+
// Modify the color if it doesn't pass the contrast check
|
|
28
|
+
// Replace 'modifiedColor' with the actual color you want to use
|
|
29
|
+
return colors.neutral1.val as string
|
|
30
|
+
}
|
|
31
|
+
return uniconColor
|
|
32
|
+
}, [avatarColors, hasAvatar, uniconColor, colors.surface2.val, colors.neutral1.val])
|
|
33
|
+
|
|
34
|
+
return smartColor
|
|
35
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { queryOptions, useQuery } from '@tanstack/react-query'
|
|
2
|
+
import { useMemo } from 'react'
|
|
3
|
+
import { useProvider } from '@luxexchange/lx/src/contexts/LuxContext'
|
|
4
|
+
import { type UniverseChainId } from '@luxexchange/lx/src/features/chains/types'
|
|
5
|
+
import { isDelegatedEOA } from '@luxexchange/lx/src/features/smartWallet/delegation/isDelegatedEOA'
|
|
6
|
+
import { ensure0xHex } from '@luxfi/utilities/src/addresses/hex'
|
|
7
|
+
import { ReactQueryCacheKey } from '@luxfi/utilities/src/reactQuery/cache'
|
|
8
|
+
import type { QueryOptionsResult } from '@luxfi/utilities/src/reactQuery/queryOptions'
|
|
9
|
+
|
|
10
|
+
export function useIsSmartContractAddress(
|
|
11
|
+
address: string | undefined,
|
|
12
|
+
chainId: UniverseChainId,
|
|
13
|
+
): {
|
|
14
|
+
loading: boolean
|
|
15
|
+
isSmartContractAddress: boolean
|
|
16
|
+
} {
|
|
17
|
+
const provider = useProvider(chainId)
|
|
18
|
+
const getQueryOptions = useMemo(() => createGetQueryOptions({ provider }), [provider])
|
|
19
|
+
|
|
20
|
+
const { data, isLoading } = useQuery(getQueryOptions({ address, chainId }))
|
|
21
|
+
return {
|
|
22
|
+
isSmartContractAddress: data?.isSmartContractAddress ?? false,
|
|
23
|
+
loading: isLoading,
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const createGetQueryOptions = (ctx: {
|
|
28
|
+
provider: ReturnType<typeof useProvider>
|
|
29
|
+
}): ((input: { address: string | undefined; chainId: UniverseChainId }) => GetCodeQueryOptions) => {
|
|
30
|
+
return (input: { address: string | undefined; chainId: UniverseChainId }): GetCodeQueryOptions =>
|
|
31
|
+
queryOptions({
|
|
32
|
+
queryKey: [ReactQueryCacheKey.IsSmartContractAddress, input.address, input.chainId],
|
|
33
|
+
queryFn: async () => {
|
|
34
|
+
if (!input.address) {
|
|
35
|
+
return null
|
|
36
|
+
}
|
|
37
|
+
const result = await ctx.provider?.getCode(input.address)
|
|
38
|
+
return result ?? null
|
|
39
|
+
},
|
|
40
|
+
enabled: !!input.address,
|
|
41
|
+
select: selectIsSmartContractAddress,
|
|
42
|
+
refetchInterval: false,
|
|
43
|
+
refetchOnWindowFocus: false,
|
|
44
|
+
refetchOnMount: true,
|
|
45
|
+
refetchOnReconnect: false,
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type GetCodeQueryOptions = QueryOptionsResult<
|
|
50
|
+
string | null,
|
|
51
|
+
Error,
|
|
52
|
+
{ isSmartContractAddress: boolean; isDelegatedAddress: boolean },
|
|
53
|
+
[ReactQueryCacheKey.IsSmartContractAddress, string | undefined, UniverseChainId]
|
|
54
|
+
>
|
|
55
|
+
|
|
56
|
+
function selectIsSmartContractAddress(bytecode: string | null): {
|
|
57
|
+
isSmartContractAddress: boolean
|
|
58
|
+
isDelegatedAddress: boolean
|
|
59
|
+
} {
|
|
60
|
+
// provider.getCode(address) will return a hex string if a smart contract is deployed at that address
|
|
61
|
+
// returning just 0x means there's no code and it's not a smart contract
|
|
62
|
+
if (!bytecode || bytecode === '0x') {
|
|
63
|
+
return {
|
|
64
|
+
isSmartContractAddress: false,
|
|
65
|
+
isDelegatedAddress: false,
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const result = isDelegatedEOA({ bytecode: ensure0xHex(bytecode) })
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
isSmartContractAddress: !result.isDelegated,
|
|
72
|
+
isDelegatedAddress: result.isDelegated,
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { unique } from '@luxfi/utilities/src/primitives/array'
|
|
2
|
+
|
|
3
|
+
interface HasAddress {
|
|
4
|
+
address: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function uniqueAddressesOnly<T extends HasAddress>(objectsWithAddress: T[]): T[] {
|
|
8
|
+
// the input array must be objects that have an obj.address field
|
|
9
|
+
// had to cast to any because ts doesn't recognize it as HasAddress... maybe issue with unique
|
|
10
|
+
// eslint-disable-next-line max-params
|
|
11
|
+
return unique(objectsWithAddress, (v, i, a) => a.findIndex((v2) => v2.address === v.address) === i)
|
|
12
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { useSelector } from 'react-redux'
|
|
2
|
+
import { AppearanceSettingType } from '@luxexchange/lx/src/features/appearance/slice'
|
|
3
|
+
import { ColorScheme } from '@luxexchange/lx/src/features/appearance/types'
|
|
4
|
+
import { useColorScheme } from '@luxexchange/lx/src/features/appearance/useColorScheme'
|
|
5
|
+
import { LuxState } from '@luxexchange/lx/src/state/luxReducer'
|
|
6
|
+
|
|
7
|
+
export function useCurrentAppearanceSetting(): AppearanceSettingType {
|
|
8
|
+
const { selectedAppearanceSettings } = useSelector((state: LuxState) => state.appearanceSettings)
|
|
9
|
+
return selectedAppearanceSettings
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function useSelectedColorScheme(): ColorScheme {
|
|
13
|
+
const currentAppearanceSetting = useCurrentAppearanceSetting()
|
|
14
|
+
const isDarkMode = useColorScheme() === 'dark'
|
|
15
|
+
if (currentAppearanceSetting !== AppearanceSettingType.System) {
|
|
16
|
+
return currentAppearanceSetting === AppearanceSettingType.Dark ? 'dark' : 'light'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const systemTheme = isDarkMode ? 'dark' : 'light'
|
|
20
|
+
return systemTheme
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Note commenting this out again, but since we still have some bugs and have
|
|
25
|
+
* tried a few versions of this already, going to leave this in for context.
|
|
26
|
+
*
|
|
27
|
+
* The general problem is that iOS wants to take a screenshot of both light/dark
|
|
28
|
+
* when an app backgrounds so it can use that for showing the placeholder screen
|
|
29
|
+
* in the app switcher properly even if you change from dark/light.
|
|
30
|
+
*
|
|
31
|
+
* React Native has some bugs around this, namely it just doesn't re-render fast
|
|
32
|
+
* enough sometimes and you see a slight flicker as you foreground the app.
|
|
33
|
+
*
|
|
34
|
+
* But unfortunately this fix - which just tries to avoid it by pausing all
|
|
35
|
+
* background scheme changes and accepting that sometimes the task switcher
|
|
36
|
+
* screen may be wrong, also causes a worse issue in that if you do actually
|
|
37
|
+
* change your color scheme while in the background (say you have Auto mode on
|
|
38
|
+
* and it becomes evening) then when you foreground now the app has to do the
|
|
39
|
+
* re-render *as it foregrounds*, which is even worse of a flicker. So, rock and
|
|
40
|
+
* a hard place.
|
|
41
|
+
*
|
|
42
|
+
* For now, disabling: it means we may get some flickers especially on slower
|
|
43
|
+
* devices.
|
|
44
|
+
*
|
|
45
|
+
* If we want less flickering in that case but stronger flickering in the case
|
|
46
|
+
* where the user changes scheme, then we can uncomment this and replace the
|
|
47
|
+
* `useColorScheme` above with `useColorSchemeForeground`.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
// ----
|
|
51
|
+
|
|
52
|
+
// Until React Native supports sync rendering with Fabric, it has a glitch where
|
|
53
|
+
// it can flicker the opposite color scheme as it resumes from the background.
|
|
54
|
+
// This is caused by the iOS feature where it takes a screenshot of your app
|
|
55
|
+
// using both color schemes when its backgrounded so it can show that screenshot
|
|
56
|
+
// in the task switcher, etc
|
|
57
|
+
|
|
58
|
+
// This basically disables that functionality. It means the app screenshot may be
|
|
59
|
+
// the wrong color scheme if you change system light/dark while its backgrounded
|
|
60
|
+
// but it avoids the flickering that you can see during task switching, which is
|
|
61
|
+
// much more common.
|
|
62
|
+
|
|
63
|
+
// Reference issues:
|
|
64
|
+
// https://github.com/facebook/react-native/issues/35972
|
|
65
|
+
// https://github.com/facebook/react-native/issues/28525
|
|
66
|
+
// https://github.com/expo/expo/issues/10815
|
|
67
|
+
// const useColorSchemeForeground = (): ColorSchemeName => {
|
|
68
|
+
// const forceUpdate = useForceUpdate()
|
|
69
|
+
// const colorScheme = useColorScheme()
|
|
70
|
+
// const appState = AppState.currentState
|
|
71
|
+
// const lastCorrectColorScheme = useRef<ColorSchemeName>(colorScheme)
|
|
72
|
+
|
|
73
|
+
// useEffect(() => {
|
|
74
|
+
// AppState.addEventListener('change', forceUpdate)
|
|
75
|
+
// }, [forceUpdate])
|
|
76
|
+
|
|
77
|
+
// return useMemo((): ColorSchemeName => {
|
|
78
|
+
// if (Platform.OS === 'ios' && appState.match(/inactive|background/)) {
|
|
79
|
+
// return lastCorrectColorScheme.current
|
|
80
|
+
// } else {
|
|
81
|
+
// lastCorrectColorScheme.current = colorScheme
|
|
82
|
+
// return lastCorrectColorScheme.current
|
|
83
|
+
// }
|
|
84
|
+
// }, [appState, colorScheme])
|
|
85
|
+
// }
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createSlice, type PayloadAction } from '@reduxjs/toolkit'
|
|
2
|
+
|
|
3
|
+
export enum AppearanceSettingType {
|
|
4
|
+
System = 'system',
|
|
5
|
+
Light = 'light',
|
|
6
|
+
Dark = 'dark',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface AppearanceSettingsState {
|
|
10
|
+
selectedAppearanceSettings: AppearanceSettingType
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const initialAppearanceSettingsState: AppearanceSettingsState = {
|
|
14
|
+
selectedAppearanceSettings: AppearanceSettingType.System,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const slice = createSlice({
|
|
18
|
+
name: 'appearanceSettings',
|
|
19
|
+
initialState: initialAppearanceSettingsState,
|
|
20
|
+
reducers: {
|
|
21
|
+
setSelectedAppearanceSettings: (state, action: PayloadAction<AppearanceSettingType>) => {
|
|
22
|
+
state.selectedAppearanceSettings = action.payload
|
|
23
|
+
},
|
|
24
|
+
resetAppearanceSettings: () => initialAppearanceSettingsState,
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
export const { setSelectedAppearanceSettings, resetAppearanceSettings } = slice.actions
|
|
29
|
+
|
|
30
|
+
export const appearanceSettingsReducer = slice.reducer
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ColorScheme = 'light' | 'dark'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useColorScheme } from 'react-native'
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ColorScheme } from '@luxexchange/lx/src/features/appearance/types'
|
|
2
|
+
import { PlatformSplitStubError } from '@luxfi/utilities/src/errors'
|
|
3
|
+
|
|
4
|
+
export const useColorScheme = (): ColorScheme => {
|
|
5
|
+
throw new PlatformSplitStubError('Use the correct hook for your platform')
|
|
6
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect, useState } from 'react'
|
|
2
|
+
import { type ColorScheme } from '@luxexchange/lx/src/features/appearance/types'
|
|
3
|
+
import { logger } from '@luxfi/utilities/src/logger/logger'
|
|
4
|
+
import { isBrowser } from '@luxfi/utilities/src/platform'
|
|
5
|
+
import { useEvent } from '@luxfi/utilities/src/react/hooks'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Custom hook to detect and track the user's preferred color scheme.
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Detects system color scheme preference immediately (no flicker)
|
|
12
|
+
* - Listens for system color scheme changes in real-time
|
|
13
|
+
* - Properly cleans up event listeners
|
|
14
|
+
* - TypeScript support with strict typing
|
|
15
|
+
*
|
|
16
|
+
* @returns The current color scheme: 'light' or 'dark'
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Creates a media query for dark mode preference and returns both the query and current preference
|
|
20
|
+
*/
|
|
21
|
+
function getDarkModeMediaQuery(): { mediaQuery: MediaQueryList | null; colorScheme: ColorScheme } {
|
|
22
|
+
if (!isBrowser) {
|
|
23
|
+
return { mediaQuery: null, colorScheme: 'light' }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')
|
|
28
|
+
return {
|
|
29
|
+
mediaQuery,
|
|
30
|
+
colorScheme: mediaQuery.matches ? 'dark' : 'light',
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
// Fallback for browsers that don't support matchMedia
|
|
34
|
+
return { mediaQuery: null, colorScheme: 'light' }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function useColorScheme(): ColorScheme {
|
|
39
|
+
// Initialize with actual system preference to prevent flicker
|
|
40
|
+
const [colorScheme, setColorScheme] = useState<ColorScheme>(() => getDarkModeMediaQuery().colorScheme)
|
|
41
|
+
// Handler for color scheme changes
|
|
42
|
+
const handleChange = useEvent((event: MediaQueryListEvent | MediaQueryList) => {
|
|
43
|
+
setColorScheme(event.matches ? 'dark' : 'light')
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
// Use useLayoutEffect for synchronous updates to prevent flashing
|
|
47
|
+
const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect
|
|
48
|
+
|
|
49
|
+
useIsomorphicLayoutEffect(() => {
|
|
50
|
+
if (!isBrowser) {
|
|
51
|
+
return
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const { mediaQuery } = getDarkModeMediaQuery()
|
|
55
|
+
|
|
56
|
+
if (!mediaQuery) {
|
|
57
|
+
return
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
// Modern browsers
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
63
|
+
if (mediaQuery.addEventListener) {
|
|
64
|
+
mediaQuery.addEventListener('change', handleChange)
|
|
65
|
+
|
|
66
|
+
// eslint-disable-next-line consistent-return
|
|
67
|
+
return (): void => {
|
|
68
|
+
mediaQuery.removeEventListener('change', handleChange)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Legacy browsers (Safari < 14)
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
73
|
+
else if (mediaQuery.addListener) {
|
|
74
|
+
mediaQuery.addListener(handleChange)
|
|
75
|
+
|
|
76
|
+
// eslint-disable-next-line consistent-return
|
|
77
|
+
return (): void => {
|
|
78
|
+
mediaQuery.removeListener(handleChange)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
} catch (error) {
|
|
82
|
+
logger.warn('useColorScheme.web.tsx', 'getDarkModeMediaQuery', 'matchMedia is not supported:', error)
|
|
83
|
+
}
|
|
84
|
+
}, [])
|
|
85
|
+
|
|
86
|
+
return colorScheme
|
|
87
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AuthTrigger = (args: { successCallback: () => void; failureCallback: () => void }) => Promise<void>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LuxState } from '@luxexchange/lx/src/state/luxReducer'
|
|
2
|
+
|
|
3
|
+
export const selectHasViewedBridgingBanner = (state: LuxState): boolean =>
|
|
4
|
+
state.luxBehaviorHistory.hasViewedBridgingBanner === true
|
|
5
|
+
|
|
6
|
+
export const selectHasDismissedBridgingWarning = (state: LuxState): boolean =>
|
|
7
|
+
state.luxBehaviorHistory.hasDismissedBridgingWarning === true
|
|
8
|
+
|
|
9
|
+
export const selectHasDismissedLowNetworkTokenWarning = (state: LuxState): boolean =>
|
|
10
|
+
state.luxBehaviorHistory.hasDismissedLowNetworkTokenWarning === true
|
|
11
|
+
|
|
12
|
+
export const selectHasViewedContractAddressExplainer = (state: LuxState): boolean =>
|
|
13
|
+
state.luxBehaviorHistory.hasViewedContractAddressExplainer === true
|
|
14
|
+
|
|
15
|
+
export const selectHasShownMismatchToast = (state: LuxState): boolean =>
|
|
16
|
+
state.luxBehaviorHistory.hasShownMismatchToast === true
|
|
17
|
+
|
|
18
|
+
/** Returns true if user has seen the modal globally (when disconnected) */
|
|
19
|
+
export const selectHasSeenToucanIntroModal = (state: LuxState): boolean =>
|
|
20
|
+
state.luxBehaviorHistory.hasSeenToucanIntroModal === true
|
|
21
|
+
|
|
22
|
+
/** Returns true if user has seen the modal for a specific wallet */
|
|
23
|
+
export const selectHasSeenToucanIntroModalForWallet = (state: LuxState, walletAddress: string): boolean =>
|
|
24
|
+
state.luxBehaviorHistory.toucanIntroModalSeenByWallet?.[walletAddress.toLowerCase()] === true
|
|
25
|
+
|
|
26
|
+
export const selectHasDismissedLuxWrapped2025Banner = (state: LuxState): boolean =>
|
|
27
|
+
state.luxBehaviorHistory.hasDismissedLuxWrapped2025Banner === true
|
|
28
|
+
|
|
29
|
+
export const selectHasDismissedCrosschainSwapsPromoBanner = (state: LuxState): boolean =>
|
|
30
|
+
state.luxBehaviorHistory.hasDismissedCrosschainSwapsPromoBanner === true
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Used to store persisted info about a users interactions with UI.
|
|
5
|
+
* We use this to show conditional UI, usually only for the first time a user views a new feature.
|
|
6
|
+
*/
|
|
7
|
+
export interface LuxBehaviorHistoryState {
|
|
8
|
+
hasViewedBridgingBanner?: boolean
|
|
9
|
+
hasDismissedBridgingWarning?: boolean
|
|
10
|
+
hasDismissedLowNetworkTokenWarning?: boolean
|
|
11
|
+
hasViewedContractAddressExplainer?: boolean
|
|
12
|
+
hasDismissedBridgedAssetsBannerV2?: boolean
|
|
13
|
+
unichainPromotion?: {
|
|
14
|
+
coldBannerDismissed?: boolean
|
|
15
|
+
warmBannerDismissed?: boolean
|
|
16
|
+
networkSelectorAnimationSeen?: boolean
|
|
17
|
+
networkSelectorTooltipSeen?: boolean
|
|
18
|
+
bridgingTooltipSeen?: boolean
|
|
19
|
+
bridgingAnimationSeen?: boolean
|
|
20
|
+
isFirstUnichainBridgeSelection?: boolean
|
|
21
|
+
}
|
|
22
|
+
// whether we have shown the mismatch toast (related to wallet capabilities & wallet bytecode)
|
|
23
|
+
hasShownMismatchToast?: boolean
|
|
24
|
+
/** Wallet addresses with timestamps that have dismissed the graduate wallet card for 30 days. The same property in the application reducer is a list of wallet addresses that have dismissed the graduated wallet card for this session. */
|
|
25
|
+
embeddedWalletGraduateCardDismissed?: {
|
|
26
|
+
[walletAddress: string]: number
|
|
27
|
+
}
|
|
28
|
+
hasShownSmartWalletNudge?: boolean
|
|
29
|
+
/** Global flag for when user sees modal without wallet connected */
|
|
30
|
+
hasSeenToucanIntroModal?: boolean
|
|
31
|
+
/** Per-wallet tracking for Toucan intro modal */
|
|
32
|
+
toucanIntroModalSeenByWallet?: {
|
|
33
|
+
[walletAddress: string]: boolean
|
|
34
|
+
}
|
|
35
|
+
hasDismissedLuxWrapped2025Banner?: boolean
|
|
36
|
+
hasDismissedCrosschainSwapsPromoBanner?: boolean
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const initialLuxBehaviorHistoryState: LuxBehaviorHistoryState = {
|
|
40
|
+
hasViewedBridgingBanner: false,
|
|
41
|
+
hasDismissedBridgingWarning: false,
|
|
42
|
+
hasDismissedLowNetworkTokenWarning: false,
|
|
43
|
+
hasViewedContractAddressExplainer: false,
|
|
44
|
+
hasDismissedBridgedAssetsBannerV2: false,
|
|
45
|
+
unichainPromotion: {
|
|
46
|
+
coldBannerDismissed: false,
|
|
47
|
+
warmBannerDismissed: false,
|
|
48
|
+
networkSelectorAnimationSeen: false,
|
|
49
|
+
networkSelectorTooltipSeen: false,
|
|
50
|
+
bridgingTooltipSeen: false,
|
|
51
|
+
bridgingAnimationSeen: false,
|
|
52
|
+
isFirstUnichainBridgeSelection: true,
|
|
53
|
+
},
|
|
54
|
+
hasShownMismatchToast: false,
|
|
55
|
+
hasShownSmartWalletNudge: false,
|
|
56
|
+
hasSeenToucanIntroModal: false,
|
|
57
|
+
hasDismissedLuxWrapped2025Banner: false,
|
|
58
|
+
hasDismissedCrosschainSwapsPromoBanner: false,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const slice = createSlice({
|
|
62
|
+
name: 'luxBehaviorHistory',
|
|
63
|
+
initialState: initialLuxBehaviorHistoryState,
|
|
64
|
+
reducers: {
|
|
65
|
+
setHasViewedBridgingBanner: (state, action: PayloadAction<boolean>) => {
|
|
66
|
+
state.hasViewedBridgingBanner = action.payload
|
|
67
|
+
},
|
|
68
|
+
setHasDismissedBridgingWarning: (state, action: PayloadAction<boolean>) => {
|
|
69
|
+
state.hasDismissedBridgingWarning = action.payload
|
|
70
|
+
},
|
|
71
|
+
setHasDismissedLowNetworkTokenWarning: (state, action: PayloadAction<boolean>) => {
|
|
72
|
+
state.hasDismissedLowNetworkTokenWarning = action.payload
|
|
73
|
+
},
|
|
74
|
+
setHasViewedContractAddressExplainer: (state, action: PayloadAction<boolean>) => {
|
|
75
|
+
state.hasViewedContractAddressExplainer = action.payload
|
|
76
|
+
},
|
|
77
|
+
setHasDismissedUnichainColdBanner: (state, action: PayloadAction<boolean>) => {
|
|
78
|
+
state.unichainPromotion ??= {}
|
|
79
|
+
state.unichainPromotion.coldBannerDismissed = action.payload
|
|
80
|
+
},
|
|
81
|
+
setHasDismissedUnichainWarmBanner: (state, action: PayloadAction<boolean>) => {
|
|
82
|
+
state.unichainPromotion ??= {}
|
|
83
|
+
state.unichainPromotion.warmBannerDismissed = action.payload
|
|
84
|
+
},
|
|
85
|
+
setHasSeenNetworkSelectorAnimation: (state, action: PayloadAction<boolean>) => {
|
|
86
|
+
state.unichainPromotion ??= {}
|
|
87
|
+
state.unichainPromotion.networkSelectorAnimationSeen = action.payload
|
|
88
|
+
},
|
|
89
|
+
setHasSeenNetworkSelectorTooltip: (state, action: PayloadAction<boolean>) => {
|
|
90
|
+
state.unichainPromotion ??= {}
|
|
91
|
+
state.unichainPromotion.networkSelectorTooltipSeen = action.payload
|
|
92
|
+
},
|
|
93
|
+
setHasSeenBridgingTooltip: (state, action: PayloadAction<boolean>) => {
|
|
94
|
+
state.unichainPromotion ??= {}
|
|
95
|
+
state.unichainPromotion.bridgingTooltipSeen = action.payload
|
|
96
|
+
},
|
|
97
|
+
setIsFirstUnichainBridgeSelection: (state, action: PayloadAction<boolean>) => {
|
|
98
|
+
state.unichainPromotion ??= {}
|
|
99
|
+
state.unichainPromotion.isFirstUnichainBridgeSelection = action.payload
|
|
100
|
+
},
|
|
101
|
+
setHasSeenBridgingAnimation: (state, action: PayloadAction<boolean>) => {
|
|
102
|
+
state.unichainPromotion ??= {}
|
|
103
|
+
state.unichainPromotion.bridgingAnimationSeen = action.payload
|
|
104
|
+
},
|
|
105
|
+
// Should only be used for testing
|
|
106
|
+
resetLuxBehaviorHistory: (_state, _action: PayloadAction) => {
|
|
107
|
+
return initialLuxBehaviorHistoryState
|
|
108
|
+
},
|
|
109
|
+
setHasShownMismatchToast: (state, action: PayloadAction<boolean>) => {
|
|
110
|
+
state.hasShownMismatchToast = action.payload
|
|
111
|
+
},
|
|
112
|
+
setEmbeddedWalletGraduateCardDismissed: (state, action: PayloadAction<{ walletAddress: string }>) => {
|
|
113
|
+
state.embeddedWalletGraduateCardDismissed ??= {}
|
|
114
|
+
state.embeddedWalletGraduateCardDismissed[action.payload.walletAddress] = new Date().getTime()
|
|
115
|
+
},
|
|
116
|
+
setHasShownSmartWalletNudge: (state, action: PayloadAction<boolean>) => {
|
|
117
|
+
state.hasShownSmartWalletNudge = action.payload
|
|
118
|
+
},
|
|
119
|
+
setHasSeenToucanIntroModal: (state, action: PayloadAction<boolean>) => {
|
|
120
|
+
state.hasSeenToucanIntroModal = action.payload
|
|
121
|
+
},
|
|
122
|
+
setToucanIntroModalSeenByWallet: (state, action: PayloadAction<{ walletAddress: string }>) => {
|
|
123
|
+
state.toucanIntroModalSeenByWallet ??= {}
|
|
124
|
+
state.toucanIntroModalSeenByWallet[action.payload.walletAddress.toLowerCase()] = true
|
|
125
|
+
},
|
|
126
|
+
setHasDismissedBridgedAssetsBannerV2: (state, action: PayloadAction<boolean>) => {
|
|
127
|
+
state.hasDismissedBridgedAssetsBannerV2 = action.payload
|
|
128
|
+
},
|
|
129
|
+
setHasDismissedLuxWrapped2025Banner: (state, action: PayloadAction<boolean>) => {
|
|
130
|
+
state.hasDismissedLuxWrapped2025Banner = action.payload
|
|
131
|
+
},
|
|
132
|
+
setHasDismissedCrosschainSwapsPromoBanner: (state, action: PayloadAction<boolean>) => {
|
|
133
|
+
state.hasDismissedCrosschainSwapsPromoBanner = action.payload
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
export const {
|
|
139
|
+
setHasViewedBridgingBanner,
|
|
140
|
+
setHasDismissedBridgingWarning,
|
|
141
|
+
setHasDismissedLowNetworkTokenWarning,
|
|
142
|
+
setHasDismissedUnichainColdBanner,
|
|
143
|
+
setHasDismissedUnichainWarmBanner,
|
|
144
|
+
setHasSeenNetworkSelectorAnimation,
|
|
145
|
+
setHasSeenNetworkSelectorTooltip,
|
|
146
|
+
setHasSeenBridgingTooltip,
|
|
147
|
+
setIsFirstUnichainBridgeSelection,
|
|
148
|
+
setHasSeenBridgingAnimation,
|
|
149
|
+
resetLuxBehaviorHistory,
|
|
150
|
+
setHasViewedContractAddressExplainer,
|
|
151
|
+
setHasShownMismatchToast,
|
|
152
|
+
setEmbeddedWalletGraduateCardDismissed,
|
|
153
|
+
setHasShownSmartWalletNudge,
|
|
154
|
+
setHasSeenToucanIntroModal,
|
|
155
|
+
setToucanIntroModalSeenByWallet,
|
|
156
|
+
setHasDismissedBridgedAssetsBannerV2,
|
|
157
|
+
setHasDismissedLuxWrapped2025Banner,
|
|
158
|
+
setHasDismissedCrosschainSwapsPromoBanner,
|
|
159
|
+
} = slice.actions
|
|
160
|
+
|
|
161
|
+
export const luxBehaviorHistoryReducer = slice.reducer
|