@lifi/widget 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.d.ts +4 -0
- package/App.js +18 -0
- package/AppDrawer.d.ts +14 -0
- package/AppDrawer.js +34 -0
- package/AppDrawer.style.d.ts +49 -0
- package/AppDrawer.style.js +52 -0
- package/AppProvider.d.ts +6 -0
- package/AppProvider.js +12 -0
- package/LICENSE.md +21 -0
- package/components/AppContainer.d.ts +5 -0
- package/components/AppContainer.js +53 -0
- package/components/BottomSheet/BottomSheet.d.ts +3 -0
- package/components/BottomSheet/BottomSheet.js +42 -0
- package/components/BottomSheet/index.d.ts +2 -0
- package/components/BottomSheet/index.js +2 -0
- package/components/BottomSheet/types.d.ts +10 -0
- package/components/BottomSheet/types.js +1 -0
- package/components/Card/Card.d.ts +8 -0
- package/components/Card/Card.js +8 -0
- package/components/Card/CardContainer.d.ts +11 -0
- package/components/Card/CardContainer.js +16 -0
- package/components/Card/CardHeader.d.ts +18 -0
- package/components/Card/CardHeader.js +20 -0
- package/components/Card/CardTitle.d.ts +14 -0
- package/components/Card/CardTitle.js +9 -0
- package/components/Card/index.d.ts +4 -0
- package/components/Card/index.js +4 -0
- package/components/Header/Header.d.ts +2 -0
- package/components/Header/Header.js +17 -0
- package/components/Header/Header.style.d.ts +22 -0
- package/components/Header/Header.style.js +21 -0
- package/components/Header/NavigationHeader.d.ts +2 -0
- package/components/Header/NavigationHeader.js +46 -0
- package/components/Header/WalletHeader.d.ts +2 -0
- package/components/Header/WalletHeader.js +28 -0
- package/components/Header/index.d.ts +1 -0
- package/components/Header/index.js +1 -0
- package/components/Input.d.ts +1 -0
- package/components/Input.js +14 -0
- package/components/LiFiLogo.d.ts +5 -0
- package/components/LiFiLogo.js +7 -0
- package/components/PoweredBy.d.ts +2 -0
- package/components/PoweredBy.js +14 -0
- package/components/ProgressToNextUpdate/ProgressToNextUpdate.d.ts +7 -0
- package/components/ProgressToNextUpdate/ProgressToNextUpdate.js +49 -0
- package/components/ProgressToNextUpdate/index.d.ts +1 -0
- package/components/ProgressToNextUpdate/index.js +1 -0
- package/components/ReverseTokensButton/ReverseTokensButton.d.ts +4 -0
- package/components/ReverseTokensButton/ReverseTokensButton.js +24 -0
- package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +29 -0
- package/components/ReverseTokensButton/ReverseTokensButton.style.js +14 -0
- package/components/ReverseTokensButton/index.d.ts +1 -0
- package/components/ReverseTokensButton/index.js +1 -0
- package/components/Select.d.ts +3 -0
- package/components/Select.js +27 -0
- package/components/SelectChainAndToken.d.ts +3 -0
- package/components/SelectChainAndToken.js +19 -0
- package/components/SelectTokenButton/SelectTokenButton.d.ts +5 -0
- package/components/SelectTokenButton/SelectTokenButton.js +29 -0
- package/components/SelectTokenButton/SelectTokenButton.style.d.ts +28 -0
- package/components/SelectTokenButton/SelectTokenButton.style.js +31 -0
- package/components/SelectTokenButton/index.d.ts +1 -0
- package/components/SelectTokenButton/index.js +1 -0
- package/components/StepActions/StepActions.d.ts +13 -0
- package/components/StepActions/StepActions.js +49 -0
- package/components/StepActions/StepActions.style.d.ts +20 -0
- package/components/StepActions/StepActions.style.js +56 -0
- package/components/StepActions/index.d.ts +1 -0
- package/components/StepActions/index.js +1 -0
- package/components/StepActions/types.d.ts +6 -0
- package/components/StepActions/types.js +1 -0
- package/components/StepToken.d.ts +6 -0
- package/components/StepToken.js +21 -0
- package/components/SwapButton/ButtonTooltip.d.ts +4 -0
- package/components/SwapButton/ButtonTooltip.js +3 -0
- package/components/SwapButton/SwapButton.d.ts +2 -0
- package/components/SwapButton/SwapButton.js +77 -0
- package/components/SwapButton/SwapButton.style.d.ts +65 -0
- package/components/SwapButton/SwapButton.style.js +20 -0
- package/components/SwapButton/index.d.ts +1 -0
- package/components/SwapButton/index.js +1 -0
- package/components/SwapInProgress/SwapInProgress.d.ts +3 -0
- package/components/SwapInProgress/SwapInProgress.js +22 -0
- package/components/SwapInProgress/SwapInProgress.style.d.ts +43 -0
- package/components/SwapInProgress/SwapInProgress.style.js +15 -0
- package/components/SwapInProgress/index.d.ts +1 -0
- package/components/SwapInProgress/index.js +1 -0
- package/components/SwapInput/FormPriceHelperText.d.ts +5 -0
- package/components/SwapInput/FormPriceHelperText.js +27 -0
- package/components/SwapInput/SwapInput.d.ts +3 -0
- package/components/SwapInput/SwapInput.js +43 -0
- package/components/SwapInput/SwapInput.style.d.ts +21 -0
- package/components/SwapInput/SwapInput.style.js +30 -0
- package/components/SwapInput/SwapInputAdornment.d.ts +2 -0
- package/components/SwapInput/SwapInputAdornment.js +23 -0
- package/components/SwapInput/SwapInputAdornment.style.d.ts +34 -0
- package/components/SwapInput/SwapInputAdornment.style.js +22 -0
- package/components/SwapInput/index.d.ts +1 -0
- package/components/SwapInput/index.js +1 -0
- package/components/SwapRouteCard/SwapRouteCard.d.ts +4 -0
- package/components/SwapRouteCard/SwapRouteCard.js +34 -0
- package/components/SwapRouteCard/SwapRouteCard.style.d.ts +36 -0
- package/components/SwapRouteCard/SwapRouteCard.style.js +71 -0
- package/components/SwapRouteCard/index.d.ts +1 -0
- package/components/SwapRouteCard/index.js +1 -0
- package/components/SwapRouteCard/types.d.ts +7 -0
- package/components/SwapRouteCard/types.js +1 -0
- package/components/SwapRoutes/SwapRoutes.d.ts +3 -0
- package/components/SwapRoutes/SwapRoutes.js +33 -0
- package/components/SwapRoutes/SwapRoutes.style.d.ts +11 -0
- package/components/SwapRoutes/SwapRoutes.style.js +9 -0
- package/components/SwapRoutes/SwapRoutesUpdateProgress.d.ts +3 -0
- package/components/SwapRoutes/SwapRoutesUpdateProgress.js +24 -0
- package/components/SwapRoutes/index.d.ts +1 -0
- package/components/SwapRoutes/index.js +1 -0
- package/components/Switch.d.ts +1 -0
- package/components/Switch.js +53 -0
- package/components/TextFitter/TextFitter.d.ts +3 -0
- package/components/TextFitter/TextFitter.js +44 -0
- package/components/TextFitter/index.d.ts +1 -0
- package/components/TextFitter/index.js +1 -0
- package/components/TextFitter/types.d.ts +12 -0
- package/components/TextFitter/types.js +1 -0
- package/components/TokenList/TokenList.d.ts +3 -0
- package/components/TokenList/TokenList.js +58 -0
- package/components/TokenList/TokenList.style.d.ts +32 -0
- package/components/TokenList/TokenList.style.js +22 -0
- package/components/TokenList/TokenListItem.d.ts +4 -0
- package/components/TokenList/TokenListItem.js +24 -0
- package/components/TokenList/index.d.ts +1 -0
- package/components/TokenList/index.js +1 -0
- package/components/TokenList/types.d.ts +16 -0
- package/components/TokenList/types.js +1 -0
- package/components/TokenList/utils.d.ts +15 -0
- package/components/TokenList/utils.js +10 -0
- package/config/env.d.ts +12 -0
- package/config/env.js +19 -0
- package/config/queryClient.d.ts +2 -0
- package/config/queryClient.js +25 -0
- package/config/rpcs.d.ts +1 -0
- package/config/rpcs.js +20 -0
- package/config/theme.d.ts +27 -0
- package/config/theme.js +126 -0
- package/hooks/index.d.ts +15 -0
- package/hooks/index.js +15 -0
- package/hooks/useBridges.d.ts +1 -0
- package/hooks/useBridges.js +12 -0
- package/hooks/useChain.d.ts +4 -0
- package/hooks/useChain.js +13 -0
- package/hooks/useChains.d.ts +101 -0
- package/hooks/useChains.js +39 -0
- package/hooks/useContentHeight.d.ts +1 -0
- package/hooks/useContentHeight.js +15 -0
- package/hooks/useDebouncedWatch.d.ts +1 -0
- package/hooks/useDebouncedWatch.js +27 -0
- package/hooks/useExchanges.d.ts +1 -0
- package/hooks/useExchanges.js +12 -0
- package/hooks/useHasSufficientBalance.d.ts +5 -0
- package/hooks/useHasSufficientBalance.js +59 -0
- package/hooks/useRouteExecution/index.d.ts +3 -0
- package/hooks/useRouteExecution/index.js +3 -0
- package/hooks/useRouteExecution/types.d.ts +15 -0
- package/hooks/useRouteExecution/types.js +1 -0
- package/hooks/useRouteExecution/useRouteExecution.d.ts +8 -0
- package/hooks/useRouteExecution/useRouteExecution.js +132 -0
- package/hooks/useRouteExecution/useRouteStore.d.ts +17 -0
- package/hooks/useRouteExecution/useRouteStore.js +71 -0
- package/hooks/useScrollableContainer.d.ts +2 -0
- package/hooks/useScrollableContainer.js +24 -0
- package/hooks/useSettings/index.d.ts +2 -0
- package/hooks/useSettings/index.js +2 -0
- package/hooks/useSettings/types.d.ts +5 -0
- package/hooks/useSettings/types.js +1 -0
- package/hooks/useSettings/useSettingsStore.d.ts +13 -0
- package/hooks/useSettings/useSettingsStore.js +22 -0
- package/hooks/useSwapRoutes.d.ts +8 -0
- package/hooks/useSwapRoutes.js +101 -0
- package/hooks/useToken.d.ts +4 -0
- package/hooks/useToken.js +13 -0
- package/hooks/useTokenBalance.d.ts +7 -0
- package/hooks/useTokenBalance.js +46 -0
- package/hooks/useTokenBalances.d.ts +7 -0
- package/hooks/useTokenBalances.js +54 -0
- package/hooks/useTokens.d.ts +5 -0
- package/hooks/useTokens.js +24 -0
- package/i18n/en/translation.json +138 -0
- package/i18n/index.d.ts +144 -0
- package/i18n/index.js +20 -0
- package/i18n/react-i18next.d.ts +9 -0
- package/index.d.ts +5 -0
- package/index.js +9 -0
- package/lifi.d.ts +2 -0
- package/lifi.js +10 -0
- package/package.json +55 -0
- package/pages/MainPage/MainPage.d.ts +2 -0
- package/pages/MainPage/MainPage.js +11 -0
- package/pages/MainPage/MainPage.style.d.ts +11 -0
- package/pages/MainPage/MainPage.style.js +8 -0
- package/pages/MainPage/SendToRecipientForm.d.ts +2 -0
- package/pages/MainPage/SendToRecipientForm.js +20 -0
- package/pages/MainPage/index.d.ts +1 -0
- package/pages/MainPage/index.js +1 -0
- package/pages/SelectTokenPage/ChainSelect.d.ts +2 -0
- package/pages/SelectTokenPage/ChainSelect.js +25 -0
- package/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -0
- package/pages/SelectTokenPage/SearchTokenInput.js +17 -0
- package/pages/SelectTokenPage/SearchTokenInput.style.d.ts +1 -0
- package/pages/SelectTokenPage/SearchTokenInput.style.js +5 -0
- package/pages/SelectTokenPage/SelectTokenPage.d.ts +5 -0
- package/pages/SelectTokenPage/SelectTokenPage.js +16 -0
- package/pages/SelectTokenPage/index.d.ts +2 -0
- package/pages/SelectTokenPage/index.js +2 -0
- package/pages/SelectTokenPage/types.d.ts +4 -0
- package/pages/SelectTokenPage/types.js +5 -0
- package/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
- package/pages/SelectWalletPage/SelectWalletPage.js +68 -0
- package/pages/SelectWalletPage/SelectWalletPage.style.d.ts +46 -0
- package/pages/SelectWalletPage/SelectWalletPage.style.js +27 -0
- package/pages/SelectWalletPage/index.d.ts +1 -0
- package/pages/SelectWalletPage/index.js +1 -0
- package/pages/SettingsPage/AdvancedPreferences.d.ts +1 -0
- package/pages/SettingsPage/AdvancedPreferences.js +19 -0
- package/pages/SettingsPage/ColorSchemeButtonGroup.d.ts +2 -0
- package/pages/SettingsPage/ColorSchemeButtonGroup.js +20 -0
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +33 -0
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.js +16 -0
- package/pages/SettingsPage/EnabledBridgesSelect.d.ts +2 -0
- package/pages/SettingsPage/EnabledBridgesSelect.js +15 -0
- package/pages/SettingsPage/EnabledExchangesSelect.d.ts +2 -0
- package/pages/SettingsPage/EnabledExchangesSelect.js +15 -0
- package/pages/SettingsPage/GasPriceSelect.d.ts +1 -0
- package/pages/SettingsPage/GasPriceSelect.js +13 -0
- package/pages/SettingsPage/RoutePrioritySelect.d.ts +2 -0
- package/pages/SettingsPage/RoutePrioritySelect.js +13 -0
- package/pages/SettingsPage/SettingsPage.d.ts +1 -0
- package/pages/SettingsPage/SettingsPage.js +10 -0
- package/pages/SettingsPage/SlippageInput.d.ts +1 -0
- package/pages/SettingsPage/SlippageInput.js +28 -0
- package/pages/SettingsPage/index.d.ts +1 -0
- package/pages/SettingsPage/index.js +1 -0
- package/pages/SwapPage/CircularProgress.d.ts +4 -0
- package/pages/SwapPage/CircularProgress.js +20 -0
- package/pages/SwapPage/CircularProgress.style.d.ts +6 -0
- package/pages/SwapPage/CircularProgress.style.js +51 -0
- package/pages/SwapPage/ExecutionItem.d.ts +6 -0
- package/pages/SwapPage/ExecutionItem.js +21 -0
- package/pages/SwapPage/ExecutionItem.style.d.ts +39 -0
- package/pages/SwapPage/ExecutionItem.style.js +5 -0
- package/pages/SwapPage/StatusBottomSheet.d.ts +3 -0
- package/pages/SwapPage/StatusBottomSheet.js +79 -0
- package/pages/SwapPage/StatusBottomSheet.style.d.ts +25 -0
- package/pages/SwapPage/StatusBottomSheet.style.js +32 -0
- package/pages/SwapPage/StepDivider.d.ts +2 -0
- package/pages/SwapPage/StepDivider.js +6 -0
- package/pages/SwapPage/StepDivider.style.d.ts +11 -0
- package/pages/SwapPage/StepDivider.style.js +8 -0
- package/pages/SwapPage/StepItem.d.ts +7 -0
- package/pages/SwapPage/StepItem.js +29 -0
- package/pages/SwapPage/StepTimer.d.ts +5 -0
- package/pages/SwapPage/StepTimer.js +59 -0
- package/pages/SwapPage/SwapPage.d.ts +2 -0
- package/pages/SwapPage/SwapPage.js +22 -0
- package/pages/SwapPage/SwapPage.style.d.ts +44 -0
- package/pages/SwapPage/SwapPage.style.js +12 -0
- package/pages/SwapPage/index.d.ts +1 -0
- package/pages/SwapPage/index.js +1 -0
- package/pages/SwapPage/utils.d.ts +6 -0
- package/pages/SwapPage/utils.js +85 -0
- package/pages/SwapRoutesPage/SwapRoutesPage.d.ts +3 -0
- package/pages/SwapRoutesPage/SwapRoutesPage.js +24 -0
- package/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +11 -0
- package/pages/SwapRoutesPage/SwapRoutesPage.style.js +6 -0
- package/pages/SwapRoutesPage/index.d.ts +1 -0
- package/pages/SwapRoutesPage/index.js +1 -0
- package/providers/SwapFormProvider/SwapFormProvider.d.ts +2 -0
- package/providers/SwapFormProvider/SwapFormProvider.js +20 -0
- package/providers/SwapFormProvider/index.d.ts +2 -0
- package/providers/SwapFormProvider/index.js +2 -0
- package/providers/SwapFormProvider/types.d.ts +44 -0
- package/providers/SwapFormProvider/types.js +24 -0
- package/providers/ThemeProvider/ThemeProvider.d.ts +2 -0
- package/providers/ThemeProvider/ThemeProvider.js +33 -0
- package/providers/ThemeProvider/index.d.ts +1 -0
- package/providers/ThemeProvider/index.js +1 -0
- package/providers/WalletProvider/WalletProvider.d.ts +4 -0
- package/providers/WalletProvider/WalletProvider.js +89 -0
- package/providers/WalletProvider/index.d.ts +2 -0
- package/providers/WalletProvider/index.js +2 -0
- package/providers/WalletProvider/types.d.ts +17 -0
- package/providers/WalletProvider/types.js +1 -0
- package/providers/WidgetProvider/WidgetProvider.d.ts +4 -0
- package/providers/WidgetProvider/WidgetProvider.js +44 -0
- package/providers/WidgetProvider/index.d.ts +2 -0
- package/providers/WidgetProvider/index.js +2 -0
- package/providers/WidgetProvider/types.d.ts +8 -0
- package/providers/WidgetProvider/types.js +1 -0
- package/react-app-env.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.js +1 -0
- package/types/widget.d.ts +41 -0
- package/types/widget.js +1 -0
- package/utils/colors.d.ts +2 -0
- package/utils/colors.js +3 -0
- package/utils/deepClone.d.ts +1 -0
- package/utils/deepClone.js +3 -0
- package/utils/elements.d.ts +4 -0
- package/utils/elements.js +5 -0
- package/utils/format.d.ts +9 -0
- package/utils/format.js +76 -0
- package/utils/input.d.ts +1 -0
- package/utils/input.js +24 -0
- package/utils/routes.d.ts +10 -0
- package/utils/routes.js +9 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": {
|
|
3
|
+
"walletConnected": "Wallet connected",
|
|
4
|
+
"connectWallet": "Connect wallet",
|
|
5
|
+
"selectWallet": "Select your wallet",
|
|
6
|
+
"swap": "Swap",
|
|
7
|
+
"from": "Swap from",
|
|
8
|
+
"to": "Swap to",
|
|
9
|
+
"settings": "Settings",
|
|
10
|
+
"routes": "You get"
|
|
11
|
+
},
|
|
12
|
+
"button": {
|
|
13
|
+
"swap": "Swap",
|
|
14
|
+
"connectWallet": "Connect wallet",
|
|
15
|
+
"switchChain": "Switch chain",
|
|
16
|
+
"startSwap": "Start the swap",
|
|
17
|
+
"restartSwap": "Restart swap",
|
|
18
|
+
"removeSwap": "Remove swap",
|
|
19
|
+
"done": "Done",
|
|
20
|
+
"okay": "Okay",
|
|
21
|
+
"seeDetails": "See details",
|
|
22
|
+
"tryAgain": "Try again",
|
|
23
|
+
"light": "Light",
|
|
24
|
+
"dark": "Dark",
|
|
25
|
+
"auto": "Auto",
|
|
26
|
+
"ok": "Ok",
|
|
27
|
+
"hide": "Hide",
|
|
28
|
+
"max": "max",
|
|
29
|
+
"lifiSwap": "LI.FI Swap"
|
|
30
|
+
},
|
|
31
|
+
"swap": {
|
|
32
|
+
"from": "From",
|
|
33
|
+
"to": "To",
|
|
34
|
+
"amount": "You pay",
|
|
35
|
+
"maxAmount": "/ {{amount}}",
|
|
36
|
+
"routes": "You get",
|
|
37
|
+
"approximateCurrency": "\u2248 {{value, currency(currency: USD)}}",
|
|
38
|
+
"currency": "{{value, currency(currency: USD)}}",
|
|
39
|
+
"sendToRecipient": "Send to recipient",
|
|
40
|
+
"recipientsAddress": "Recipient's {{chain}} address",
|
|
41
|
+
"addressConfirmation": "I confirm that the address above is correct",
|
|
42
|
+
"gas": "gas fee",
|
|
43
|
+
"minutes": "minutes",
|
|
44
|
+
"tokenSearch": "Search your token",
|
|
45
|
+
"selectChain": "Chain",
|
|
46
|
+
"selectToken": "Token",
|
|
47
|
+
"selectChainAndToken": "Select chain and token",
|
|
48
|
+
"inProgress": "In progress",
|
|
49
|
+
"couldntFindTokens": "We couldn't find tokens on this chain or you don't have any.",
|
|
50
|
+
"insufficientFunds": "Insufficient funds",
|
|
51
|
+
"insufficientGasOnStartChain": "Insufficient gas on start chain",
|
|
52
|
+
"insufficientGasOnDestinationChain": "Insufficient gas on destination chain",
|
|
53
|
+
"insufficientGasOnDestinationChainTooltip": "The selected route requires a swap on the chain you are transferring to. You need to have gas on that chain to pay for the transaction there.",
|
|
54
|
+
"stepSwap": "Swap",
|
|
55
|
+
"stepBridge": "Bridge",
|
|
56
|
+
"stepSwapAndBridge": "Swap and bridge",
|
|
57
|
+
"estimatedTime": "~{{value}} min.",
|
|
58
|
+
"networkIsBusy": "Network is busy...",
|
|
59
|
+
"crossStepDetails": "Bridge {{from}} to {{to}} via {{tool}}",
|
|
60
|
+
"swapStepDetails": "Swap on {{value}}",
|
|
61
|
+
"success": {
|
|
62
|
+
"title": {
|
|
63
|
+
"fundsReceived": "Funds received"
|
|
64
|
+
},
|
|
65
|
+
"message": {
|
|
66
|
+
"fundsReceived": "You now have {{amount}} {{tokenSymbol}} in your wallet on {{chainName}} chain."
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"error": {
|
|
70
|
+
"title": {
|
|
71
|
+
"chainSwitch": "Chain switch required.",
|
|
72
|
+
"transactionFailed": "Transaction has failed.",
|
|
73
|
+
"transactionUnderpriced": "Transaction is underpriced.",
|
|
74
|
+
"transactionUnprepared": "Unable to prepare transaction.",
|
|
75
|
+
"unknown": "Something went wrong.",
|
|
76
|
+
"userRejectedSignatureRequest": "Signature required."
|
|
77
|
+
},
|
|
78
|
+
"message": {
|
|
79
|
+
"signatureRequired": "Your signature is required to complete the transaction. {{amount}} {{tokenSymbol}} on {{chainName}} remain in your wallet.",
|
|
80
|
+
"transactionFailed": "Please check the block explorer for more information.",
|
|
81
|
+
"transactionNotSent": "Transaction was not sent, your funds are still in your wallet ({{amount}} {{tokenSymbol}} on {{chainName}})."
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"process": {
|
|
85
|
+
"tokenAllowance": {
|
|
86
|
+
"started": "Setting token allowance.",
|
|
87
|
+
"pending": "Waiting for token allowance approval.",
|
|
88
|
+
"done": "Token allowance approved."
|
|
89
|
+
},
|
|
90
|
+
"switchChain": {
|
|
91
|
+
"pending": "Chain switch required.",
|
|
92
|
+
"done": "Chain switched successfully."
|
|
93
|
+
},
|
|
94
|
+
"swap": {
|
|
95
|
+
"started": "Preparing swap.",
|
|
96
|
+
"actionRequired": "Please sign the transaction.",
|
|
97
|
+
"pending": "Swapping.",
|
|
98
|
+
"done": "Swap completed."
|
|
99
|
+
},
|
|
100
|
+
"crossChain": {
|
|
101
|
+
"started": "Preparing transaction.",
|
|
102
|
+
"actionRequired": "Please sign the transaction.",
|
|
103
|
+
"pending": "Waiting for transaction.",
|
|
104
|
+
"done": "Transaction approved."
|
|
105
|
+
},
|
|
106
|
+
"receivingChain": {
|
|
107
|
+
"pending": "Waiting for receiving chain.",
|
|
108
|
+
"done": "Funds received."
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"settings": {
|
|
113
|
+
"routePriority": {
|
|
114
|
+
"title": "Route priority",
|
|
115
|
+
"recommended": "Recommended"
|
|
116
|
+
},
|
|
117
|
+
"slippage": "Slippage",
|
|
118
|
+
"gasPrice": {
|
|
119
|
+
"title": "Gas price",
|
|
120
|
+
"slow": "Slow",
|
|
121
|
+
"normal": "Normal",
|
|
122
|
+
"fast": "Fast"
|
|
123
|
+
},
|
|
124
|
+
"advancedPreferences": "Advanced preferences",
|
|
125
|
+
"bridgePrioritization": "Bridge prioritization",
|
|
126
|
+
"enabledBridges": "Enabled bridges",
|
|
127
|
+
"selectEnabledBridges": "Select enabled bridges",
|
|
128
|
+
"enabledExchanges": "Enabled exchanges",
|
|
129
|
+
"selectEnabledExchanges": "Select enabled exchanges",
|
|
130
|
+
"resetToDefault": "Reset to default"
|
|
131
|
+
},
|
|
132
|
+
"wallet": {
|
|
133
|
+
"extensionNotFound": "Please make sure that only the {{name}} browser extension is active before choosing this wallet."
|
|
134
|
+
},
|
|
135
|
+
"tooltip": {
|
|
136
|
+
"progressToNextUpdate": "Displayed data will auto-refresh after {{value}} seconds. Click this circle to update manually."
|
|
137
|
+
}
|
|
138
|
+
}
|
package/i18n/index.d.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
export declare const defaultNS = "translation";
|
|
2
|
+
export declare const resources: {
|
|
3
|
+
readonly en: {
|
|
4
|
+
readonly translation: {
|
|
5
|
+
header: {
|
|
6
|
+
walletConnected: string;
|
|
7
|
+
connectWallet: string;
|
|
8
|
+
selectWallet: string;
|
|
9
|
+
swap: string;
|
|
10
|
+
from: string;
|
|
11
|
+
to: string;
|
|
12
|
+
settings: string;
|
|
13
|
+
routes: string;
|
|
14
|
+
};
|
|
15
|
+
button: {
|
|
16
|
+
swap: string;
|
|
17
|
+
connectWallet: string;
|
|
18
|
+
switchChain: string;
|
|
19
|
+
startSwap: string;
|
|
20
|
+
restartSwap: string;
|
|
21
|
+
removeSwap: string;
|
|
22
|
+
done: string;
|
|
23
|
+
okay: string;
|
|
24
|
+
seeDetails: string;
|
|
25
|
+
tryAgain: string;
|
|
26
|
+
light: string;
|
|
27
|
+
dark: string;
|
|
28
|
+
auto: string;
|
|
29
|
+
ok: string;
|
|
30
|
+
hide: string;
|
|
31
|
+
max: string;
|
|
32
|
+
lifiSwap: string;
|
|
33
|
+
};
|
|
34
|
+
swap: {
|
|
35
|
+
from: string;
|
|
36
|
+
to: string;
|
|
37
|
+
amount: string;
|
|
38
|
+
maxAmount: string;
|
|
39
|
+
routes: string;
|
|
40
|
+
approximateCurrency: string;
|
|
41
|
+
currency: string;
|
|
42
|
+
sendToRecipient: string;
|
|
43
|
+
recipientsAddress: string;
|
|
44
|
+
addressConfirmation: string;
|
|
45
|
+
gas: string;
|
|
46
|
+
minutes: string;
|
|
47
|
+
tokenSearch: string;
|
|
48
|
+
selectChain: string;
|
|
49
|
+
selectToken: string;
|
|
50
|
+
selectChainAndToken: string;
|
|
51
|
+
inProgress: string;
|
|
52
|
+
couldntFindTokens: string;
|
|
53
|
+
insufficientFunds: string;
|
|
54
|
+
insufficientGasOnStartChain: string;
|
|
55
|
+
insufficientGasOnDestinationChain: string;
|
|
56
|
+
insufficientGasOnDestinationChainTooltip: string;
|
|
57
|
+
stepSwap: string;
|
|
58
|
+
stepBridge: string;
|
|
59
|
+
stepSwapAndBridge: string;
|
|
60
|
+
estimatedTime: string;
|
|
61
|
+
networkIsBusy: string;
|
|
62
|
+
crossStepDetails: string;
|
|
63
|
+
swapStepDetails: string;
|
|
64
|
+
success: {
|
|
65
|
+
title: {
|
|
66
|
+
fundsReceived: string;
|
|
67
|
+
};
|
|
68
|
+
message: {
|
|
69
|
+
fundsReceived: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
error: {
|
|
73
|
+
title: {
|
|
74
|
+
chainSwitch: string;
|
|
75
|
+
transactionFailed: string;
|
|
76
|
+
transactionUnderpriced: string;
|
|
77
|
+
transactionUnprepared: string;
|
|
78
|
+
unknown: string;
|
|
79
|
+
userRejectedSignatureRequest: string;
|
|
80
|
+
};
|
|
81
|
+
message: {
|
|
82
|
+
signatureRequired: string;
|
|
83
|
+
transactionFailed: string;
|
|
84
|
+
transactionNotSent: string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
process: {
|
|
88
|
+
tokenAllowance: {
|
|
89
|
+
started: string;
|
|
90
|
+
pending: string;
|
|
91
|
+
done: string;
|
|
92
|
+
};
|
|
93
|
+
switchChain: {
|
|
94
|
+
pending: string;
|
|
95
|
+
done: string;
|
|
96
|
+
};
|
|
97
|
+
swap: {
|
|
98
|
+
started: string;
|
|
99
|
+
actionRequired: string;
|
|
100
|
+
pending: string;
|
|
101
|
+
done: string;
|
|
102
|
+
};
|
|
103
|
+
crossChain: {
|
|
104
|
+
started: string;
|
|
105
|
+
actionRequired: string;
|
|
106
|
+
pending: string;
|
|
107
|
+
done: string;
|
|
108
|
+
};
|
|
109
|
+
receivingChain: {
|
|
110
|
+
pending: string;
|
|
111
|
+
done: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
settings: {
|
|
116
|
+
routePriority: {
|
|
117
|
+
title: string;
|
|
118
|
+
recommended: string;
|
|
119
|
+
};
|
|
120
|
+
slippage: string;
|
|
121
|
+
gasPrice: {
|
|
122
|
+
title: string;
|
|
123
|
+
slow: string;
|
|
124
|
+
normal: string;
|
|
125
|
+
fast: string;
|
|
126
|
+
};
|
|
127
|
+
advancedPreferences: string;
|
|
128
|
+
bridgePrioritization: string;
|
|
129
|
+
enabledBridges: string;
|
|
130
|
+
selectEnabledBridges: string;
|
|
131
|
+
enabledExchanges: string;
|
|
132
|
+
selectEnabledExchanges: string;
|
|
133
|
+
resetToDefault: string;
|
|
134
|
+
};
|
|
135
|
+
wallet: {
|
|
136
|
+
extensionNotFound: string;
|
|
137
|
+
};
|
|
138
|
+
tooltip: {
|
|
139
|
+
progressToNextUpdate: string;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
export declare function configureReactI18next(): void;
|
package/i18n/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import i18n from 'i18next';
|
|
2
|
+
import { initReactI18next } from 'react-i18next';
|
|
3
|
+
import translation from './en/translation.json';
|
|
4
|
+
export const defaultNS = 'translation';
|
|
5
|
+
export const resources = {
|
|
6
|
+
en: {
|
|
7
|
+
translation,
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export function configureReactI18next() {
|
|
11
|
+
i18n.use(initReactI18next).init({
|
|
12
|
+
lng: 'en',
|
|
13
|
+
fallbackLng: 'en',
|
|
14
|
+
lowerCaseLng: true,
|
|
15
|
+
interpolation: {
|
|
16
|
+
escapeValue: false,
|
|
17
|
+
},
|
|
18
|
+
resources,
|
|
19
|
+
});
|
|
20
|
+
}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './fonts/inter.css';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export declare const LiFiWidget: import("react").FC<import("./AppProvider").AppProps>;
|
|
5
|
+
export declare const LiFiWidgetDrawer: import("react").ForwardRefExoticComponent<Pick<import("./AppDrawer").AppDrawerProps, "className" | "style" | "classes" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "transitionDuration" | "variant" | "open" | "anchor" | "elementRef" | "components" | "componentsProps" | "BackdropComponent" | "BackdropProps" | "closeAfterTransition" | "container" | "disableAutoFocus" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disablePortal" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "onBackdropClick" | "onClose" | "config" | "elevation" | "ModalProps" | "PaperProps" | "SlideProps"> & import("react").RefAttributes<import("./AppDrawer").AppDrawerBase>>;
|
package/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { App } from './App';
|
|
2
|
+
import { AppDrawer } from './AppDrawer';
|
|
3
|
+
import './fonts/inter.css';
|
|
4
|
+
import { configureReactI18next } from './i18n';
|
|
5
|
+
export * from './types';
|
|
6
|
+
configureReactI18next();
|
|
7
|
+
// ClassNameGenerator.configure((componentName) => componentName.replace('Mui', ''));
|
|
8
|
+
export const LiFiWidget = App;
|
|
9
|
+
export const LiFiWidgetDrawer = AppDrawer;
|
package/lifi.d.ts
ADDED
package/lifi.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lifi/widget",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"sideEffects": false,
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"module": "./index.js",
|
|
7
|
+
"lint-staged": {
|
|
8
|
+
"src/**/*.{ts,tsx}": [
|
|
9
|
+
"yarn run lint:fix",
|
|
10
|
+
"yarn run prettier:fix"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"author": "Eugene Chybisov <eugene@li.finance>",
|
|
17
|
+
"license": "UNLICENSED",
|
|
18
|
+
"homepage": "https://github.com/lifinance/widget",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+ssh://git@github.com/lifinance/widget.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/lifinance/widget/issues"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@emotion/react": "^11.9.0",
|
|
28
|
+
"@emotion/styled": "^11.8.1",
|
|
29
|
+
"@ethersproject/experimental": "^5.6.2",
|
|
30
|
+
"@ethersproject/providers": "^5.6.8",
|
|
31
|
+
"@lifi/wallet-management": "^1.0.0",
|
|
32
|
+
"@lifinance/sdk": "^1.0.0-beta.8",
|
|
33
|
+
"@mui/icons-material": "^5.8.2",
|
|
34
|
+
"@mui/lab": "^5.0.0-alpha.84",
|
|
35
|
+
"@mui/material": "^5.8.2",
|
|
36
|
+
"big.js": "^6.2.0",
|
|
37
|
+
"i18next": "^21.8.7",
|
|
38
|
+
"immer": "^9.0.14",
|
|
39
|
+
"react": "^18.1.0",
|
|
40
|
+
"react-dom": "^18.1.0",
|
|
41
|
+
"react-hook-form": "^7.31.3",
|
|
42
|
+
"react-i18next": "^11.16.10",
|
|
43
|
+
"react-query": "^4.0.0-beta.23",
|
|
44
|
+
"react-resize-detector": "^7.1.1",
|
|
45
|
+
"react-router-dom": "^6.3.0",
|
|
46
|
+
"react-timer-hook": "^3.0.5",
|
|
47
|
+
"react-virtual": "^2.10.4",
|
|
48
|
+
"zustand": "^4.0.0-rc.1"
|
|
49
|
+
},
|
|
50
|
+
"eslintConfig": {
|
|
51
|
+
"extends": "../../.eslintrc"
|
|
52
|
+
},
|
|
53
|
+
"private": false,
|
|
54
|
+
"types": "./index.d.ts"
|
|
55
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import { SelectChainAndToken } from '../../components/SelectChainAndToken';
|
|
4
|
+
import { SwapButton } from '../../components/SwapButton';
|
|
5
|
+
import { SwapInProgress } from '../../components/SwapInProgress';
|
|
6
|
+
import { SwapInput } from '../../components/SwapInput';
|
|
7
|
+
import { SwapRoutes } from '../../components/SwapRoutes';
|
|
8
|
+
import { FormContainer } from './MainPage.style';
|
|
9
|
+
export const MainPage = () => {
|
|
10
|
+
return (_jsxs(FormContainer, Object.assign({ disableGutters: true }, { children: [_jsx(SwapInProgress, { mx: 3, mt: 2, mb: 1 }), _jsx(SelectChainAndToken, { mt: 2, mx: 3, mb: 3 }), _jsx(Box, Object.assign({ mx: 3, mb: 3 }, { children: _jsx(SwapInput, { formType: "from" }) })), _jsx(SwapRoutes, { mx: 3, mb: 3 }), _jsx(Box, Object.assign({ mx: 3, mb: 1 }, { children: _jsx(SwapButton, {}) }))] })));
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const FormContainer: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
classes?: Partial<import("@mui/material").ContainerClasses> | undefined;
|
|
5
|
+
disableGutters?: boolean | undefined;
|
|
6
|
+
fixed?: boolean | undefined;
|
|
7
|
+
maxWidth?: false | import("@mui/material").Breakpoint | undefined;
|
|
8
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
9
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
10
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
11
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "maxWidth" | "fixed" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, {}, {}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { HelpOutline as HelpOutlineIcon } from '@mui/icons-material';
|
|
3
|
+
import { Box, Checkbox, FormControl, FormControlLabel, Typography, } from '@mui/material';
|
|
4
|
+
import { useFormContext, useWatch } from 'react-hook-form';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { Input } from '../../components/Input';
|
|
7
|
+
import { Switch } from '../../components/Switch';
|
|
8
|
+
import { SwapFormKey } from '../../providers/SwapFormProvider';
|
|
9
|
+
export const SendToRecipientForm = () => {
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
const { register } = useFormContext();
|
|
12
|
+
const sendToRecipientChecked = useWatch({
|
|
13
|
+
name: SwapFormKey.IsSendToRecipient,
|
|
14
|
+
});
|
|
15
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Box, Object.assign({ mb: 2, sx: {
|
|
16
|
+
display: 'flex',
|
|
17
|
+
justifyContent: 'space-between',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
} }, { children: [_jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: [_jsx(HelpOutlineIcon, { sx: { color: 'grey.500' } }), _jsx(Typography, Object.assign({ lineHeight: "normal", variant: "subtitle1", color: "text.primary", ml: 1 }, { children: t(`swap.sendToRecipient`) }))] })), _jsx(Switch, Object.assign({}, register(SwapFormKey.IsSendToRecipient)))] })), sendToRecipientChecked ? (_jsxs(_Fragment, { children: [_jsx(FormControl, Object.assign({ variant: "standard", fullWidth: true }, { children: _jsx(Input, { size: "small", placeholder: t(`swap.recipientsAddress`, { chain: 'ETH' }), required: true, inputProps: Object.assign({}, register(SwapFormKey.RecipientsAddress)) }) })), _jsx(Box, Object.assign({ mt: 0.5, mb: 1 }, { children: _jsx(FormControlLabel, { control: _jsx(Checkbox, Object.assign({ required: true }, register(SwapFormKey.IsAddressConfirmed))), label: t(`swap.addressConfirmation`), componentsProps: { typography: { variant: 'body2' } } }) }))] })) : null] }));
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MainPage';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MainPage';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
|
|
3
|
+
import { Avatar, FormControl, ListItemAvatar, MenuItem, Skeleton, } from '@mui/material';
|
|
4
|
+
import { useFormContext, useWatch } from 'react-hook-form';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { CardContainer, CardTitle } from '../../components/Card';
|
|
7
|
+
import { Select } from '../../components/Select';
|
|
8
|
+
import { useChains } from '../../hooks';
|
|
9
|
+
import { SwapFormKeyHelper, } from '../../providers/SwapFormProvider';
|
|
10
|
+
import { useWidgetConfig } from '../../providers/WidgetProvider';
|
|
11
|
+
export const ChainSelect = ({ formType }) => {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const { setValue } = useFormContext();
|
|
14
|
+
const { fromChain, toChain } = useWidgetConfig();
|
|
15
|
+
const { chains, isLoading } = useChains();
|
|
16
|
+
const [chainId] = useWatch({
|
|
17
|
+
name: [SwapFormKeyHelper.getChainKey(formType)],
|
|
18
|
+
});
|
|
19
|
+
const handleChain = (event) => {
|
|
20
|
+
setValue(SwapFormKeyHelper.getChainKey(formType), event.target.value);
|
|
21
|
+
setValue(SwapFormKeyHelper.getTokenKey(formType), '');
|
|
22
|
+
setValue(SwapFormKeyHelper.getAmountKey(formType), '');
|
|
23
|
+
};
|
|
24
|
+
return !isLoading ? (_jsxs(CardContainer, { children: [_jsx(CardTitle, { children: t(`swap.selectChain`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ labelId: "label", MenuProps: { elevation: 2 }, defaultValue: formType === 'from' ? fromChain : toChain, value: chainId, onChange: handleChain, IconComponent: KeyboardArrowDownIcon }, { children: chains === null || chains === void 0 ? void 0 : chains.map((chain) => (_jsxs(MenuItem, Object.assign({ value: chain.id }, { children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, Object.assign({ src: chain.logoURI, alt: chain.key }, { children: chain.name[0] })) }), chain.name] }), chain.key))) })) }))] })) : (_jsx(Skeleton, { variant: "rectangular", width: "100%", height: 89, sx: { borderRadius: 1 } }));
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SearchTokenInput: () => JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Search as SearchIcon } from '@mui/icons-material';
|
|
3
|
+
import { FormControl, InputAdornment } from '@mui/material';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
import { useFormContext } from 'react-hook-form';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { CardContainer } from '../../components/Card';
|
|
8
|
+
import { SwapFormKey } from '../../providers/SwapFormProvider';
|
|
9
|
+
import { Input } from './SearchTokenInput.style';
|
|
10
|
+
export const SearchTokenInput = () => {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const { register, setValue } = useFormContext();
|
|
13
|
+
useEffect(() => () => {
|
|
14
|
+
setValue(SwapFormKey.SearchTokensFilter, '');
|
|
15
|
+
}, [setValue]);
|
|
16
|
+
return (_jsx(CardContainer, { children: _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Input, { size: "small", placeholder: t(`swap.tokenSearch`), defaultValue: "", endAdornment: _jsx(InputAdornment, Object.assign({ position: "end" }, { children: _jsx(SearchIcon, {}) })), inputProps: Object.assign({ inputMode: 'search' }, register(SwapFormKey.SearchTokensFilter)), autoComplete: "off" }) })) }));
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Input: import("@emotion/styled").StyledComponent<import("@mui/material").InputBaseProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Container } from '@mui/material';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import { TokenList } from '../../components/TokenList';
|
|
5
|
+
import { useContentHeight, useScrollableOverflowHidden } from '../../hooks';
|
|
6
|
+
import { ChainSelect } from './ChainSelect';
|
|
7
|
+
import { SearchTokenInput } from './SearchTokenInput';
|
|
8
|
+
export const SelectTokenPage = ({ formType, }) => {
|
|
9
|
+
const navigate = useNavigate();
|
|
10
|
+
useScrollableOverflowHidden();
|
|
11
|
+
const contentHeight = useContentHeight();
|
|
12
|
+
const handleTokenClick = () => {
|
|
13
|
+
navigate(-1);
|
|
14
|
+
};
|
|
15
|
+
return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsxs(Box, Object.assign({ pt: 1, pb: 2, px: 3 }, { children: [_jsx(ChainSelect, { formType: formType }), _jsx(Box, Object.assign({ mt: 2 }, { children: _jsx(SearchTokenInput, {}) }))] })), _jsx(TokenList, { height: contentHeight - 184, onClick: handleTokenClick, formType: formType })] })));
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SelectWalletPage: () => JSX.Element;
|