@lifi/widget 4.3.0 → 4.4.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/dist/esm/App.d.ts +0 -1
- package/dist/esm/App.d.ts.map +1 -1
- package/dist/esm/AppDrawer.d.ts +1 -1
- package/dist/esm/AppDrawer.d.ts.map +1 -1
- package/dist/esm/components/ActionRow/ActionRow.d.ts +13 -0
- package/dist/esm/components/ActionRow/ActionRow.d.ts.map +1 -0
- package/dist/esm/components/AmountInput/AmountInput.style.d.ts +9 -0
- package/dist/esm/components/AmountInput/AmountInput.style.d.ts.map +1 -0
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.d.ts +7 -0
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.d.ts.map +1 -0
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.d.ts +7 -0
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.d.ts.map +1 -0
- package/dist/esm/components/Avatar/Avatar.d.ts +12 -0
- package/dist/esm/components/Avatar/Avatar.d.ts.map +1 -0
- package/dist/esm/components/Avatar/TokenAvatar.d.ts +14 -0
- package/dist/esm/components/Avatar/TokenAvatar.d.ts.map +1 -0
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.d.ts +6 -0
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.d.ts.map +1 -0
- package/dist/esm/components/BaseTransactionButton/types.d.ts +14 -0
- package/dist/esm/components/BaseTransactionButton/types.d.ts.map +1 -0
- package/dist/esm/components/BottomSheet/types.d.ts +11 -0
- package/dist/esm/components/BottomSheet/types.d.ts.map +1 -0
- package/dist/esm/components/ButtonTertiary.d.ts +7 -0
- package/dist/esm/components/ButtonTertiary.d.ts.map +1 -0
- package/dist/esm/components/Card/Card.d.ts +12 -0
- package/dist/esm/components/Card/Card.d.ts.map +1 -0
- package/dist/esm/components/Card/CardIconButton.d.ts +7 -0
- package/dist/esm/components/Card/CardIconButton.d.ts.map +1 -0
- package/dist/esm/components/Card/CardTitle.d.ts +9 -0
- package/dist/esm/components/Card/CardTitle.d.ts.map +1 -0
- package/dist/esm/components/Card/InputCard.d.ts +7 -0
- package/dist/esm/components/Card/InputCard.d.ts.map +1 -0
- package/dist/esm/components/ChainSelect/ChainSelect.d.ts +7 -0
- package/dist/esm/components/ChainSelect/ChainSelect.d.ts.map +1 -0
- package/dist/esm/components/ChainSelect/ChainSelect.style.d.ts +10 -0
- package/dist/esm/components/ChainSelect/ChainSelect.style.d.ts.map +1 -0
- package/dist/esm/components/ContractComponent/ContractComponent.d.ts +7 -0
- package/dist/esm/components/ContractComponent/ContractComponent.d.ts.map +1 -0
- package/dist/esm/components/ContractComponent/ItemPrice.d.ts +0 -1
- package/dist/esm/components/ContractComponent/ItemPrice.d.ts.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.d.ts +0 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.d.ts.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFTBase.d.ts +0 -1
- package/dist/esm/components/ContractComponent/NFT/NFTBase.d.ts.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/types.d.ts +0 -1
- package/dist/esm/components/ContractComponent/NFT/types.d.ts.map +1 -1
- package/dist/esm/components/ExecutionStatusCard/ExecutionStatusCard.d.ts +21 -0
- package/dist/esm/components/ExecutionStatusCard/ExecutionStatusCard.d.ts.map +1 -0
- package/dist/esm/components/ExecutionStatusCard/StatusIcon.d.ts +16 -0
- package/dist/esm/components/ExecutionStatusCard/StatusIcon.d.ts.map +1 -0
- package/dist/esm/components/ExecutionStatusCard/iconKey.js +1 -0
- package/dist/esm/components/ExecutionStatusCard/iconKey.js.map +1 -1
- package/dist/esm/components/FeeBreakdownTooltip.d.ts +13 -0
- package/dist/esm/components/FeeBreakdownTooltip.d.ts.map +1 -0
- package/dist/esm/components/IconCircle/IconCircle.d.ts +11 -0
- package/dist/esm/components/IconCircle/IconCircle.d.ts.map +1 -0
- package/dist/esm/components/IconCircle/statusIcons.d.ts +6 -0
- package/dist/esm/components/IconCircle/statusIcons.d.ts.map +1 -0
- package/dist/esm/components/IconTypography.d.ts +7 -0
- package/dist/esm/components/IconTypography.d.ts.map +1 -0
- package/dist/esm/components/ListItem/ListItemButton.d.ts +7 -0
- package/dist/esm/components/ListItem/ListItemButton.d.ts.map +1 -0
- package/dist/esm/components/ListItemButton.d.ts +7 -0
- package/dist/esm/components/ListItemButton.d.ts.map +1 -0
- package/dist/esm/components/Messages/WarningMessages.d.ts +11 -0
- package/dist/esm/components/Messages/WarningMessages.d.ts.map +1 -0
- package/dist/esm/components/PageContainer.d.ts +12 -0
- package/dist/esm/components/PageContainer.d.ts.map +1 -0
- package/dist/esm/components/PoweredBy/PoweredBy.d.ts +5 -0
- package/dist/esm/components/PoweredBy/PoweredBy.d.ts.map +1 -0
- package/dist/esm/components/ProgressToNextUpdate.d.ts +10 -0
- package/dist/esm/components/ProgressToNextUpdate.d.ts.map +1 -0
- package/dist/esm/components/RouteCard/RouteCard.d.ts +7 -0
- package/dist/esm/components/RouteCard/RouteCard.d.ts.map +1 -0
- package/dist/esm/components/RouteCard/RouteCardSkeleton.d.ts +7 -0
- package/dist/esm/components/RouteCard/RouteCardSkeleton.d.ts.map +1 -0
- package/dist/esm/components/RouteCard/RouteDetails.d.ts +10 -0
- package/dist/esm/components/RouteCard/RouteDetails.d.ts.map +1 -0
- package/dist/esm/components/RouteCard/RouteDetails.style.d.ts +12 -0
- package/dist/esm/components/RouteCard/RouteDetails.style.d.ts.map +1 -0
- package/dist/esm/components/RouteCard/RouteNotFoundCard.d.ts +5 -0
- package/dist/esm/components/RouteCard/RouteNotFoundCard.d.ts.map +1 -0
- package/dist/esm/components/RouteCard/RouteTokens.d.ts +11 -0
- package/dist/esm/components/RouteCard/RouteTokens.d.ts.map +1 -0
- package/dist/esm/components/RouteCard/RouteTokens.js +2 -2
- package/dist/esm/components/RouteCard/RouteTokens.js.map +1 -1
- package/dist/esm/components/RouteCard/types.d.ts +14 -0
- package/dist/esm/components/RouteCard/types.d.ts.map +1 -0
- package/dist/esm/components/Search/SearchInput.d.ts +17 -0
- package/dist/esm/components/Search/SearchInput.d.ts.map +1 -0
- package/dist/esm/components/SendToWallet/SendToWalletButton.d.ts +10 -0
- package/dist/esm/components/SendToWallet/SendToWalletButton.d.ts.map +1 -0
- package/dist/esm/components/SendToWallet/SendToWalletButton.js +15 -6
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.d.ts +1 -4
- package/dist/esm/components/Skeleton/WidgetSkeleton.d.ts.map +1 -1
- package/dist/esm/components/StepActions/SentToWalletRow.d.ts +9 -0
- package/dist/esm/components/StepActions/SentToWalletRow.d.ts.map +1 -0
- package/dist/esm/components/StepActions/StepActionRow.style.d.ts +7 -0
- package/dist/esm/components/StepActions/StepActionRow.style.d.ts.map +1 -0
- package/dist/esm/components/StepActions/StepActionsList.d.ts +12 -0
- package/dist/esm/components/StepActions/StepActionsList.d.ts.map +1 -0
- package/dist/esm/components/StepActions/executionRows.d.ts +26 -0
- package/dist/esm/components/StepActions/executionRows.d.ts.map +1 -0
- package/dist/esm/components/Token/Token.d.ts +17 -0
- package/dist/esm/components/Token/Token.d.ts.map +1 -0
- package/dist/esm/components/TokenList/TokenNotFound.d.ts +6 -0
- package/dist/esm/components/TokenList/TokenNotFound.d.ts.map +1 -0
- package/dist/esm/components/TokenList/VirtualizedTokenList.d.ts +7 -0
- package/dist/esm/components/TokenList/VirtualizedTokenList.d.ts.map +1 -0
- package/dist/esm/components/TokenList/types.d.ts +20 -0
- package/dist/esm/components/TokenList/types.d.ts.map +1 -0
- package/dist/esm/components/TokenList/useTokenSelect.d.ts +6 -0
- package/dist/esm/components/TokenList/useTokenSelect.d.ts.map +1 -0
- package/dist/esm/components/TokenRate/TokenRate.d.ts +10 -0
- package/dist/esm/components/TokenRate/TokenRate.d.ts.map +1 -0
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.js +1 -0
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.js.map +1 -1
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.style.js +9 -0
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.style.js.map +1 -1
- package/dist/esm/components/TransactionCard/TransactionCard.style.d.ts +8 -0
- package/dist/esm/components/TransactionCard/TransactionCard.style.d.ts.map +1 -0
- package/dist/esm/config/constants.d.ts.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.d.ts.map +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/config/version.js.map +1 -1
- package/dist/esm/hooks/useAddressActivity.d.ts +11 -0
- package/dist/esm/hooks/useAddressActivity.d.ts.map +1 -0
- package/dist/esm/hooks/useAddressValidation.d.ts +28 -0
- package/dist/esm/hooks/useAddressValidation.d.ts.map +1 -0
- package/dist/esm/hooks/useAddressValidation.js +6 -1
- package/dist/esm/hooks/useAddressValidation.js.map +1 -1
- package/dist/esm/hooks/useAvailableChains.d.ts +12 -0
- package/dist/esm/hooks/useAvailableChains.d.ts.map +1 -0
- package/dist/esm/hooks/useChain.d.ts +10 -0
- package/dist/esm/hooks/useChain.d.ts.map +1 -0
- package/dist/esm/hooks/useContactSupport.d.ts +5 -0
- package/dist/esm/hooks/useContactSupport.d.ts.map +1 -0
- package/dist/esm/hooks/useDebouncedWatch.d.ts +6 -0
- package/dist/esm/hooks/useDebouncedWatch.d.ts.map +1 -0
- package/dist/esm/hooks/useDisplayedTokens.js +48 -0
- package/dist/esm/hooks/useDisplayedTokens.js.map +1 -0
- package/dist/esm/hooks/useExplorer.d.ts +14 -0
- package/dist/esm/hooks/useExplorer.d.ts.map +1 -0
- package/dist/esm/hooks/useHeader.d.ts +6 -0
- package/dist/esm/hooks/useHeader.d.ts.map +1 -0
- package/dist/esm/hooks/useListHeight.d.ts +12 -0
- package/dist/esm/hooks/useListHeight.d.ts.map +1 -0
- package/dist/esm/hooks/useListHeight.js +1 -0
- package/dist/esm/hooks/useListHeight.js.map +1 -1
- package/dist/esm/hooks/useNavigateBack.d.ts +5 -0
- package/dist/esm/hooks/useNavigateBack.d.ts.map +1 -0
- package/dist/esm/hooks/usePacedRouteExecution.js +1 -0
- package/dist/esm/hooks/usePacedRouteExecution.js.map +1 -1
- package/dist/esm/hooks/useRouteExecution.d.ts +18 -0
- package/dist/esm/hooks/useRouteExecution.d.ts.map +1 -0
- package/dist/esm/hooks/useRouteExecutionMessage.d.ts +10 -0
- package/dist/esm/hooks/useRouteExecutionMessage.d.ts.map +1 -0
- package/dist/esm/hooks/useRouteExecutionMessage.js +1 -0
- package/dist/esm/hooks/useRouteExecutionMessage.js.map +1 -1
- package/dist/esm/hooks/useRoutes.d.ts +32 -0
- package/dist/esm/hooks/useRoutes.d.ts.map +1 -0
- package/dist/esm/hooks/useRoutes.js +12 -8
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useToAddressRequirements.d.ts +16 -0
- package/dist/esm/hooks/useToAddressRequirements.d.ts.map +1 -0
- package/dist/esm/hooks/useToken.d.ts +9 -0
- package/dist/esm/hooks/useToken.d.ts.map +1 -0
- package/dist/esm/hooks/useTokenAddressBalance.d.ts +11 -0
- package/dist/esm/hooks/useTokenAddressBalance.d.ts.map +1 -0
- package/dist/esm/hooks/useTokenBalances.d.ts +14 -0
- package/dist/esm/hooks/useTokenBalances.d.ts.map +1 -0
- package/dist/esm/hooks/useTokenBalances.js +5 -45
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenList.d.ts +16 -0
- package/dist/esm/hooks/useTokenList.d.ts.map +1 -0
- package/dist/esm/hooks/useTokenList.js +31 -0
- package/dist/esm/hooks/useTokenList.js.map +1 -0
- package/dist/esm/hooks/useTools.d.ts +8 -0
- package/dist/esm/hooks/useTools.d.ts.map +1 -0
- package/dist/esm/hooks/useTransactionDetails.js +1 -3
- package/dist/esm/hooks/useTransactionDetails.js.map +1 -1
- package/dist/esm/hooks/useTransactionList.js +1 -0
- package/dist/esm/hooks/useTransactionList.js.map +1 -1
- package/dist/esm/hooks/useWidgetChains.d.ts +0 -1
- package/dist/esm/hooks/useWidgetChains.d.ts.map +1 -1
- package/dist/esm/hooks/useWidgetEvents.d.ts +0 -1
- package/dist/esm/hooks/useWidgetEvents.d.ts.map +1 -1
- package/dist/esm/i18n/en.json +321 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/pages/ActivitiesPage/ActivitiesPage.js +1 -0
- package/dist/esm/pages/ActivitiesPage/ActivitiesPage.js.map +1 -1
- package/dist/esm/pages/LanguagesPage.js +19 -7
- package/dist/esm/pages/LanguagesPage.js.map +1 -1
- package/dist/esm/pages/MainPage/MainWarningMessages.d.ts +10 -0
- package/dist/esm/pages/MainPage/MainWarningMessages.d.ts.map +1 -0
- package/dist/esm/pages/RoutesPage/RoutesPage.js +28 -16
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.style.d.ts +7 -0
- package/dist/esm/pages/RoutesPage/RoutesPage.style.d.ts.map +1 -0
- package/dist/esm/pages/SelectChainPage/SelectChainPage.d.ts +6 -0
- package/dist/esm/pages/SelectChainPage/SelectChainPage.d.ts.map +1 -0
- package/dist/esm/pages/SelectChainPage/types.d.ts +8 -0
- package/dist/esm/pages/SelectChainPage/types.d.ts.map +1 -0
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.d.ts +10 -0
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.d.ts.map +1 -0
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.d.ts +9 -0
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.d.ts.map +1 -0
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.d.ts +14 -0
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.d.ts.map +1 -0
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.d.ts +19 -0
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.d.ts.map +1 -0
- package/dist/esm/pages/TransactionPage/ExecutionDoneCard.d.ts +12 -0
- package/dist/esm/pages/TransactionPage/ExecutionDoneCard.d.ts.map +1 -0
- package/dist/esm/pages/TransactionPage/ExecutionDoneCard.js +1 -0
- package/dist/esm/pages/TransactionPage/ExecutionDoneCard.js.map +1 -1
- package/dist/esm/pages/TransactionPage/RouteTracker.d.ts +11 -0
- package/dist/esm/pages/TransactionPage/RouteTracker.d.ts.map +1 -0
- package/dist/esm/pages/TransactionPage/StartTransactionButton.d.ts +6 -0
- package/dist/esm/pages/TransactionPage/StartTransactionButton.d.ts.map +1 -0
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.d.ts +15 -0
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.d.ts.map +1 -0
- package/dist/esm/pages/TransactionPage/TransactionContent.js +1 -0
- package/dist/esm/pages/TransactionPage/TransactionContent.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionDoneButtons.d.ts +12 -0
- package/dist/esm/pages/TransactionPage/TransactionDoneButtons.d.ts.map +1 -0
- package/dist/esm/pages/TransactionPage/TransactionDoneButtons.js +1 -0
- package/dist/esm/pages/TransactionPage/TransactionDoneButtons.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionExecutionContent.js +1 -0
- package/dist/esm/pages/TransactionPage/TransactionExecutionContent.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionPage.js +1 -0
- package/dist/esm/pages/TransactionPage/TransactionPage.js.map +1 -1
- package/dist/esm/pages/TransactionPage/types.d.ts +9 -0
- package/dist/esm/pages/TransactionPage/types.d.ts.map +1 -0
- package/dist/esm/pages/TransactionPage/utils.d.ts +6 -0
- package/dist/esm/pages/TransactionPage/utils.d.ts.map +1 -0
- package/dist/esm/providers/I18nProvider/I18nProvider.d.ts +5 -0
- package/dist/esm/providers/I18nProvider/I18nProvider.d.ts.map +1 -0
- package/dist/esm/providers/I18nProvider/types.d.ts +2 -3
- package/dist/esm/providers/I18nProvider/types.d.ts.map +1 -1
- package/dist/esm/providers/QueryClientProvider.d.ts +6 -0
- package/dist/esm/providers/QueryClientProvider.d.ts.map +1 -0
- package/dist/esm/providers/SDKClientProvider.d.ts +8 -0
- package/dist/esm/providers/SDKClientProvider.d.ts.map +1 -0
- package/dist/esm/providers/WalletProvider/WalletProvider.d.ts +10 -0
- package/dist/esm/providers/WalletProvider/WalletProvider.d.ts.map +1 -0
- package/dist/esm/providers/WalletProvider/WalletProvider.js +8 -3
- package/dist/esm/providers/WalletProvider/WalletProvider.js.map +1 -1
- package/dist/esm/providers/WidgetProvider/WidgetProvider.d.ts +8 -0
- package/dist/esm/providers/WidgetProvider/WidgetProvider.d.ts.map +1 -0
- package/dist/esm/providers/WidgetProvider/types.d.ts +11 -0
- package/dist/esm/providers/WidgetProvider/types.d.ts.map +1 -0
- package/dist/esm/shared.d.ts +107 -0
- package/dist/esm/shared.js +105 -0
- package/dist/esm/stores/StoreProvider.d.ts +7 -0
- package/dist/esm/stores/StoreProvider.d.ts.map +1 -0
- package/dist/esm/stores/bookmarks/BookmarkStore.d.ts +7 -0
- package/dist/esm/stores/bookmarks/BookmarkStore.d.ts.map +1 -0
- package/dist/esm/stores/bookmarks/types.d.ts +0 -1
- package/dist/esm/stores/bookmarks/types.d.ts.map +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.d.ts +8 -0
- package/dist/esm/stores/chains/ChainOrderStore.d.ts.map +1 -0
- package/dist/esm/stores/chains/types.d.ts +27 -0
- package/dist/esm/stores/chains/types.d.ts.map +1 -0
- package/dist/esm/stores/form/createFormStore.js +1 -0
- package/dist/esm/stores/form/createFormStore.js.map +1 -1
- package/dist/esm/stores/form/types.d.ts +7 -7
- package/dist/esm/stores/form/types.d.ts.map +1 -1
- package/dist/esm/stores/form/types.js.map +1 -1
- package/dist/esm/stores/form/useFieldActions.d.ts +0 -1
- package/dist/esm/stores/form/useFieldActions.d.ts.map +1 -1
- package/dist/esm/stores/form/useFieldValues.d.ts +0 -1
- package/dist/esm/stores/form/useFieldValues.d.ts.map +1 -1
- package/dist/esm/stores/header/types.d.ts +20 -0
- package/dist/esm/stores/header/types.d.ts.map +1 -0
- package/dist/esm/stores/header/useHeaderStore.d.ts +8 -0
- package/dist/esm/stores/header/useHeaderStore.d.ts.map +1 -0
- package/dist/esm/stores/inputMode/useInputModeStore.d.ts +13 -0
- package/dist/esm/stores/inputMode/useInputModeStore.d.ts.map +1 -0
- package/dist/esm/stores/routes/RouteExecutionStore.d.ts +9 -0
- package/dist/esm/stores/routes/RouteExecutionStore.d.ts.map +1 -0
- package/dist/esm/stores/routes/createRouteExecutionStore.js +1 -0
- package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/routes/types.d.ts +24 -0
- package/dist/esm/stores/routes/types.d.ts.map +1 -0
- package/dist/esm/stores/routes/types.js +14 -0
- package/dist/esm/stores/routes/types.js.map +1 -0
- package/dist/esm/stores/routes/useRouteExecutionIndicator.js +1 -0
- package/dist/esm/stores/routes/useRouteExecutionIndicator.js.map +1 -1
- package/dist/esm/stores/routes/utils.d.ts +9 -0
- package/dist/esm/stores/routes/utils.d.ts.map +1 -0
- package/dist/esm/stores/settings/SettingsStore.d.ts +8 -0
- package/dist/esm/stores/settings/SettingsStore.d.ts.map +1 -0
- package/dist/esm/stores/settings/types.d.ts +5 -2
- package/dist/esm/stores/settings/types.d.ts.map +1 -1
- package/dist/esm/stores/types.d.ts +9 -0
- package/dist/esm/stores/types.d.ts.map +1 -0
- package/dist/esm/themes/azureLight.d.ts +0 -1
- package/dist/esm/themes/azureLight.d.ts.map +1 -1
- package/dist/esm/themes/createTheme.d.ts +0 -1
- package/dist/esm/themes/createTheme.d.ts.map +1 -1
- package/dist/esm/themes/jumper.d.ts +0 -1
- package/dist/esm/themes/jumper.d.ts.map +1 -1
- package/dist/esm/themes/palettes.d.ts.map +1 -1
- package/dist/esm/themes/types.d.ts +0 -1
- package/dist/esm/themes/types.d.ts.map +1 -1
- package/dist/esm/themes/watermelonLight.d.ts +0 -1
- package/dist/esm/themes/watermelonLight.d.ts.map +1 -1
- package/dist/esm/themes/windows95.d.ts +0 -1
- package/dist/esm/themes/windows95.d.ts.map +1 -1
- package/dist/esm/types/events.d.ts +4 -3
- package/dist/esm/types/events.d.ts.map +1 -1
- package/dist/esm/types/token.d.ts +1 -2
- package/dist/esm/types/token.d.ts.map +1 -1
- package/dist/esm/types/widget.d.ts +72 -73
- package/dist/esm/types/widget.d.ts.map +1 -1
- package/dist/esm/utils/compactNumberFormatter.d.ts +8 -8
- package/dist/esm/utils/compactNumberFormatter.d.ts.map +1 -1
- package/dist/esm/utils/converters.d.ts +7 -0
- package/dist/esm/utils/converters.d.ts.map +1 -0
- package/dist/esm/utils/currencyExtendedFormatter.d.ts.map +1 -1
- package/dist/esm/utils/elements.d.ts +11 -0
- package/dist/esm/utils/elements.d.ts.map +1 -0
- package/dist/esm/utils/elements.js +8 -1
- package/dist/esm/utils/elements.js.map +1 -1
- package/dist/esm/utils/enum.d.ts +5 -0
- package/dist/esm/utils/enum.d.ts.map +1 -0
- package/dist/esm/utils/fees.d.ts +17 -0
- package/dist/esm/utils/fees.d.ts.map +1 -0
- package/dist/esm/utils/format.d.ts +14 -14
- package/dist/esm/utils/format.d.ts.map +1 -1
- package/dist/esm/utils/getPriceImpact.d.ts +1 -7
- package/dist/esm/utils/getPriceImpact.d.ts.map +1 -1
- package/dist/esm/utils/input.d.ts +5 -0
- package/dist/esm/utils/input.d.ts.map +1 -0
- package/dist/esm/utils/navigationRoutes.d.ts.map +1 -1
- package/dist/esm/utils/percentFormatter.d.ts +5 -5
- package/dist/esm/utils/percentFormatter.d.ts.map +1 -1
- package/dist/esm/utils/tokenList.js +3 -3
- package/dist/esm/utils/tokenList.js.map +1 -1
- package/dist/esm/utils/wallet.d.ts +5 -0
- package/dist/esm/utils/wallet.d.ts.map +1 -0
- package/package.json +28 -20
- package/src/components/RouteCard/RouteTokens.tsx +3 -2
- package/src/components/SendToWallet/SendToWalletButton.tsx +27 -5
- package/src/components/TransactionCard/ActiveTransactionCard.style.tsx +11 -0
- package/src/config/version.ts +1 -1
- package/src/hooks/useDisplayedTokens.ts +70 -0
- package/src/hooks/useListHeight.ts +4 -0
- package/src/hooks/useRoutes.ts +360 -325
- package/src/hooks/useTokenBalances.ts +8 -53
- package/src/hooks/useTokenList.ts +59 -0
- package/src/hooks/useTransactionDetails.ts +1 -3
- package/src/pages/LanguagesPage.tsx +36 -23
- package/src/pages/RoutesPage/RoutesPage.tsx +38 -27
- package/src/providers/WalletProvider/WalletProvider.tsx +15 -3
- package/src/shared.ts +191 -0
- package/src/stores/form/createFormStore.ts +1 -0
- package/src/stores/form/types.ts +1 -0
- package/src/utils/tokenList.ts +3 -3
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { FormKeyHelper, FormType, FormTypeProps } from "./stores/form/types.js";
|
|
2
|
+
import { FormRef, WidgetConfig, WidgetTheme } from "./types/widget.js";
|
|
3
|
+
import { navigationRoutes } from "./utils/navigationRoutes.js";
|
|
4
|
+
import { WidgetEvent } from "./types/events.js";
|
|
5
|
+
import { useWidgetEvents } from "./hooks/useWidgetEvents.js";
|
|
6
|
+
import { useFieldActions } from "./stores/form/useFieldActions.js";
|
|
7
|
+
import { useFieldValues } from "./stores/form/useFieldValues.js";
|
|
8
|
+
import { createTheme } from "./themes/createTheme.js";
|
|
9
|
+
import { formatDuration, formatInputAmount, formatTokenAmount, formatTokenPrice, priceToTokenAmount, usdDecimals } from "./utils/format.js";
|
|
10
|
+
import { getPriceImpact } from "./utils/getPriceImpact.js";
|
|
11
|
+
import { ActionRow } from "./components/ActionRow/ActionRow.js";
|
|
12
|
+
import { CardTitle } from "./components/Card/CardTitle.js";
|
|
13
|
+
import { FormControl, Input } from "./components/AmountInput/AmountInput.style.js";
|
|
14
|
+
import { AmountInputEndAdornment } from "./components/AmountInput/AmountInputEndAdornment.js";
|
|
15
|
+
import { InputPriceButton } from "./components/AmountInput/PriceFormHelperText.style.js";
|
|
16
|
+
import { AvatarBadgedDefault } from "./components/Avatar/Avatar.js";
|
|
17
|
+
import { TokenAvatar } from "./components/Avatar/TokenAvatar.js";
|
|
18
|
+
import { BaseTransactionButton } from "./components/BaseTransactionButton/BaseTransactionButton.js";
|
|
19
|
+
import { BottomSheetBase } from "./components/BottomSheet/types.js";
|
|
20
|
+
import { ButtonTertiary } from "./components/ButtonTertiary.js";
|
|
21
|
+
import { Card } from "./components/Card/Card.js";
|
|
22
|
+
import { CardIconButton } from "./components/Card/CardIconButton.js";
|
|
23
|
+
import { InputCard } from "./components/Card/InputCard.js";
|
|
24
|
+
import { ChainSelect } from "./components/ChainSelect/ChainSelect.js";
|
|
25
|
+
import { ChainAvatar } from "./components/ChainSelect/ChainSelect.style.js";
|
|
26
|
+
import { ContractComponent } from "./components/ContractComponent/ContractComponent.js";
|
|
27
|
+
import { ExecutionRow, useExecutionRows } from "./components/StepActions/executionRows.js";
|
|
28
|
+
import { ExecutionStatusCard } from "./components/ExecutionStatusCard/ExecutionStatusCard.js";
|
|
29
|
+
import { RouteExecutionStatus } from "./stores/routes/types.js";
|
|
30
|
+
import { StatusIcon } from "./components/ExecutionStatusCard/StatusIcon.js";
|
|
31
|
+
import { getAccumulatedFeeCostsBreakdown } from "./utils/fees.js";
|
|
32
|
+
import { FeeBreakdownTooltip } from "./components/FeeBreakdownTooltip.js";
|
|
33
|
+
import { IconCircle } from "./components/IconCircle/IconCircle.js";
|
|
34
|
+
import { IconTypography } from "./components/IconTypography.js";
|
|
35
|
+
import { ListItemButton } from "./components/ListItem/ListItemButton.js";
|
|
36
|
+
import { WarningMessages } from "./components/Messages/WarningMessages.js";
|
|
37
|
+
import { PageContainer } from "./components/PageContainer.js";
|
|
38
|
+
import { PoweredBy } from "./components/PoweredBy/PoweredBy.js";
|
|
39
|
+
import { ProgressToNextUpdate } from "./components/ProgressToNextUpdate.js";
|
|
40
|
+
import { RouteCard } from "./components/RouteCard/RouteCard.js";
|
|
41
|
+
import { RouteCardSkeleton } from "./components/RouteCard/RouteCardSkeleton.js";
|
|
42
|
+
import { RouteDetails } from "./components/RouteCard/RouteDetails.js";
|
|
43
|
+
import { DetailInfoIcon, DetailLabel, DetailLabelContainer, DetailRow, DetailValue } from "./components/RouteCard/RouteDetails.style.js";
|
|
44
|
+
import { RouteNotFoundCard } from "./components/RouteCard/RouteNotFoundCard.js";
|
|
45
|
+
import { RouteTokens } from "./components/RouteCard/RouteTokens.js";
|
|
46
|
+
import { SearchInput } from "./components/Search/SearchInput.js";
|
|
47
|
+
import { SendToWalletButton } from "./components/SendToWallet/SendToWalletButton.js";
|
|
48
|
+
import { SentToWalletRow } from "./components/StepActions/SentToWalletRow.js";
|
|
49
|
+
import { ExternalLink } from "./components/StepActions/StepActionRow.style.js";
|
|
50
|
+
import { StepActionsList } from "./components/StepActions/StepActionsList.js";
|
|
51
|
+
import { Token } from "./components/Token/Token.js";
|
|
52
|
+
import { TokenNotFound } from "./components/TokenList/TokenNotFound.js";
|
|
53
|
+
import { useTokenSelect } from "./components/TokenList/useTokenSelect.js";
|
|
54
|
+
import { VirtualizedTokenList } from "./components/TokenList/VirtualizedTokenList.js";
|
|
55
|
+
import { TokenRate } from "./components/TokenRate/TokenRate.js";
|
|
56
|
+
import { DateLabelContainer, DateLabelText } from "./components/TransactionCard/TransactionCard.style.js";
|
|
57
|
+
import { useAddressActivity } from "./hooks/useAddressActivity.js";
|
|
58
|
+
import { AddressType, useAddressValidation } from "./hooks/useAddressValidation.js";
|
|
59
|
+
import { useAvailableChains } from "./hooks/useAvailableChains.js";
|
|
60
|
+
import { useChain } from "./hooks/useChain.js";
|
|
61
|
+
import { useContactSupport } from "./hooks/useContactSupport.js";
|
|
62
|
+
import { useDebouncedWatch } from "./hooks/useDebouncedWatch.js";
|
|
63
|
+
import { useExplorer } from "./hooks/useExplorer.js";
|
|
64
|
+
import { useHeader } from "./hooks/useHeader.js";
|
|
65
|
+
import { useListHeight } from "./hooks/useListHeight.js";
|
|
66
|
+
import { useNavigateBack } from "./hooks/useNavigateBack.js";
|
|
67
|
+
import { useRouteExecution } from "./hooks/useRouteExecution.js";
|
|
68
|
+
import { useRouteExecutionMessage } from "./hooks/useRouteExecutionMessage.js";
|
|
69
|
+
import { useRoutes } from "./hooks/useRoutes.js";
|
|
70
|
+
import { useToAddressRequirements } from "./hooks/useToAddressRequirements.js";
|
|
71
|
+
import { useToken } from "./hooks/useToken.js";
|
|
72
|
+
import { useTokenAddressBalance } from "./hooks/useTokenAddressBalance.js";
|
|
73
|
+
import { useTokenBalances } from "./hooks/useTokenBalances.js";
|
|
74
|
+
import { useTokenList } from "./hooks/useTokenList.js";
|
|
75
|
+
import { useTools } from "./hooks/useTools.js";
|
|
76
|
+
import { MainWarningMessages } from "./pages/MainPage/MainWarningMessages.js";
|
|
77
|
+
import { Stack } from "./pages/RoutesPage/RoutesPage.style.js";
|
|
78
|
+
import { SelectChainPage } from "./pages/SelectChainPage/SelectChainPage.js";
|
|
79
|
+
import { SearchTokenInput } from "./pages/SelectTokenPage/SearchTokenInput.js";
|
|
80
|
+
import { ContactSupportButton } from "./pages/TransactionDetailsPage/ContactSupportButton.js";
|
|
81
|
+
import { ConfirmToAddressSheet } from "./pages/TransactionPage/ConfirmToAddressSheet.js";
|
|
82
|
+
import { ExchangeRateBottomSheet, ExchangeRateBottomSheetBase } from "./pages/TransactionPage/ExchangeRateBottomSheet.js";
|
|
83
|
+
import { ExecutionDoneCard } from "./pages/TransactionPage/ExecutionDoneCard.js";
|
|
84
|
+
import { RouteTracker } from "./pages/TransactionPage/RouteTracker.js";
|
|
85
|
+
import { StartTransactionButton } from "./pages/TransactionPage/StartTransactionButton.js";
|
|
86
|
+
import { TokenValueBottomSheet } from "./pages/TransactionPage/TokenValueBottomSheet.js";
|
|
87
|
+
import { TransactionDoneButtons } from "./pages/TransactionPage/TransactionDoneButtons.js";
|
|
88
|
+
import { calculateValueLossPercentage, getTokenValueLossThreshold } from "./pages/TransactionPage/utils.js";
|
|
89
|
+
import { I18nProvider } from "./providers/I18nProvider/I18nProvider.js";
|
|
90
|
+
import { QueryClientProvider } from "./providers/QueryClientProvider.js";
|
|
91
|
+
import { SDKClientProvider, useSDKClient } from "./providers/SDKClientProvider.js";
|
|
92
|
+
import { WalletProvider } from "./providers/WalletProvider/WalletProvider.js";
|
|
93
|
+
import { WidgetProvider, useWidgetConfig } from "./providers/WidgetProvider/WidgetProvider.js";
|
|
94
|
+
import { BookmarkStoreProvider } from "./stores/bookmarks/BookmarkStore.js";
|
|
95
|
+
import { useChainOrderStore } from "./stores/chains/ChainOrderStore.js";
|
|
96
|
+
import { useHeaderStore, useSetHeaderHeight } from "./stores/header/useHeaderStore.js";
|
|
97
|
+
import { useInputModeStore } from "./stores/inputMode/useInputModeStore.js";
|
|
98
|
+
import { useRouteExecutionStore, useRouteExecutionStoreContext } from "./stores/routes/RouteExecutionStore.js";
|
|
99
|
+
import { getSourceTxHash, isRouteActive, isRouteDone, isRouteFailed } from "./stores/routes/utils.js";
|
|
100
|
+
import { StoreProvider } from "./stores/StoreProvider.js";
|
|
101
|
+
import { SettingsStoreProvider, useSettingsStoreContext } from "./stores/settings/SettingsStore.js";
|
|
102
|
+
import { buildRouteFromTxHistory } from "./utils/converters.js";
|
|
103
|
+
import { ElementId, createElementId } from "./utils/elements.js";
|
|
104
|
+
import { hasEnumFlag } from "./utils/enum.js";
|
|
105
|
+
import { fitInputText } from "./utils/input.js";
|
|
106
|
+
import { shortenAddress } from "./utils/wallet.js";
|
|
107
|
+
export { ActionRow, AddressType, AmountInputEndAdornment, AvatarBadgedDefault, BaseTransactionButton, BookmarkStoreProvider, type BottomSheetBase, ButtonTertiary, Card, CardIconButton, CardTitle, ChainAvatar, ChainSelect, ConfirmToAddressSheet, ContactSupportButton, ContractComponent, DateLabelContainer, DateLabelText, DetailInfoIcon, DetailLabel, DetailLabelContainer, DetailRow, DetailValue, ElementId, ExchangeRateBottomSheet, type ExchangeRateBottomSheetBase, ExecutionDoneCard, type ExecutionRow, ExecutionStatusCard, ExternalLink, FeeBreakdownTooltip, FormControl, FormKeyHelper, type FormRef, type FormType, type FormTypeProps, I18nProvider, IconCircle, IconTypography, Input, InputCard, InputPriceButton, ListItemButton, MainWarningMessages, PageContainer, PoweredBy, ProgressToNextUpdate, QueryClientProvider, RouteCard, RouteCardSkeleton, RouteDetails, RouteExecutionStatus, RouteNotFoundCard, RouteTokens, RouteTracker, SDKClientProvider, SearchInput, SearchTokenInput, SelectChainPage, SendToWalletButton, SentToWalletRow, SettingsStoreProvider, Stack, StartTransactionButton, StatusIcon, StepActionsList, StoreProvider, Token, TokenAvatar, TokenNotFound, TokenRate, TokenValueBottomSheet, TransactionDoneButtons, VirtualizedTokenList, WalletProvider, WarningMessages, type WidgetConfig, WidgetEvent, WidgetProvider, type WidgetTheme, buildRouteFromTxHistory, calculateValueLossPercentage, createElementId, createTheme, fitInputText, formatDuration, formatInputAmount, formatTokenAmount, formatTokenPrice, getAccumulatedFeeCostsBreakdown, getPriceImpact, getSourceTxHash, getTokenValueLossThreshold, hasEnumFlag, isRouteActive, isRouteDone, isRouteFailed, navigationRoutes, priceToTokenAmount, shortenAddress, usdDecimals, useAddressActivity, useAddressValidation, useAvailableChains, useChain, useChainOrderStore, useContactSupport, useDebouncedWatch, useExecutionRows, useExplorer, useFieldActions, useFieldValues, useHeader, useHeaderStore, useInputModeStore, useListHeight, useNavigateBack, useRouteExecution, useRouteExecutionMessage, useRouteExecutionStore, useRouteExecutionStoreContext, useRoutes, useSDKClient, useSetHeaderHeight, useSettingsStoreContext, useToAddressRequirements, useToken, useTokenAddressBalance, useTokenBalances, useTokenList, useTokenSelect, useTools, useWidgetConfig, useWidgetEvents };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { useWidgetEvents } from "./hooks/useWidgetEvents.js";
|
|
2
|
+
import { WidgetEvent } from "./types/events.js";
|
|
3
|
+
import { SettingsStoreProvider, useSettingsStoreContext } from "./stores/settings/SettingsStore.js";
|
|
4
|
+
import { WidgetProvider, useWidgetConfig } from "./providers/WidgetProvider/WidgetProvider.js";
|
|
5
|
+
import { useHeaderStore, useSetHeaderHeight } from "./stores/header/useHeaderStore.js";
|
|
6
|
+
import { ElementId, createElementId } from "./utils/elements.js";
|
|
7
|
+
import { navigationRoutes } from "./utils/navigationRoutes.js";
|
|
8
|
+
import { SDKClientProvider, useSDKClient } from "./providers/SDKClientProvider.js";
|
|
9
|
+
import { useAvailableChains } from "./hooks/useAvailableChains.js";
|
|
10
|
+
import { BookmarkStoreProvider } from "./stores/bookmarks/BookmarkStore.js";
|
|
11
|
+
import { useFieldActions } from "./stores/form/useFieldActions.js";
|
|
12
|
+
import { formatDuration, formatInputAmount, formatTokenAmount, formatTokenPrice, priceToTokenAmount, usdDecimals } from "./utils/format.js";
|
|
13
|
+
import { useChainOrderStore } from "./stores/chains/ChainOrderStore.js";
|
|
14
|
+
import { FormKeyHelper } from "./stores/form/types.js";
|
|
15
|
+
import { useFieldValues } from "./stores/form/useFieldValues.js";
|
|
16
|
+
import { PageContainer } from "./components/PageContainer.js";
|
|
17
|
+
import { Card } from "./components/Card/Card.js";
|
|
18
|
+
import { InputCard } from "./components/Card/InputCard.js";
|
|
19
|
+
import { SearchInput } from "./components/Search/SearchInput.js";
|
|
20
|
+
import { hasEnumFlag } from "./utils/enum.js";
|
|
21
|
+
import { RouteExecutionStatus } from "./stores/routes/types.js";
|
|
22
|
+
import { getSourceTxHash, isRouteActive, isRouteDone, isRouteFailed } from "./stores/routes/utils.js";
|
|
23
|
+
import { useRouteExecutionStore, useRouteExecutionStoreContext } from "./stores/routes/RouteExecutionStore.js";
|
|
24
|
+
import { useChain } from "./hooks/useChain.js";
|
|
25
|
+
import { useDebouncedWatch } from "./hooks/useDebouncedWatch.js";
|
|
26
|
+
import { useToken } from "./hooks/useToken.js";
|
|
27
|
+
import { useRoutes } from "./hooks/useRoutes.js";
|
|
28
|
+
import { useToAddressRequirements } from "./hooks/useToAddressRequirements.js";
|
|
29
|
+
import { ProgressToNextUpdate } from "./components/ProgressToNextUpdate.js";
|
|
30
|
+
import { getAccumulatedFeeCostsBreakdown } from "./utils/fees.js";
|
|
31
|
+
import { CardIconButton } from "./components/Card/CardIconButton.js";
|
|
32
|
+
import { getPriceImpact } from "./utils/getPriceImpact.js";
|
|
33
|
+
import { AvatarBadgedDefault } from "./components/Avatar/Avatar.js";
|
|
34
|
+
import { TokenAvatar } from "./components/Avatar/TokenAvatar.js";
|
|
35
|
+
import { Token } from "./components/Token/Token.js";
|
|
36
|
+
import { FeeBreakdownTooltip } from "./components/FeeBreakdownTooltip.js";
|
|
37
|
+
import { IconTypography } from "./components/IconTypography.js";
|
|
38
|
+
import { TokenRate } from "./components/TokenRate/TokenRate.js";
|
|
39
|
+
import { DetailInfoIcon, DetailLabel, DetailLabelContainer, DetailRow, DetailValue } from "./components/RouteCard/RouteDetails.style.js";
|
|
40
|
+
import { RouteDetails } from "./components/RouteCard/RouteDetails.js";
|
|
41
|
+
import { RouteCard } from "./components/RouteCard/RouteCard.js";
|
|
42
|
+
import { RouteCardSkeleton } from "./components/RouteCard/RouteCardSkeleton.js";
|
|
43
|
+
import { RouteNotFoundCard } from "./components/RouteCard/RouteNotFoundCard.js";
|
|
44
|
+
import { useNavigateBack } from "./hooks/useNavigateBack.js";
|
|
45
|
+
import { useTools } from "./hooks/useTools.js";
|
|
46
|
+
import { shortenAddress } from "./utils/wallet.js";
|
|
47
|
+
import { useExplorer } from "./hooks/useExplorer.js";
|
|
48
|
+
import { AddressType, useAddressValidation } from "./hooks/useAddressValidation.js";
|
|
49
|
+
import { useHeader } from "./hooks/useHeader.js";
|
|
50
|
+
import { useListHeight } from "./hooks/useListHeight.js";
|
|
51
|
+
import { buildRouteFromTxHistory } from "./utils/converters.js";
|
|
52
|
+
import { ActionRow } from "./components/ActionRow/ActionRow.js";
|
|
53
|
+
import { IconCircle } from "./components/IconCircle/IconCircle.js";
|
|
54
|
+
import { RouteTokens } from "./components/RouteCard/RouteTokens.js";
|
|
55
|
+
import { useRouteExecution } from "./hooks/useRouteExecution.js";
|
|
56
|
+
import { DateLabelContainer, DateLabelText } from "./components/TransactionCard/TransactionCard.style.js";
|
|
57
|
+
import { useInputModeStore } from "./stores/inputMode/useInputModeStore.js";
|
|
58
|
+
import { fitInputText } from "./utils/input.js";
|
|
59
|
+
import { CardTitle } from "./components/Card/CardTitle.js";
|
|
60
|
+
import { FormControl, Input } from "./components/AmountInput/AmountInput.style.js";
|
|
61
|
+
import { useTokenAddressBalance } from "./hooks/useTokenAddressBalance.js";
|
|
62
|
+
import { ButtonTertiary } from "./components/ButtonTertiary.js";
|
|
63
|
+
import { AmountInputEndAdornment } from "./components/AmountInput/AmountInputEndAdornment.js";
|
|
64
|
+
import { InputPriceButton } from "./components/AmountInput/PriceFormHelperText.style.js";
|
|
65
|
+
import { ContractComponent } from "./components/ContractComponent/ContractComponent.js";
|
|
66
|
+
import { SendToWalletButton } from "./components/SendToWallet/SendToWalletButton.js";
|
|
67
|
+
import { PoweredBy } from "./components/PoweredBy/PoweredBy.js";
|
|
68
|
+
import { WarningMessages } from "./components/Messages/WarningMessages.js";
|
|
69
|
+
import { MainWarningMessages } from "./pages/MainPage/MainWarningMessages.js";
|
|
70
|
+
import { BaseTransactionButton } from "./components/BaseTransactionButton/BaseTransactionButton.js";
|
|
71
|
+
import { Stack } from "./pages/RoutesPage/RoutesPage.style.js";
|
|
72
|
+
import { useTokenSelect } from "./components/TokenList/useTokenSelect.js";
|
|
73
|
+
import { SelectChainPage } from "./pages/SelectChainPage/SelectChainPage.js";
|
|
74
|
+
import { ChainAvatar } from "./components/ChainSelect/ChainSelect.style.js";
|
|
75
|
+
import { ChainSelect } from "./components/ChainSelect/ChainSelect.js";
|
|
76
|
+
import { useTokenBalances } from "./hooks/useTokenBalances.js";
|
|
77
|
+
import { TokenNotFound } from "./components/TokenList/TokenNotFound.js";
|
|
78
|
+
import { ListItemButton } from "./components/ListItem/ListItemButton.js";
|
|
79
|
+
import { VirtualizedTokenList } from "./components/TokenList/VirtualizedTokenList.js";
|
|
80
|
+
import { SearchTokenInput } from "./pages/SelectTokenPage/SearchTokenInput.js";
|
|
81
|
+
import { SentToWalletRow } from "./components/StepActions/SentToWalletRow.js";
|
|
82
|
+
import { ExternalLink } from "./components/StepActions/StepActionRow.style.js";
|
|
83
|
+
import { useExecutionRows } from "./components/StepActions/executionRows.js";
|
|
84
|
+
import { StepActionsList } from "./components/StepActions/StepActionsList.js";
|
|
85
|
+
import { useContactSupport } from "./hooks/useContactSupport.js";
|
|
86
|
+
import { ContactSupportButton } from "./pages/TransactionDetailsPage/ContactSupportButton.js";
|
|
87
|
+
import { ExchangeRateBottomSheet } from "./pages/TransactionPage/ExchangeRateBottomSheet.js";
|
|
88
|
+
import { RouteTracker } from "./pages/TransactionPage/RouteTracker.js";
|
|
89
|
+
import { ExecutionStatusCard } from "./components/ExecutionStatusCard/ExecutionStatusCard.js";
|
|
90
|
+
import { StatusIcon } from "./components/ExecutionStatusCard/StatusIcon.js";
|
|
91
|
+
import { useRouteExecutionMessage } from "./hooks/useRouteExecutionMessage.js";
|
|
92
|
+
import { ExecutionDoneCard } from "./pages/TransactionPage/ExecutionDoneCard.js";
|
|
93
|
+
import { TransactionDoneButtons } from "./pages/TransactionPage/TransactionDoneButtons.js";
|
|
94
|
+
import { useAddressActivity } from "./hooks/useAddressActivity.js";
|
|
95
|
+
import { ConfirmToAddressSheet } from "./pages/TransactionPage/ConfirmToAddressSheet.js";
|
|
96
|
+
import { StartTransactionButton } from "./pages/TransactionPage/StartTransactionButton.js";
|
|
97
|
+
import { calculateValueLossPercentage, getTokenValueLossThreshold } from "./pages/TransactionPage/utils.js";
|
|
98
|
+
import { TokenValueBottomSheet } from "./pages/TransactionPage/TokenValueBottomSheet.js";
|
|
99
|
+
import { I18nProvider } from "./providers/I18nProvider/I18nProvider.js";
|
|
100
|
+
import { QueryClientProvider } from "./providers/QueryClientProvider.js";
|
|
101
|
+
import { createTheme } from "./themes/createTheme.js";
|
|
102
|
+
import { WalletProvider } from "./providers/WalletProvider/WalletProvider.js";
|
|
103
|
+
import { StoreProvider } from "./stores/StoreProvider.js";
|
|
104
|
+
import { useTokenList } from "./hooks/useTokenList.js";
|
|
105
|
+
export { ActionRow, AddressType, AmountInputEndAdornment, AvatarBadgedDefault, BaseTransactionButton, BookmarkStoreProvider, ButtonTertiary, Card, CardIconButton, CardTitle, ChainAvatar, ChainSelect, ConfirmToAddressSheet, ContactSupportButton, ContractComponent, DateLabelContainer, DateLabelText, DetailInfoIcon, DetailLabel, DetailLabelContainer, DetailRow, DetailValue, ElementId, ExchangeRateBottomSheet, ExecutionDoneCard, ExecutionStatusCard, ExternalLink, FeeBreakdownTooltip, FormControl, FormKeyHelper, I18nProvider, IconCircle, IconTypography, Input, InputCard, InputPriceButton, ListItemButton, MainWarningMessages, PageContainer, PoweredBy, ProgressToNextUpdate, QueryClientProvider, RouteCard, RouteCardSkeleton, RouteDetails, RouteExecutionStatus, RouteNotFoundCard, RouteTokens, RouteTracker, SDKClientProvider, SearchInput, SearchTokenInput, SelectChainPage, SendToWalletButton, SentToWalletRow, SettingsStoreProvider, Stack, StartTransactionButton, StatusIcon, StepActionsList, StoreProvider, Token, TokenAvatar, TokenNotFound, TokenRate, TokenValueBottomSheet, TransactionDoneButtons, VirtualizedTokenList, WalletProvider, WarningMessages, WidgetEvent, WidgetProvider, buildRouteFromTxHistory, calculateValueLossPercentage, createElementId, createTheme, fitInputText, formatDuration, formatInputAmount, formatTokenAmount, formatTokenPrice, getAccumulatedFeeCostsBreakdown, getPriceImpact, getSourceTxHash, getTokenValueLossThreshold, hasEnumFlag, isRouteActive, isRouteDone, isRouteFailed, navigationRoutes, priceToTokenAmount, shortenAddress, usdDecimals, useAddressActivity, useAddressValidation, useAvailableChains, useChain, useChainOrderStore, useContactSupport, useDebouncedWatch, useExecutionRows, useExplorer, useFieldActions, useFieldValues, useHeader, useHeaderStore, useInputModeStore, useListHeight, useNavigateBack, useRouteExecution, useRouteExecutionMessage, useRouteExecutionStore, useRouteExecutionStoreContext, useRoutes, useSDKClient, useSetHeaderHeight, useSettingsStoreContext, useToAddressRequirements, useToken, useTokenAddressBalance, useTokenBalances, useTokenList, useTokenSelect, useTools, useWidgetConfig, useWidgetEvents };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WidgetConfigProps } from "../types/widget.js";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
//#region src/stores/StoreProvider.d.ts
|
|
4
|
+
declare const StoreProvider: React.FC<PropsWithChildren<WidgetConfigProps>>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { StoreProvider };
|
|
7
|
+
//# sourceMappingURL=StoreProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoreProvider.d.ts","names":[],"sources":["../../../src/stores/StoreProvider.tsx"],"mappings":";;;cAUa,eAAe,MAAM,GAAG,kBAAkB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./types.js";
|
|
2
|
+
import { PersistStoreProviderProps } from "../types.js";
|
|
3
|
+
//#region src/stores/bookmarks/BookmarkStore.d.ts
|
|
4
|
+
declare const BookmarkStoreProvider: React.FC<PersistStoreProviderProps>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { BookmarkStoreProvider };
|
|
7
|
+
//# sourceMappingURL=BookmarkStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BookmarkStore.d.ts","names":[],"sources":["../../../../src/stores/bookmarks/BookmarkStore.tsx"],"mappings":";;;cASa,uBAAuB,MAAM,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/stores/bookmarks/types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/stores/bookmarks/types.ts"],"mappings":";;;UAGiB,iBAAiB;EAChC;;UAGe;EACf,mBAAmB;EACnB,WAAW;EACX,eAAe;;UAGA;EACf,cAAc,oBAAoB;EAClC,cAAc,UAAU;EACxB,iBAAiB;EACjB,sBAAsB,WAAW;EACjC,2BAA2B;EAC3B,kBAAkB,UAAU;EAC5B,qBAAqB;;KAGX,gBAAgB,gBAAgB;KAEhC,gBAAgB,cAAc,SAAS"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "../types.js";
|
|
2
|
+
import { ChainOrderState } from "./types.js";
|
|
3
|
+
import { JSX } from "react";
|
|
4
|
+
//#region src/stores/chains/ChainOrderStore.d.ts
|
|
5
|
+
declare function useChainOrderStore<T>(selector: (state: ChainOrderState) => T): T;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { useChainOrderStore };
|
|
8
|
+
//# sourceMappingURL=ChainOrderStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChainOrderStore.d.ts","names":[],"sources":["../../../../src/stores/chains/ChainOrderStore.tsx"],"mappings":";;;;iBA+JgB,mBAAmB,GACjC,WAAW,OAAO,oBAAoB,IACrC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FormType } from "../form/types.js";
|
|
2
|
+
//#region src/stores/chains/types.d.ts
|
|
3
|
+
interface ChainOrderProps {
|
|
4
|
+
chainOrder: {
|
|
5
|
+
from: number[];
|
|
6
|
+
to: number[];
|
|
7
|
+
};
|
|
8
|
+
availableChains: {
|
|
9
|
+
from: number[];
|
|
10
|
+
to: number[];
|
|
11
|
+
};
|
|
12
|
+
fromShowAllNetworks: boolean;
|
|
13
|
+
toShowAllNetworks: boolean;
|
|
14
|
+
fromIsAllNetworks: boolean;
|
|
15
|
+
toIsAllNetworks: boolean;
|
|
16
|
+
pinnedChains: number[];
|
|
17
|
+
}
|
|
18
|
+
interface ChainOrderState extends ChainOrderProps {
|
|
19
|
+
initializeChains(chainIds: number[], type: FormType): number[];
|
|
20
|
+
setChain(chainId: number, type: FormType): void;
|
|
21
|
+
setIsAllNetworks(isAllNetworks: boolean, formType: FormType): void;
|
|
22
|
+
setShowAllNetworks(showAllNetworks: boolean, formType: FormType): void;
|
|
23
|
+
setPinnedChain(chainId: number): void;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { ChainOrderState };
|
|
27
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/stores/chains/types.ts"],"mappings":";;UAEU;EACR;IACE;IACA;;EAEF;IACE;IACA;;EAEF;EACA;EACA;EACA;EACA;;UAGe,wBAAwB;EACvC,iBAAiB,oBAAoB,MAAM;EAC3C,SAAS,iBAAiB,MAAM;EAChC,iBAAiB,wBAAwB,UAAU;EACnD,mBAAmB,0BAA0B,UAAU;EACvD,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFormStore.js","names":[],"sources":["../../../../src/stores/form/createFormStore.ts"],"sourcesContent":["import type { StoreApi, UseBoundStore } from 'zustand'\nimport { create } from 'zustand'\nimport { DEFAULT_VALID_UNTIL_SECONDS } from '../../utils/limitOrder.js'\nimport type {\n DefaultValues,\n FormFieldArray,\n FormFieldNames,\n FormValueControl,\n FormValues,\n FormValuesState,\n} from './types.js'\n\nexport const formDefaultValues: DefaultValues = {\n fromAmount: '',\n toAmount: '',\n tokenSearchFilter: '',\n priceInverted: false,\n validUntil: DEFAULT_VALID_UNTIL_SECONDS,\n partiallyFillable: true,\n}\n\nconst defaultValueToFormValue = <T>(value: T): FormValueControl<T> => ({\n isTouched: false,\n isDirty: false,\n value,\n})\n\nconst valuesToFormValues = (defaultValues: DefaultValues): FormValues => {\n return (Object.keys(defaultValues) as FormFieldNames[]).reduce(\n (accum, key) => {\n accum[key] = defaultValueToFormValue(defaultValues[key]) as never\n return accum\n },\n {} as FormValues\n )\n}\n\nconst isString = (str: unknown): str is string =>\n typeof str === 'string' || str instanceof String\n\nconst getUpdatedTouchedFields = (userValues: FormValues) => {\n return (Object.keys(userValues) as FormFieldNames[]).reduce(\n (accum, key) => {\n if (userValues[key]?.isTouched) {\n accum[key] = true\n }\n return accum\n },\n {} as Record<FormFieldNames, boolean>\n )\n}\n\nconst mergeDefaultFormValues = (\n userValues: FormValues,\n defaultValues: FormValues\n) =>\n (Object.keys(defaultValues) as FormFieldNames[]).reduce<FormValues>(\n (accum, key) => {\n const formValue = {\n isTouched: !!(\n userValues[key]?.isTouched || defaultValues[key]?.isTouched\n ),\n isDirty: !!(userValues[key]?.isDirty || defaultValues[key]?.isTouched),\n value:\n userValues[key]?.value !== undefined && userValues[key]?.value !== ''\n ? userValues[key]?.value\n : defaultValues[key]?.value,\n }\n accum[key] = formValue as never\n return accum\n },\n { ...valuesToFormValues(formDefaultValues) }\n )\n\nexport const createFormStore = (\n defaultValues?: DefaultValues\n): UseBoundStore<StoreApi<FormValuesState>> =>\n create<FormValuesState>((set, get) => {\n const _defaultValues = valuesToFormValues({\n ...formDefaultValues,\n ...defaultValues,\n })\n return {\n defaultValues: _defaultValues,\n userValues: _defaultValues,\n touchedFields: {},\n isValid: true,\n isValidating: false,\n errors: {},\n validation: {},\n setDefaultValues: (defaultValue) => {\n const defaultFormValues = valuesToFormValues(defaultValue)\n set((state) => ({\n defaultValues: defaultFormValues,\n userValues: mergeDefaultFormValues(\n state.userValues,\n defaultFormValues\n ),\n }))\n },\n setUserAndDefaultValues: (formValues) => {\n const currentUserValues = get().userValues\n ;(Object.keys(formValues) as FormFieldNames[]).forEach((key) => {\n if (formValues[key] !== currentUserValues[key]?.value) {\n get().resetField(key, { defaultValue: formValues[key] })\n get().setFieldValue(key, formValues[key], { isTouched: true })\n }\n })\n },\n isTouched: (fieldName: FormFieldNames) =>\n !!get().userValues[fieldName]?.isTouched,\n isDirty: (fieldName: FormFieldNames) =>\n !!get().userValues[fieldName]?.isDirty,\n setAsTouched: (fieldName: FormFieldNames) => {\n const userValues = {\n ...get().userValues,\n [fieldName]: {\n ...get().userValues[fieldName],\n isTouched: true,\n },\n }\n\n const touchedFields = getUpdatedTouchedFields(userValues)\n\n set(() => ({\n userValues,\n touchedFields,\n }))\n },\n resetField: (fieldName, { defaultValue } = {}) => {\n if (defaultValue) {\n const fieldValues = {\n ...get().defaultValues[fieldName],\n value: defaultValue,\n }\n const defaultValues = {\n ...get().defaultValues,\n [fieldName]: { ...fieldValues },\n }\n const userValues = {\n ...get().userValues,\n [fieldName]: { ...fieldValues },\n }\n const touchedFields = getUpdatedTouchedFields(userValues)\n\n set(() => {\n return {\n defaultValues,\n userValues,\n touchedFields,\n }\n })\n } else {\n const userValues = {\n ...get().userValues,\n [fieldName]: { ...get().defaultValues[fieldName] },\n }\n const touchedFields = getUpdatedTouchedFields(userValues)\n\n set(() => ({\n userValues,\n touchedFields,\n }))\n }\n },\n setFieldValue: (fieldName, value, { isDirty, isTouched } = {}) => {\n const userValues = {\n ...get().userValues,\n [fieldName]: {\n value,\n isDirty:\n isDirty === undefined\n ? get().userValues[fieldName]?.isDirty\n : isDirty,\n isTouched:\n isTouched === undefined\n ? get().userValues[fieldName]?.isTouched\n : isTouched,\n },\n }\n\n const touchedFields = getUpdatedTouchedFields(userValues)\n\n set(() => ({\n userValues,\n touchedFields,\n }))\n },\n getFieldValues: <T extends FormFieldNames[]>(...names: T) =>\n names.map((name) => get().userValues[name]?.value) as FormFieldArray<T>,\n addFieldValidation: (name, validationFn) => {\n set((state) => ({\n validation: {\n ...state.validation,\n [name]: validationFn,\n },\n }))\n },\n triggerFieldValidation: async (name) => {\n try {\n let valid = true\n set(() => ({ isValid: false, isValidating: true }))\n\n const validationFn = get().validation[name]\n\n if (validationFn) {\n const result = await validationFn(get().userValues?.[name]?.value)\n if (isString(result)) {\n valid = false\n set((state) => ({\n errors: {\n ...state.errors,\n [name]: result,\n },\n }))\n } else {\n valid = result as boolean\n if (valid) {\n get().clearErrors(name)\n }\n }\n }\n\n set(() => ({ isValid: valid, isValidating: false }))\n return valid\n } catch (err) {\n set(() => ({ isValidating: false }))\n throw err\n }\n },\n clearErrors: (name) => {\n const newErrors = { ...get().errors }\n\n delete newErrors[name]\n\n set(() => ({\n errors: newErrors,\n }))\n },\n }\n })\n"],"mappings":";;;AAYA,MAAa,oBAAmC;CAC9C,YAAY;CACZ,UAAU;CACV,mBAAmB;CACnB,eAAe;CACf,YAAY;CACZ,mBAAmB;AACrB;AAEA,MAAM,2BAA8B,WAAmC;CACrE,WAAW;CACX,SAAS;CACT;AACF;AAEA,MAAM,sBAAsB,kBAA6C;CACvE,OAAQ,OAAO,KAAK,aAAa,CAAC,CAAsB,QACrD,OAAO,QAAQ;EACd,MAAM,OAAO,wBAAwB,cAAc,IAAI;EACvD,OAAO;CACT,GACA,CAAC,CACH;AACF;AAEA,MAAM,YAAY,QAChB,OAAO,QAAQ,YAAY,eAAe;AAE5C,MAAM,2BAA2B,eAA2B;CAC1D,OAAQ,OAAO,KAAK,UAAU,CAAC,CAAsB,QAClD,OAAO,QAAQ;EACd,IAAI,WAAW,IAAI,EAAE,WACnB,MAAM,OAAO;EAEf,OAAO;CACT,GACA,CAAC,CACH;AACF;AAEA,MAAM,0BACJ,YACA,kBAEC,OAAO,KAAK,aAAa,CAAC,CAAsB,QAC9C,OAAO,QAAQ;CAWd,MAAM,OAAO;EATX,WAAW,CAAC,EACV,WAAW,IAAI,EAAE,aAAa,cAAc,IAAI,EAAE;EAEpD,SAAS,CAAC,EAAE,WAAW,IAAI,EAAE,WAAW,cAAc,IAAI,EAAE;EAC5D,OACE,WAAW,IAAI,EAAE,UAAU,KAAA,KAAa,WAAW,IAAI,EAAE,UAAU,KAC/D,WAAW,IAAI,EAAE,QACjB,cAAc,IAAI,EAAE;CAEP;CACrB,OAAO;AACT,GACA,EAAE,GAAG,mBAAmB,iBAAiB,EAAE,CAC7C;AAEF,MAAa,mBACX,kBAEA,QAAyB,KAAK,QAAQ;CACpC,MAAM,iBAAiB,mBAAmB;EACxC,GAAG;EACH,GAAG;CACL,CAAC;CACD,OAAO;EACL,eAA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O,cAAc;IAAM,EAAE;IACnD,OAAO;GACT,SAAS,KAAK;IACZ,WAAW,EAAE,cAAc,MAAM,EAAE;IACnC,MAAM;GACR;EACF;EACA,cAAc,SAAS;GACrB,MAAM,YAAY,EAAE,GAAG,IAAI,CAAC,CAAC,OAAO;GAEpC,OAAO,UAAU;GAEjB,WAAW,EACT,QAAQ,UACV,EAAE;EACJ;CACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"createFormStore.js","names":[],"sources":["../../../../src/stores/form/createFormStore.ts"],"sourcesContent":["import type { StoreApi, UseBoundStore } from 'zustand'\nimport { create } from 'zustand'\nimport { DEFAULT_VALID_UNTIL_SECONDS } from '../../utils/limitOrder.js'\nimport type {\n DefaultValues,\n FormFieldArray,\n FormFieldNames,\n FormValueControl,\n FormValues,\n FormValuesState,\n} from './types.js'\n\nexport const formDefaultValues: DefaultValues = {\n fromAmount: '',\n toAmount: '',\n cashFiatAmount: '',\n tokenSearchFilter: '',\n priceInverted: false,\n validUntil: DEFAULT_VALID_UNTIL_SECONDS,\n partiallyFillable: true,\n}\n\nconst defaultValueToFormValue = <T>(value: T): FormValueControl<T> => ({\n isTouched: false,\n isDirty: false,\n value,\n})\n\nconst valuesToFormValues = (defaultValues: DefaultValues): FormValues => {\n return (Object.keys(defaultValues) as FormFieldNames[]).reduce(\n (accum, key) => {\n accum[key] = defaultValueToFormValue(defaultValues[key]) as never\n return accum\n },\n {} as FormValues\n )\n}\n\nconst isString = (str: unknown): str is string =>\n typeof str === 'string' || str instanceof String\n\nconst getUpdatedTouchedFields = (userValues: FormValues) => {\n return (Object.keys(userValues) as FormFieldNames[]).reduce(\n (accum, key) => {\n if (userValues[key]?.isTouched) {\n accum[key] = true\n }\n return accum\n },\n {} as Record<FormFieldNames, boolean>\n )\n}\n\nconst mergeDefaultFormValues = (\n userValues: FormValues,\n defaultValues: FormValues\n) =>\n (Object.keys(defaultValues) as FormFieldNames[]).reduce<FormValues>(\n (accum, key) => {\n const formValue = {\n isTouched: !!(\n userValues[key]?.isTouched || defaultValues[key]?.isTouched\n ),\n isDirty: !!(userValues[key]?.isDirty || defaultValues[key]?.isTouched),\n value:\n userValues[key]?.value !== undefined && userValues[key]?.value !== ''\n ? userValues[key]?.value\n : defaultValues[key]?.value,\n }\n accum[key] = formValue as never\n return accum\n },\n { ...valuesToFormValues(formDefaultValues) }\n )\n\nexport const createFormStore = (\n defaultValues?: DefaultValues\n): UseBoundStore<StoreApi<FormValuesState>> =>\n create<FormValuesState>((set, get) => {\n const _defaultValues = valuesToFormValues({\n ...formDefaultValues,\n ...defaultValues,\n })\n return {\n defaultValues: _defaultValues,\n userValues: _defaultValues,\n touchedFields: {},\n isValid: true,\n isValidating: false,\n errors: {},\n validation: {},\n setDefaultValues: (defaultValue) => {\n const defaultFormValues = valuesToFormValues(defaultValue)\n set((state) => ({\n defaultValues: defaultFormValues,\n userValues: mergeDefaultFormValues(\n state.userValues,\n defaultFormValues\n ),\n }))\n },\n setUserAndDefaultValues: (formValues) => {\n const currentUserValues = get().userValues\n ;(Object.keys(formValues) as FormFieldNames[]).forEach((key) => {\n if (formValues[key] !== currentUserValues[key]?.value) {\n get().resetField(key, { defaultValue: formValues[key] })\n get().setFieldValue(key, formValues[key], { isTouched: true })\n }\n })\n },\n isTouched: (fieldName: FormFieldNames) =>\n !!get().userValues[fieldName]?.isTouched,\n isDirty: (fieldName: FormFieldNames) =>\n !!get().userValues[fieldName]?.isDirty,\n setAsTouched: (fieldName: FormFieldNames) => {\n const userValues = {\n ...get().userValues,\n [fieldName]: {\n ...get().userValues[fieldName],\n isTouched: true,\n },\n }\n\n const touchedFields = getUpdatedTouchedFields(userValues)\n\n set(() => ({\n userValues,\n touchedFields,\n }))\n },\n resetField: (fieldName, { defaultValue } = {}) => {\n if (defaultValue) {\n const fieldValues = {\n ...get().defaultValues[fieldName],\n value: defaultValue,\n }\n const defaultValues = {\n ...get().defaultValues,\n [fieldName]: { ...fieldValues },\n }\n const userValues = {\n ...get().userValues,\n [fieldName]: { ...fieldValues },\n }\n const touchedFields = getUpdatedTouchedFields(userValues)\n\n set(() => {\n return {\n defaultValues,\n userValues,\n touchedFields,\n }\n })\n } else {\n const userValues = {\n ...get().userValues,\n [fieldName]: { ...get().defaultValues[fieldName] },\n }\n const touchedFields = getUpdatedTouchedFields(userValues)\n\n set(() => ({\n userValues,\n touchedFields,\n }))\n }\n },\n setFieldValue: (fieldName, value, { isDirty, isTouched } = {}) => {\n const userValues = {\n ...get().userValues,\n [fieldName]: {\n value,\n isDirty:\n isDirty === undefined\n ? get().userValues[fieldName]?.isDirty\n : isDirty,\n isTouched:\n isTouched === undefined\n ? get().userValues[fieldName]?.isTouched\n : isTouched,\n },\n }\n\n const touchedFields = getUpdatedTouchedFields(userValues)\n\n set(() => ({\n userValues,\n touchedFields,\n }))\n },\n getFieldValues: <T extends FormFieldNames[]>(...names: T) =>\n names.map((name) => get().userValues[name]?.value) as FormFieldArray<T>,\n addFieldValidation: (name, validationFn) => {\n set((state) => ({\n validation: {\n ...state.validation,\n [name]: validationFn,\n },\n }))\n },\n triggerFieldValidation: async (name) => {\n try {\n let valid = true\n set(() => ({ isValid: false, isValidating: true }))\n\n const validationFn = get().validation[name]\n\n if (validationFn) {\n const result = await validationFn(get().userValues?.[name]?.value)\n if (isString(result)) {\n valid = false\n set((state) => ({\n errors: {\n ...state.errors,\n [name]: result,\n },\n }))\n } else {\n valid = result as boolean\n if (valid) {\n get().clearErrors(name)\n }\n }\n }\n\n set(() => ({ isValid: valid, isValidating: false }))\n return valid\n } catch (err) {\n set(() => ({ isValidating: false }))\n throw err\n }\n },\n clearErrors: (name) => {\n const newErrors = { ...get().errors }\n\n delete newErrors[name]\n\n set(() => ({\n errors: newErrors,\n }))\n },\n }\n })\n"],"mappings":";;;AAYA,MAAa,oBAAmC;CAC9C,YAAY;CACZ,UAAU;CACV,gBAAgB;CAChB,mBAAmB;CACnB,eAAe;CACf,YAAY;CACZ,mBAAmB;AACrB;AAEA,MAAM,2BAA8B,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F,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ContractCall } from "@lifi/sdk";
|
|
2
2
|
import { StoreApi, UseBoundStore } from "zustand";
|
|
3
|
-
|
|
4
3
|
//#region src/stores/form/types.d.ts
|
|
5
4
|
interface DefaultFieldValues {
|
|
6
5
|
fromChain?: number;
|
|
@@ -12,6 +11,7 @@ interface DefaultFieldValues {
|
|
|
12
11
|
toAmount: string;
|
|
13
12
|
}
|
|
14
13
|
interface DefaultValues extends DefaultFieldValues {
|
|
14
|
+
cashFiatAmount: string;
|
|
15
15
|
contractCalls?: ContractCall[];
|
|
16
16
|
tokenSearchFilter: string;
|
|
17
17
|
/** Limit-order: when true, the price is displayed/entered inverted. */
|
|
@@ -29,17 +29,17 @@ interface FormValueControl<T> {
|
|
|
29
29
|
isDirty: boolean;
|
|
30
30
|
value: T;
|
|
31
31
|
}
|
|
32
|
-
type FormValues = { [Property in keyof DefaultValues]: FormValueControl<DefaultValues[Property]
|
|
32
|
+
type FormValues = { [Property in keyof DefaultValues]: FormValueControl<DefaultValues[Property]>; };
|
|
33
33
|
type FormFieldNames = keyof FormValues;
|
|
34
34
|
type ExtractValueType<T> = T extends FormValueControl<infer U> ? U : never;
|
|
35
|
-
type FormFieldArray<T extends FormFieldNames[]> = { [K in keyof T]: ExtractValueType<FormValues[T[K]]
|
|
36
|
-
type TouchedFields = { [K in FormFieldNames]?: boolean };
|
|
35
|
+
type FormFieldArray<T extends FormFieldNames[]> = { [K in keyof T]: ExtractValueType<FormValues[T[K]]>; };
|
|
36
|
+
type TouchedFields = { [K in FormFieldNames]?: boolean; };
|
|
37
37
|
type ValidationFn = (value: any) => Promise<boolean | string>;
|
|
38
38
|
interface ValidationProps {
|
|
39
39
|
isValid: boolean;
|
|
40
40
|
isValidating: boolean;
|
|
41
|
-
errors: { [K in FormFieldNames]?: string };
|
|
42
|
-
validation: { [K in FormFieldNames]?: ValidationFn };
|
|
41
|
+
errors: { [K in FormFieldNames]?: string; };
|
|
42
|
+
validation: { [K in FormFieldNames]?: ValidationFn; };
|
|
43
43
|
}
|
|
44
44
|
interface ValidationActions {
|
|
45
45
|
addFieldValidation: (name: FormFieldNames, validationFn: ValidationFn) => void;
|
|
@@ -49,7 +49,7 @@ interface ValidationActions {
|
|
|
49
49
|
interface FormProps {
|
|
50
50
|
defaultValues: FormValues;
|
|
51
51
|
userValues: FormValues;
|
|
52
|
-
touchedFields: { [K in FormFieldNames]?: boolean };
|
|
52
|
+
touchedFields: { [K in FormFieldNames]?: boolean; };
|
|
53
53
|
}
|
|
54
54
|
interface ResetOptions {
|
|
55
55
|
defaultValue?: GenericFormValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/stores/form/types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/stores/form/types.ts"],"mappings":";;;UAGiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe,sBAAsB;EACrC;EACA,gBAAgB;EAChB;;EAEA;;EAEA;;EAEA;;EAEA;;KAGU,+CAIR;UAEa,iBAAiB;EAChC;EACA;EACA,OAAO;;KAGG,gBACT,kBAAkB,gBAAgB,iBAAiB,cAAc;KAGxD,uBAAuB;KACvB,iBAAiB,KAC3B,UAAU,uBAAuB,KAAK;KAC5B,eAAe,UAAU,uBAClC,WAAW,IAAI,iBAAiB,WAAW,EAAE;KAGpC,mBAAmB,KAAK;KAE/B,gBAAgB,eAAe;UACnB;EACf;EACA;EACA,WACG,KAAK;EAER,eACG,KAAK,kBAAkB;;UAIX;EACf,qBAAqB,MAAM,gBAAgB,cAAc;EACzD,yBAAyB,MAAM,mBAAmB;EAClD,cAAc,MAAM;;UAGL;EACf,eAAe;EACf,YAAY;EACZ,kBAAkB,KAAK;;UAGR;EACf,eAAe;;UAGA;EACf,mBAAmB,YAAY;EAC/B,0BAA0B,YAAY,QAAQ;EAC9C,YAAY,WAAW;EACvB,UAAU,WAAW;EACrB,eAAe,WAAW;EAC1B,aAAa,WAAW,gBAAgB,eAAe;EACvD,gBACE,WAAW,gBACX,OAAO,kBACP,UAAU;EAEZ,iBAAiB,UAAU,qBAAqB,OAAO,MAAM,eAAe;;KAGlE,kBAAkB,YAC5B,cACA,kBACA;KAEU,iBAAiB,cAAc,SAAS;UAEnC;EACf;EACA;;KAGU;UAEK;EACf,UAAU;;cAGC;EACX,cAAc,UAAU;EAExB,cAAc,UAAU;EAExB,eAAe,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/stores/form/types.ts"],"sourcesContent":["import type { ContractCall } from '@lifi/sdk'\nimport type { StoreApi, UseBoundStore } from 'zustand'\n\nexport interface DefaultFieldValues {\n fromChain?: number\n fromToken?: string\n toChain?: number\n toToken?: string\n toAddress?: string\n fromAmount: string\n toAmount: string\n}\n\nexport interface DefaultValues extends DefaultFieldValues {\n contractCalls?: ContractCall[]\n tokenSearchFilter: string\n /** Limit-order: when true, the price is displayed/entered inverted. */\n priceInverted: boolean\n /** Limit-order: order validity as a duration in seconds. */\n validUntil: number\n /** Limit-order: whether the order may be partially filled. */\n partiallyFillable: boolean\n /** Limit-order: id of the route the user picked. */\n selectedRouteId?: string\n}\n\nexport type GenericFormValue =\n | string\n | number\n | boolean\n | ContractCall[]\n | undefined\nexport interface FormValueControl<T> {\n isTouched: boolean\n isDirty: boolean\n value: T\n}\n\nexport type FormValues = {\n [Property in keyof DefaultValues]: FormValueControl<DefaultValues[Property]>\n}\n\nexport type FormFieldNames = keyof FormValues\nexport type ExtractValueType<T> =\n T extends FormValueControl<infer U> ? U : never\nexport type FormFieldArray<T extends FormFieldNames[]> = {\n [K in keyof T]: ExtractValueType<FormValues[T[K]]>\n}\n\nexport type TouchedFields = { [K in FormFieldNames]?: boolean }\n\ntype ValidationFn = (value: any) => Promise<boolean | string>\nexport interface ValidationProps {\n isValid: boolean\n isValidating: boolean\n errors: {\n [K in FormFieldNames]?: string\n }\n validation: {\n [K in FormFieldNames]?: ValidationFn\n }\n}\n\nexport interface ValidationActions {\n addFieldValidation: (name: FormFieldNames, validationFn: ValidationFn) => void\n triggerFieldValidation: (name: FormFieldNames) => Promise<boolean>\n clearErrors: (name: FormFieldNames) => void\n}\n\nexport interface FormProps {\n defaultValues: FormValues\n userValues: FormValues\n touchedFields: { [K in FormFieldNames]?: boolean }\n}\n\nexport interface ResetOptions {\n defaultValue?: GenericFormValue\n}\n\nexport interface FormActions {\n setDefaultValues: (formValues: DefaultValues) => void\n setUserAndDefaultValues: (formValues: Partial<DefaultValues>) => void\n isTouched: (fieldName: FormFieldNames) => boolean\n isDirty: (fieldName: FormFieldNames) => boolean\n setAsTouched: (fieldName: FormFieldNames) => void\n resetField: (fieldName: FormFieldNames, resetOptions?: ResetOptions) => void\n setFieldValue: (\n fieldName: FormFieldNames,\n value: GenericFormValue,\n options?: SetOptions\n ) => void\n getFieldValues: <T extends FormFieldNames[]>(...names: T) => FormFieldArray<T>\n}\n\nexport type FormValuesState = FormProps &\n FormActions &\n ValidationProps &\n ValidationActions\n\nexport type FormStoreStore = UseBoundStore<StoreApi<FormValuesState>>\n\nexport interface SetOptions {\n isDirty?: boolean\n isTouched?: boolean\n}\n\nexport type FormType = 'from' | 'to'\n\nexport interface FormTypeProps {\n formType: FormType\n}\n\nexport const FormKeyHelper = {\n getChainKey: (formType: FormType): 'fromChain' | 'toChain' =>\n `${formType}Chain`,\n getTokenKey: (formType: FormType): 'fromToken' | 'toToken' =>\n `${formType}Token`,\n getAmountKey: (formType: FormType): 'fromAmount' | 'toAmount' =>\n `${formType}Amount`,\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/stores/form/types.ts"],"sourcesContent":["import type { ContractCall } from '@lifi/sdk'\nimport type { StoreApi, UseBoundStore } from 'zustand'\n\nexport interface DefaultFieldValues {\n fromChain?: number\n fromToken?: string\n toChain?: number\n toToken?: string\n toAddress?: string\n fromAmount: string\n toAmount: string\n}\n\nexport interface DefaultValues extends DefaultFieldValues {\n cashFiatAmount: string\n contractCalls?: ContractCall[]\n tokenSearchFilter: string\n /** Limit-order: when true, the price is displayed/entered inverted. */\n priceInverted: boolean\n /** Limit-order: order validity as a duration in seconds. */\n validUntil: number\n /** Limit-order: whether the order may be partially filled. */\n partiallyFillable: boolean\n /** Limit-order: id of the route the user picked. */\n selectedRouteId?: string\n}\n\nexport type GenericFormValue =\n | string\n | number\n | boolean\n | ContractCall[]\n | undefined\nexport interface FormValueControl<T> {\n isTouched: boolean\n isDirty: boolean\n value: T\n}\n\nexport type FormValues = {\n [Property in keyof DefaultValues]: FormValueControl<DefaultValues[Property]>\n}\n\nexport type FormFieldNames = keyof FormValues\nexport type ExtractValueType<T> =\n T extends FormValueControl<infer U> ? U : never\nexport type FormFieldArray<T extends FormFieldNames[]> = {\n [K in keyof T]: ExtractValueType<FormValues[T[K]]>\n}\n\nexport type TouchedFields = { [K in FormFieldNames]?: boolean }\n\ntype ValidationFn = (value: any) => Promise<boolean | string>\nexport interface ValidationProps {\n isValid: boolean\n isValidating: boolean\n errors: {\n [K in FormFieldNames]?: string\n }\n validation: {\n [K in FormFieldNames]?: ValidationFn\n }\n}\n\nexport interface ValidationActions {\n addFieldValidation: (name: FormFieldNames, validationFn: ValidationFn) => void\n triggerFieldValidation: (name: FormFieldNames) => Promise<boolean>\n clearErrors: (name: FormFieldNames) => void\n}\n\nexport interface FormProps {\n defaultValues: FormValues\n userValues: FormValues\n touchedFields: { [K in FormFieldNames]?: boolean }\n}\n\nexport interface ResetOptions {\n defaultValue?: GenericFormValue\n}\n\nexport interface FormActions {\n setDefaultValues: (formValues: DefaultValues) => void\n setUserAndDefaultValues: (formValues: Partial<DefaultValues>) => void\n isTouched: (fieldName: FormFieldNames) => boolean\n isDirty: (fieldName: FormFieldNames) => boolean\n setAsTouched: (fieldName: FormFieldNames) => void\n resetField: (fieldName: FormFieldNames, resetOptions?: ResetOptions) => void\n setFieldValue: (\n fieldName: FormFieldNames,\n value: GenericFormValue,\n options?: SetOptions\n ) => void\n getFieldValues: <T extends FormFieldNames[]>(...names: T) => FormFieldArray<T>\n}\n\nexport type FormValuesState = FormProps &\n FormActions &\n ValidationProps &\n ValidationActions\n\nexport type FormStoreStore = UseBoundStore<StoreApi<FormValuesState>>\n\nexport interface SetOptions {\n isDirty?: boolean\n isTouched?: boolean\n}\n\nexport type FormType = 'from' | 'to'\n\nexport interface FormTypeProps {\n formType: FormType\n}\n\nexport const FormKeyHelper = {\n getChainKey: (formType: FormType): 'fromChain' | 'toChain' =>\n `${formType}Chain`,\n getTokenKey: (formType: FormType): 'fromToken' | 'toToken' =>\n `${formType}Token`,\n getAmountKey: (formType: FormType): 'fromAmount' | 'toAmount' =>\n `${formType}Amount`,\n}\n"],"mappings":";AAiHA,MAAa,gBAAgB;CAC3B,cAAc,aACZ,GAAG,SAAS;CACd,cAAc,aACZ,GAAG,SAAS;CACd,eAAe,aACb,GAAG,SAAS;AAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldActions.d.ts","names":[],"sources":["../../../../src/stores/form/useFieldActions.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFieldActions.d.ts","names":[],"sources":["../../../../src/stores/form/useFieldActions.ts"],"mappings":";;cAaa,uBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldValues.d.ts","names":[],"sources":["../../../../src/stores/form/useFieldValues.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFieldValues.d.ts","names":[],"sources":["../../../../src/stores/form/useFieldValues.ts"],"mappings":";;cAIa,iBAAkB,UAAU,qBACpC,OAAO,MACT,eAAe"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StoreApi, UseBoundStore } from "zustand";
|
|
2
|
+
//#region src/stores/header/types.d.ts
|
|
3
|
+
interface HeaderStateBase {
|
|
4
|
+
element?: React.ReactNode | null;
|
|
5
|
+
title?: string;
|
|
6
|
+
headerHeight: number;
|
|
7
|
+
backAction?: () => void;
|
|
8
|
+
}
|
|
9
|
+
interface HeaderState extends HeaderStateBase {
|
|
10
|
+
setAction(element?: React.ReactNode | null): () => void;
|
|
11
|
+
setTitle(title?: string): () => void;
|
|
12
|
+
removeAction(): void;
|
|
13
|
+
removeTitle(): void;
|
|
14
|
+
setHeaderHeight(headerHeight: number): void;
|
|
15
|
+
setBackAction(action: () => void): void;
|
|
16
|
+
executeBackAction(): void;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { HeaderState };
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/stores/header/types.ts"],"mappings":";;UAIU;EACR,UAAU,MAAM;EAChB;EACA;EACA;;UAGe,oBAAoB;EACnC,UAAU,UAAU,MAAM;EAC1B,SAAS;EACT;EACA;EACA,gBAAgB;EAChB,cAAc;EACd"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "../types.js";
|
|
2
|
+
import { HeaderState } from "./types.js";
|
|
3
|
+
//#region src/stores/header/useHeaderStore.d.ts
|
|
4
|
+
declare function useHeaderStore<T>(selector: (state: HeaderState) => T): T;
|
|
5
|
+
declare function useSetHeaderHeight(): any;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { useHeaderStore, useSetHeaderHeight };
|
|
8
|
+
//# sourceMappingURL=useHeaderStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHeaderStore.d.ts","names":[],"sources":["../../../../src/stores/header/useHeaderStore.tsx"],"mappings":";;;iBA8BgB,eAAe,GAAG,WAAW,OAAO,gBAAgB,IAAI;iBAkBxD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FormTypeProps } from "../form/types.js";
|
|
2
|
+
import { StoreApi, UseBoundStore } from "zustand";
|
|
3
|
+
//#region src/stores/inputMode/useInputModeStore.d.ts
|
|
4
|
+
type InputMode = "amount" | "price";
|
|
5
|
+
interface InputModeState {
|
|
6
|
+
inputMode: Record<"from" | "to", InputMode>;
|
|
7
|
+
setInputMode: (formType: FormTypeProps["formType"], mode: InputMode) => void;
|
|
8
|
+
toggleInputMode: (formType: FormTypeProps["formType"]) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const useInputModeStore: UseBoundStore<StoreApi<InputModeState>>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { useInputModeStore };
|
|
13
|
+
//# sourceMappingURL=useInputModeStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInputModeStore.d.ts","names":[],"sources":["../../../../src/stores/inputMode/useInputModeStore.ts"],"mappings":";;;KAIK;UAEK;EACR,WAAW,sBAAsB;EACjC,eAAe,UAAU,2BAA2B,MAAM;EAC1D,kBAAkB,UAAU;;cAGjB,mBAAmB,cAAc,SAAS"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RouteExecutionState } from "./types.js";
|
|
2
|
+
import "../types.js";
|
|
3
|
+
import { JSX } from "react";
|
|
4
|
+
//#region src/stores/routes/RouteExecutionStore.d.ts
|
|
5
|
+
declare function useRouteExecutionStoreContext(): any;
|
|
6
|
+
declare function useRouteExecutionStore<T>(selector: (state: RouteExecutionState) => T): T;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { useRouteExecutionStore, useRouteExecutionStoreContext };
|
|
9
|
+
//# sourceMappingURL=RouteExecutionStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteExecutionStore.d.ts","names":[],"sources":["../../../../src/stores/routes/RouteExecutionStore.tsx"],"mappings":";;;;iBA4BgB;iBAUA,uBAAuB,GACrC,WAAW,OAAO,wBAAwB,IACzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRouteExecutionStore.js","names":[],"sources":["../../../../src/stores/routes/createRouteExecutionStore.ts"],"sourcesContent":["import type { Route, RouteExtended } from '@lifi/sdk'\nimport type { StoreApi, UseBoundStore } from 'zustand'\nimport { create } from 'zustand'\nimport { persist } from 'zustand/middleware'\nimport { hasEnumFlag } from '../../utils/enum.js'\nimport type { PersistStoreProps } from '../types.js'\nimport type { RouteExecution, RouteExecutionState } from './types.js'\nimport { RouteExecutionStatus } from './types.js'\nimport {\n isRouteDone,\n isRouteFailed,\n isRoutePartiallyDone,\n isRouteRefunded,\n} from './utils.js'\n\nexport const createRouteExecutionStore = ({\n namePrefix,\n}: PersistStoreProps): UseBoundStore<StoreApi<RouteExecutionState>> =>\n create<RouteExecutionState>()(\n persist(\n (set, get) => ({\n routes: {},\n setExecutableRoute: (route: Route, observableRouteIds?: string[]) => {\n if (!get().routes[route.id]) {\n set((state: RouteExecutionState) => {\n const routes = { ...state.routes }\n // clean previous idle routes\n Object.keys(routes)\n .filter(\n (routeId) =>\n !observableRouteIds?.includes(routeId) &&\n hasEnumFlag(\n routes[routeId]!.status,\n RouteExecutionStatus.Idle\n )\n )\n .forEach((routeId) => {\n delete routes[routeId]\n })\n routes[route.id] = {\n route,\n status: RouteExecutionStatus.Idle,\n }\n return {\n routes,\n }\n })\n }\n },\n updateRoute: (route: RouteExtended) => {\n if (get().routes[route.id]) {\n set((state: RouteExecutionState) => {\n const updatedState = {\n routes: {\n ...state.routes,\n [route.id]: { ...state.routes[route.id]!, route },\n },\n }\n const isFailed = isRouteFailed(route)\n if (isFailed) {\n updatedState.routes[route.id]!.status =\n RouteExecutionStatus.Failed\n return updatedState\n }\n const isDone = isRouteDone(route)\n if (isDone) {\n updatedState.routes[route.id]!.status =\n RouteExecutionStatus.Done\n if (isRoutePartiallyDone(route)) {\n updatedState.routes[route.id]!.status |=\n RouteExecutionStatus.Partial\n } else if (isRouteRefunded(route)) {\n updatedState.routes[route.id]!.status |=\n RouteExecutionStatus.Refunded\n }\n return updatedState\n }\n const isLoading = route.steps.some((step) => step.execution)\n if (isLoading) {\n updatedState.routes[route.id]!.status =\n RouteExecutionStatus.Pending\n }\n return updatedState\n })\n }\n },\n deleteRoutes: (type, accountAddresses) =>\n set((state: RouteExecutionState) => {\n const routes = { ...state.routes }\n Object.keys(routes)\n .filter((routeId) => {\n const route = routes[routeId]\n if (\n accountAddresses &&\n !accountAddresses.includes(route?.route.fromAddress ?? '')\n ) {\n return false\n }\n return type === 'completed'\n ? hasEnumFlag(route?.status ?? 0, RouteExecutionStatus.Done)\n : type === 'failed'\n ? hasEnumFlag(\n route?.status ?? 0,\n RouteExecutionStatus.Failed\n )\n : !hasEnumFlag(\n route?.status ?? 0,\n RouteExecutionStatus.Done\n )\n })\n .forEach((routeId) => {\n delete routes[routeId]\n })\n return {\n routes,\n }\n }),\n deleteRoute: (routeId: string) => {\n if (get().routes[routeId]) {\n set((state: RouteExecutionState) => {\n const routes = { ...state.routes }\n delete routes[routeId]\n return {\n routes,\n }\n })\n }\n },\n }),\n {\n name: `${namePrefix || 'li.fi'}-widget-routes`,\n // Bump version on breaking changes to the stored structure.\n version: 4,\n // Clear stored routes on any version mismatch to avoid errors from incompatible data shapes.\n migrate: () => ({ routes: {} }),\n partialize: (state) => ({ routes: state.routes }),\n merge: (persistedState: any, currentState: RouteExecutionState) => {\n const state = {\n ...currentState,\n ...persistedState,\n } as RouteExecutionState\n try {\n // Keep only the most recent 100 routes, evicting the oldest when the\n // limit is exceeded.\n const maxStoredRoutes = 100\n const allRoutes = Object.values(state.routes) as RouteExecution[]\n const storedRoutes = allRoutes\n .sort(\n (a, b) =>\n (b.route.steps[0]?.execution?.startedAt ?? 0) -\n (a.route.steps[0]?.execution?.startedAt ?? 0)\n )\n .slice(0, maxStoredRoutes)\n const keepIds = new Set(storedRoutes.map((r) => r.route.id))\n for (const id of Object.keys(state.routes)) {\n if (!keepIds.has(id)) {\n delete state.routes[id]\n }\n }\n } catch (error) {\n console.error(error)\n }\n return state\n },\n }\n )\n )\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createRouteExecutionStore.js","names":[],"sources":["../../../../src/stores/routes/createRouteExecutionStore.ts"],"sourcesContent":["import type { Route, RouteExtended } from '@lifi/sdk'\nimport type { StoreApi, UseBoundStore } from 'zustand'\nimport { create } from 'zustand'\nimport { persist } from 'zustand/middleware'\nimport { hasEnumFlag } from '../../utils/enum.js'\nimport type { PersistStoreProps } from '../types.js'\nimport type { RouteExecution, RouteExecutionState } from './types.js'\nimport { RouteExecutionStatus } from './types.js'\nimport {\n isRouteDone,\n isRouteFailed,\n isRoutePartiallyDone,\n isRouteRefunded,\n} from './utils.js'\n\nexport const createRouteExecutionStore = ({\n namePrefix,\n}: PersistStoreProps): UseBoundStore<StoreApi<RouteExecutionState>> =>\n create<RouteExecutionState>()(\n persist(\n (set, get) => ({\n routes: {},\n setExecutableRoute: (route: Route, observableRouteIds?: string[]) => {\n if (!get().routes[route.id]) {\n set((state: RouteExecutionState) => {\n const routes = { ...state.routes }\n // clean previous idle routes\n Object.keys(routes)\n .filter(\n (routeId) =>\n !observableRouteIds?.includes(routeId) &&\n hasEnumFlag(\n routes[routeId]!.status,\n RouteExecutionStatus.Idle\n )\n )\n .forEach((routeId) => {\n delete routes[routeId]\n })\n routes[route.id] = {\n route,\n status: RouteExecutionStatus.Idle,\n }\n return {\n routes,\n }\n })\n }\n },\n updateRoute: (route: RouteExtended) => {\n if (get().routes[route.id]) {\n set((state: RouteExecutionState) => {\n const updatedState = {\n routes: {\n ...state.routes,\n [route.id]: { ...state.routes[route.id]!, route },\n },\n }\n const isFailed = isRouteFailed(route)\n if (isFailed) {\n updatedState.routes[route.id]!.status =\n RouteExecutionStatus.Failed\n return updatedState\n }\n const isDone = isRouteDone(route)\n if (isDone) {\n updatedState.routes[route.id]!.status =\n RouteExecutionStatus.Done\n if (isRoutePartiallyDone(route)) {\n updatedState.routes[route.id]!.status |=\n RouteExecutionStatus.Partial\n } else if (isRouteRefunded(route)) {\n updatedState.routes[route.id]!.status |=\n RouteExecutionStatus.Refunded\n }\n return updatedState\n }\n const isLoading = route.steps.some((step) => step.execution)\n if (isLoading) {\n updatedState.routes[route.id]!.status =\n RouteExecutionStatus.Pending\n }\n return updatedState\n })\n }\n },\n deleteRoutes: (type, accountAddresses) =>\n set((state: RouteExecutionState) => {\n const routes = { ...state.routes }\n Object.keys(routes)\n .filter((routeId) => {\n const route = routes[routeId]\n if (\n accountAddresses &&\n !accountAddresses.includes(route?.route.fromAddress ?? '')\n ) {\n return false\n }\n return type === 'completed'\n ? hasEnumFlag(route?.status ?? 0, RouteExecutionStatus.Done)\n : type === 'failed'\n ? hasEnumFlag(\n route?.status ?? 0,\n RouteExecutionStatus.Failed\n )\n : !hasEnumFlag(\n route?.status ?? 0,\n RouteExecutionStatus.Done\n )\n })\n .forEach((routeId) => {\n delete routes[routeId]\n })\n return {\n routes,\n }\n }),\n deleteRoute: (routeId: string) => {\n if (get().routes[routeId]) {\n set((state: RouteExecutionState) => {\n const routes = { ...state.routes }\n delete routes[routeId]\n return {\n routes,\n }\n })\n }\n },\n }),\n {\n name: `${namePrefix || 'li.fi'}-widget-routes`,\n // Bump version on breaking changes to the stored structure.\n version: 4,\n // Clear stored routes on any version mismatch to avoid errors from incompatible data shapes.\n migrate: () => ({ routes: {} }),\n partialize: (state) => ({ routes: state.routes }),\n merge: (persistedState: any, currentState: RouteExecutionState) => {\n const state = {\n ...currentState,\n ...persistedState,\n } as RouteExecutionState\n try {\n // Keep only the most recent 100 routes, evicting the oldest when the\n // limit is exceeded.\n const maxStoredRoutes = 100\n const allRoutes = Object.values(state.routes) as RouteExecution[]\n const storedRoutes = allRoutes\n .sort(\n (a, b) =>\n (b.route.steps[0]?.execution?.startedAt ?? 0) -\n (a.route.steps[0]?.execution?.startedAt ?? 0)\n )\n .slice(0, maxStoredRoutes)\n const keepIds = new Set(storedRoutes.map((r) => r.route.id))\n for (const id of Object.keys(state.routes)) {\n if (!keepIds.has(id)) {\n delete state.routes[id]\n }\n }\n } catch (error) {\n console.error(error)\n }\n return state\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