@lifi/widget 2.0.0-beta.1 → 2.0.0-beta.10
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 -3
- package/AppDrawer.d.ts +1 -1
- package/AppDrawer.js +2 -1
- package/AppProvider.js +1 -1
- package/README.md +11 -12
- package/cjs/App.d.ts +4 -3
- package/cjs/AppDrawer.d.ts +1 -1
- package/cjs/AppDrawer.js +2 -1
- package/cjs/AppProvider.js +1 -1
- package/cjs/components/ChainSelect/ChainSelect.d.ts +1 -2
- package/cjs/components/ChainSelect/ChainSelect.style.js +1 -1
- package/cjs/components/ChainSelect/useChainSelect.js +6 -0
- package/cjs/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -2
- package/cjs/components/GasMessage/GasMessage.js +1 -6
- package/cjs/components/Header/Header.js +2 -2
- package/cjs/components/Header/Header.style.d.ts +10 -3
- package/cjs/components/Header/Header.style.js +3 -0
- package/cjs/components/Header/NavigationHeader.js +23 -7
- package/cjs/components/Header/NavigationTabs.d.ts +1 -0
- package/cjs/components/Header/NavigationTabs.js +26 -0
- package/cjs/components/Header/NavigationTabs.style.d.ts +34 -0
- package/cjs/components/Header/NavigationTabs.style.js +61 -0
- package/cjs/components/Header/WalletHeader.d.ts +1 -0
- package/cjs/components/Header/WalletHeader.js +16 -9
- package/cjs/components/Header/useHeaderActionStore.js +0 -1
- package/cjs/components/Insurance/Insurance.js +2 -2
- package/cjs/components/Insurance/InsuranceCard.js +34 -12
- package/cjs/components/Insurance/InsuranceCollapsed.js +9 -11
- package/cjs/components/Insurance/index.d.ts +1 -0
- package/cjs/components/Insurance/index.js +1 -0
- package/cjs/components/Insurance/types.d.ts +12 -9
- package/cjs/components/NFT/NFT.js +2 -2
- package/cjs/components/NFT/types.d.ts +1 -1
- package/cjs/components/PoweredBy/PoweredBy.js +2 -3
- package/cjs/components/SelectChainAndToken.js +8 -7
- package/cjs/components/SelectTokenButton/SelectTokenButton.js +6 -3
- package/cjs/components/SendToWallet/SendToWallet.js +2 -2
- package/cjs/components/SmallAvatar.d.ts +1 -1
- package/cjs/components/Step/CircularProgress.d.ts +1 -2
- package/cjs/components/Step/Step.js +15 -5
- package/cjs/components/Step/StepList.d.ts +1 -2
- package/cjs/components/StepActions/StepActions.js +4 -20
- package/cjs/components/SwapButton/SwapButton.js +16 -4
- package/cjs/components/SwapInput/FormPriceHelperText.js +1 -1
- package/cjs/components/SwapInput/SwapInput.js +2 -2
- package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +1 -2
- package/cjs/components/SwapInput/SwapInputEndAdornment.js +2 -2
- package/cjs/components/SwapRouteCard/SwapRouteCard.js +19 -3
- package/cjs/components/SwapRouteCard/SwapRouteCardEssentials.js +1 -1
- package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +1 -1
- package/cjs/components/SwapRoutes/SwapRoutes.js +1 -1
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -3
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +2 -2
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.style.js +1 -0
- package/cjs/components/Token/Token.js +1 -1
- package/cjs/components/TokenAvatar/TokenAvatar.d.ts +4 -4
- package/cjs/components/TokenList/TokenList.js +9 -4
- package/cjs/components/TokenList/TokenList.style.d.ts +5 -2
- package/cjs/components/TokenList/TokenList.style.js +20 -1
- package/cjs/components/TokenList/TokenListItem.d.ts +1 -1
- package/cjs/components/TokenList/TokenListItem.js +28 -5
- package/cjs/components/TokenList/VirtualizedTokenList.js +3 -3
- package/cjs/components/TokenList/types.d.ts +6 -3
- package/cjs/config/theme.js +15 -3
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/index.d.ts +2 -1
- package/cjs/hooks/index.js +2 -1
- package/cjs/hooks/useContentHeight.js +3 -5
- package/cjs/hooks/useFeaturedTokens.d.ts +1 -1
- package/cjs/hooks/useFundsSufficiency.js +2 -2
- package/cjs/hooks/useGasRefuel.d.ts +1 -1
- package/cjs/hooks/useGasRefuel.js +5 -15
- package/cjs/hooks/useGasSufficiency.js +12 -3
- package/cjs/hooks/useInitializer.js +0 -1
- package/cjs/hooks/useProcessMessage.d.ts +2 -1
- package/cjs/hooks/useProcessMessage.js +27 -9
- package/cjs/hooks/useRouteExecution.js +6 -5
- package/cjs/hooks/useSwapOnly.d.ts +1 -0
- package/cjs/hooks/useSwapOnly.js +9 -0
- package/cjs/hooks/useSwapRoutes.d.ts +1 -2
- package/cjs/hooks/useSwapRoutes.js +32 -18
- package/cjs/hooks/useToken.d.ts +1 -1
- package/cjs/hooks/useTokenAddressBalance.d.ts +2 -2
- package/cjs/hooks/useTokenBalance.js +6 -7
- package/cjs/hooks/useTokenBalances.d.ts +5 -5
- package/cjs/hooks/useTokenBalances.js +4 -19
- package/cjs/hooks/useTokenSearch.d.ts +2 -2
- package/cjs/hooks/useTokens.d.ts +2 -2
- package/cjs/i18n/bn.json +8 -0
- package/cjs/i18n/en.json +30 -5
- package/cjs/i18n/fr.json +8 -0
- package/cjs/i18n/id.json +22 -7
- package/cjs/i18n/ko.json +22 -7
- package/cjs/i18n/pt.json +32 -7
- package/cjs/i18n/th.json +21 -6
- package/cjs/i18n/uk.json +43 -18
- package/cjs/i18n/zh.json +23 -8
- package/cjs/icons/InsuraceLogo.d.ts +1 -1
- package/cjs/icons/LiFiFullLogo.d.ts +1 -1
- package/cjs/icons/LiFiLogo.d.ts +1 -1
- package/cjs/icons/LiFiToolLogo.d.ts +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -2
- package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -2
- package/cjs/pages/SelectTokenPage/SelectTokenPage.js +3 -1
- package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -2
- package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +1 -2
- package/cjs/pages/SettingsPage/LanguageSelect.js +1 -1
- package/cjs/pages/SettingsPage/SettingsPage.d.ts +1 -2
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -2
- package/cjs/pages/SettingsPage/SlippageInput.d.ts +1 -2
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +6 -2
- package/cjs/pages/SwapPage/ExchangeRateBottomSheet.js +1 -1
- package/cjs/pages/SwapPage/StatusBottomSheet.js +15 -9
- package/cjs/pages/SwapPage/StatusBottomSheet.style.d.ts +1 -1
- package/cjs/pages/SwapPage/StatusBottomSheet.style.js +2 -2
- package/cjs/pages/SwapPage/SwapPage.js +31 -10
- package/cjs/pages/SwapPage/TokenValueBottomSheet.js +7 -12
- package/cjs/pages/SwapPage/utils.d.ts +2 -0
- package/cjs/pages/SwapPage/utils.js +10 -0
- package/cjs/providers/I18nProvider/I18nProvider.js +3 -3
- package/cjs/providers/SDKProvider/SDKProvider.js +2 -0
- package/cjs/providers/SwapFormProvider/FormUpdater.js +3 -0
- package/cjs/providers/WalletProvider/WalletProvider.js +77 -49
- package/cjs/providers/WalletProvider/types.d.ts +3 -5
- package/cjs/providers/WidgetProvider/WidgetProvider.js +1 -1
- package/cjs/stores/StoreProvider.d.ts +2 -2
- package/cjs/stores/StoreProvider.js +3 -2
- package/cjs/stores/routes/RouteExecutionStore.d.ts +1 -1
- package/cjs/stores/routes/RouteExecutionStore.js +0 -1
- package/cjs/stores/settings/index.d.ts +1 -0
- package/cjs/stores/settings/index.js +1 -0
- package/cjs/stores/settings/types.d.ts +11 -0
- package/cjs/stores/settings/useSplitSubvariantStore.d.ts +7 -0
- package/cjs/stores/settings/useSplitSubvariantStore.js +44 -0
- package/cjs/types/events.d.ts +9 -1
- package/cjs/types/events.js +1 -0
- package/cjs/types/token.d.ts +2 -2
- package/cjs/types/widget.d.ts +13 -8
- package/cjs/types/widget.js +4 -2
- package/cjs/utils/format.d.ts +1 -1
- package/cjs/utils/format.js +7 -12
- package/cjs/utils/wallet.d.ts +1 -1
- package/cjs/utils/wallet.js +3 -3
- package/components/ChainSelect/ChainSelect.d.ts +1 -2
- package/components/ChainSelect/ChainSelect.style.js +1 -1
- package/components/ChainSelect/useChainSelect.js +7 -1
- package/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -2
- package/components/GasMessage/GasMessage.js +2 -7
- package/components/Header/Header.js +3 -3
- package/components/Header/Header.style.d.ts +10 -3
- package/components/Header/Header.style.js +3 -0
- package/components/Header/NavigationHeader.js +23 -7
- package/components/Header/NavigationTabs.d.ts +1 -0
- package/components/Header/NavigationTabs.js +22 -0
- package/components/Header/NavigationTabs.style.d.ts +34 -0
- package/components/Header/NavigationTabs.style.js +58 -0
- package/components/Header/WalletHeader.d.ts +1 -0
- package/components/Header/WalletHeader.js +14 -8
- package/components/Header/useHeaderActionStore.js +0 -1
- package/components/Insurance/Insurance.js +2 -2
- package/components/Insurance/InsuranceCard.js +37 -15
- package/components/Insurance/InsuranceCollapsed.js +9 -11
- package/components/Insurance/index.d.ts +1 -0
- package/components/Insurance/index.js +1 -0
- package/components/Insurance/types.d.ts +12 -9
- package/components/NFT/NFT.js +2 -2
- package/components/NFT/types.d.ts +1 -1
- package/components/PoweredBy/PoweredBy.js +2 -3
- package/components/SelectChainAndToken.js +9 -8
- package/components/SelectTokenButton/SelectTokenButton.js +7 -4
- package/components/SendToWallet/SendToWallet.js +2 -2
- package/components/SmallAvatar.d.ts +1 -1
- package/components/Step/CircularProgress.d.ts +1 -2
- package/components/Step/Step.js +16 -6
- package/components/Step/StepList.d.ts +1 -2
- package/components/StepActions/StepActions.js +4 -20
- package/components/SwapButton/SwapButton.js +16 -4
- package/components/SwapInput/FormPriceHelperText.js +2 -2
- package/components/SwapInput/SwapInput.js +3 -3
- package/components/SwapInput/SwapInputEndAdornment.d.ts +1 -2
- package/components/SwapInput/SwapInputEndAdornment.js +2 -2
- package/components/SwapRouteCard/SwapRouteCard.js +21 -5
- package/components/SwapRouteCard/SwapRouteCardEssentials.js +1 -1
- package/components/SwapRouteCard/SwapRouteCardSkeleton.js +1 -1
- package/components/SwapRoutes/SwapRoutes.js +1 -1
- package/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -3
- package/components/SwapRoutes/SwapRoutesExpanded.js +2 -2
- package/components/SwapRoutes/SwapRoutesExpanded.style.js +1 -0
- package/components/Token/Token.js +1 -1
- package/components/TokenAvatar/TokenAvatar.d.ts +4 -4
- package/components/TokenList/TokenList.js +10 -5
- package/components/TokenList/TokenList.style.d.ts +5 -2
- package/components/TokenList/TokenList.style.js +21 -2
- package/components/TokenList/TokenListItem.d.ts +1 -1
- package/components/TokenList/TokenListItem.js +32 -9
- package/components/TokenList/VirtualizedTokenList.js +3 -3
- package/components/TokenList/types.d.ts +6 -3
- package/config/theme.js +15 -3
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +2 -1
- package/hooks/useContentHeight.js +4 -6
- package/hooks/useFeaturedTokens.d.ts +1 -1
- package/hooks/useFundsSufficiency.js +2 -2
- package/hooks/useGasRefuel.d.ts +1 -1
- package/hooks/useGasRefuel.js +5 -15
- package/hooks/useGasSufficiency.js +13 -4
- package/hooks/useInitializer.js +0 -1
- package/hooks/useProcessMessage.d.ts +2 -1
- package/hooks/useProcessMessage.js +27 -9
- package/hooks/useRouteExecution.js +6 -5
- package/hooks/useSwapOnly.d.ts +1 -0
- package/hooks/useSwapOnly.js +5 -0
- package/hooks/useSwapRoutes.d.ts +1 -2
- package/hooks/useSwapRoutes.js +32 -18
- package/hooks/useToken.d.ts +1 -1
- package/hooks/useTokenAddressBalance.d.ts +2 -2
- package/hooks/useTokenBalance.js +6 -7
- package/hooks/useTokenBalances.d.ts +5 -5
- package/hooks/useTokenBalances.js +4 -19
- package/hooks/useTokenSearch.d.ts +2 -2
- package/hooks/useTokens.d.ts +2 -2
- package/i18n/bn.json +8 -0
- package/i18n/en.json +30 -5
- package/i18n/fr.json +8 -0
- package/i18n/id.json +22 -7
- package/i18n/ko.json +22 -7
- package/i18n/pt.json +32 -7
- package/i18n/th.json +21 -6
- package/i18n/uk.json +43 -18
- package/i18n/zh.json +23 -8
- package/icons/InsuraceLogo.d.ts +1 -1
- package/icons/LiFiFullLogo.d.ts +1 -1
- package/icons/LiFiLogo.d.ts +1 -1
- package/icons/LiFiToolLogo.d.ts +1 -1
- package/index.d.ts +1 -1
- package/package.json +13 -13
- package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -2
- package/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -2
- package/pages/SelectTokenPage/SelectTokenPage.js +4 -2
- package/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -2
- package/pages/SettingsPage/GasPriceSelect.d.ts +1 -2
- package/pages/SettingsPage/LanguageSelect.js +1 -1
- package/pages/SettingsPage/SettingsPage.d.ts +1 -2
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -2
- package/pages/SettingsPage/SlippageInput.d.ts +1 -2
- package/pages/SwapDetailsPage/SwapDetailsPage.js +6 -2
- package/pages/SwapPage/ExchangeRateBottomSheet.js +2 -2
- package/pages/SwapPage/StatusBottomSheet.js +18 -12
- package/pages/SwapPage/StatusBottomSheet.style.d.ts +1 -1
- package/pages/SwapPage/StatusBottomSheet.style.js +1 -1
- package/pages/SwapPage/SwapPage.js +33 -12
- package/pages/SwapPage/TokenValueBottomSheet.js +8 -13
- package/pages/SwapPage/utils.d.ts +2 -0
- package/pages/SwapPage/utils.js +6 -0
- package/providers/I18nProvider/I18nProvider.js +3 -3
- package/providers/SDKProvider/SDKProvider.js +2 -0
- package/providers/SwapFormProvider/FormUpdater.js +3 -0
- package/providers/WalletProvider/WalletProvider.js +78 -50
- package/providers/WalletProvider/types.d.ts +3 -5
- package/providers/WidgetProvider/WidgetProvider.js +2 -2
- package/stores/StoreProvider.d.ts +2 -2
- package/stores/StoreProvider.js +3 -2
- package/stores/routes/RouteExecutionStore.d.ts +1 -1
- package/stores/routes/RouteExecutionStore.js +0 -1
- package/stores/settings/index.d.ts +1 -0
- package/stores/settings/index.js +1 -0
- package/stores/settings/types.d.ts +11 -0
- package/stores/settings/useSplitSubvariantStore.d.ts +7 -0
- package/stores/settings/useSplitSubvariantStore.js +37 -0
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/events.d.ts +9 -1
- package/types/events.js +1 -0
- package/types/token.d.ts +2 -2
- package/types/widget.d.ts +13 -8
- package/types/widget.js +4 -2
- package/utils/format.d.ts +1 -1
- package/utils/format.js +5 -10
- package/utils/wallet.d.ts +1 -1
- package/utils/wallet.js +1 -1
|
@@ -3,20 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getProcessMessage = exports.useProcessMessage = void 0;
|
|
4
4
|
const sdk_1 = require("@lifi/sdk");
|
|
5
5
|
const react_i18next_1 = require("react-i18next");
|
|
6
|
+
const providers_1 = require("../providers");
|
|
6
7
|
const utils_1 = require("../utils");
|
|
7
8
|
const useChains_1 = require("./useChains");
|
|
8
9
|
const useProcessMessage = (step, process) => {
|
|
10
|
+
const { variant } = (0, providers_1.useWidgetConfig)();
|
|
9
11
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
10
12
|
const { getChainById } = (0, useChains_1.useChains)();
|
|
11
13
|
if (!step || !process) {
|
|
12
14
|
return {};
|
|
13
15
|
}
|
|
14
|
-
return getProcessMessage(t, getChainById, step, process);
|
|
16
|
+
return getProcessMessage(t, getChainById, step, process, variant);
|
|
15
17
|
};
|
|
16
18
|
exports.useProcessMessage = useProcessMessage;
|
|
17
19
|
const processStatusMessages = {
|
|
18
20
|
TOKEN_ALLOWANCE: {
|
|
19
21
|
STARTED: (t) => t(`swap.process.tokenAllowance.started`),
|
|
22
|
+
ACTION_REQUIRED: (t) => t(`swap.process.tokenAllowance.pending`),
|
|
20
23
|
PENDING: (t) => t(`swap.process.tokenAllowance.pending`),
|
|
21
24
|
DONE: (t) => t(`swap.process.tokenAllowance.done`),
|
|
22
25
|
},
|
|
@@ -28,7 +31,9 @@ const processStatusMessages = {
|
|
|
28
31
|
STARTED: (t) => t(`swap.process.swap.started`),
|
|
29
32
|
ACTION_REQUIRED: (t) => t(`swap.process.swap.actionRequired`),
|
|
30
33
|
PENDING: (t) => t(`swap.process.swap.pending`),
|
|
31
|
-
DONE: (t) =>
|
|
34
|
+
DONE: (t, variant) => variant === 'nft'
|
|
35
|
+
? t(`swap.process.nft.done`)
|
|
36
|
+
: t(`swap.process.swap.done`),
|
|
32
37
|
},
|
|
33
38
|
CROSS_CHAIN: {
|
|
34
39
|
STARTED: (t) => t(`swap.process.crossChain.started`),
|
|
@@ -38,7 +43,9 @@ const processStatusMessages = {
|
|
|
38
43
|
},
|
|
39
44
|
RECEIVING_CHAIN: {
|
|
40
45
|
PENDING: (t) => t(`swap.process.receivingChain.pending`),
|
|
41
|
-
DONE: (t) =>
|
|
46
|
+
DONE: (t, variant) => variant === 'nft'
|
|
47
|
+
? t(`swap.process.nft.done`)
|
|
48
|
+
: t(`swap.process.receivingChain.done`),
|
|
42
49
|
},
|
|
43
50
|
TRANSACTION: {},
|
|
44
51
|
};
|
|
@@ -68,7 +75,7 @@ const processSubstatusMessages = {
|
|
|
68
75
|
INVALID: {},
|
|
69
76
|
NOT_FOUND: {},
|
|
70
77
|
};
|
|
71
|
-
function getProcessMessage(t, getChainById, step, process) {
|
|
78
|
+
function getProcessMessage(t, getChainById, step, process, variant) {
|
|
72
79
|
if (process.error && process.status === 'FAILED') {
|
|
73
80
|
const getTransactionNotSentMessage = () => t(`swap.error.message.transactionNotSent`, {
|
|
74
81
|
amount: (0, utils_1.formatTokenAmount)(step.action.fromAmount, step.action.fromToken.decimals),
|
|
@@ -78,6 +85,12 @@ function getProcessMessage(t, getChainById, step, process) {
|
|
|
78
85
|
let title = '';
|
|
79
86
|
let message = '';
|
|
80
87
|
switch (process.error.code) {
|
|
88
|
+
case sdk_1.LifiErrorCode.AllowanceRequired:
|
|
89
|
+
title = t(`swap.error.title.allowanceRequired`);
|
|
90
|
+
message = t(`swap.error.message.allowanceRequired`, {
|
|
91
|
+
tokenSymbol: step.action.fromToken.symbol,
|
|
92
|
+
});
|
|
93
|
+
break;
|
|
81
94
|
case sdk_1.LifiErrorCode.BalanceError:
|
|
82
95
|
title = t(`swap.error.title.balanceIsTooLow`);
|
|
83
96
|
message = getTransactionNotSentMessage();
|
|
@@ -90,6 +103,14 @@ function getProcessMessage(t, getChainById, step, process) {
|
|
|
90
103
|
title = t(`swap.error.title.gasLimitIsTooLow`);
|
|
91
104
|
message = getTransactionNotSentMessage();
|
|
92
105
|
break;
|
|
106
|
+
case sdk_1.LifiErrorCode.InsufficientFunds:
|
|
107
|
+
title = t(`swap.error.title.insufficientFunds`);
|
|
108
|
+
message = `${t(`swap.error.message.insufficientFunds`)} ${getTransactionNotSentMessage()}`;
|
|
109
|
+
break;
|
|
110
|
+
case sdk_1.LifiErrorCode.SlippageError:
|
|
111
|
+
title = t(`swap.error.title.slippageNotMet`);
|
|
112
|
+
message = t(`swap.error.message.slippageThreshold`);
|
|
113
|
+
break;
|
|
93
114
|
case sdk_1.LifiErrorCode.TransactionFailed:
|
|
94
115
|
title = t(`swap.error.title.transactionFailed`);
|
|
95
116
|
message = t(`swap.error.message.transactionFailed`);
|
|
@@ -106,10 +127,6 @@ function getProcessMessage(t, getChainById, step, process) {
|
|
|
106
127
|
title = t(`swap.error.title.transactionCanceled`);
|
|
107
128
|
message = getTransactionNotSentMessage();
|
|
108
129
|
break;
|
|
109
|
-
case sdk_1.LifiErrorCode.SlippageError:
|
|
110
|
-
title = t(`swap.error.title.slippageNotMet`);
|
|
111
|
-
message = t(`swap.error.message.slippageThreshold`);
|
|
112
|
-
break;
|
|
113
130
|
case sdk_1.LifiErrorCode.TransactionRejected:
|
|
114
131
|
title = t(`swap.error.title.transactionRejected`);
|
|
115
132
|
message = t(`swap.error.message.transactionRejected`, {
|
|
@@ -131,7 +148,8 @@ function getProcessMessage(t, getChainById, step, process) {
|
|
|
131
148
|
}
|
|
132
149
|
return { title, message };
|
|
133
150
|
}
|
|
134
|
-
const title = processSubstatusMessages[process.status]?.[process.substatus]?.(t) ??
|
|
151
|
+
const title = processSubstatusMessages[process.status]?.[process.substatus]?.(t) ??
|
|
152
|
+
processStatusMessages[process.type]?.[process.status]?.(t, variant);
|
|
135
153
|
return { title };
|
|
136
154
|
}
|
|
137
155
|
exports.getProcessMessage = getProcessMessage;
|
|
@@ -17,7 +17,7 @@ const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchangeRateU
|
|
|
17
17
|
const routeExecutionStoreContext = (0, stores_1.useRouteExecutionStoreContext)();
|
|
18
18
|
const routeExecution = (0, stores_1.useRouteExecutionStore)((state) => state.routes[routeId]);
|
|
19
19
|
const [updateRoute, restartRoute, deleteRoute] = (0, stores_1.useRouteExecutionStore)((state) => [state.updateRoute, state.restartRoute, state.deleteRoute], shallow_1.shallow);
|
|
20
|
-
const
|
|
20
|
+
const updateRouteHook = (updatedRoute) => {
|
|
21
21
|
const routeExecution = routeExecutionStoreContext.getState().routes[updatedRoute.id];
|
|
22
22
|
if (!routeExecution) {
|
|
23
23
|
return;
|
|
@@ -48,10 +48,11 @@ const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchangeRateU
|
|
|
48
48
|
}
|
|
49
49
|
const currentChainId = await account.signer.getChainId();
|
|
50
50
|
if (currentChainId !== requiredChainId) {
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
51
|
+
const signer = await switchChain(requiredChainId);
|
|
52
|
+
if (!signer) {
|
|
53
53
|
throw new Error('Chain was not switched.');
|
|
54
54
|
}
|
|
55
|
+
return signer;
|
|
55
56
|
}
|
|
56
57
|
return account.signer;
|
|
57
58
|
};
|
|
@@ -71,7 +72,7 @@ const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchangeRateU
|
|
|
71
72
|
}
|
|
72
73
|
queryClient.removeQueries(['routes'], { exact: false });
|
|
73
74
|
return lifi.executeRoute(account.signer, routeExecution.route, {
|
|
74
|
-
|
|
75
|
+
updateRouteHook,
|
|
75
76
|
switchChainHook,
|
|
76
77
|
acceptExchangeRateUpdateHook,
|
|
77
78
|
infiniteApproval: false,
|
|
@@ -93,7 +94,7 @@ const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchangeRateU
|
|
|
93
94
|
throw Error('Execution route not found.');
|
|
94
95
|
}
|
|
95
96
|
return lifi.resumeRoute(account.signer, resumedRoute ?? routeExecution.route, {
|
|
96
|
-
|
|
97
|
+
updateRouteHook,
|
|
97
98
|
switchChainHook,
|
|
98
99
|
acceptExchangeRateUpdateHook,
|
|
99
100
|
infiniteApproval: false,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useSwapOnly: () => boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSwapOnly = void 0;
|
|
4
|
+
const stores_1 = require("../stores");
|
|
5
|
+
const useSwapOnly = () => {
|
|
6
|
+
const state = (0, stores_1.useSplitSubvariantStore)((state) => state.state);
|
|
7
|
+
return state === 'swap';
|
|
8
|
+
};
|
|
9
|
+
exports.useSwapOnly = useSwapOnly;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Route, RoutesResponse } from '@lifi/sdk';
|
|
2
2
|
interface SwapRoutesProps {
|
|
3
|
-
onSettled?: (data?: RoutesResponse) => void;
|
|
4
3
|
insurableRoute?: Route;
|
|
5
4
|
}
|
|
6
|
-
export declare const useSwapRoutes: ({
|
|
5
|
+
export declare const useSwapRoutes: ({ insurableRoute }?: SwapRoutesProps) => {
|
|
7
6
|
routes: Route[] | undefined;
|
|
8
7
|
isLoading: boolean;
|
|
9
8
|
isFetching: boolean;
|
|
@@ -10,12 +10,14 @@ const uuid_1 = require("uuid");
|
|
|
10
10
|
const _1 = require(".");
|
|
11
11
|
const providers_1 = require("../providers");
|
|
12
12
|
const stores_1 = require("../stores");
|
|
13
|
+
const useSwapOnly_1 = require("./useSwapOnly");
|
|
13
14
|
const refetchTime = 60000;
|
|
14
|
-
const useSwapRoutes = ({
|
|
15
|
+
const useSwapRoutes = ({ insurableRoute } = {}) => {
|
|
15
16
|
const lifi = (0, providers_1.useLiFi)();
|
|
16
|
-
const { variant, sdkConfig, insurance } = (0, providers_1.useWidgetConfig)();
|
|
17
|
-
const { account
|
|
17
|
+
const { variant, sdkConfig, insurance, contractTool } = (0, providers_1.useWidgetConfig)();
|
|
18
|
+
const { account } = (0, providers_1.useWallet)();
|
|
18
19
|
const queryClient = (0, react_query_1.useQueryClient)();
|
|
20
|
+
const swapOnly = (0, useSwapOnly_1.useSwapOnly)();
|
|
19
21
|
const { slippage, enabledBridges, enabledAutoRefuel, enabledExchanges, routePriority, } = (0, stores_1.useSettings)([
|
|
20
22
|
'slippage',
|
|
21
23
|
'routePriority',
|
|
@@ -39,7 +41,7 @@ const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
39
41
|
});
|
|
40
42
|
const { token: fromToken } = (0, _1.useToken)(fromChainId, fromTokenAddress);
|
|
41
43
|
const { token: toToken } = (0, _1.useToken)(toChainId, toTokenAddress);
|
|
42
|
-
const { enabled: enabledRefuel,
|
|
44
|
+
const { enabled: enabledRefuel, fromAmount: gasRecommendationFromAmount } = (0, _1.useGasRefuel)();
|
|
43
45
|
const hasAmount = (!isNaN(fromTokenAmount) && Number(fromTokenAmount) > 0) ||
|
|
44
46
|
(!isNaN(toTokenAmount) && Number(toTokenAmount) > 0);
|
|
45
47
|
const contractCallQuoteEnabled = variant === 'nft'
|
|
@@ -66,13 +68,13 @@ const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
66
68
|
toContractCallData,
|
|
67
69
|
toContractGasLimit,
|
|
68
70
|
slippage,
|
|
69
|
-
enabledBridges,
|
|
71
|
+
swapOnly ? [] : enabledBridges,
|
|
70
72
|
enabledExchanges,
|
|
71
73
|
routePriority,
|
|
72
74
|
variant,
|
|
73
75
|
sdkConfig?.defaultRouteOptions?.allowSwitchChain,
|
|
74
76
|
enabledRefuel && enabledAutoRefuel,
|
|
75
|
-
|
|
77
|
+
gasRecommendationFromAmount,
|
|
76
78
|
insurance,
|
|
77
79
|
insurableRoute?.id,
|
|
78
80
|
];
|
|
@@ -80,7 +82,7 @@ const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
80
82
|
let toWalletAddress;
|
|
81
83
|
try {
|
|
82
84
|
toWalletAddress =
|
|
83
|
-
(await provider?.resolveName(toAddress)) ??
|
|
85
|
+
(await account.signer?.provider?.resolveName(toAddress)) ??
|
|
84
86
|
((0, address_1.isAddress)(toAddress) ? toAddress : fromAddress);
|
|
85
87
|
}
|
|
86
88
|
catch {
|
|
@@ -90,6 +92,16 @@ const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
90
92
|
.mul(10 ** (fromToken?.decimals ?? 0))
|
|
91
93
|
.toFixed(0);
|
|
92
94
|
const formattedSlippage = parseFloat(slippage) / 100;
|
|
95
|
+
const allowedBridges = insurableRoute
|
|
96
|
+
? insurableRoute.steps.flatMap((step) => step.includedSteps
|
|
97
|
+
.filter((includedStep) => includedStep.type === 'cross')
|
|
98
|
+
.map((includedStep) => includedStep.toolDetails.key))
|
|
99
|
+
: enabledBridges;
|
|
100
|
+
const allowedExchanges = insurableRoute
|
|
101
|
+
? insurableRoute.steps.flatMap((step) => step.includedSteps
|
|
102
|
+
.filter((includedStep) => includedStep.type === 'swap')
|
|
103
|
+
.map((includedStep) => includedStep.toolDetails.key))
|
|
104
|
+
: enabledExchanges;
|
|
93
105
|
if (variant === 'nft') {
|
|
94
106
|
const contractCallQuote = await lifi.getContractCallQuote({
|
|
95
107
|
fromAddress,
|
|
@@ -101,12 +113,25 @@ const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
101
113
|
toContractAddress,
|
|
102
114
|
toContractCallData,
|
|
103
115
|
toContractGasLimit,
|
|
116
|
+
allowBridges: allowedBridges,
|
|
104
117
|
// toFallbackAddress: toAddress,
|
|
105
118
|
slippage: formattedSlippage,
|
|
106
119
|
}, { signal });
|
|
107
120
|
contractCallQuote.estimate.toAmount = toTokenAmount;
|
|
108
121
|
contractCallQuote.estimate.toAmountMin = toTokenAmount;
|
|
109
122
|
contractCallQuote.action.toToken = toToken;
|
|
123
|
+
const customStep = variant === 'nft'
|
|
124
|
+
? contractCallQuote.includedSteps?.find((step) => step.type === 'custom')
|
|
125
|
+
: undefined;
|
|
126
|
+
if (customStep && contractTool) {
|
|
127
|
+
const toolDetails = {
|
|
128
|
+
key: contractTool.name,
|
|
129
|
+
name: contractTool.name,
|
|
130
|
+
logoURI: contractTool.logoURI,
|
|
131
|
+
};
|
|
132
|
+
customStep.toolDetails = toolDetails;
|
|
133
|
+
contractCallQuote.toolDetails = toolDetails;
|
|
134
|
+
}
|
|
110
135
|
const route = {
|
|
111
136
|
id: (0, uuid_1.v4)(),
|
|
112
137
|
fromChainId: contractCallQuote.action.fromChainId,
|
|
@@ -126,16 +151,6 @@ const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
126
151
|
};
|
|
127
152
|
return { routes: [route] };
|
|
128
153
|
}
|
|
129
|
-
const allowedBridges = insurableRoute
|
|
130
|
-
? insurableRoute.steps.flatMap((step) => step.includedSteps
|
|
131
|
-
.filter((includedStep) => includedStep.type === 'cross')
|
|
132
|
-
.map((includedStep) => includedStep.toolDetails.key))
|
|
133
|
-
: enabledBridges;
|
|
134
|
-
const allowedExchanges = insurableRoute
|
|
135
|
-
? insurableRoute.steps.flatMap((step) => step.includedSteps
|
|
136
|
-
.filter((includedStep) => includedStep.type === 'swap')
|
|
137
|
-
.map((includedStep) => includedStep.toolDetails.key))
|
|
138
|
-
: enabledExchanges;
|
|
139
154
|
return lifi.getRoutes({
|
|
140
155
|
fromChainId,
|
|
141
156
|
fromAmount,
|
|
@@ -192,7 +207,6 @@ const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
192
207
|
});
|
|
193
208
|
}
|
|
194
209
|
},
|
|
195
|
-
onSettled,
|
|
196
210
|
});
|
|
197
211
|
return {
|
|
198
212
|
routes: data?.routes,
|
package/cjs/hooks/useToken.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const useTokenAddressBalance: (chainId?: number, tokenAddress?: string) => {
|
|
2
|
-
token: import("..").
|
|
2
|
+
token: import("..").TokenAmount | undefined;
|
|
3
3
|
isLoading: boolean;
|
|
4
|
-
refetch: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<import("..").
|
|
4
|
+
refetch: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<import("..").TokenAmount[], unknown>>;
|
|
5
5
|
};
|
|
@@ -4,14 +4,13 @@ exports.useTokenBalance = void 0;
|
|
|
4
4
|
const react_query_1 = require("@tanstack/react-query");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const providers_1 = require("../providers");
|
|
7
|
-
const utils_1 = require("../utils");
|
|
8
7
|
const useGetTokenBalancesWithRetry_1 = require("./useGetTokenBalancesWithRetry");
|
|
9
8
|
const defaultRefetchInterval = 30000;
|
|
10
9
|
const useTokenBalance = (token, accountAddress) => {
|
|
11
|
-
const { account
|
|
10
|
+
const { account } = (0, providers_1.useWallet)();
|
|
12
11
|
const queryClient = (0, react_query_1.useQueryClient)();
|
|
13
12
|
const walletAddress = accountAddress || account.address;
|
|
14
|
-
const getTokenBalancesWithRetry = (0, useGetTokenBalancesWithRetry_1.useGetTokenBalancesWithRetry)(provider);
|
|
13
|
+
const getTokenBalancesWithRetry = (0, useGetTokenBalancesWithRetry_1.useGetTokenBalancesWithRetry)(account.signer?.provider);
|
|
15
14
|
const tokenBalanceQueryKey = (0, react_1.useMemo)(() => ['token-balance', walletAddress, token?.chainId, token?.address], [token?.address, token?.chainId, walletAddress]);
|
|
16
15
|
const { data, isLoading, refetch } = (0, react_query_1.useQuery)(tokenBalanceQueryKey, async ({ queryKey: [, accountAddress] }) => {
|
|
17
16
|
const cachedToken = queryClient
|
|
@@ -29,8 +28,8 @@ const useTokenBalance = (token, accountAddress) => {
|
|
|
29
28
|
throw Error('Could not get tokens balance.');
|
|
30
29
|
}
|
|
31
30
|
const cachedTokenAmount = queryClient.getQueryData(tokenBalanceQueryKey);
|
|
32
|
-
const
|
|
33
|
-
if (cachedTokenAmount?.amount !==
|
|
31
|
+
const tokenAmount = tokenBalances[0].amount;
|
|
32
|
+
if (cachedTokenAmount?.amount !== tokenAmount) {
|
|
34
33
|
queryClient.setQueryDefaults(tokenBalanceQueryKey, {
|
|
35
34
|
refetchInterval: defaultRefetchInterval,
|
|
36
35
|
staleTime: defaultRefetchInterval,
|
|
@@ -42,14 +41,14 @@ const useTokenBalance = (token, accountAddress) => {
|
|
|
42
41
|
const index = clonedData.findIndex((dataToken) => dataToken.address === token.address);
|
|
43
42
|
clonedData[index] = {
|
|
44
43
|
...clonedData[index],
|
|
45
|
-
amount:
|
|
44
|
+
amount: tokenAmount,
|
|
46
45
|
};
|
|
47
46
|
return clonedData;
|
|
48
47
|
}
|
|
49
48
|
});
|
|
50
49
|
return {
|
|
51
50
|
...tokenBalances[0],
|
|
52
|
-
amount:
|
|
51
|
+
amount: tokenAmount,
|
|
53
52
|
};
|
|
54
53
|
}, {
|
|
55
54
|
enabled: Boolean(walletAddress && token),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TokenAmount } from '../types';
|
|
2
2
|
export declare const useTokenBalances: (selectedChainId?: number) => {
|
|
3
|
-
tokens:
|
|
4
|
-
tokensWithBalance:
|
|
5
|
-
featuredTokens: import("@lifi/types").
|
|
3
|
+
tokens: TokenAmount[];
|
|
4
|
+
tokensWithBalance: TokenAmount[] | undefined;
|
|
5
|
+
featuredTokens: import("@lifi/types").StaticToken[] | undefined;
|
|
6
6
|
isLoading: boolean;
|
|
7
7
|
isBalanceLoading: boolean;
|
|
8
|
-
refetch: <TPageData>(options?: (import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/react-query").QueryObserverResult<
|
|
8
|
+
refetch: <TPageData>(options?: (import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/react-query").QueryObserverResult<TokenAmount[], unknown>>;
|
|
9
9
|
};
|
|
@@ -2,39 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useTokenBalances = void 0;
|
|
4
4
|
const react_query_1 = require("@tanstack/react-query");
|
|
5
|
-
const react_1 = require("react");
|
|
6
5
|
const providers_1 = require("../providers");
|
|
7
|
-
const utils_1 = require("../utils");
|
|
8
6
|
const useFeaturedTokens_1 = require("./useFeaturedTokens");
|
|
9
7
|
const useTokens_1 = require("./useTokens");
|
|
10
|
-
const defaultRefetchInterval =
|
|
11
|
-
const minRefetchInterval = 1000;
|
|
8
|
+
const defaultRefetchInterval = 32000;
|
|
12
9
|
const useTokenBalances = (selectedChainId) => {
|
|
13
10
|
const lifi = (0, providers_1.useLiFi)();
|
|
14
11
|
const { account } = (0, providers_1.useWallet)();
|
|
15
12
|
const featuredTokens = (0, useFeaturedTokens_1.useFeaturedTokens)(selectedChainId);
|
|
16
13
|
const { tokens, isLoading } = (0, useTokens_1.useTokens)(selectedChainId);
|
|
17
|
-
const [refetchInterval, setRefetchInterval] = (0, react_1.useState)(defaultRefetchInterval);
|
|
18
14
|
const isBalanceLoadingEnabled = Boolean(account.address) &&
|
|
19
15
|
Boolean(tokens?.length) &&
|
|
20
16
|
Boolean(selectedChainId);
|
|
21
17
|
const { data: tokensWithBalance, isLoading: isBalanceLoading, refetch, } = (0, react_query_1.useQuery)(['token-balances', account.address, selectedChainId, tokens?.length], async ({ queryKey: [, accountAddress] }) => {
|
|
22
18
|
const tokenBalances = await lifi.getTokenBalances(accountAddress, tokens);
|
|
23
|
-
if (!tokenBalances?.length) {
|
|
24
|
-
// Sometimes RPCs (e.g. Arbitrum) don't return balances on first call
|
|
25
|
-
// TODO: fix and remove backplane
|
|
26
|
-
setRefetchInterval((interval) => interval === defaultRefetchInterval
|
|
27
|
-
? minRefetchInterval
|
|
28
|
-
: interval * 2);
|
|
29
|
-
throw Error('Could not get tokens balance.');
|
|
30
|
-
}
|
|
31
19
|
const featuredTokenAddresses = new Set(featuredTokens?.map((token) => token.address));
|
|
32
20
|
const sortFn = (a, b) => parseFloat(b.amount ?? '0') * parseFloat(b.priceUSD ?? '0') -
|
|
33
21
|
parseFloat(a.amount ?? '0') * parseFloat(a.priceUSD ?? '0');
|
|
34
|
-
const formattedTokens = (tokenBalances.length === 0 ? tokens : tokenBalances)
|
|
35
|
-
token.amount = (0, utils_1.formatTokenAmount)(token.amount);
|
|
36
|
-
return token;
|
|
37
|
-
});
|
|
22
|
+
const formattedTokens = (tokenBalances.length === 0 ? tokens : tokenBalances);
|
|
38
23
|
const result = [
|
|
39
24
|
...formattedTokens
|
|
40
25
|
.filter((token) => token.amount !== '0' && featuredTokenAddresses.has(token.address))
|
|
@@ -49,8 +34,8 @@ const useTokenBalances = (selectedChainId) => {
|
|
|
49
34
|
return result;
|
|
50
35
|
}, {
|
|
51
36
|
enabled: isBalanceLoadingEnabled,
|
|
52
|
-
refetchInterval,
|
|
53
|
-
staleTime:
|
|
37
|
+
refetchInterval: defaultRefetchInterval,
|
|
38
|
+
staleTime: defaultRefetchInterval,
|
|
54
39
|
});
|
|
55
40
|
return {
|
|
56
41
|
tokens,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TokenAmount } from '../types';
|
|
2
2
|
export declare const useTokenSearch: (chainId?: number, tokenQuery?: string, enabled?: boolean) => {
|
|
3
|
-
token:
|
|
3
|
+
token: TokenAmount | undefined;
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
};
|
package/cjs/hooks/useTokens.d.ts
CHANGED
package/cjs/i18n/bn.json
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"done": "সম্পন্ন হয়েছে",
|
|
13
13
|
"getGas": "গ্যাস পান",
|
|
14
14
|
"hide": "গোপন করুন",
|
|
15
|
+
"learnMore": "আরও জানুন",
|
|
15
16
|
"lifiSwap": "লি.ফাই সোওয়াপ",
|
|
16
17
|
"light": "লাইট",
|
|
17
18
|
"max": "সর্বোচ্চ",
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
"startSwap": "সোওয়াপ শুরু করুন",
|
|
30
31
|
"swap": "সোওয়াপ",
|
|
31
32
|
"tryAgain": "আবার চেষ্টা করুন",
|
|
33
|
+
"viewCoverage": "কভারেজ দেখুন",
|
|
32
34
|
"viewOnExplorer": "এক্সপ্লোরারে দেখুন"
|
|
33
35
|
},
|
|
34
36
|
"format": {
|
|
@@ -104,6 +106,12 @@
|
|
|
104
106
|
"gasFeeEstimated": "আনুমানিক গ্যাস ফি",
|
|
105
107
|
"gasFeePaid": "গ্যাস ফি প্রদান করা হয়",
|
|
106
108
|
"inProgress": "প্রক্রিয়াধীন",
|
|
109
|
+
"insurance": {
|
|
110
|
+
"bridgeExploits": "ব্রিজের ত্রুটি, হ্যাক বা শোষণ",
|
|
111
|
+
"insure": "ট্রানজিটে টোকেনের ১০০% বীমা করুন।",
|
|
112
|
+
"insured": "আপনি ট্রানজিটের ১০০% টোকেন বীমা করেছেন:",
|
|
113
|
+
"slippageError": "প্রাপ্ত টোকেনগুলির জন্য স্লিপেজে ত্রুটি।"
|
|
114
|
+
},
|
|
107
115
|
"info": {
|
|
108
116
|
"message": {
|
|
109
117
|
"autoRefuel": "আপনার {{chainName}} গ্যাস কম। চালিয়ে যাওয়ার মাধ্যমে, আপনি সোওয়াপ সম্পূর্ণ করার জন্য পর্যাপ্ত গ্যাস পাবেন।",
|
package/cjs/i18n/en.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"button": {
|
|
3
3
|
"auto": "Auto",
|
|
4
|
+
"buy": "Buy",
|
|
5
|
+
"buyNow": "Buy now",
|
|
4
6
|
"cancel": "Cancel",
|
|
5
7
|
"connectWallet": "Connect wallet",
|
|
6
8
|
"contactSupport": "Contact support",
|
|
@@ -12,6 +14,7 @@
|
|
|
12
14
|
"done": "Done",
|
|
13
15
|
"getGas": "Get gas",
|
|
14
16
|
"hide": "Hide",
|
|
17
|
+
"learnMore": "Learn more",
|
|
15
18
|
"lifiSwap": "LI.FI Swap",
|
|
16
19
|
"light": "Light",
|
|
17
20
|
"max": "max",
|
|
@@ -22,6 +25,7 @@
|
|
|
22
25
|
"resetSettings": "Reset settings",
|
|
23
26
|
"restartSwap": "Restart swap",
|
|
24
27
|
"reviewGasSwap": "Review gas swap",
|
|
28
|
+
"reviewPurchase": "Review purchase",
|
|
25
29
|
"reviewSwap": "Review swap",
|
|
26
30
|
"seeDetails": "See details",
|
|
27
31
|
"showAll": "Show all",
|
|
@@ -29,6 +33,7 @@
|
|
|
29
33
|
"startSwap": "Start swap",
|
|
30
34
|
"swap": "Swap",
|
|
31
35
|
"tryAgain": "Try again",
|
|
36
|
+
"viewCoverage": "View coverage",
|
|
32
37
|
"viewOnExplorer": "View on explorer"
|
|
33
38
|
},
|
|
34
39
|
"format": {
|
|
@@ -37,10 +42,14 @@
|
|
|
37
42
|
},
|
|
38
43
|
"header": {
|
|
39
44
|
"activeSwaps": "Active swaps",
|
|
45
|
+
"bridge": "Bridge",
|
|
40
46
|
"checkout": "Checkout",
|
|
41
47
|
"from": "Swap from",
|
|
42
48
|
"gas": "Gas",
|
|
43
49
|
"gasSwap": "Gas swap",
|
|
50
|
+
"payWith": "Pay with",
|
|
51
|
+
"purchase": "Purchase",
|
|
52
|
+
"purchaseDetails": "Purchase details",
|
|
44
53
|
"routes": "You get",
|
|
45
54
|
"selectChain": "Select chain",
|
|
46
55
|
"selectWallet": "Select your wallet",
|
|
@@ -73,6 +82,8 @@
|
|
|
73
82
|
"currentAmount": "Current amount",
|
|
74
83
|
"error": {
|
|
75
84
|
"message": {
|
|
85
|
+
"allowanceRequired": "Transfer amount for {{tokenSymbol}} exceeds your current allowance. Please increase your allowance and try again.",
|
|
86
|
+
"insufficientFunds": "You don't have enough gas to cover the cost of the transaction.",
|
|
76
87
|
"slippageThreshold": "The slippage is larger than the defined threshold. Please request a new route to get a fresh quote.",
|
|
77
88
|
"transactionFailed": "Please check the block explorer for more information.",
|
|
78
89
|
"transactionNotSent": "Transaction was not sent. {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}} remain in your wallet.",
|
|
@@ -80,10 +91,12 @@
|
|
|
80
91
|
"unknown": "Please try again or contact support."
|
|
81
92
|
},
|
|
82
93
|
"title": {
|
|
94
|
+
"allowanceRequired": "Insufficient allowance",
|
|
83
95
|
"balanceIsTooLow": "The balance is too low",
|
|
84
96
|
"chainSwitch": "Chain switch required",
|
|
85
97
|
"failed": "Swap failed",
|
|
86
98
|
"gasLimitIsTooLow": "The gas limit is too low",
|
|
99
|
+
"insufficientFunds": "Insufficient funds",
|
|
87
100
|
"slippageNotMet": "Slippage conditions not met",
|
|
88
101
|
"transactionCanceled": "Transaction canceled",
|
|
89
102
|
"transactionFailed": "Transaction failed",
|
|
@@ -104,6 +117,12 @@
|
|
|
104
117
|
"gasFeeEstimated": "estimated gas fee",
|
|
105
118
|
"gasFeePaid": "gas fee paid",
|
|
106
119
|
"inProgress": "in progress",
|
|
120
|
+
"insurance": {
|
|
121
|
+
"bridgeExploits": "Bridge malfunctions, hacks or exploits",
|
|
122
|
+
"insure": "Insure <strong>{{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}}</strong> in transit.",
|
|
123
|
+
"insured": "You've insured <strong>{{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}}</strong> in transit:",
|
|
124
|
+
"slippageError": "Error in slippage for tokens received"
|
|
125
|
+
},
|
|
107
126
|
"info": {
|
|
108
127
|
"message": {
|
|
109
128
|
"autoRefuel": "You're low on {{chainName}} gas. By continuing, you'll get enough gas to complete the swap.",
|
|
@@ -123,7 +142,6 @@
|
|
|
123
142
|
"onChain": "on {{chainName}}",
|
|
124
143
|
"otherTokens": "Other tokens",
|
|
125
144
|
"ownedBy": "Owned by",
|
|
126
|
-
"payWith": "Pay with",
|
|
127
145
|
"process": {
|
|
128
146
|
"crossChain": {
|
|
129
147
|
"actionRequired": "Please sign the transaction",
|
|
@@ -131,6 +149,9 @@
|
|
|
131
149
|
"pending": "Waiting for bridge transaction",
|
|
132
150
|
"started": "Preparing bridge transaction"
|
|
133
151
|
},
|
|
152
|
+
"nft": {
|
|
153
|
+
"done": "NFT purchased"
|
|
154
|
+
},
|
|
134
155
|
"receivingChain": {
|
|
135
156
|
"done": "Bridge completed",
|
|
136
157
|
"partial": "Bridge partially completed",
|
|
@@ -157,24 +178,27 @@
|
|
|
157
178
|
"rateChange": "Rate change",
|
|
158
179
|
"receiving": "Receiving",
|
|
159
180
|
"refuelStepDetails": "Get gas via {{tool}}",
|
|
160
|
-
"
|
|
161
|
-
"selectChain": "Chain",
|
|
181
|
+
"selectChain": "Select chain",
|
|
162
182
|
"selectChainAndToken": "Select chain and token",
|
|
163
|
-
"selectToken": "
|
|
183
|
+
"selectToken": "Select token",
|
|
164
184
|
"sendToAddress": "Send to {{address}}",
|
|
165
185
|
"sendToWallet": "Send to a different wallet",
|
|
166
186
|
"sentToAddress": "Sent to {{address}}",
|
|
167
187
|
"stepBridge": "Bridge",
|
|
188
|
+
"stepBridgeAndBuy": "Bridge and buy",
|
|
168
189
|
"stepDetails": "{{tool}} via LI.FI",
|
|
169
190
|
"stepSwap": "Swap",
|
|
170
191
|
"stepSwapAndBridge": "Swap and bridge",
|
|
192
|
+
"stepSwapAndBuy": "Swap and buy",
|
|
171
193
|
"success": {
|
|
172
194
|
"message": {
|
|
173
195
|
"swapPartiallySuccessful": "We've tried to complete the swap, but {{tool}} ran out of liquidity for {{tokenSymbol}} token.",
|
|
196
|
+
"purchaseSuccessful": "You now own {{assetName}} in {{walletAddress}} wallet on {{chainName}} chain.",
|
|
174
197
|
"swapSuccessful": "There are now {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in {{walletAddress}} wallet on {{chainName}} chain."
|
|
175
198
|
},
|
|
176
199
|
"title": {
|
|
177
200
|
"gasSwapSuccessful": "Gas swap successful",
|
|
201
|
+
"purchaseSuccessful": "Purchase successful",
|
|
178
202
|
"refundIssued": "Refund issued",
|
|
179
203
|
"swapPartiallySuccessful": "Swap partially successful",
|
|
180
204
|
"swapSuccessful": "Swap successful"
|
|
@@ -195,7 +219,7 @@
|
|
|
195
219
|
"to": "To",
|
|
196
220
|
"tokenOnChain": "{{tokenSymbol}} on {{chainName}}",
|
|
197
221
|
"tokenOnChainAmount": "{{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}}",
|
|
198
|
-
"tokenSearch": "Search
|
|
222
|
+
"tokenSearch": "Search by token name or address",
|
|
199
223
|
"valueLoss": "Value loss",
|
|
200
224
|
"walletAddressOrEns": "Wallet address or ENS name",
|
|
201
225
|
"warning": {
|
|
@@ -229,6 +253,7 @@
|
|
|
229
253
|
},
|
|
230
254
|
"numberOfSteps": "A number of swap steps. Each step can contain 1-2 transactions that require a signature.",
|
|
231
255
|
"progressToNextUpdate": "Displayed data will auto-refresh after {{value}} seconds. Click here to update manually.",
|
|
256
|
+
"recommended": "A cheap route that balances complexity and ease of use.",
|
|
232
257
|
"settingsModified": "Settings (modified)"
|
|
233
258
|
},
|
|
234
259
|
"wallet": {
|
package/cjs/i18n/fr.json
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"done": "Terminé",
|
|
13
13
|
"getGas": "Obtenir du gaz",
|
|
14
14
|
"hide": "Cacher",
|
|
15
|
+
"learnMore": "Plus d'info",
|
|
15
16
|
"lifiSwap": "LI.FI Swap",
|
|
16
17
|
"light": "Clair",
|
|
17
18
|
"max": "max",
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
"startSwap": "Commencer l'échange",
|
|
30
31
|
"swap": "Échanger",
|
|
31
32
|
"tryAgain": "Réessayer",
|
|
33
|
+
"viewCoverage": "Voir la couverture",
|
|
32
34
|
"viewOnExplorer": "Voir sur l'explorateur"
|
|
33
35
|
},
|
|
34
36
|
"format": {
|
|
@@ -104,6 +106,12 @@
|
|
|
104
106
|
"gasFeeEstimated": "frais de gaz estimés",
|
|
105
107
|
"gasFeePaid": "frais de gaz payés",
|
|
106
108
|
"inProgress": "en cours",
|
|
109
|
+
"insurance": {
|
|
110
|
+
"bridgeExploits": "Des dysfonctionnements de pont, des hacks ou des exploits",
|
|
111
|
+
"insure": "Assurer 100% des jetons en cours de transit.",
|
|
112
|
+
"insured": "Vous avez assuré 100 % des jetons en cours de transit:",
|
|
113
|
+
"slippageError": "Erreur dans le slippage pour les jetons reçus"
|
|
114
|
+
},
|
|
107
115
|
"info": {
|
|
108
116
|
"message": {
|
|
109
117
|
"autoRefuel": "Vous avez peu de gaz sur {{chainName}}. En continuant, vous aurez assez de gaz pour compléter l'échange.",
|