@lifi/widget 4.5.0 → 4.7.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/README.md +26 -3
- package/dist/esm/App.d.ts +1 -2
- package/dist/esm/App.d.ts.map +1 -1
- package/dist/esm/AppDrawer.d.ts +1 -2
- package/dist/esm/AppDrawer.d.ts.map +1 -1
- package/dist/esm/AppDrawer.js +2 -1
- package/dist/esm/AppDrawer.js.map +1 -1
- package/dist/esm/components/ActionRow/ActionRow.d.ts +1 -2
- package/dist/esm/components/ActionRow/ActionRow.d.ts.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.js +13 -7
- package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.d.ts +2 -2
- package/dist/esm/components/AmountInput/AmountInput.style.d.ts.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.d.ts +1 -2
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.d.ts.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js +2 -13
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.d.ts +1 -2
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.d.ts.map +1 -1
- package/dist/esm/components/AmountInputCard/PercentageChips.js +2 -13
- package/dist/esm/components/AmountInputCard/PercentageChips.js.map +1 -1
- package/dist/esm/components/AmountInputCard/PercentageChips.style.js +1 -1
- package/dist/esm/components/AmountInputCard/PercentageChips.style.js.map +1 -1
- package/dist/esm/components/AmountInputCard/ReceiveAmountCard.js +6 -2
- package/dist/esm/components/AmountInputCard/ReceiveAmountCard.js.map +1 -1
- package/dist/esm/components/AmountInputCard/SendAmountCard.js +13 -6
- package/dist/esm/components/AmountInputCard/SendAmountCard.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.d.ts +1 -2
- package/dist/esm/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/esm/components/Avatar/TokenAvatar.d.ts +1 -2
- package/dist/esm/components/Avatar/TokenAvatar.d.ts.map +1 -1
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.d.ts +1 -2
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.d.ts.map +1 -1
- package/dist/esm/components/BaseTransactionButton/types.d.ts +1 -2
- package/dist/esm/components/BaseTransactionButton/types.d.ts.map +1 -1
- package/dist/esm/components/BottomSheet/BottomSheet.js +1 -0
- package/dist/esm/components/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/esm/components/BottomSheet/types.d.ts +1 -2
- package/dist/esm/components/BottomSheet/types.d.ts.map +1 -1
- package/dist/esm/components/ButtonTertiary.d.ts +1 -2
- package/dist/esm/components/ButtonTertiary.d.ts.map +1 -1
- package/dist/esm/components/Card/CardIconButton.d.ts +1 -2
- package/dist/esm/components/Card/CardIconButton.d.ts.map +1 -1
- package/dist/esm/components/Card/CardTitle.d.ts +1 -2
- package/dist/esm/components/Card/CardTitle.d.ts.map +1 -1
- package/dist/esm/components/Card/InputCard.d.ts +1 -2
- package/dist/esm/components/Card/InputCard.d.ts.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.d.ts +1 -2
- package/dist/esm/components/ChainSelect/ChainSelect.d.ts.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.style.d.ts +1 -2
- package/dist/esm/components/ChainSelect/ChainSelect.style.d.ts.map +1 -1
- package/dist/esm/components/Chains/AllChainsAvatar.js +7 -1
- package/dist/esm/components/Chains/AllChainsAvatar.js.map +1 -1
- package/dist/esm/components/ContractComponent/ContractComponent.d.ts +1 -2
- package/dist/esm/components/ContractComponent/ContractComponent.d.ts.map +1 -1
- package/dist/esm/components/ContractComponent/ItemPrice.d.ts +2 -3
- package/dist/esm/components/ContractComponent/ItemPrice.d.ts.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.d.ts +1 -2
- package/dist/esm/components/ContractComponent/NFT/NFT.d.ts.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFTBase.d.ts +1 -2
- package/dist/esm/components/ContractComponent/NFT/NFTBase.d.ts.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/types.d.ts +3 -4
- package/dist/esm/components/ContractComponent/NFT/types.d.ts.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +2 -1
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/ExecutionStatusCard/ExecutionStatusCard.d.ts +1 -2
- package/dist/esm/components/ExecutionStatusCard/ExecutionStatusCard.d.ts.map +1 -1
- package/dist/esm/components/ExecutionStatusCard/StatusIcon.d.ts +1 -2
- package/dist/esm/components/ExecutionStatusCard/StatusIcon.d.ts.map +1 -1
- package/dist/esm/components/Expansion/Expansion.js +4 -3
- package/dist/esm/components/Expansion/Expansion.js.map +1 -1
- package/dist/esm/components/FeeBreakdownTooltip.d.ts +1 -2
- package/dist/esm/components/FeeBreakdownTooltip.d.ts.map +1 -1
- package/dist/esm/components/Header/SettingsButton.js +2 -1
- package/dist/esm/components/Header/SettingsButton.js.map +1 -1
- package/dist/esm/components/IconCircle/IconCircle.d.ts +1 -2
- package/dist/esm/components/IconCircle/IconCircle.d.ts.map +1 -1
- package/dist/esm/components/IconCircle/IconCircle.js +2 -1
- package/dist/esm/components/IconCircle/IconCircle.js.map +1 -1
- package/dist/esm/components/IconCircle/statusIcons.d.ts +1 -2
- package/dist/esm/components/IconCircle/statusIcons.d.ts.map +1 -1
- package/dist/esm/components/IconTypography.d.ts +1 -2
- package/dist/esm/components/IconTypography.d.ts.map +1 -1
- package/dist/esm/components/ListItem/ListItemButton.d.ts +1 -2
- package/dist/esm/components/ListItem/ListItemButton.d.ts.map +1 -1
- package/dist/esm/components/Messages/UnsupportedToAddressMessage.js +27 -0
- package/dist/esm/components/Messages/UnsupportedToAddressMessage.js.map +1 -0
- package/dist/esm/components/Messages/WarningMessages.d.ts +1 -2
- package/dist/esm/components/Messages/WarningMessages.d.ts.map +1 -1
- package/dist/esm/components/Messages/WarningMessages.js +2 -0
- package/dist/esm/components/Messages/WarningMessages.js.map +1 -1
- package/dist/esm/components/Messages/useMessageQueue.js +6 -1
- package/dist/esm/components/Messages/useMessageQueue.js.map +1 -1
- package/dist/esm/components/PageContainer.d.ts +2 -3
- package/dist/esm/components/PageContainer.d.ts.map +1 -1
- package/dist/esm/components/PoweredBy/PoweredBy.d.ts +1 -2
- package/dist/esm/components/PoweredBy/PoweredBy.d.ts.map +1 -1
- package/dist/esm/components/ProgressToNextUpdate.d.ts +1 -2
- package/dist/esm/components/ProgressToNextUpdate.d.ts.map +1 -1
- package/dist/esm/components/RouteCard/RouteCard.d.ts +1 -2
- package/dist/esm/components/RouteCard/RouteCard.d.ts.map +1 -1
- package/dist/esm/components/RouteCard/RouteCardSkeleton.d.ts +1 -2
- package/dist/esm/components/RouteCard/RouteCardSkeleton.d.ts.map +1 -1
- package/dist/esm/components/RouteCard/RouteDetails.d.ts +1 -2
- package/dist/esm/components/RouteCard/RouteDetails.d.ts.map +1 -1
- package/dist/esm/components/RouteCard/RouteDetails.js +2 -1
- package/dist/esm/components/RouteCard/RouteDetails.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteDetails.style.d.ts +5 -6
- package/dist/esm/components/RouteCard/RouteDetails.style.d.ts.map +1 -1
- package/dist/esm/components/RouteCard/RouteNotFoundCard.d.ts +1 -2
- package/dist/esm/components/RouteCard/RouteNotFoundCard.d.ts.map +1 -1
- package/dist/esm/components/RouteCard/RouteTokens.d.ts +1 -2
- package/dist/esm/components/RouteCard/RouteTokens.d.ts.map +1 -1
- package/dist/esm/components/RouteCard/types.d.ts +2 -3
- package/dist/esm/components/RouteCard/types.d.ts.map +1 -1
- package/dist/esm/components/Routes/LimitOrderRoutes.js +2 -2
- package/dist/esm/components/Routes/LimitOrderRoutes.js.map +1 -1
- package/dist/esm/components/Routes/RoutesContent.js +2 -2
- package/dist/esm/components/Routes/RoutesContent.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.d.ts +1 -2
- package/dist/esm/components/Search/SearchInput.d.ts.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.d.ts +1 -2
- package/dist/esm/components/SendToWallet/SendToWalletButton.d.ts.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletExpandButton.js +2 -2
- package/dist/esm/components/SendToWallet/SendToWalletExpandButton.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.d.ts +1 -2
- package/dist/esm/components/Skeleton/WidgetSkeleton.d.ts.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.js +2 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.js.map +1 -1
- package/dist/esm/components/Step/StepActions.js +18 -16
- package/dist/esm/components/Step/StepActions.js.map +1 -1
- package/dist/esm/components/StepActions/SentToWalletRow.d.ts +1 -2
- package/dist/esm/components/StepActions/SentToWalletRow.d.ts.map +1 -1
- package/dist/esm/components/StepActions/StepActionRow.js +2 -1
- package/dist/esm/components/StepActions/StepActionRow.js.map +1 -1
- package/dist/esm/components/StepActions/StepActionRow.style.d.ts +1 -2
- package/dist/esm/components/StepActions/StepActionRow.style.d.ts.map +1 -1
- package/dist/esm/components/StepActions/StepActionsList.d.ts +1 -2
- package/dist/esm/components/StepActions/StepActionsList.d.ts.map +1 -1
- package/dist/esm/components/StepActions/executionRows.d.ts +2 -3
- package/dist/esm/components/StepActions/executionRows.d.ts.map +1 -1
- package/dist/esm/components/Switch.js +1 -1
- package/dist/esm/components/Switch.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.style.js +4 -2
- package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
- package/dist/esm/components/Token/Token.d.ts.map +1 -1
- package/dist/esm/components/Token/Token.js +2 -4
- package/dist/esm/components/Token/Token.js.map +1 -1
- package/dist/esm/components/TokenList/RecentTokensHeader.js +44 -0
- package/dist/esm/components/TokenList/RecentTokensHeader.js.map +1 -0
- package/dist/esm/components/TokenList/RecentTokensToggle.js +36 -0
- package/dist/esm/components/TokenList/RecentTokensToggle.js.map +1 -0
- package/dist/esm/components/TokenList/RemoveRecentTokenButton.js +32 -0
- package/dist/esm/components/TokenList/RemoveRecentTokenButton.js.map +1 -0
- package/dist/esm/components/TokenList/TokenList.js +55 -5
- package/dist/esm/components/TokenList/TokenList.js.map +1 -1
- package/dist/esm/components/TokenList/TokenListItem.js +81 -27
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/TokenNotFound.d.ts +1 -2
- package/dist/esm/components/TokenList/TokenNotFound.d.ts.map +1 -1
- package/dist/esm/components/TokenList/VirtualizedTokenList.d.ts +1 -2
- package/dist/esm/components/TokenList/VirtualizedTokenList.d.ts.map +1 -1
- package/dist/esm/components/TokenList/VirtualizedTokenList.js +63 -37
- package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/dist/esm/components/TokenList/types.d.ts +9 -2
- package/dist/esm/components/TokenList/types.d.ts.map +1 -1
- package/dist/esm/components/TokenList/useTokenSelect.d.ts +1 -2
- package/dist/esm/components/TokenList/useTokenSelect.d.ts.map +1 -1
- package/dist/esm/components/TokenRate/TokenRate.d.ts +1 -2
- package/dist/esm/components/TokenRate/TokenRate.d.ts.map +1 -1
- package/dist/esm/components/TokenRate/TokenRate.js +2 -1
- package/dist/esm/components/TokenRate/TokenRate.js.map +1 -1
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.js +22 -21
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.js.map +1 -1
- package/dist/esm/components/TransactionCard/TransactionCard.style.d.ts +2 -3
- package/dist/esm/components/TransactionCard/TransactionCard.style.d.ts.map +1 -1
- package/dist/esm/config/constants.d.ts +1 -2
- package/dist/esm/config/constants.d.ts.map +1 -1
- package/dist/esm/config/version.d.ts +2 -3
- 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/timer/time.js +2 -2
- package/dist/esm/hooks/timer/time.js.map +1 -1
- package/dist/esm/hooks/useAddressActivity.d.ts +1 -2
- package/dist/esm/hooks/useAddressActivity.d.ts.map +1 -1
- package/dist/esm/hooks/useAddressValidation.d.ts +2 -3
- package/dist/esm/hooks/useAddressValidation.d.ts.map +1 -1
- package/dist/esm/hooks/useAvailableChains.d.ts +1 -2
- package/dist/esm/hooks/useAvailableChains.d.ts.map +1 -1
- package/dist/esm/hooks/useAvailableChains.js +2 -1
- package/dist/esm/hooks/useAvailableChains.js.map +1 -1
- package/dist/esm/hooks/useChain.d.ts +1 -2
- package/dist/esm/hooks/useChain.d.ts.map +1 -1
- package/dist/esm/hooks/useContactSupport.d.ts +1 -2
- package/dist/esm/hooks/useContactSupport.d.ts.map +1 -1
- package/dist/esm/hooks/useDebouncedWatch.d.ts +1 -2
- package/dist/esm/hooks/useDebouncedWatch.d.ts.map +1 -1
- package/dist/esm/hooks/useDisplayedTokens.js +6 -4
- package/dist/esm/hooks/useDisplayedTokens.js.map +1 -1
- package/dist/esm/hooks/useExplorer.d.ts +1 -2
- package/dist/esm/hooks/useExplorer.d.ts.map +1 -1
- package/dist/esm/hooks/useExplorer.js +4 -0
- package/dist/esm/hooks/useExplorer.js.map +1 -1
- package/dist/esm/hooks/useFlaggedTokenGuard.js +28 -0
- package/dist/esm/hooks/useFlaggedTokenGuard.js.map +1 -0
- package/dist/esm/hooks/useGasSufficiency.js +3 -1
- package/dist/esm/hooks/useGasSufficiency.js.map +1 -1
- package/dist/esm/hooks/useHeader.d.ts +1 -2
- package/dist/esm/hooks/useHeader.d.ts.map +1 -1
- package/dist/esm/hooks/useListHeight.d.ts +1 -2
- package/dist/esm/hooks/useListHeight.d.ts.map +1 -1
- package/dist/esm/hooks/useMaxSendAmount.js +15 -0
- package/dist/esm/hooks/useMaxSendAmount.js.map +1 -0
- package/dist/esm/hooks/useNavigateBack.d.ts +1 -2
- package/dist/esm/hooks/useNavigateBack.d.ts.map +1 -1
- package/dist/esm/hooks/usePacedRouteExecution.js +3 -2
- package/dist/esm/hooks/usePacedRouteExecution.js.map +1 -1
- package/dist/esm/hooks/useRecentTokens.js +46 -0
- package/dist/esm/hooks/useRecentTokens.js.map +1 -0
- package/dist/esm/hooks/useRouteExecution.d.ts +1 -2
- package/dist/esm/hooks/useRouteExecution.d.ts.map +1 -1
- package/dist/esm/hooks/useRouteExecutionMessage.d.ts +1 -2
- package/dist/esm/hooks/useRouteExecutionMessage.d.ts.map +1 -1
- package/dist/esm/hooks/useRouteExecutionMessage.js +3 -2
- package/dist/esm/hooks/useRouteExecutionMessage.js.map +1 -1
- package/dist/esm/hooks/useRoutes.d.ts +1 -2
- package/dist/esm/hooks/useRoutes.d.ts.map +1 -1
- package/dist/esm/hooks/useRoutes.js +8 -1
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useToAddressRequirements.d.ts +3 -2
- package/dist/esm/hooks/useToAddressRequirements.d.ts.map +1 -1
- package/dist/esm/hooks/useToAddressRequirements.js +13 -1
- package/dist/esm/hooks/useToAddressRequirements.js.map +1 -1
- package/dist/esm/hooks/useToken.d.ts +1 -2
- package/dist/esm/hooks/useToken.d.ts.map +1 -1
- package/dist/esm/hooks/useTokenAddressBalance.d.ts +1 -2
- package/dist/esm/hooks/useTokenAddressBalance.d.ts.map +1 -1
- package/dist/esm/hooks/useTokenBalances.d.ts +3 -2
- package/dist/esm/hooks/useTokenBalances.d.ts.map +1 -1
- package/dist/esm/hooks/useTokenBalances.js +19 -8
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenBalancesQueries.js +29 -28
- package/dist/esm/hooks/useTokenBalancesQueries.js.map +1 -1
- package/dist/esm/hooks/useTokenList.d.ts +1 -2
- package/dist/esm/hooks/useTokenList.d.ts.map +1 -1
- package/dist/esm/hooks/useTokenSearch.js +5 -6
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.js +40 -25
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/hooks/useTools.d.ts +1 -2
- package/dist/esm/hooks/useTools.d.ts.map +1 -1
- package/dist/esm/hooks/useWideVariant.js +2 -1
- package/dist/esm/hooks/useWideVariant.js.map +1 -1
- package/dist/esm/hooks/useWidgetChains.d.ts +1 -2
- package/dist/esm/hooks/useWidgetChains.d.ts.map +1 -1
- package/dist/esm/hooks/useWidgetEvents.d.ts +3 -4
- package/dist/esm/hooks/useWidgetEvents.d.ts.map +1 -1
- package/dist/esm/i18n/bn.json +7 -1
- package/dist/esm/i18n/de.json +7 -1
- package/dist/esm/i18n/en.json +16 -3
- package/dist/esm/i18n/es.json +7 -1
- package/dist/esm/i18n/fr.json +7 -1
- package/dist/esm/i18n/hi.json +7 -1
- package/dist/esm/i18n/id.json +7 -1
- package/dist/esm/i18n/it.json +7 -1
- package/dist/esm/i18n/ja.json +7 -1
- package/dist/esm/i18n/ko.json +7 -1
- package/dist/esm/i18n/pl.json +7 -1
- package/dist/esm/i18n/pt.json +7 -1
- package/dist/esm/i18n/th.json +7 -1
- package/dist/esm/i18n/tr.json +7 -1
- package/dist/esm/i18n/uk.json +7 -1
- package/dist/esm/i18n/vi.json +7 -1
- package/dist/esm/i18n/zh.json +7 -1
- package/dist/esm/pages/MainPage/MainPage.js +2 -1
- package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
- package/dist/esm/pages/MainPage/MainWarningMessages.d.ts +1 -2
- package/dist/esm/pages/MainPage/MainWarningMessages.d.ts.map +1 -1
- package/dist/esm/pages/MainPage/ReviewButton.js +2 -2
- package/dist/esm/pages/MainPage/ReviewButton.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.js +2 -2
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/SelectChainPage/SelectChainPage.d.ts +1 -2
- package/dist/esm/pages/SelectChainPage/SelectChainPage.d.ts.map +1 -1
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js +13 -12
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/dist/esm/pages/SelectChainPage/types.d.ts +1 -2
- package/dist/esm/pages/SelectChainPage/types.d.ts.map +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js +8 -5
- package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -2
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.d.ts.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js +2 -1
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SmallBalanceFilterSettings.js +2 -1
- package/dist/esm/pages/SettingsPage/SmallBalanceFilterSettings.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.d.ts +1 -2
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.d.ts.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.js +2 -1
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +2 -1
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.d.ts +1 -2
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.d.ts.map +1 -1
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.d.ts +2 -3
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.d.ts.map +1 -1
- package/dist/esm/pages/TransactionPage/ExecutionDoneCard.d.ts +1 -2
- package/dist/esm/pages/TransactionPage/ExecutionDoneCard.d.ts.map +1 -1
- package/dist/esm/pages/TransactionPage/RouteTracker.d.ts +1 -2
- package/dist/esm/pages/TransactionPage/RouteTracker.d.ts.map +1 -1
- package/dist/esm/pages/TransactionPage/StartTransactionButton.d.ts +1 -2
- package/dist/esm/pages/TransactionPage/StartTransactionButton.d.ts.map +1 -1
- package/dist/esm/pages/TransactionPage/StartTransactionButton.js +4 -3
- package/dist/esm/pages/TransactionPage/StartTransactionButton.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.d.ts +1 -2
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.d.ts.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +0 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenVerificationBottomSheet.js +63 -0
- package/dist/esm/pages/TransactionPage/TokenVerificationBottomSheet.js.map +1 -0
- package/dist/esm/pages/TransactionPage/TransactionDoneButtons.d.ts +1 -2
- package/dist/esm/pages/TransactionPage/TransactionDoneButtons.d.ts.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionExecutionContent.js +19 -16
- package/dist/esm/pages/TransactionPage/TransactionExecutionContent.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionFailedButtons.js +38 -10
- package/dist/esm/pages/TransactionPage/TransactionFailedButtons.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionReview.js +32 -9
- package/dist/esm/pages/TransactionPage/TransactionReview.js.map +1 -1
- package/dist/esm/pages/TransactionPage/types.d.ts +1 -2
- package/dist/esm/pages/TransactionPage/types.d.ts.map +1 -1
- package/dist/esm/pages/TransactionPage/utils.d.ts +2 -3
- package/dist/esm/pages/TransactionPage/utils.d.ts.map +1 -1
- package/dist/esm/pages/TransactionPage/utils.js +23 -1
- package/dist/esm/pages/TransactionPage/utils.js.map +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.d.ts +1 -2
- package/dist/esm/providers/I18nProvider/I18nProvider.d.ts.map +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js +37 -36
- package/dist/esm/providers/I18nProvider/I18nProvider.js.map +1 -1
- package/dist/esm/providers/I18nProvider/types.d.ts +4 -5
- package/dist/esm/providers/I18nProvider/types.d.ts.map +1 -1
- package/dist/esm/providers/QueryClientProvider.d.ts +1 -2
- package/dist/esm/providers/QueryClientProvider.d.ts.map +1 -1
- package/dist/esm/providers/SDKClientProvider.d.ts +2 -3
- package/dist/esm/providers/SDKClientProvider.d.ts.map +1 -1
- package/dist/esm/providers/ThemeProvider/ThemeProvider.js +2 -1
- package/dist/esm/providers/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.d.ts +1 -2
- package/dist/esm/providers/WalletProvider/WalletProvider.d.ts.map +1 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.js +10 -9
- package/dist/esm/providers/WalletProvider/WalletProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js +7 -3
- package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js.map +1 -1
- package/dist/esm/providers/WidgetProvider/WidgetProvider.d.ts +2 -3
- package/dist/esm/providers/WidgetProvider/WidgetProvider.d.ts.map +1 -1
- package/dist/esm/providers/WidgetProvider/types.d.ts +2 -3
- package/dist/esm/providers/WidgetProvider/types.d.ts.map +1 -1
- package/dist/esm/stores/StoreProvider.d.ts +1 -2
- package/dist/esm/stores/StoreProvider.d.ts.map +1 -1
- package/dist/esm/stores/StoreProvider.js +10 -6
- package/dist/esm/stores/StoreProvider.js.map +1 -1
- package/dist/esm/stores/bookmarks/BookmarkStore.d.ts +1 -2
- package/dist/esm/stores/bookmarks/BookmarkStore.d.ts.map +1 -1
- package/dist/esm/stores/bookmarks/types.d.ts +5 -6
- package/dist/esm/stores/bookmarks/types.d.ts.map +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.d.ts +1 -2
- package/dist/esm/stores/chains/ChainOrderStore.d.ts.map +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.js +11 -5
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/types.d.ts +1 -2
- package/dist/esm/stores/chains/types.d.ts.map +1 -1
- package/dist/esm/stores/form/types.d.ts +20 -21
- package/dist/esm/stores/form/types.d.ts.map +1 -1
- package/dist/esm/stores/form/useFieldActions.d.ts +1 -2
- package/dist/esm/stores/form/useFieldActions.d.ts.map +1 -1
- package/dist/esm/stores/form/useFieldValues.d.ts +1 -2
- package/dist/esm/stores/form/useFieldValues.d.ts.map +1 -1
- package/dist/esm/stores/header/types.d.ts +1 -2
- package/dist/esm/stores/header/types.d.ts.map +1 -1
- package/dist/esm/stores/header/useHeaderStore.d.ts +2 -3
- package/dist/esm/stores/header/useHeaderStore.d.ts.map +1 -1
- package/dist/esm/stores/inputMode/useInputModeStore.d.ts +1 -2
- package/dist/esm/stores/inputMode/useInputModeStore.d.ts.map +1 -1
- package/dist/esm/stores/recentTokens/RecentTokensStore.js +23 -0
- package/dist/esm/stores/recentTokens/RecentTokensStore.js.map +1 -0
- package/dist/esm/stores/recentTokens/createRecentTokensStore.js +54 -0
- package/dist/esm/stores/recentTokens/createRecentTokensStore.js.map +1 -0
- package/dist/esm/stores/recentTokens/utils.js +15 -0
- package/dist/esm/stores/recentTokens/utils.js.map +1 -0
- package/dist/esm/stores/routes/RouteExecutionStore.d.ts +2 -3
- package/dist/esm/stores/routes/RouteExecutionStore.d.ts.map +1 -1
- package/dist/esm/stores/routes/types.d.ts +3 -4
- package/dist/esm/stores/routes/types.d.ts.map +1 -1
- package/dist/esm/stores/routes/useRouteExecutionIndicator.js +4 -3
- package/dist/esm/stores/routes/useRouteExecutionIndicator.js.map +1 -1
- package/dist/esm/stores/routes/utils.d.ts +4 -5
- package/dist/esm/stores/routes/utils.d.ts.map +1 -1
- package/dist/esm/stores/settings/SettingsStore.d.ts +2 -3
- package/dist/esm/stores/settings/SettingsStore.d.ts.map +1 -1
- package/dist/esm/stores/settings/types.d.ts +2 -3
- package/dist/esm/stores/settings/types.d.ts.map +1 -1
- package/dist/esm/stores/types.d.ts +2 -3
- package/dist/esm/stores/types.d.ts.map +1 -1
- package/dist/esm/themes/azureLight.d.ts +1 -2
- package/dist/esm/themes/azureLight.d.ts.map +1 -1
- package/dist/esm/themes/jumper.d.ts +1 -2
- package/dist/esm/themes/jumper.d.ts.map +1 -1
- package/dist/esm/themes/palettes.d.ts +3 -4
- package/dist/esm/themes/palettes.d.ts.map +1 -1
- package/dist/esm/themes/types.d.ts +1 -0
- package/dist/esm/themes/watermelonLight.d.ts +1 -2
- package/dist/esm/themes/watermelonLight.d.ts.map +1 -1
- package/dist/esm/themes/windows95.d.ts +1 -2
- package/dist/esm/themes/windows95.d.ts.map +1 -1
- package/dist/esm/types/events.d.ts +13 -14
- package/dist/esm/types/events.d.ts.map +1 -1
- package/dist/esm/types/token.d.ts +6 -1
- package/dist/esm/types/token.d.ts.map +1 -1
- package/dist/esm/types/widget.d.ts +55 -51
- package/dist/esm/types/widget.d.ts.map +1 -1
- package/dist/esm/types/widget.js.map +1 -1
- package/dist/esm/utils/address.js +19 -0
- package/dist/esm/utils/address.js.map +1 -0
- package/dist/esm/utils/compactNumberFormatter.d.ts +1 -2
- package/dist/esm/utils/compactNumberFormatter.d.ts.map +1 -1
- package/dist/esm/utils/compactNumberFormatter.js +1 -3
- package/dist/esm/utils/compactNumberFormatter.js.map +1 -1
- package/dist/esm/utils/converters.d.ts +1 -2
- package/dist/esm/utils/converters.d.ts.map +1 -1
- package/dist/esm/utils/currencyExtendedFormatter.d.ts +1 -2
- package/dist/esm/utils/currencyExtendedFormatter.d.ts.map +1 -1
- package/dist/esm/utils/customReceiver.js +12 -0
- package/dist/esm/utils/customReceiver.js.map +1 -0
- package/dist/esm/utils/elements.d.ts +2 -3
- package/dist/esm/utils/elements.d.ts.map +1 -1
- package/dist/esm/utils/enum.d.ts +1 -2
- package/dist/esm/utils/enum.d.ts.map +1 -1
- package/dist/esm/utils/fees.d.ts +2 -3
- package/dist/esm/utils/fees.d.ts.map +1 -1
- package/dist/esm/utils/format.d.ts +8 -9
- package/dist/esm/utils/format.d.ts.map +1 -1
- package/dist/esm/utils/gas.js +24 -0
- package/dist/esm/utils/gas.js.map +1 -0
- package/dist/esm/utils/getErrorMessage.js +0 -1
- package/dist/esm/utils/getErrorMessage.js.map +1 -1
- package/dist/esm/utils/getPriceImpact.d.ts +1 -2
- package/dist/esm/utils/getPriceImpact.d.ts.map +1 -1
- package/dist/esm/utils/input.d.ts +1 -2
- package/dist/esm/utils/input.d.ts.map +1 -1
- package/dist/esm/utils/limitOrder.js +1 -1
- package/dist/esm/utils/limitOrder.js.map +1 -1
- package/dist/esm/utils/navigationRoutes.d.ts +2 -3
- package/dist/esm/utils/navigationRoutes.d.ts.map +1 -1
- package/dist/esm/utils/percentFormatter.d.ts +1 -2
- package/dist/esm/utils/percentFormatter.d.ts.map +1 -1
- package/dist/esm/utils/recentTokens.js +97 -0
- package/dist/esm/utils/recentTokens.js.map +1 -0
- package/dist/esm/utils/token.js +50 -7
- package/dist/esm/utils/token.js.map +1 -1
- package/dist/esm/utils/tokenList.js +54 -25
- package/dist/esm/utils/tokenList.js.map +1 -1
- package/dist/esm/utils/tokenListBands.js +85 -0
- package/dist/esm/utils/tokenListBands.js.map +1 -0
- package/dist/esm/utils/wallet.d.ts +1 -2
- package/dist/esm/utils/wallet.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/components/AmountInput/AmountInputEndAdornment.tsx +2 -21
- package/src/components/AmountInputCard/PercentageChips.tsx +2 -18
- package/src/components/AmountInputCard/ReceiveAmountCard.tsx +16 -3
- package/src/components/BottomSheet/BottomSheet.tsx +3 -0
- package/src/components/Chains/AllChainsAvatar.tsx +7 -1
- package/src/components/Messages/UnsupportedToAddressMessage.tsx +24 -0
- package/src/components/Messages/WarningMessages.tsx +3 -0
- package/src/components/Messages/useMessageQueue.ts +9 -0
- package/src/components/Routes/LimitOrderRoutes.tsx +5 -2
- package/src/components/Routes/RoutesContent.tsx +5 -2
- package/src/components/SendToWallet/SendToWalletExpandButton.tsx +2 -1
- package/src/components/Token/Token.tsx +2 -1
- package/src/components/TokenList/RecentTokensHeader.tsx +52 -0
- package/src/components/TokenList/RecentTokensToggle.tsx +45 -0
- package/src/components/TokenList/RemoveRecentTokenButton.tsx +38 -0
- package/src/components/TokenList/TokenList.tsx +92 -3
- package/src/components/TokenList/TokenListItem.tsx +83 -9
- package/src/components/TokenList/VirtualizedTokenList.tsx +86 -103
- package/src/components/TokenList/types.ts +13 -0
- package/src/config/version.ts +1 -1
- package/src/hooks/useAvailableChains.ts +1 -0
- package/src/hooks/useDisplayedTokens.ts +17 -3
- package/src/hooks/useExplorer.ts +2 -0
- package/src/hooks/useFlaggedTokenGuard.ts +33 -0
- package/src/hooks/useGasSufficiency.ts +9 -1
- package/src/hooks/useMaxSendAmount.ts +21 -0
- package/src/hooks/useRecentTokens.ts +88 -0
- package/src/hooks/useRoutes.ts +10 -0
- package/src/hooks/useToAddressRequirements.ts +23 -1
- package/src/hooks/useTokenBalances.ts +38 -19
- package/src/hooks/useTokenSearch.ts +6 -19
- package/src/hooks/useTokens.ts +97 -40
- package/src/pages/MainPage/ReviewButton.tsx +6 -2
- package/src/pages/RoutesPage/RoutesPage.tsx +5 -2
- package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +1 -1
- package/src/pages/TransactionPage/TokenVerificationBottomSheet.tsx +93 -0
- package/src/pages/TransactionPage/TransactionFailedButtons.tsx +62 -26
- package/src/pages/TransactionPage/TransactionReview.tsx +51 -25
- package/src/pages/TransactionPage/utils.ts +78 -0
- package/src/providers/WalletProvider/useExternalWalletProvider.ts +9 -1
- package/src/stores/StoreProvider.tsx +10 -7
- package/src/stores/chains/ChainOrderStore.test.tsx +298 -0
- package/src/stores/chains/ChainOrderStore.tsx +25 -6
- package/src/stores/recentTokens/RecentTokensStore.tsx +39 -0
- package/src/stores/recentTokens/createRecentTokensStore.ts +107 -0
- package/src/stores/recentTokens/types.ts +37 -0
- package/src/stores/recentTokens/utils.ts +18 -0
- package/src/types/token.ts +8 -3
- package/src/types/widget.ts +5 -0
- package/src/utils/address.ts +21 -0
- package/src/utils/customReceiver.ts +31 -0
- package/src/utils/gas.ts +41 -0
- package/src/utils/recentTokens.ts +187 -0
- package/src/utils/token.ts +122 -19
- package/src/utils/tokenList.ts +60 -14
- package/src/utils/tokenListBands.ts +181 -0
|
@@ -2,7 +2,7 @@ import { LanguageResource } from "../../providers/I18nProvider/types.js";
|
|
|
2
2
|
import { WidgetConfig } from "../../types/widget.js";
|
|
3
3
|
import { Order } from "@lifi/sdk";
|
|
4
4
|
//#region src/stores/settings/types.d.ts
|
|
5
|
-
interface SettingsProps {
|
|
5
|
+
export interface SettingsProps {
|
|
6
6
|
gasPrice?: string;
|
|
7
7
|
language?: string;
|
|
8
8
|
languageCache?: LanguageResource;
|
|
@@ -18,9 +18,8 @@ interface SettingsProps {
|
|
|
18
18
|
_enabledExchanges: Record<string, boolean>;
|
|
19
19
|
smallBalanceThreshold?: string;
|
|
20
20
|
}
|
|
21
|
-
interface SettingsStoreProviderProps {
|
|
21
|
+
export interface SettingsStoreProviderProps {
|
|
22
22
|
config: WidgetConfig;
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
-
export { SettingsProps, SettingsStoreProviderProps };
|
|
26
25
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/stores/settings/types.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/stores/settings/types.ts"],"mappings":";;;;iBAciB;EACf;EACA;EACA,gBAAgB;EAChB;EACA,gBAAgB;EAChB;EACA;EACA;EACA;EACA,iBAAiB;EACjB;EACA;EACA,mBAAmB;EACnB;;iBAoBe;EACf,QAAQ"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
2
|
//#region src/stores/types.d.ts
|
|
3
|
-
interface PersistStoreProps {
|
|
3
|
+
export interface PersistStoreProps {
|
|
4
4
|
namePrefix?: string;
|
|
5
5
|
}
|
|
6
|
-
type PersistStoreProviderProps = PropsWithChildren<PersistStoreProps>;
|
|
6
|
+
export type PersistStoreProviderProps = PropsWithChildren<PersistStoreProps>;
|
|
7
7
|
//#endregion
|
|
8
|
-
export { PersistStoreProps, PersistStoreProviderProps };
|
|
9
8
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/stores/types.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/stores/types.ts"],"mappings":";;iBAEiB;EACf;;YAGU,4BAA4B,kBAAkB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { WidgetTheme } from "../types/widget.js";
|
|
2
2
|
//#region src/themes/azureLight.d.ts
|
|
3
|
-
declare const azureLightTheme: WidgetTheme;
|
|
3
|
+
export declare const azureLightTheme: WidgetTheme;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { azureLightTheme };
|
|
6
5
|
//# sourceMappingURL=azureLight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azureLight.d.ts","names":[],"sources":["../../../src/themes/azureLight.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"azureLight.d.ts","names":[],"sources":["../../../src/themes/azureLight.ts"],"mappings":";;qBAGa,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jumper.d.ts","names":[],"sources":["../../../src/themes/jumper.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"jumper.d.ts","names":[],"sources":["../../../src/themes/jumper.ts"],"mappings":";;qBAEa,aAAa"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/themes/palettes.d.ts
|
|
2
|
-
declare const palette: {
|
|
2
|
+
export declare const palette: {
|
|
3
3
|
primary: {
|
|
4
4
|
main: string;
|
|
5
5
|
};
|
|
@@ -29,7 +29,7 @@ declare const palette: {
|
|
|
29
29
|
"800": string;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
declare const paletteDark: {
|
|
32
|
+
export declare const paletteDark: {
|
|
33
33
|
background: {
|
|
34
34
|
paper: string;
|
|
35
35
|
default: string;
|
|
@@ -39,7 +39,7 @@ declare const paletteDark: {
|
|
|
39
39
|
secondary: string;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
-
declare const paletteLight: {
|
|
42
|
+
export declare const paletteLight: {
|
|
43
43
|
background: {
|
|
44
44
|
paper: string;
|
|
45
45
|
default: string;
|
|
@@ -50,5 +50,4 @@ declare const paletteLight: {
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
//#endregion
|
|
53
|
-
export { palette, paletteDark, paletteLight };
|
|
54
53
|
//# sourceMappingURL=palettes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palettes.d.ts","names":[],"sources":["../../../src/themes/palettes.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"palettes.d.ts","names":[],"sources":["../../../src/themes/palettes.ts"],"mappings":";qBAAa;EACX;IACE;;EAEF;IACE;;EAEF;IACE;;EAEF;IACE;;EAEF;IACE;;EAEF;IACE;;EAEF;IACE;IACA;;EAEF;IACE;IACA;IACA;IACA;;;qBAIS;EACX;IACE;IACA;;EAEF;IACE;IACA;;;qBAIS;EACX;IACE;IACA;;EAEF;IACE;IACA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { WidgetTheme } from "../types/widget.js";
|
|
2
2
|
//#region src/themes/watermelonLight.d.ts
|
|
3
|
-
declare const watermelonLightTheme: WidgetTheme;
|
|
3
|
+
export declare const watermelonLightTheme: WidgetTheme;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { watermelonLightTheme };
|
|
6
5
|
//# sourceMappingURL=watermelonLight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watermelonLight.d.ts","names":[],"sources":["../../../src/themes/watermelonLight.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"watermelonLight.d.ts","names":[],"sources":["../../../src/themes/watermelonLight.ts"],"mappings":";;qBAGa,sBAAsB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { WidgetTheme } from "../types/widget.js";
|
|
2
2
|
//#region src/themes/windows95.d.ts
|
|
3
|
-
declare const windows95Theme: WidgetTheme;
|
|
3
|
+
export declare const windows95Theme: WidgetTheme;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { windows95Theme };
|
|
6
5
|
//# sourceMappingURL=windows95.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windows95.d.ts","names":[],"sources":["../../../src/themes/windows95.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"windows95.d.ts","names":[],"sources":["../../../src/themes/windows95.ts"],"mappings":";;qBAGa,gBAAgB"}
|
|
@@ -5,7 +5,7 @@ import { SettingsProps } from "../stores/settings/types.js";
|
|
|
5
5
|
import { NavigationRouteType } from "../utils/navigationRoutes.js";
|
|
6
6
|
import { ChainId, ExecutionAction, Route } from "@lifi/sdk";
|
|
7
7
|
//#region src/types/events.d.ts
|
|
8
|
-
declare enum WidgetEvent {
|
|
8
|
+
export declare enum WidgetEvent {
|
|
9
9
|
AppearanceChanged = "appearanceChanged",
|
|
10
10
|
AvailableRoutes = "availableRoutes",
|
|
11
11
|
ChainPinned = "chainPinned",
|
|
@@ -27,7 +27,7 @@ declare enum WidgetEvent {
|
|
|
27
27
|
TokenSearch = "tokenSearch",
|
|
28
28
|
WidgetExpanded = "widgetExpanded"
|
|
29
29
|
}
|
|
30
|
-
type WidgetEvents = {
|
|
30
|
+
export type WidgetEvents = {
|
|
31
31
|
appearanceChanged: (data: Appearance) => void;
|
|
32
32
|
availableRoutes: (data: Route[]) => void;
|
|
33
33
|
chainPinned: (data: ChainPinned) => void;
|
|
@@ -49,58 +49,57 @@ type WidgetEvents = {
|
|
|
49
49
|
tokenSearch: (data: TokenSearch) => void;
|
|
50
50
|
widgetExpanded: (data: boolean) => void;
|
|
51
51
|
};
|
|
52
|
-
type ContactSupport = {
|
|
52
|
+
export type ContactSupport = {
|
|
53
53
|
supportId?: string;
|
|
54
54
|
};
|
|
55
|
-
type RouteHighValueLossUpdate = {
|
|
55
|
+
export type RouteHighValueLossUpdate = {
|
|
56
56
|
fromAmountUSD: number;
|
|
57
57
|
toAmountUSD: number;
|
|
58
58
|
gasCostUSD?: number;
|
|
59
59
|
feeCostUSD?: number;
|
|
60
60
|
valueLoss: number;
|
|
61
61
|
};
|
|
62
|
-
type RouteExecutionUpdate = {
|
|
62
|
+
export type RouteExecutionUpdate = {
|
|
63
63
|
route: Route;
|
|
64
64
|
action: ExecutionAction;
|
|
65
65
|
};
|
|
66
|
-
type RouteSelected = {
|
|
66
|
+
export type RouteSelected = {
|
|
67
67
|
route: Route;
|
|
68
68
|
routes: Route[];
|
|
69
69
|
};
|
|
70
|
-
type TokenSearch = {
|
|
70
|
+
export type TokenSearch = {
|
|
71
71
|
value: string;
|
|
72
72
|
tokens: TokenAmount$1[];
|
|
73
73
|
};
|
|
74
|
-
type ChainTokenSelected = {
|
|
74
|
+
export type ChainTokenSelected = {
|
|
75
75
|
chainId: ChainId;
|
|
76
76
|
tokenAddress: string;
|
|
77
77
|
};
|
|
78
|
-
type FormFieldChanged = { [K in keyof DefaultValues]: {
|
|
78
|
+
export type FormFieldChanged = { [K in keyof DefaultValues]: {
|
|
79
79
|
fieldName: K;
|
|
80
80
|
newValue: DefaultValues[K];
|
|
81
81
|
oldValue: DefaultValues[K];
|
|
82
82
|
}; }[keyof DefaultValues];
|
|
83
|
-
type SettingUpdated<K extends keyof SettingsProps = keyof SettingsProps> = {
|
|
83
|
+
export type SettingUpdated<K extends keyof SettingsProps = keyof SettingsProps> = {
|
|
84
84
|
setting: K;
|
|
85
85
|
newValue: SettingsProps[K];
|
|
86
86
|
oldValue: SettingsProps[K];
|
|
87
87
|
newSettings: SettingsProps;
|
|
88
88
|
oldSettings: SettingsProps;
|
|
89
89
|
};
|
|
90
|
-
type ChainPinned = {
|
|
90
|
+
export type ChainPinned = {
|
|
91
91
|
chainId: number;
|
|
92
92
|
pinned: boolean;
|
|
93
93
|
};
|
|
94
|
-
type LowAddressActivityConfirmed = {
|
|
94
|
+
export type LowAddressActivityConfirmed = {
|
|
95
95
|
address: string;
|
|
96
96
|
chainId: number;
|
|
97
97
|
};
|
|
98
|
-
type NavigationTabChanged = {
|
|
98
|
+
export type NavigationTabChanged = {
|
|
99
99
|
/** Key of the now-active tab. */
|
|
100
100
|
tab: NavigationTabKey;
|
|
101
101
|
/** Key of the previously active tab, or `undefined` on first render. */
|
|
102
102
|
previousTab?: NavigationTabKey;
|
|
103
103
|
};
|
|
104
104
|
//#endregion
|
|
105
|
-
export { ChainPinned, ChainTokenSelected, ContactSupport, FormFieldChanged, LowAddressActivityConfirmed, NavigationTabChanged, RouteExecutionUpdate, RouteHighValueLossUpdate, RouteSelected, SettingUpdated, TokenSearch, WidgetEvent, WidgetEvents };
|
|
106
105
|
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","names":[],"sources":["../../../src/types/events.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"events.d.ts","names":[],"sources":["../../../src/types/events.ts"],"mappings":";;;;;;;oBAOY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU;EACV,oBAAoB,MAAM;EAC1B,kBAAkB,MAAM;EACxB,cAAc,MAAM;EACpB,iBAAiB,MAAM;EACvB,gCAAgC,MAAM;EACtC,mBAAmB,MAAM;EACzB,8BAA8B,MAAM;EACpC,uBAAuB,MAAM;EAC7B,cAAc,MAAM;EACpB,0BAA0B,MAAM;EAChC,uBAAuB,MAAM;EAC7B,wBAAwB,MAAM;EAC9B,wBAAwB,MAAM;EAC9B,qBAAqB,MAAM;EAC3B,gBAAgB,MAAM;EACtB,sBAAsB;EACtB,iBAAiB,MAAM;EACvB,2BAA2B,MAAM;EACjC,cAAc,MAAM;EACpB,iBAAiB;;YAUP;EACV;;YAGU;EACV;EACA;EACA;EACA;EACA;;YAGU;EACV,OAAO;EACP,QAAQ;;YAGE;EACV,OAAO;EACP,QAAQ;;YAGE;EACV;EACA,QAAQ;;YAGE;EACV,SAAS;EACT;;YAGU,sBACT,WAAW;EACV,WAAW;EACX,UAAU,cAAc;EACxB,UAAU,cAAc;WAEpB;YAEI,eACV,gBAAgB,sBAAsB;EAEtC,SAAS;EACT,UAAU,cAAc;EACxB,UAAU,cAAc;EACxB,aAAa;EACb,aAAa;;YAGH;EACV;EACA;;YAGU;EACV;EACA;;YAGU;;EAEV,KAAK;;EAEL,cAAc"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { TokenAmount, TokenExtended } from "@lifi/sdk";
|
|
2
2
|
//#region src/types/token.d.ts
|
|
3
|
-
interface TokenFlags {
|
|
3
|
+
export interface TokenFlags {
|
|
4
4
|
featured?: boolean;
|
|
5
5
|
popular?: boolean;
|
|
6
6
|
pinned?: boolean;
|
|
7
|
+
/** A copy promoted into the "Recent searches" band. */
|
|
8
|
+
recent?: boolean;
|
|
7
9
|
verified?: boolean;
|
|
10
|
+
native?: boolean;
|
|
11
|
+
/** Came from the main token list rather than from a search. */
|
|
12
|
+
listed?: boolean;
|
|
8
13
|
}
|
|
9
14
|
interface TokenAmount$1 extends TokenAmount, TokenFlags {}
|
|
10
15
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","names":[],"sources":["../../../src/types/token.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"token.d.ts","names":[],"sources":["../../../src/types/token.ts"],"mappings":";;iBAMiB;EACf;EACA;EACA;;EAEA;EACA;EACA;;EAEA;;UAGe,sBAAoB,aAAgB"}
|
|
@@ -7,16 +7,16 @@ import { WidgetProviderProps } from "@lifi/widget-provider";
|
|
|
7
7
|
import { WalletMenuOpenArgs } from "@lifi/wallet-management";
|
|
8
8
|
import { TypographyVariantsOptions } from "@mui/material/styles";
|
|
9
9
|
//#region src/types/widget.d.ts
|
|
10
|
-
type WidgetVariant = "compact" | "wide" | "drawer";
|
|
10
|
+
export type WidgetVariant = "compact" | "wide" | "drawer";
|
|
11
11
|
/** @internal Not part of the public API. */
|
|
12
|
-
type InternalWidgetMode = "limit";
|
|
13
|
-
type WidgetMode = "default" | "split" | "custom" | "refuel" | InternalWidgetMode;
|
|
14
|
-
type SplitMode = "bridge" | "swap";
|
|
15
|
-
type SplitModeOptions = {
|
|
12
|
+
export type InternalWidgetMode = "limit";
|
|
13
|
+
export type WidgetMode = "default" | "split" | "custom" | "refuel" | InternalWidgetMode;
|
|
14
|
+
export type SplitMode = "bridge" | "swap";
|
|
15
|
+
export type SplitModeOptions = {
|
|
16
16
|
defaultTab: SplitMode;
|
|
17
17
|
};
|
|
18
|
-
type CustomMode = "checkout" | "deposit";
|
|
19
|
-
interface ModeOptions {
|
|
18
|
+
export type CustomMode = "checkout" | "deposit";
|
|
19
|
+
export interface ModeOptions {
|
|
20
20
|
/**
|
|
21
21
|
* Configure split mode behavior:
|
|
22
22
|
* - 'bridge' | 'swap': Single mode without tabs
|
|
@@ -31,20 +31,20 @@ interface ModeOptions {
|
|
|
31
31
|
* Identity of a header navigation tab. Each key maps to a widget variant, mode and
|
|
32
32
|
* (optionally) mode options; labels are resolved from the key.
|
|
33
33
|
*/
|
|
34
|
-
type SplitNavigationTabKey = SplitMode;
|
|
34
|
+
export type SplitNavigationTabKey = SplitMode;
|
|
35
35
|
/** @internal Not part of the public API. */
|
|
36
|
-
type InternalNavigationTabKey = "default" | "private" | "refuel" | "swap-advanced" | "bridge-advanced" | "limit";
|
|
37
|
-
type NavigationTabKey = InternalNavigationTabKey | SplitNavigationTabKey;
|
|
38
|
-
type Appearance = PaletteMode | "system";
|
|
39
|
-
interface NavigationProps {
|
|
36
|
+
export type InternalNavigationTabKey = "default" | "private" | "refuel" | "swap-advanced" | "bridge-advanced" | "limit";
|
|
37
|
+
export type NavigationTabKey = InternalNavigationTabKey | SplitNavigationTabKey;
|
|
38
|
+
export type Appearance = PaletteMode | "system";
|
|
39
|
+
export interface NavigationProps {
|
|
40
40
|
/**
|
|
41
41
|
* If given, uses a negative margin to counteract the padding on sides for navigation elements like icon buttons.
|
|
42
42
|
* @default true
|
|
43
43
|
*/
|
|
44
44
|
edge?: boolean;
|
|
45
45
|
}
|
|
46
|
-
type WidgetThemeComponents = Partial<Pick<Components<Theme>, "MuiAppBar" | "MuiAvatar" | "MuiButton" | "MuiCard" | "MuiDrawer" | "MuiIconButton" | "MuiInputCard" | "MuiNavigationTabs" | "MuiNavigationTab" | "MuiTabs" | "MuiCheckbox">>;
|
|
47
|
-
type WidgetTheme = {
|
|
46
|
+
export type WidgetThemeComponents = Partial<Pick<Components<Theme>, "MuiAppBar" | "MuiAvatar" | "MuiButton" | "MuiCard" | "MuiDrawer" | "MuiIconButton" | "MuiInputCard" | "MuiNavigationTabs" | "MuiNavigationTab" | "MuiTabs" | "MuiCheckbox">>;
|
|
47
|
+
export type WidgetTheme = {
|
|
48
48
|
colorSchemes?: {
|
|
49
49
|
light?: {
|
|
50
50
|
palette: PaletteOptions;
|
|
@@ -62,13 +62,13 @@ type WidgetTheme = {
|
|
|
62
62
|
header?: CSSProperties;
|
|
63
63
|
navigation?: NavigationProps;
|
|
64
64
|
};
|
|
65
|
-
interface DisabledUIConfig {
|
|
65
|
+
export interface DisabledUIConfig {
|
|
66
66
|
fromAmount?: boolean;
|
|
67
67
|
fromToken?: boolean;
|
|
68
68
|
toAddress?: boolean;
|
|
69
69
|
toToken?: boolean;
|
|
70
70
|
}
|
|
71
|
-
interface HiddenUIConfig {
|
|
71
|
+
export interface HiddenUIConfig {
|
|
72
72
|
addressBookConnectedWallets?: boolean;
|
|
73
73
|
allNetworks?: boolean;
|
|
74
74
|
appearance?: boolean;
|
|
@@ -99,6 +99,11 @@ interface HiddenUIConfig {
|
|
|
99
99
|
*/
|
|
100
100
|
lowAddressActivityConfirmation?: boolean;
|
|
101
101
|
poweredBy?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Hide the "Recent searches" section in the token select view.
|
|
104
|
+
* @default false
|
|
105
|
+
*/
|
|
106
|
+
recentSearches?: boolean;
|
|
102
107
|
reverseTokensButton?: boolean;
|
|
103
108
|
routeCardPriceImpact?: boolean;
|
|
104
109
|
routeTokenDescription?: boolean;
|
|
@@ -107,11 +112,11 @@ interface HiddenUIConfig {
|
|
|
107
112
|
toToken?: boolean;
|
|
108
113
|
walletMenu?: boolean;
|
|
109
114
|
}
|
|
110
|
-
interface RequiredUIConfig {
|
|
115
|
+
export interface RequiredUIConfig {
|
|
111
116
|
accountDeployedMessage?: boolean;
|
|
112
117
|
toAddress?: boolean;
|
|
113
118
|
}
|
|
114
|
-
type DefaultUI = {
|
|
119
|
+
export type DefaultUI = {
|
|
115
120
|
transactionDetailsExpanded?: boolean;
|
|
116
121
|
navigationHeaderTitleNoWrap?: boolean;
|
|
117
122
|
/**
|
|
@@ -124,7 +129,7 @@ type DefaultUI = {
|
|
|
124
129
|
*/
|
|
125
130
|
layout?: "default" | "cards";
|
|
126
131
|
};
|
|
127
|
-
interface WidgetWalletConfig {
|
|
132
|
+
export interface WidgetWalletConfig {
|
|
128
133
|
walletEcosystemsOrder?: Record<string, ChainType[]>;
|
|
129
134
|
onConnect?(args?: WalletMenuOpenArgs): void;
|
|
130
135
|
/**
|
|
@@ -142,15 +147,15 @@ interface WidgetWalletConfig {
|
|
|
142
147
|
*/
|
|
143
148
|
forceInternalWalletManagement?: boolean;
|
|
144
149
|
}
|
|
145
|
-
interface WidgetSDKConfig extends Omit<SDKConfig, "apiKey" | "disableVersionCheck" | "integrator" | "providers" | "routeOptions" | "widgetVersion"> {
|
|
150
|
+
export interface WidgetSDKConfig extends Omit<SDKConfig, "apiKey" | "disableVersionCheck" | "integrator" | "providers" | "routeOptions" | "widgetVersion"> {
|
|
146
151
|
routeOptions?: Omit<RouteOptions, "bridges" | "exchanges" | "fee" | "referrer" | "order" | "slippage">;
|
|
147
152
|
executionOptions?: Pick<ExecutionOptions, "updateTransactionRequestHook">;
|
|
148
153
|
}
|
|
149
|
-
interface WidgetContractTool {
|
|
154
|
+
export interface WidgetContractTool {
|
|
150
155
|
name: string;
|
|
151
156
|
logoURI: string;
|
|
152
157
|
}
|
|
153
|
-
interface CalculateFeeParams {
|
|
158
|
+
export interface CalculateFeeParams {
|
|
154
159
|
fromChain: ExtendedChain;
|
|
155
160
|
toChain: ExtendedChain;
|
|
156
161
|
fromToken: Token;
|
|
@@ -161,7 +166,7 @@ interface CalculateFeeParams {
|
|
|
161
166
|
toAmount?: bigint;
|
|
162
167
|
slippage?: number;
|
|
163
168
|
}
|
|
164
|
-
interface WidgetFeeConfig {
|
|
169
|
+
export interface WidgetFeeConfig {
|
|
165
170
|
name?: string;
|
|
166
171
|
logoURI?: string;
|
|
167
172
|
fee?: number;
|
|
@@ -189,47 +194,47 @@ interface WidgetFeeConfig {
|
|
|
189
194
|
*/
|
|
190
195
|
calculateFee?(params: CalculateFeeParams): Promise<number | undefined>;
|
|
191
196
|
}
|
|
192
|
-
interface ToAddress {
|
|
197
|
+
export interface ToAddress {
|
|
193
198
|
name?: string;
|
|
194
199
|
address: string;
|
|
195
200
|
chainType: ChainType;
|
|
196
201
|
logoURI?: string;
|
|
197
202
|
}
|
|
198
|
-
interface AllowDeny<T> {
|
|
203
|
+
export interface AllowDeny<T> {
|
|
199
204
|
allow?: T[];
|
|
200
205
|
deny?: T[];
|
|
201
206
|
}
|
|
202
|
-
type AllowDenySetItem = string | number;
|
|
203
|
-
interface AllowDenySet {
|
|
207
|
+
export type AllowDenySetItem = string | number;
|
|
208
|
+
export interface AllowDenySet {
|
|
204
209
|
allow?: Set<AllowDenySetItem>;
|
|
205
210
|
deny?: Set<AllowDenySetItem>;
|
|
206
211
|
}
|
|
207
|
-
type AllowDenySets = {
|
|
212
|
+
export type AllowDenySets = {
|
|
208
213
|
from?: AllowDenySet;
|
|
209
214
|
to?: AllowDenySet;
|
|
210
215
|
} & AllowDenySet;
|
|
211
|
-
type AllowDenyItems<T> = {
|
|
216
|
+
export type AllowDenyItems<T> = {
|
|
212
217
|
from?: AllowDeny<T>;
|
|
213
218
|
to?: AllowDeny<T>;
|
|
214
219
|
} & AllowDeny<T>;
|
|
215
|
-
type WidgetChains = {
|
|
220
|
+
export type WidgetChains = {
|
|
216
221
|
types?: AllowDeny<ChainType>;
|
|
217
222
|
} & AllowDenyItems<number>;
|
|
218
|
-
type WidgetTokens = {
|
|
223
|
+
export type WidgetTokens = {
|
|
219
224
|
featured?: StaticToken[];
|
|
220
225
|
include?: Token[];
|
|
221
226
|
popular?: StaticToken[];
|
|
222
227
|
verified?: BaseToken[];
|
|
223
228
|
} & AllowDenyItems<BaseToken>;
|
|
224
|
-
type WidgetLanguages = {
|
|
229
|
+
export type WidgetLanguages = {
|
|
225
230
|
default?: LanguageKey;
|
|
226
231
|
} & AllowDeny<LanguageKey>;
|
|
227
|
-
type PoweredByType = "default" | "jumper";
|
|
228
|
-
interface RouteLabel {
|
|
232
|
+
export type PoweredByType = "default" | "jumper";
|
|
233
|
+
export interface RouteLabel {
|
|
229
234
|
text: string;
|
|
230
235
|
sx?: SxProps<Theme>;
|
|
231
236
|
}
|
|
232
|
-
interface RouteLabelRule {
|
|
237
|
+
export interface RouteLabelRule {
|
|
233
238
|
label: RouteLabel;
|
|
234
239
|
bridges?: AllowDeny<string>;
|
|
235
240
|
exchanges?: AllowDeny<string>;
|
|
@@ -246,13 +251,13 @@ interface RouteLabelRule {
|
|
|
246
251
|
*/
|
|
247
252
|
match?: (route: Route) => boolean;
|
|
248
253
|
}
|
|
249
|
-
type ExplorerUrl = string | {
|
|
254
|
+
export type ExplorerUrl = string | {
|
|
250
255
|
url: string;
|
|
251
256
|
txPath?: string;
|
|
252
257
|
addressPath?: string;
|
|
253
258
|
};
|
|
254
|
-
type WidgetProvider = (props: PropsWithChildren<WidgetProviderProps>) => ReactNode;
|
|
255
|
-
interface WidgetConfig {
|
|
259
|
+
export type WidgetProvider = (props: PropsWithChildren<WidgetProviderProps>) => ReactNode;
|
|
260
|
+
export interface WidgetConfig {
|
|
256
261
|
fromChain?: number;
|
|
257
262
|
toChain?: number;
|
|
258
263
|
fromToken?: string;
|
|
@@ -316,31 +321,31 @@ interface WidgetConfig {
|
|
|
316
321
|
*/
|
|
317
322
|
routeLabels?: RouteLabelRule[];
|
|
318
323
|
}
|
|
319
|
-
interface FormFieldOptions {
|
|
324
|
+
export interface FormFieldOptions {
|
|
320
325
|
setUrlSearchParam: boolean;
|
|
321
326
|
}
|
|
322
|
-
interface FieldValues extends Omit<DefaultFieldValues, "fromAmount" | "toAmount" | "toAddress"> {
|
|
327
|
+
export interface FieldValues extends Omit<DefaultFieldValues, "fromAmount" | "toAmount" | "toAddress"> {
|
|
323
328
|
fromAmount?: number | string;
|
|
324
329
|
toAmount?: number | string;
|
|
325
330
|
toAddress?: ToAddress | string;
|
|
326
331
|
}
|
|
327
|
-
type FieldNames = keyof FieldValues;
|
|
328
|
-
type SetFieldValueFunction = <K extends FieldNames>(key: K, value: FieldValues[K], options?: FormFieldOptions) => void;
|
|
329
|
-
type FormState = {
|
|
332
|
+
export type FieldNames = keyof FieldValues;
|
|
333
|
+
export type SetFieldValueFunction = <K extends FieldNames>(key: K, value: FieldValues[K], options?: FormFieldOptions) => void;
|
|
334
|
+
export type FormState = {
|
|
330
335
|
setFieldValue: SetFieldValueFunction;
|
|
331
336
|
};
|
|
332
|
-
type FormRef = RefObject<FormState | null>;
|
|
333
|
-
interface FormRefProps {
|
|
337
|
+
export type FormRef = RefObject<FormState | null>;
|
|
338
|
+
export interface FormRefProps {
|
|
334
339
|
formRef?: FormRef;
|
|
335
340
|
}
|
|
336
|
-
interface WidgetConfigProps extends FormRefProps {
|
|
341
|
+
export interface WidgetConfigProps extends FormRefProps {
|
|
337
342
|
config: WidgetConfig;
|
|
338
343
|
}
|
|
339
|
-
interface WidgetConfigPartialProps {
|
|
344
|
+
export interface WidgetConfigPartialProps {
|
|
340
345
|
config?: Partial<WidgetConfig>;
|
|
341
346
|
}
|
|
342
|
-
type WidgetProps = WidgetDrawerProps & WidgetConfig & WidgetConfigPartialProps & FormRefProps;
|
|
343
|
-
interface WidgetDrawerProps extends WidgetConfigPartialProps {
|
|
347
|
+
export type WidgetProps = WidgetDrawerProps & WidgetConfig & WidgetConfigPartialProps & FormRefProps;
|
|
348
|
+
export interface WidgetDrawerProps extends WidgetConfigPartialProps {
|
|
344
349
|
elementRef?: RefObject<HTMLDivElement>;
|
|
345
350
|
open?: boolean;
|
|
346
351
|
/**
|
|
@@ -348,11 +353,10 @@ interface WidgetDrawerProps extends WidgetConfigPartialProps {
|
|
|
348
353
|
*/
|
|
349
354
|
onClose?(): void;
|
|
350
355
|
}
|
|
351
|
-
declare enum ExpansionType {
|
|
356
|
+
export declare enum ExpansionType {
|
|
352
357
|
Routes = "routes",
|
|
353
358
|
FromChain = "fromChain",
|
|
354
359
|
ToChain = "toChain"
|
|
355
360
|
}
|
|
356
361
|
//#endregion
|
|
357
|
-
export { AllowDeny, AllowDenyItems, AllowDenySet, AllowDenySetItem, AllowDenySets, Appearance, CalculateFeeParams, CustomMode, DefaultUI, DisabledUIConfig, ExpansionType, ExplorerUrl, FieldNames, FieldValues, FormFieldOptions, FormRef, FormRefProps, FormState, HiddenUIConfig, InternalNavigationTabKey, InternalWidgetMode, ModeOptions, NavigationProps, NavigationTabKey, PoweredByType, RequiredUIConfig, RouteLabel, RouteLabelRule, SetFieldValueFunction, SplitMode, SplitModeOptions, SplitNavigationTabKey, ToAddress, WidgetChains, WidgetConfig, WidgetConfigPartialProps, WidgetConfigProps, WidgetContractTool, WidgetDrawerProps, WidgetFeeConfig, WidgetLanguages, WidgetMode, WidgetProps, WidgetProvider, WidgetSDKConfig, WidgetTheme, WidgetThemeComponents, WidgetTokens, WidgetVariant, WidgetWalletConfig };
|
|
358
362
|
//# sourceMappingURL=widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.ts","names":[],"sources":["../../../src/types/widget.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"widget.d.ts","names":[],"sources":["../../../src/types/widget.ts"],"mappings":";;;;;;;;;YAoCY;;YAGA;YACA,yDAKR;YACQ;YACA;EACV,YAAY;;YAEF;iBACK;;;;;;EAMf,QAAQ,YAAY;EACpB;IAAW,MAAM;;;;;;;YAOP,wBAAwB;;YAExB;YAOA,mBAAmB,2BAA2B;YAE9C,aAAa;iBACR;;;;;EAKf;;YAEU,wBAAwB,QAClC,KACE,WAAW;YAeH;EACV;IACE;MACE,SAAS;;IAEX;MACE,SAAS;;;EAGb,QAAQ,QAAQ;EAChB,aAAa;EACb,aAAa;EACb,YAAY;EACZ,kBAAkB;EAClB,wBAAwB;EACxB,SAAS;EACT,aAAa;;iBAGE;EACf;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;;;;;EAKA;EACA;;;;;EAKA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;EAMA;EACA;;;;;EAKA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;;YAGU;EACV;EACA;;;;;;;;;EASA;;iBAGe;EACf,wBAAwB,eAAe;EACvC,WAAW,OAAO;;;;;;;;;EASlB;;;;;EAKA;;iBAGe,wBACP,KACN;EAQF,eAAe,KACb;EAGF,mBAAmB,KAAK;;iBAGT;EACf;EACA;;iBAGe;EACf,WAAW;EACX,SAAS;EACT,WAAW;EACX,SAAS;EACT;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;;;;;EAKA;;;;;EAKA;;;;EAIA,sBAAsB;;;;;;;;;EAStB,cAAc,QAAQ,qBAAqB;;iBAG5B;EACf;EACA;EACA,WAAW;EACX;;iBAGe,UAAU;EACzB,QAAQ;EACR,OAAO;;YAGG;iBACK;EACf,QAAQ,IAAI;EACZ,OAAO,IAAI;;YAGD;EACV,OAAO;EACP,KAAK;IACH;YAEQ,eAAe;EACzB,OAAO,UAAU;EACjB,KAAK,UAAU;IACb,UAAU;YAEF;EACV,QAAQ,UAAU;IAChB;YAEQ;EACV,WAAW;EACX,UAAU;EACV,UAAU;EACV,WAAW;IACT,eAAe;YAEP;EACV,UAAU;IACR,UAAU;YAEF;iBAEK;EACf;EACA,KAAK,QAAQ;;iBAGE;EACf,OAAO;EAEP,UAAU;EACV,YAAY;EACZ;EACA;EACA;EACA;;;;;;;;EAQA,SAAS,OAAO;;YAGN;EAGN;EACA;EACA;;YAGM,kBACV,OAAO,kBAAkB,yBACtB;iBAEY;EACf;EACA;EACA;EACA;EACA,YAAY;EACZ,cAAc;EACd;EACA;EACA;EACA;EAEA,YAAY;EAEZ,gBAAgB;EAChB,oBAAoB;EACpB,6BAA6B;EAC7B,2BAA2B;EAC3B,eAAe;EACf;EACA;EACA,YAAY;EACZ;EAEA,gBAAgB;EAChB;EAEA,UAAU;EACV,OAAO;EACP,cAAc;;;;;;;EAOd,kBAAkB;EAElB,aAAa;EACb,QAAQ;EAER,aAAa;EACb,WAAW;EACX,aAAa;EACb,YAAY;;;;;;;EAOZ;EACA;EAEA,eAAe;EACf,YAAY;EAEZ;EACA;EAEA,UAAU;EACV,YAAY;EACZ,SAAS;EACT,SAAS;EACT,YAAY;EACZ,oBAAoB;EACpB,eAAe,eAAe,iBAC5B,QAAQ,mBAAmB;EAC7B,YAAY;;;;EAKZ,cAAc;;iBAGC;EACf;;iBAGe,oBACP,KAAK;EACb;EACA;EACA,YAAY;;YAGF,mBAAmB;YAEnB,yBAAyB,UAAU,YAC7C,KAAK,GACL,OAAO,YAAY,IACnB,UAAU;YAGA;EACV,eAAe;;YAGL,UAAU,UAAU;iBAEf;EACf,UAAU;;iBAGK,0BAA0B;EACzC,QAAQ;;iBAGO;EACf,SAAS,QAAQ;;YAGP,cAAc,oBACxB,eACA,2BACA;iBAEe,0BAA0B;EACzC,aAAa,UAAU;EACvB;;;;EAIA;;oBAGU;EACV;EACA;EACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.js","names":[],"sources":["../../../src/types/widget.ts"],"sourcesContent":["import type {\n BaseToken,\n ChainType,\n ContractCall,\n ExecutionOptions,\n ExtendedChain,\n Order,\n Route,\n RouteOptions,\n SDKConfig,\n StaticToken,\n Token,\n} from '@lifi/sdk'\nimport type { WalletMenuOpenArgs } from '@lifi/wallet-management'\nimport type { WidgetProviderProps } from '@lifi/widget-provider'\nimport type {\n Components,\n PaletteMode,\n PaletteOptions,\n Shape,\n SxProps,\n Theme,\n} from '@mui/material'\nimport type { TypographyVariantsOptions } from '@mui/material/styles'\nimport type {\n CSSProperties,\n PropsWithChildren,\n ReactNode,\n RefObject,\n} from 'react'\nimport type {\n LanguageKey,\n LanguageResources,\n} from '../providers/I18nProvider/types.js'\nimport type { DefaultFieldValues } from '../stores/form/types.js'\n\nexport type WidgetVariant = 'compact' | 'wide' | 'drawer'\n\n/** @internal Not part of the public API. */\nexport type InternalWidgetMode = 'limit'\nexport type WidgetMode =\n | 'default'\n | 'split'\n | 'custom'\n | 'refuel'\n | InternalWidgetMode\nexport type SplitMode = 'bridge' | 'swap'\nexport type SplitModeOptions = {\n defaultTab: SplitMode\n}\nexport type CustomMode = 'checkout' | 'deposit'\nexport interface ModeOptions {\n /**\n * Configure split mode behavior:\n * - 'bridge' | 'swap': Single mode without tabs\n * - { defaultTab: 'bridge' | 'swap' }: Tabs mode with configurable default tab\n */\n split?: SplitMode | SplitModeOptions\n custom?: { type: CustomMode }\n}\n\n/**\n * Identity of a header navigation tab. Each key maps to a widget variant, mode and\n * (optionally) mode options; labels are resolved from the key.\n */\nexport type SplitNavigationTabKey = SplitMode\n/** @internal Not part of the public API. */\nexport type InternalNavigationTabKey =\n | 'default'\n | 'private'\n | 'refuel'\n | 'swap-advanced'\n | 'bridge-advanced'\n | 'limit'\nexport type NavigationTabKey = InternalNavigationTabKey | SplitNavigationTabKey\n\nexport type Appearance = PaletteMode | 'system'\nexport interface NavigationProps {\n /**\n * If given, uses a negative margin to counteract the padding on sides for navigation elements like icon buttons.\n * @default true\n */\n edge?: boolean\n}\nexport type WidgetThemeComponents = Partial<\n Pick<\n Components<Theme>,\n | 'MuiAppBar'\n | 'MuiAvatar'\n | 'MuiButton'\n | 'MuiCard'\n | 'MuiDrawer'\n | 'MuiIconButton'\n | 'MuiInputCard'\n | 'MuiNavigationTabs'\n | 'MuiNavigationTab'\n | 'MuiTabs'\n | 'MuiCheckbox'\n >\n>\n\nexport type WidgetTheme = {\n colorSchemes?: {\n light?: {\n palette: PaletteOptions\n }\n dark?: {\n palette: PaletteOptions\n }\n }\n shape?: Partial<Shape>\n typography?: TypographyVariantsOptions\n components?: WidgetThemeComponents\n container?: CSSProperties\n routesContainer?: CSSProperties\n chainSidebarContainer?: CSSProperties\n header?: CSSProperties\n navigation?: NavigationProps\n}\n\nexport interface DisabledUIConfig {\n fromAmount?: boolean\n fromToken?: boolean\n toAddress?: boolean\n toToken?: boolean\n}\n\nexport interface HiddenUIConfig {\n addressBookConnectedWallets?: boolean\n allNetworks?: boolean\n appearance?: boolean\n bridgesSettings?: boolean\n chainSelect?: boolean\n /**\n * Hide the chain sidebar in the `wide` variant. No effect in other variants.\n * @default false\n */\n chainSidebar?: boolean\n contactSupport?: boolean\n /**\n * Hide the drawer close button. Only meaningful when `variant === 'drawer'`.\n * @default false\n */\n drawerCloseButton?: boolean\n fromToken?: boolean\n gasRefuelMessage?: boolean\n hideSmallBalances?: boolean\n history?: boolean\n insufficientGasMessage?: boolean\n integratorStepDetails?: boolean\n language?: boolean\n /**\n * Hide the warning shown when sending to an address with low historical\n * on-chain activity (low transaction count or contract-like behavior).\n * @default false\n */\n lowAddressActivityConfirmation?: boolean\n poweredBy?: boolean\n reverseTokensButton?: boolean\n routeCardPriceImpact?: boolean\n routeTokenDescription?: boolean\n searchTokenInput?: boolean\n toAddress?: boolean\n toToken?: boolean\n walletMenu?: boolean\n}\n\nexport interface RequiredUIConfig {\n accountDeployedMessage?: boolean\n toAddress?: boolean\n}\n\nexport type DefaultUI = {\n transactionDetailsExpanded?: boolean\n navigationHeaderTitleNoWrap?: boolean\n /**\n * Layout for the main form.\n * - `'default'`: the chain/token selectors plus single amount input.\n * - `'cards'`: the redesigned card-based layout — stacked Send/Receive amount\n * cards (`AmountInputCardPair`) with inline token pill selectors and a swap\n * button.\n * @default 'default'\n */\n layout?: 'default' | 'cards'\n}\n\nexport interface WidgetWalletConfig {\n walletEcosystemsOrder?: Record<string, ChainType[]>\n onConnect?(args?: WalletMenuOpenArgs): void\n /**\n * Determines whether the widget should provide partial wallet management functionality.\n *\n * In partial mode, external wallet management will be used for \"opt-out\" providers,\n * while the internal management is applied for any remaining providers that do not opt out.\n * This allows a flexible balance between the integrator's custom wallet menu and the widget's native wallet menu.\n * @default false\n */\n usePartialWalletManagement?: boolean\n /**\n * This option forces the widget to always use internal wallet management ignoring external wallet management contexts\n * @default false\n */\n forceInternalWalletManagement?: boolean\n}\n\nexport interface WidgetSDKConfig\n extends Omit<\n SDKConfig,\n | 'apiKey'\n | 'disableVersionCheck'\n | 'integrator'\n | 'providers'\n | 'routeOptions'\n | 'widgetVersion'\n > {\n routeOptions?: Omit<\n RouteOptions,\n 'bridges' | 'exchanges' | 'fee' | 'referrer' | 'order' | 'slippage'\n >\n executionOptions?: Pick<ExecutionOptions, 'updateTransactionRequestHook'>\n}\n\nexport interface WidgetContractTool {\n name: string\n logoURI: string\n}\n\nexport interface CalculateFeeParams {\n fromChain: ExtendedChain\n toChain: ExtendedChain\n fromToken: Token\n toToken: Token\n fromAddress?: string\n toAddress?: string\n fromAmount?: bigint\n toAmount?: bigint\n slippage?: number\n}\n\nexport interface WidgetFeeConfig {\n name?: string\n logoURI?: string\n fee?: number\n /**\n * Whether to show the fee percentage in the fee details.\n * @default false\n */\n showFeePercentage?: boolean\n /**\n * Whether to show a tooltip with the fee details. Requires `name` or `feeTooltipComponent` to be set.\n * @default false\n */\n showFeeTooltip?: boolean\n /**\n * Custom tooltip component to show with the fee details.\n */\n feeTooltipComponent?: ReactNode\n /**\n * Function to calculate fees before fetching quotes.\n * If provided, this function will be used instead of the `fee` parameter.\n * Only one of `fee` or `calculateFee` should be used.\n *\n * @param params Object containing the fee calculation parameters\n * @returns A promise that resolves to the calculated fee as a number (e.g., 0.03 represents a 3% fee)\n */\n calculateFee?(params: CalculateFeeParams): Promise<number | undefined>\n}\n\nexport interface ToAddress {\n name?: string\n address: string\n chainType: ChainType\n logoURI?: string\n}\n\nexport interface AllowDeny<T> {\n allow?: T[]\n deny?: T[]\n}\n\nexport type AllowDenySetItem = string | number\nexport interface AllowDenySet {\n allow?: Set<AllowDenySetItem>\n deny?: Set<AllowDenySetItem>\n}\n\nexport type AllowDenySets = {\n from?: AllowDenySet\n to?: AllowDenySet\n} & AllowDenySet\n\nexport type AllowDenyItems<T> = {\n from?: AllowDeny<T>\n to?: AllowDeny<T>\n} & AllowDeny<T>\n\nexport type WidgetChains = {\n types?: AllowDeny<ChainType>\n} & AllowDenyItems<number>\n\nexport type WidgetTokens = {\n featured?: StaticToken[]\n include?: Token[]\n popular?: StaticToken[]\n verified?: BaseToken[]\n} & AllowDenyItems<BaseToken>\n\nexport type WidgetLanguages = {\n default?: LanguageKey\n} & AllowDeny<LanguageKey>\n\nexport type PoweredByType = 'default' | 'jumper'\n\nexport interface RouteLabel {\n text: string\n sx?: SxProps<Theme>\n}\n\nexport interface RouteLabelRule {\n label: RouteLabel\n // Matching criteria\n bridges?: AllowDeny<string>\n exchanges?: AllowDeny<string>\n fromChainId?: number[]\n toChainId?: number[]\n fromTokenAddress?: string[]\n toTokenAddress?: string[]\n /**\n * Custom match function evaluated against the route. When provided, its\n * result is AND'd with the other matching criteria — all specified\n * conditions must pass for the label to apply. Use this for matching logic\n * that the built-in fields cannot express (gas costs, step count, route\n * tags, etc.).\n */\n match?: (route: Route) => boolean\n}\n\nexport type ExplorerUrl =\n | string\n | {\n url: string\n txPath?: string\n addressPath?: string\n }\n\nexport type WidgetProvider = (\n props: PropsWithChildren<WidgetProviderProps>\n) => ReactNode\n\nexport interface WidgetConfig {\n fromChain?: number\n toChain?: number\n fromToken?: string\n toToken?: string\n toAddress?: ToAddress\n toAddresses?: ToAddress[]\n fromAmount?: number | string\n minFromAmountUSD?: number\n toAmount?: number | string\n formUpdateKey?: string\n\n providers?: WidgetProvider[]\n\n contractCalls?: ContractCall[]\n contractComponent?: ReactNode\n contractSecondaryComponent?: ReactNode\n contractCompactComponent?: ReactNode\n contractTool?: WidgetContractTool\n integrator: string\n apiKey?: string\n feeConfig?: WidgetFeeConfig\n referrer?: string\n\n routePriority?: Order\n slippage?: number\n\n variant?: WidgetVariant\n mode?: WidgetMode\n modeOptions?: ModeOptions\n /**\n * Header navigation tabs, in order. When set, the widget renders a tab bar\n * and the active tab drives the displayed flow. Each entry is a tab key.\n *\n * @internal Not part of the public API.\n */\n _navigationTabs?: NavigationTabKey[]\n\n appearance?: Appearance\n theme?: WidgetTheme\n\n disabledUI?: DisabledUIConfig\n hiddenUI?: HiddenUIConfig\n requiredUI?: RequiredUIConfig\n defaultUI?: DefaultUI\n /**\n * When true, shows only the recommended route and hides the route\n * selector UI. Distinct from `routePriority`, which sets the SDK\n * ranking order across multiple displayed routes.\n * @default false\n */\n showSingleRoute?: boolean\n useRelayerRoutes?: boolean\n\n walletConfig?: WidgetWalletConfig\n sdkConfig?: WidgetSDKConfig\n\n buildUrl?: boolean\n keyPrefix?: string\n\n bridges?: AllowDeny<string>\n exchanges?: AllowDeny<string>\n chains?: WidgetChains\n tokens?: WidgetTokens\n languages?: WidgetLanguages\n languageResources?: LanguageResources\n explorerUrls?: Record<number, ExplorerUrl[]> &\n Partial<Record<'internal', ExplorerUrl[]>>\n poweredBy?: PoweredByType\n\n /**\n * Custom labels/badges to show on routes based on specified rules\n */\n routeLabels?: RouteLabelRule[]\n}\n\nexport interface FormFieldOptions {\n setUrlSearchParam: boolean\n}\n\nexport interface FieldValues\n extends Omit<DefaultFieldValues, 'fromAmount' | 'toAmount' | 'toAddress'> {\n fromAmount?: number | string\n toAmount?: number | string\n toAddress?: ToAddress | string\n}\n\nexport type FieldNames = keyof FieldValues\n\nexport type SetFieldValueFunction = <K extends FieldNames>(\n key: K,\n value: FieldValues[K],\n options?: FormFieldOptions\n) => void\n\nexport type FormState = {\n setFieldValue: SetFieldValueFunction\n}\n\nexport type FormRef = RefObject<FormState | null>\n\nexport interface FormRefProps {\n formRef?: FormRef\n}\n\nexport interface WidgetConfigProps extends FormRefProps {\n config: WidgetConfig\n}\n\nexport interface WidgetConfigPartialProps {\n config?: Partial<WidgetConfig>\n}\n\nexport type WidgetProps = WidgetDrawerProps &\n WidgetConfig &\n WidgetConfigPartialProps &\n FormRefProps\n\nexport interface WidgetDrawerProps extends WidgetConfigPartialProps {\n elementRef?: RefObject<HTMLDivElement>\n open?: boolean\n /**\n * Make sure to make the onClose callback stable (e.g. using useCallback) to avoid causing re-renders of the entire widget\n */\n onClose?(): void\n}\n\nexport enum ExpansionType {\n Routes = 'routes',\n FromChain = 'fromChain',\n ToChain = 'toChain',\n}\n"],"mappings":";AA4dA,IAAY,gBAAL,yBAAA,eAAA;CACL,cAAA,YAAA;CACA,cAAA,eAAA;CACA,cAAA,aAAA;;AACF,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"widget.js","names":[],"sources":["../../../src/types/widget.ts"],"sourcesContent":["import type {\n BaseToken,\n ChainType,\n ContractCall,\n ExecutionOptions,\n ExtendedChain,\n Order,\n Route,\n RouteOptions,\n SDKConfig,\n StaticToken,\n Token,\n} from '@lifi/sdk'\nimport type { WalletMenuOpenArgs } from '@lifi/wallet-management'\nimport type { WidgetProviderProps } from '@lifi/widget-provider'\nimport type {\n Components,\n PaletteMode,\n PaletteOptions,\n Shape,\n SxProps,\n Theme,\n} from '@mui/material'\nimport type { TypographyVariantsOptions } from '@mui/material/styles'\nimport type {\n CSSProperties,\n PropsWithChildren,\n ReactNode,\n RefObject,\n} from 'react'\nimport type {\n LanguageKey,\n LanguageResources,\n} from '../providers/I18nProvider/types.js'\nimport type { DefaultFieldValues } from '../stores/form/types.js'\n\nexport type WidgetVariant = 'compact' | 'wide' | 'drawer'\n\n/** @internal Not part of the public API. */\nexport type InternalWidgetMode = 'limit'\nexport type WidgetMode =\n | 'default'\n | 'split'\n | 'custom'\n | 'refuel'\n | InternalWidgetMode\nexport type SplitMode = 'bridge' | 'swap'\nexport type SplitModeOptions = {\n defaultTab: SplitMode\n}\nexport type CustomMode = 'checkout' | 'deposit'\nexport interface ModeOptions {\n /**\n * Configure split mode behavior:\n * - 'bridge' | 'swap': Single mode without tabs\n * - { defaultTab: 'bridge' | 'swap' }: Tabs mode with configurable default tab\n */\n split?: SplitMode | SplitModeOptions\n custom?: { type: CustomMode }\n}\n\n/**\n * Identity of a header navigation tab. Each key maps to a widget variant, mode and\n * (optionally) mode options; labels are resolved from the key.\n */\nexport type SplitNavigationTabKey = SplitMode\n/** @internal Not part of the public API. */\nexport type InternalNavigationTabKey =\n | 'default'\n | 'private'\n | 'refuel'\n | 'swap-advanced'\n | 'bridge-advanced'\n | 'limit'\nexport type NavigationTabKey = InternalNavigationTabKey | SplitNavigationTabKey\n\nexport type Appearance = PaletteMode | 'system'\nexport interface NavigationProps {\n /**\n * If given, uses a negative margin to counteract the padding on sides for navigation elements like icon buttons.\n * @default true\n */\n edge?: boolean\n}\nexport type WidgetThemeComponents = Partial<\n Pick<\n Components<Theme>,\n | 'MuiAppBar'\n | 'MuiAvatar'\n | 'MuiButton'\n | 'MuiCard'\n | 'MuiDrawer'\n | 'MuiIconButton'\n | 'MuiInputCard'\n | 'MuiNavigationTabs'\n | 'MuiNavigationTab'\n | 'MuiTabs'\n | 'MuiCheckbox'\n >\n>\n\nexport type WidgetTheme = {\n colorSchemes?: {\n light?: {\n palette: PaletteOptions\n }\n dark?: {\n palette: PaletteOptions\n }\n }\n shape?: Partial<Shape>\n typography?: TypographyVariantsOptions\n components?: WidgetThemeComponents\n container?: CSSProperties\n routesContainer?: CSSProperties\n chainSidebarContainer?: CSSProperties\n header?: CSSProperties\n navigation?: NavigationProps\n}\n\nexport interface DisabledUIConfig {\n fromAmount?: boolean\n fromToken?: boolean\n toAddress?: boolean\n toToken?: boolean\n}\n\nexport interface HiddenUIConfig {\n addressBookConnectedWallets?: boolean\n allNetworks?: boolean\n appearance?: boolean\n bridgesSettings?: boolean\n chainSelect?: boolean\n /**\n * Hide the chain sidebar in the `wide` variant. No effect in other variants.\n * @default false\n */\n chainSidebar?: boolean\n contactSupport?: boolean\n /**\n * Hide the drawer close button. Only meaningful when `variant === 'drawer'`.\n * @default false\n */\n drawerCloseButton?: boolean\n fromToken?: boolean\n gasRefuelMessage?: boolean\n hideSmallBalances?: boolean\n history?: boolean\n insufficientGasMessage?: boolean\n integratorStepDetails?: boolean\n language?: boolean\n /**\n * Hide the warning shown when sending to an address with low historical\n * on-chain activity (low transaction count or contract-like behavior).\n * @default false\n */\n lowAddressActivityConfirmation?: boolean\n poweredBy?: boolean\n /**\n * Hide the \"Recent searches\" section in the token select view.\n * @default false\n */\n recentSearches?: boolean\n reverseTokensButton?: boolean\n routeCardPriceImpact?: boolean\n routeTokenDescription?: boolean\n searchTokenInput?: boolean\n toAddress?: boolean\n toToken?: boolean\n walletMenu?: boolean\n}\n\nexport interface RequiredUIConfig {\n accountDeployedMessage?: boolean\n toAddress?: boolean\n}\n\nexport type DefaultUI = {\n transactionDetailsExpanded?: boolean\n navigationHeaderTitleNoWrap?: boolean\n /**\n * Layout for the main form.\n * - `'default'`: the chain/token selectors plus single amount input.\n * - `'cards'`: the redesigned card-based layout — stacked Send/Receive amount\n * cards (`AmountInputCardPair`) with inline token pill selectors and a swap\n * button.\n * @default 'default'\n */\n layout?: 'default' | 'cards'\n}\n\nexport interface WidgetWalletConfig {\n walletEcosystemsOrder?: Record<string, ChainType[]>\n onConnect?(args?: WalletMenuOpenArgs): void\n /**\n * Determines whether the widget should provide partial wallet management functionality.\n *\n * In partial mode, external wallet management will be used for \"opt-out\" providers,\n * while the internal management is applied for any remaining providers that do not opt out.\n * This allows a flexible balance between the integrator's custom wallet menu and the widget's native wallet menu.\n * @default false\n */\n usePartialWalletManagement?: boolean\n /**\n * This option forces the widget to always use internal wallet management ignoring external wallet management contexts\n * @default false\n */\n forceInternalWalletManagement?: boolean\n}\n\nexport interface WidgetSDKConfig\n extends Omit<\n SDKConfig,\n | 'apiKey'\n | 'disableVersionCheck'\n | 'integrator'\n | 'providers'\n | 'routeOptions'\n | 'widgetVersion'\n > {\n routeOptions?: Omit<\n RouteOptions,\n 'bridges' | 'exchanges' | 'fee' | 'referrer' | 'order' | 'slippage'\n >\n executionOptions?: Pick<ExecutionOptions, 'updateTransactionRequestHook'>\n}\n\nexport interface WidgetContractTool {\n name: string\n logoURI: string\n}\n\nexport interface CalculateFeeParams {\n fromChain: ExtendedChain\n toChain: ExtendedChain\n fromToken: Token\n toToken: Token\n fromAddress?: string\n toAddress?: string\n fromAmount?: bigint\n toAmount?: bigint\n slippage?: number\n}\n\nexport interface WidgetFeeConfig {\n name?: string\n logoURI?: string\n fee?: number\n /**\n * Whether to show the fee percentage in the fee details.\n * @default false\n */\n showFeePercentage?: boolean\n /**\n * Whether to show a tooltip with the fee details. Requires `name` or `feeTooltipComponent` to be set.\n * @default false\n */\n showFeeTooltip?: boolean\n /**\n * Custom tooltip component to show with the fee details.\n */\n feeTooltipComponent?: ReactNode\n /**\n * Function to calculate fees before fetching quotes.\n * If provided, this function will be used instead of the `fee` parameter.\n * Only one of `fee` or `calculateFee` should be used.\n *\n * @param params Object containing the fee calculation parameters\n * @returns A promise that resolves to the calculated fee as a number (e.g., 0.03 represents a 3% fee)\n */\n calculateFee?(params: CalculateFeeParams): Promise<number | undefined>\n}\n\nexport interface ToAddress {\n name?: string\n address: string\n chainType: ChainType\n logoURI?: string\n}\n\nexport interface AllowDeny<T> {\n allow?: T[]\n deny?: T[]\n}\n\nexport type AllowDenySetItem = string | number\nexport interface AllowDenySet {\n allow?: Set<AllowDenySetItem>\n deny?: Set<AllowDenySetItem>\n}\n\nexport type AllowDenySets = {\n from?: AllowDenySet\n to?: AllowDenySet\n} & AllowDenySet\n\nexport type AllowDenyItems<T> = {\n from?: AllowDeny<T>\n to?: AllowDeny<T>\n} & AllowDeny<T>\n\nexport type WidgetChains = {\n types?: AllowDeny<ChainType>\n} & AllowDenyItems<number>\n\nexport type WidgetTokens = {\n featured?: StaticToken[]\n include?: Token[]\n popular?: StaticToken[]\n verified?: BaseToken[]\n} & AllowDenyItems<BaseToken>\n\nexport type WidgetLanguages = {\n default?: LanguageKey\n} & AllowDeny<LanguageKey>\n\nexport type PoweredByType = 'default' | 'jumper'\n\nexport interface RouteLabel {\n text: string\n sx?: SxProps<Theme>\n}\n\nexport interface RouteLabelRule {\n label: RouteLabel\n // Matching criteria\n bridges?: AllowDeny<string>\n exchanges?: AllowDeny<string>\n fromChainId?: number[]\n toChainId?: number[]\n fromTokenAddress?: string[]\n toTokenAddress?: string[]\n /**\n * Custom match function evaluated against the route. When provided, its\n * result is AND'd with the other matching criteria — all specified\n * conditions must pass for the label to apply. Use this for matching logic\n * that the built-in fields cannot express (gas costs, step count, route\n * tags, etc.).\n */\n match?: (route: Route) => boolean\n}\n\nexport type ExplorerUrl =\n | string\n | {\n url: string\n txPath?: string\n addressPath?: string\n }\n\nexport type WidgetProvider = (\n props: PropsWithChildren<WidgetProviderProps>\n) => ReactNode\n\nexport interface WidgetConfig {\n fromChain?: number\n toChain?: number\n fromToken?: string\n toToken?: string\n toAddress?: ToAddress\n toAddresses?: ToAddress[]\n fromAmount?: number | string\n minFromAmountUSD?: number\n toAmount?: number | string\n formUpdateKey?: string\n\n providers?: WidgetProvider[]\n\n contractCalls?: ContractCall[]\n contractComponent?: ReactNode\n contractSecondaryComponent?: ReactNode\n contractCompactComponent?: ReactNode\n contractTool?: WidgetContractTool\n integrator: string\n apiKey?: string\n feeConfig?: WidgetFeeConfig\n referrer?: string\n\n routePriority?: Order\n slippage?: number\n\n variant?: WidgetVariant\n mode?: WidgetMode\n modeOptions?: ModeOptions\n /**\n * Header navigation tabs, in order. When set, the widget renders a tab bar\n * and the active tab drives the displayed flow. Each entry is a tab key.\n *\n * @internal Not part of the public API.\n */\n _navigationTabs?: NavigationTabKey[]\n\n appearance?: Appearance\n theme?: WidgetTheme\n\n disabledUI?: DisabledUIConfig\n hiddenUI?: HiddenUIConfig\n requiredUI?: RequiredUIConfig\n defaultUI?: DefaultUI\n /**\n * When true, shows only the recommended route and hides the route\n * selector UI. Distinct from `routePriority`, which sets the SDK\n * ranking order across multiple displayed routes.\n * @default false\n */\n showSingleRoute?: boolean\n useRelayerRoutes?: boolean\n\n walletConfig?: WidgetWalletConfig\n sdkConfig?: WidgetSDKConfig\n\n buildUrl?: boolean\n keyPrefix?: string\n\n bridges?: AllowDeny<string>\n exchanges?: AllowDeny<string>\n chains?: WidgetChains\n tokens?: WidgetTokens\n languages?: WidgetLanguages\n languageResources?: LanguageResources\n explorerUrls?: Record<number, ExplorerUrl[]> &\n Partial<Record<'internal', ExplorerUrl[]>>\n poweredBy?: PoweredByType\n\n /**\n * Custom labels/badges to show on routes based on specified rules\n */\n routeLabels?: RouteLabelRule[]\n}\n\nexport interface FormFieldOptions {\n setUrlSearchParam: boolean\n}\n\nexport interface FieldValues\n extends Omit<DefaultFieldValues, 'fromAmount' | 'toAmount' | 'toAddress'> {\n fromAmount?: number | string\n toAmount?: number | string\n toAddress?: ToAddress | string\n}\n\nexport type FieldNames = keyof FieldValues\n\nexport type SetFieldValueFunction = <K extends FieldNames>(\n key: K,\n value: FieldValues[K],\n options?: FormFieldOptions\n) => void\n\nexport type FormState = {\n setFieldValue: SetFieldValueFunction\n}\n\nexport type FormRef = RefObject<FormState | null>\n\nexport interface FormRefProps {\n formRef?: FormRef\n}\n\nexport interface WidgetConfigProps extends FormRefProps {\n config: WidgetConfig\n}\n\nexport interface WidgetConfigPartialProps {\n config?: Partial<WidgetConfig>\n}\n\nexport type WidgetProps = WidgetDrawerProps &\n WidgetConfig &\n WidgetConfigPartialProps &\n FormRefProps\n\nexport interface WidgetDrawerProps extends WidgetConfigPartialProps {\n elementRef?: RefObject<HTMLDivElement>\n open?: boolean\n /**\n * Make sure to make the onClose callback stable (e.g. using useCallback) to avoid causing re-renders of the entire widget\n */\n onClose?(): void\n}\n\nexport enum ExpansionType {\n Routes = 'routes',\n FromChain = 'fromChain',\n ToChain = 'toChain',\n}\n"],"mappings":";AAieA,IAAY,gBAAL,yBAAA,eAAA;CACL,cAAA,YAAA;CACA,cAAA,eAAA;CACA,cAAA,aAAA;;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/utils/address.ts
|
|
2
|
+
/**
|
|
3
|
+
* True when a token search query is a contract address rather than free text.
|
|
4
|
+
* `getChainTypeFromTokenAddress` asks the configured providers' own
|
|
5
|
+
* `isTokenAddress` (see `useChainTypeFromAddress`), so it covers the token
|
|
6
|
+
* identifier of every ecosystem. Two consequences follow. `bitcoin` stays a
|
|
7
|
+
* name search, because the Bitcoin provider implements no token check. And an
|
|
8
|
+
* ecosystem is not detected unless the host configures its provider from
|
|
9
|
+
* `@lifi/sdk` 4.7.0 or later, even when its chains are listed.
|
|
10
|
+
*/
|
|
11
|
+
const isAddressQuery = (query, getChainTypeFromTokenAddress) => {
|
|
12
|
+
const value = query?.trim();
|
|
13
|
+
if (!value) return false;
|
|
14
|
+
return getChainTypeFromTokenAddress(value) !== void 0;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { isAddressQuery };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","names":[],"sources":["../../../src/utils/address.ts"],"sourcesContent":["import type { ChainType } from '@lifi/sdk'\n\n/**\n * True when a token search query is a contract address rather than free text.\n * `getChainTypeFromTokenAddress` asks the configured providers' own\n * `isTokenAddress` (see `useChainTypeFromAddress`), so it covers the token\n * identifier of every ecosystem. Two consequences follow. `bitcoin` stays a\n * name search, because the Bitcoin provider implements no token check. And an\n * ecosystem is not detected unless the host configures its provider from\n * `@lifi/sdk` 4.7.0 or later, even when its chains are listed.\n */\nexport const isAddressQuery = (\n query: string | undefined,\n getChainTypeFromTokenAddress: (address: string) => ChainType | undefined\n): boolean => {\n const value = query?.trim()\n if (!value) {\n return false\n }\n return getChainTypeFromTokenAddress(value) !== undefined\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAa,kBACX,OACA,iCACY;CACZ,MAAM,QAAQ,OAAO,KAAK;CAC1B,IAAI,CAAC,OACH,OAAO;CAET,OAAO,6BAA6B,KAAK,MAAM,KAAA;AACjD"}
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
* @param options - Formatting options including decimals and Intl.NumberFormat options
|
|
9
9
|
* @returns A formatted string with subscript notation for leading zeros
|
|
10
10
|
*/
|
|
11
|
-
declare const compactNumberFormatter: (lng: string | undefined, options: any) => ((value: any) => string);
|
|
11
|
+
export declare const compactNumberFormatter: (lng: string | undefined, options: any) => ((value: any) => string);
|
|
12
12
|
//#endregion
|
|
13
|
-
export { compactNumberFormatter };
|
|
14
13
|
//# sourceMappingURL=compactNumberFormatter.d.ts.map
|