@lifi/widget 2.0.0-beta.1 → 2.0.0-beta.3

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.
@@ -2,8 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InsuranceCard = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ExpandLess_1 = require("@mui/icons-material/ExpandLess");
6
+ const ExpandMore_1 = require("@mui/icons-material/ExpandMore");
5
7
  const VerifiedUser_1 = require("@mui/icons-material/VerifiedUser");
6
8
  const material_1 = require("@mui/material");
9
+ const react_1 = require("react");
7
10
  const react_i18next_1 = require("react-i18next");
8
11
  const icons_1 = require("../../icons");
9
12
  const stores_1 = require("../../stores");
@@ -11,16 +14,24 @@ const Card_1 = require("../Card");
11
14
  const Switch_1 = require("../Switch");
12
15
  const InsuranceCard = ({ status, feeAmountUsd, insuranceCoverageId, onChange, ...props }) => {
13
16
  const { t } = (0, react_i18next_1.useTranslation)();
14
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { selectionColor: "secondary", indented: true, ...props, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [(0, jsx_runtime_1.jsxs)(Card_1.CardLabel, { type: 'insurance', children: [(0, jsx_runtime_1.jsx)(VerifiedUser_1.default, { fontSize: "inherit" }), (0, jsx_runtime_1.jsx)(Card_1.CardLabelTypography, { type: "icon", children: status === stores_1.RouteExecutionStatus.Idle
15
- ? t(`swap.tags.insurance`)
16
- : t(`swap.tags.insured`) })] }), (0, jsx_runtime_1.jsx)(icons_1.InsuraceLogo, {})] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 24, fontWeight: 700, lineHeight: 1, children: t('format.currency', {
17
- value: feeAmountUsd,
18
- }) }), status === stores_1.RouteExecutionStatus.Idle ? ((0, jsx_runtime_1.jsx)(Switch_1.Switch, { onChange: onChange })) : null] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, children: status === stores_1.RouteExecutionStatus.Idle
19
- ? 'Get 100% coverage for lost tokens.'
20
- : '100% coverage for lost tokens.' }), (0, jsx_runtime_1.jsx)(material_1.Link, { href: status === stores_1.RouteExecutionStatus.Idle
21
- ? 'https://docs.insurace.io/landing-page/documentation/cover-products/bridge-cover/li.fi'
22
- : `https://app.insurace.io/bridge-cover?search=${insuranceCoverageId}`, target: "_blank", underline: "none", color: "text.primary", children: (0, jsx_runtime_1.jsx)(material_1.Typography, { px: 0.5, color: "primary", fontSize: 12, fontWeight: 600, children: status === stores_1.RouteExecutionStatus.Idle
23
- ? 'Learn more'
24
- : 'View coverage' }) })] })] }));
17
+ const [cardExpanded, setCardExpanded] = (0, react_1.useState)(status === stores_1.RouteExecutionStatus.Idle);
18
+ const handleExpand = (e) => {
19
+ e.stopPropagation();
20
+ setCardExpanded((expanded) => !expanded);
21
+ };
22
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { selectionColor: "secondary", indented: true, ...props, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsxs)(Card_1.CardLabel, { type: 'insurance', children: [(0, jsx_runtime_1.jsx)(VerifiedUser_1.default, { fontSize: "inherit" }), (0, jsx_runtime_1.jsx)(Card_1.CardLabelTypography, { type: "icon", children: status === stores_1.RouteExecutionStatus.Idle
23
+ ? t('swap.tags.insurance')
24
+ : t('swap.tags.insured') })] }), status === stores_1.RouteExecutionStatus.Idle ? ((0, jsx_runtime_1.jsx)(Switch_1.Switch, { onChange: onChange })) : ((0, jsx_runtime_1.jsx)(material_1.Box, { my: -0.5, children: (0, jsx_runtime_1.jsx)(Card_1.CardIconButton, { onClick: handleExpand, size: "small", children: cardExpanded ? (0, jsx_runtime_1.jsx)(ExpandLess_1.default, {}) : (0, jsx_runtime_1.jsx)(ExpandMore_1.default, {}) }) }))] }), (0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { mt: 2, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 24, fontWeight: 700, lineHeight: 1, children: t('format.currency', {
25
+ value: feeAmountUsd,
26
+ }) }), (0, jsx_runtime_1.jsx)(icons_1.InsuraceLogo, {})] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, children: status === stores_1.RouteExecutionStatus.Idle
27
+ ? t('swap.insurance.insure')
28
+ : t('swap.insurance.insured') }), status !== stores_1.RouteExecutionStatus.Idle ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
29
+ listStyleType: 'disc',
30
+ pl: 2,
31
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, display: "list-item", children: t('swap.insurance.bridgeExploits') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, display: "list-item", children: t('swap.insurance.slippageError') })] })) : null, (0, jsx_runtime_1.jsx)(material_1.Link, { href: status === stores_1.RouteExecutionStatus.Idle
32
+ ? 'https://docs.insurace.io/landing-page/documentation/cover-products/bridge-cover/li.fi'
33
+ : `https://app.insurace.io/bridge-cover?search=${insuranceCoverageId}`, target: "_blank", underline: "none", color: "text.primary", children: (0, jsx_runtime_1.jsx)(material_1.Typography, { pt: 0.5, color: "primary", fontSize: 14, fontWeight: 600, children: status === stores_1.RouteExecutionStatus.Idle
34
+ ? t('button.learnMore')
35
+ : t('button.viewCoverage') }) })] })] }) })] }));
25
36
  };
26
37
  exports.InsuranceCard = InsuranceCard;
@@ -11,6 +11,7 @@ exports.CollapseContainer = (0, styles_1.styled)(material_1.Box)(({ theme }) =>
11
11
  exports.ScrollableContainer = (0, styles_1.styled)(material_1.Box)({
12
12
  overflowY: 'auto',
13
13
  height: '100%',
14
+ width: '100%',
14
15
  flex: 1,
15
16
  display: 'flex',
16
17
  flexDirection: 'column',
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "2.0.0-beta.1";
2
+ export declare const version = "2.0.0-beta.3";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = exports.name = void 0;
4
4
  exports.name = '@lifi/widget';
5
- exports.version = '2.0.0-beta.1';
5
+ exports.version = '2.0.0-beta.3';
package/cjs/i18n/en.json CHANGED
@@ -12,6 +12,7 @@
12
12
  "done": "Done",
13
13
  "getGas": "Get gas",
14
14
  "hide": "Hide",
15
+ "learnMore": "Learn more",
15
16
  "lifiSwap": "LI.FI Swap",
16
17
  "light": "Light",
17
18
  "max": "max",
@@ -29,6 +30,7 @@
29
30
  "startSwap": "Start swap",
30
31
  "swap": "Swap",
31
32
  "tryAgain": "Try again",
33
+ "viewCoverage": "View coverage",
32
34
  "viewOnExplorer": "View on explorer"
33
35
  },
34
36
  "format": {
@@ -104,6 +106,12 @@
104
106
  "gasFeeEstimated": "estimated gas fee",
105
107
  "gasFeePaid": "gas fee paid",
106
108
  "inProgress": "in progress",
109
+ "insurance": {
110
+ "bridgeExploits": "Bridge malfunctions, hacks or exploits",
111
+ "insure": "Insure 100% of tokens in transit.",
112
+ "insured": "You've insured 100% of tokens in transit:",
113
+ "slippageError": "Error in slippage for tokens received"
114
+ },
107
115
  "info": {
108
116
  "message": {
109
117
  "autoRefuel": "You're low on {{chainName}} gas. By continuing, you'll get enough gas to complete the swap.",
package/cjs/i18n/zh.json CHANGED
@@ -106,12 +106,14 @@
106
106
  "inProgress": "进行中",
107
107
  "info": {
108
108
  "message": {
109
+ "autoRefuel": "您在 {{chainName}} 链上的燃气费很低。如果启用该选项,您将获得足够的燃气费完成此次兑换。",
109
110
  "emptyActiveSwaps": "正在进行的兑换将在这里显示。一旦完成,你可在兑换记录中找到它们。",
110
111
  "emptySwapHistory": "兑换记录只存储在本地,如果你清除浏览器数据,他们将被删除。",
111
112
  "emptyTokenList": "我们无法在 {{chainName}} 链上找到这些代币,或者你的钱包内没有这些代币。请再次搜索或者选择其他链再试一次。",
112
113
  "routeNotFound": "试试另一个代币组合。"
113
114
  },
114
115
  "title": {
116
+ "autoRefuel": "获得燃气费",
115
117
  "emptyActiveSwaps": "没有正在进行的兑换",
116
118
  "emptySwapHistory": "没有兑换记录",
117
119
  "routeNotFound": "没有可用的路由"
@@ -154,6 +156,7 @@
154
156
  "quotedAmount": "报价金额",
155
157
  "rateChange": "波动率",
156
158
  "receiving": "接收",
159
+ "refuelStepDetails": "通过 {{tool}} 获取燃气费",
157
160
  "routes": "你会收到",
158
161
  "selectChain": "网络",
159
162
  "selectChainAndToken": "选择链和代币",
@@ -162,6 +165,7 @@
162
165
  "sendToWallet": "发送到另外的钱包",
163
166
  "sentToAddress": "发送到{{address}}",
164
167
  "stepBridge": "跨链",
168
+ "stepDetails": "通过 LI.FI {{tool}}",
165
169
  "stepSwap": "兑换",
166
170
  "stepSwapAndBridge": "兑换和跨链",
167
171
  "success": {
@@ -180,11 +184,13 @@
180
184
  "swapStepDetails": "通过{{tool}}在{{chain}}链上兑换代币",
181
185
  "swapping": "兑换中",
182
186
  "tags": {
183
- "ALTERNATIVE": "可用",
184
- "CHEAPEST": "便宜",
185
- "FASTEST": "快捷",
186
- "RECOMMENDED": "推荐",
187
- "SAFEST": "安全"
187
+ "cheapest": "便宜的",
188
+ "fastest": "快速的",
189
+ "insurable": "可保性",
190
+ "insurance": "保险",
191
+ "insured": "受保的",
192
+ "recommended": "建议的",
193
+ "safest": "最佳/安全"
188
194
  },
189
195
  "to": "到",
190
196
  "tokenOnChain": "{{chainName}}链上的{{tokenSymbol}}",
@@ -197,8 +203,8 @@
197
203
  "deleteActiveSwaps": "正在进行的兑换记录只存储在本地,如果删除它们,我们将无法恢复这些记录。",
198
204
  "deleteSwapHistory": "兑换记录只存储在本地,如果你删除它,我们将无法恢复这些记录。",
199
205
  "highValueLoss": "收到的代币的价值明显低于要被兑换的代币和交易成本。",
200
- "insufficientFunds": "你没有足够的资金来执行这笔兑换。",
201
- "insufficientGas": "你至少需要:",
206
+ "insufficientFunds": "你没有足够的资金来完成这笔交易。",
207
+ "insufficientGas": "您没有足够的燃气费来完成此次交易。您至少需要添加:",
202
208
  "rateChanged": "兑换比例已经改变,如果继续兑换,您将接受新的兑换比例。",
203
209
  "resetSettings": "这将重置您的路由优先级,滑点,燃气费,选中的跨链桥和链上交易所。"
204
210
  },
@@ -207,13 +213,14 @@
207
213
  "deleteSwap": "确定要删除这个兑换记录?",
208
214
  "deleteSwapHistory": "确定要清空兑换记录?",
209
215
  "highValueLoss": "大额资金损失",
210
- "insufficientGas": "燃料费不足",
216
+ "insufficientGas": "燃气费不足",
211
217
  "rateChanged": "兑换比例变动",
212
218
  "resetSettings": "确定要恢复默认设置吗?"
213
219
  }
214
220
  }
215
221
  },
216
222
  "tooltip": {
223
+ "additionalProviderFee": "跨链和交易所的手续费。",
217
224
  "estimatedNetworkFee": "预估网络手续费。",
218
225
  "estimatedTime": "预计兑换的执行时间(分钟)。",
219
226
  "notFound": {
@@ -11,7 +11,7 @@ const stores_1 = require("../../stores");
11
11
  const utils_1 = require("../../utils");
12
12
  const WidgetProvider_1 = require("../WidgetProvider");
13
13
  const I18nProvider = ({ children, }) => {
14
- const { languageResources, languages, disableI18n } = (0, WidgetProvider_1.useWidgetConfig)();
14
+ const { languageResources, languages, disableLanguageDetector } = (0, WidgetProvider_1.useWidgetConfig)();
15
15
  const { language } = (0, stores_1.useSettings)(['language']);
16
16
  const i18n = (0, react_1.useMemo)(() => {
17
17
  let resources = Object.keys(supportedLanguages)
@@ -50,12 +50,12 @@ const I18nProvider = ({ children, }) => {
50
50
  caches: [],
51
51
  },
52
52
  });
53
- if (!language && !languages?.default && !disableI18n) {
53
+ if (!language && !languages?.default && !disableLanguageDetector) {
54
54
  i18n = i18n.use(i18next_browser_languagedetector_1.default);
55
55
  }
56
56
  i18n.use(react_i18next_1.initReactI18next).init();
57
57
  return i18n;
58
- }, [disableI18n, language, languageResources, languages]);
58
+ }, [disableLanguageDetector, language, languageResources, languages]);
59
59
  return (0, jsx_runtime_1.jsx)(react_i18next_1.I18nextProvider, { i18n: i18n, children: children });
60
60
  };
61
61
  exports.I18nProvider = I18nProvider;
@@ -75,7 +75,6 @@ export interface WidgetConfig {
75
75
  appearance?: Appearance;
76
76
  theme?: ThemeConfig;
77
77
  containerStyle?: CSSProperties;
78
- disableTelemetry?: boolean;
79
78
  disabledUI?: DisabledUIType[];
80
79
  hiddenUI?: HiddenUIType[];
81
80
  requiredUI?: RequiredUIType[];
@@ -107,7 +106,7 @@ export interface WidgetConfig {
107
106
  deny?: LanguageKey[];
108
107
  };
109
108
  languageResources?: LanguageResources;
110
- disableI18n?: boolean;
109
+ disableLanguageDetector?: boolean;
111
110
  }
112
111
  export type WidgetDrawerProps = {
113
112
  elementRef?: RefObject<HTMLDivElement>;
@@ -1,22 +1,33 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import ExpandLessIcon from '@mui/icons-material/ExpandLess';
3
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
2
4
  import VerifiedUserIcon from '@mui/icons-material/VerifiedUser';
3
- import { Box, Link, Typography } from '@mui/material';
5
+ import { Box, Collapse, Link, Typography } from '@mui/material';
6
+ import { useState } from 'react';
4
7
  import { useTranslation } from 'react-i18next';
5
8
  import { InsuraceLogo } from '../../icons';
6
9
  import { RouteExecutionStatus } from '../../stores';
7
- import { Card, CardLabel, CardLabelTypography } from '../Card';
10
+ import { Card, CardIconButton, CardLabel, CardLabelTypography } from '../Card';
8
11
  import { Switch } from '../Switch';
9
12
  export const InsuranceCard = ({ status, feeAmountUsd, insuranceCoverageId, onChange, ...props }) => {
10
13
  const { t } = useTranslation();
11
- return (_jsxs(Card, { selectionColor: "secondary", indented: true, ...props, children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [_jsxs(CardLabel, { type: 'insurance', children: [_jsx(VerifiedUserIcon, { fontSize: "inherit" }), _jsx(CardLabelTypography, { type: "icon", children: status === RouteExecutionStatus.Idle
12
- ? t(`swap.tags.insurance`)
13
- : t(`swap.tags.insured`) })] }), _jsx(InsuraceLogo, {})] }), _jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [_jsx(Typography, { fontSize: 24, fontWeight: 700, lineHeight: 1, children: t('format.currency', {
14
- value: feeAmountUsd,
15
- }) }), status === RouteExecutionStatus.Idle ? (_jsx(Switch, { onChange: onChange })) : null] }), _jsxs(Box, { display: "flex", alignItems: "center", children: [_jsx(Typography, { fontSize: 12, children: status === RouteExecutionStatus.Idle
16
- ? 'Get 100% coverage for lost tokens.'
17
- : '100% coverage for lost tokens.' }), _jsx(Link, { href: status === RouteExecutionStatus.Idle
18
- ? 'https://docs.insurace.io/landing-page/documentation/cover-products/bridge-cover/li.fi'
19
- : `https://app.insurace.io/bridge-cover?search=${insuranceCoverageId}`, target: "_blank", underline: "none", color: "text.primary", children: _jsx(Typography, { px: 0.5, color: "primary", fontSize: 12, fontWeight: 600, children: status === RouteExecutionStatus.Idle
20
- ? 'Learn more'
21
- : 'View coverage' }) })] })] }));
14
+ const [cardExpanded, setCardExpanded] = useState(status === RouteExecutionStatus.Idle);
15
+ const handleExpand = (e) => {
16
+ e.stopPropagation();
17
+ setCardExpanded((expanded) => !expanded);
18
+ };
19
+ return (_jsxs(Card, { selectionColor: "secondary", indented: true, ...props, children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", children: [_jsxs(CardLabel, { type: 'insurance', children: [_jsx(VerifiedUserIcon, { fontSize: "inherit" }), _jsx(CardLabelTypography, { type: "icon", children: status === RouteExecutionStatus.Idle
20
+ ? t('swap.tags.insurance')
21
+ : t('swap.tags.insured') })] }), status === RouteExecutionStatus.Idle ? (_jsx(Switch, { onChange: onChange })) : (_jsx(Box, { my: -0.5, children: _jsx(CardIconButton, { onClick: handleExpand, size: "small", children: cardExpanded ? _jsx(ExpandLessIcon, {}) : _jsx(ExpandMoreIcon, {}) }) }))] }), _jsx(Collapse, { timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true, children: _jsxs(Box, { mt: 2, children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [_jsx(Typography, { fontSize: 24, fontWeight: 700, lineHeight: 1, children: t('format.currency', {
22
+ value: feeAmountUsd,
23
+ }) }), _jsx(InsuraceLogo, {})] }), _jsxs(Box, { children: [_jsx(Typography, { fontSize: 14, children: status === RouteExecutionStatus.Idle
24
+ ? t('swap.insurance.insure')
25
+ : t('swap.insurance.insured') }), status !== RouteExecutionStatus.Idle ? (_jsxs(Box, { sx: {
26
+ listStyleType: 'disc',
27
+ pl: 2,
28
+ }, children: [_jsx(Typography, { fontSize: 14, display: "list-item", children: t('swap.insurance.bridgeExploits') }), _jsx(Typography, { fontSize: 14, display: "list-item", children: t('swap.insurance.slippageError') })] })) : null, _jsx(Link, { href: status === RouteExecutionStatus.Idle
29
+ ? 'https://docs.insurace.io/landing-page/documentation/cover-products/bridge-cover/li.fi'
30
+ : `https://app.insurace.io/bridge-cover?search=${insuranceCoverageId}`, target: "_blank", underline: "none", color: "text.primary", children: _jsx(Typography, { pt: 0.5, color: "primary", fontSize: 14, fontWeight: 600, children: status === RouteExecutionStatus.Idle
31
+ ? t('button.learnMore')
32
+ : t('button.viewCoverage') }) })] })] }) })] }));
22
33
  };
@@ -8,6 +8,7 @@ export const CollapseContainer = styled(Box)(({ theme }) => ({
8
8
  export const ScrollableContainer = styled(Box)({
9
9
  overflowY: 'auto',
10
10
  height: '100%',
11
+ width: '100%',
11
12
  flex: 1,
12
13
  display: 'flex',
13
14
  flexDirection: 'column',
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "2.0.0-beta.1";
2
+ export declare const version = "2.0.0-beta.3";
package/config/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget';
2
- export const version = '2.0.0-beta.1';
2
+ export const version = '2.0.0-beta.3';
package/i18n/en.json CHANGED
@@ -12,6 +12,7 @@
12
12
  "done": "Done",
13
13
  "getGas": "Get gas",
14
14
  "hide": "Hide",
15
+ "learnMore": "Learn more",
15
16
  "lifiSwap": "LI.FI Swap",
16
17
  "light": "Light",
17
18
  "max": "max",
@@ -29,6 +30,7 @@
29
30
  "startSwap": "Start swap",
30
31
  "swap": "Swap",
31
32
  "tryAgain": "Try again",
33
+ "viewCoverage": "View coverage",
32
34
  "viewOnExplorer": "View on explorer"
33
35
  },
34
36
  "format": {
@@ -104,6 +106,12 @@
104
106
  "gasFeeEstimated": "estimated gas fee",
105
107
  "gasFeePaid": "gas fee paid",
106
108
  "inProgress": "in progress",
109
+ "insurance": {
110
+ "bridgeExploits": "Bridge malfunctions, hacks or exploits",
111
+ "insure": "Insure 100% of tokens in transit.",
112
+ "insured": "You've insured 100% of tokens in transit:",
113
+ "slippageError": "Error in slippage for tokens received"
114
+ },
107
115
  "info": {
108
116
  "message": {
109
117
  "autoRefuel": "You're low on {{chainName}} gas. By continuing, you'll get enough gas to complete the swap.",
package/i18n/zh.json CHANGED
@@ -106,12 +106,14 @@
106
106
  "inProgress": "进行中",
107
107
  "info": {
108
108
  "message": {
109
+ "autoRefuel": "您在 {{chainName}} 链上的燃气费很低。如果启用该选项,您将获得足够的燃气费完成此次兑换。",
109
110
  "emptyActiveSwaps": "正在进行的兑换将在这里显示。一旦完成,你可在兑换记录中找到它们。",
110
111
  "emptySwapHistory": "兑换记录只存储在本地,如果你清除浏览器数据,他们将被删除。",
111
112
  "emptyTokenList": "我们无法在 {{chainName}} 链上找到这些代币,或者你的钱包内没有这些代币。请再次搜索或者选择其他链再试一次。",
112
113
  "routeNotFound": "试试另一个代币组合。"
113
114
  },
114
115
  "title": {
116
+ "autoRefuel": "获得燃气费",
115
117
  "emptyActiveSwaps": "没有正在进行的兑换",
116
118
  "emptySwapHistory": "没有兑换记录",
117
119
  "routeNotFound": "没有可用的路由"
@@ -154,6 +156,7 @@
154
156
  "quotedAmount": "报价金额",
155
157
  "rateChange": "波动率",
156
158
  "receiving": "接收",
159
+ "refuelStepDetails": "通过 {{tool}} 获取燃气费",
157
160
  "routes": "你会收到",
158
161
  "selectChain": "网络",
159
162
  "selectChainAndToken": "选择链和代币",
@@ -162,6 +165,7 @@
162
165
  "sendToWallet": "发送到另外的钱包",
163
166
  "sentToAddress": "发送到{{address}}",
164
167
  "stepBridge": "跨链",
168
+ "stepDetails": "通过 LI.FI {{tool}}",
165
169
  "stepSwap": "兑换",
166
170
  "stepSwapAndBridge": "兑换和跨链",
167
171
  "success": {
@@ -180,11 +184,13 @@
180
184
  "swapStepDetails": "通过{{tool}}在{{chain}}链上兑换代币",
181
185
  "swapping": "兑换中",
182
186
  "tags": {
183
- "ALTERNATIVE": "可用",
184
- "CHEAPEST": "便宜",
185
- "FASTEST": "快捷",
186
- "RECOMMENDED": "推荐",
187
- "SAFEST": "安全"
187
+ "cheapest": "便宜的",
188
+ "fastest": "快速的",
189
+ "insurable": "可保性",
190
+ "insurance": "保险",
191
+ "insured": "受保的",
192
+ "recommended": "建议的",
193
+ "safest": "最佳/安全"
188
194
  },
189
195
  "to": "到",
190
196
  "tokenOnChain": "{{chainName}}链上的{{tokenSymbol}}",
@@ -197,8 +203,8 @@
197
203
  "deleteActiveSwaps": "正在进行的兑换记录只存储在本地,如果删除它们,我们将无法恢复这些记录。",
198
204
  "deleteSwapHistory": "兑换记录只存储在本地,如果你删除它,我们将无法恢复这些记录。",
199
205
  "highValueLoss": "收到的代币的价值明显低于要被兑换的代币和交易成本。",
200
- "insufficientFunds": "你没有足够的资金来执行这笔兑换。",
201
- "insufficientGas": "你至少需要:",
206
+ "insufficientFunds": "你没有足够的资金来完成这笔交易。",
207
+ "insufficientGas": "您没有足够的燃气费来完成此次交易。您至少需要添加:",
202
208
  "rateChanged": "兑换比例已经改变,如果继续兑换,您将接受新的兑换比例。",
203
209
  "resetSettings": "这将重置您的路由优先级,滑点,燃气费,选中的跨链桥和链上交易所。"
204
210
  },
@@ -207,13 +213,14 @@
207
213
  "deleteSwap": "确定要删除这个兑换记录?",
208
214
  "deleteSwapHistory": "确定要清空兑换记录?",
209
215
  "highValueLoss": "大额资金损失",
210
- "insufficientGas": "燃料费不足",
216
+ "insufficientGas": "燃气费不足",
211
217
  "rateChanged": "兑换比例变动",
212
218
  "resetSettings": "确定要恢复默认设置吗?"
213
219
  }
214
220
  }
215
221
  },
216
222
  "tooltip": {
223
+ "additionalProviderFee": "跨链和交易所的手续费。",
217
224
  "estimatedNetworkFee": "预估网络手续费。",
218
225
  "estimatedTime": "预计兑换的执行时间(分钟)。",
219
226
  "notFound": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/widget",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.3",
4
4
  "description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./index.js",
@@ -44,14 +44,14 @@
44
44
  "@ethersproject/experimental": "^5.7.0",
45
45
  "@ethersproject/providers": "^5.7.2",
46
46
  "@lifi/sdk": "^2.0.0-beta.8",
47
- "@lifi/wallet-management": "^2.0.0-beta.0",
47
+ "@lifi/wallet-management": "^2.0.0-beta.2",
48
48
  "@mui/icons-material": "^5.11.16",
49
49
  "@mui/lab": "^5.0.0-alpha.127",
50
50
  "@mui/material": "^5.12.1",
51
51
  "@tanstack/react-query": "^4.29.3",
52
52
  "@tanstack/react-virtual": "^3.0.0-beta.54",
53
53
  "big.js": "^6.2.1",
54
- "i18next": "^22.4.14",
54
+ "i18next": "^22.4.15",
55
55
  "i18next-browser-languagedetector": "^7.0.1",
56
56
  "microdiff": "^1.3.2",
57
57
  "mitt": "^3.0.0",
@@ -8,7 +8,7 @@ import { useSettings } from '../../stores';
8
8
  import { deepMerge } from '../../utils';
9
9
  import { isItemAllowed, useWidgetConfig } from '../WidgetProvider';
10
10
  export const I18nProvider = ({ children, }) => {
11
- const { languageResources, languages, disableI18n } = useWidgetConfig();
11
+ const { languageResources, languages, disableLanguageDetector } = useWidgetConfig();
12
12
  const { language } = useSettings(['language']);
13
13
  const i18n = useMemo(() => {
14
14
  let resources = Object.keys(supportedLanguages)
@@ -47,11 +47,11 @@ export const I18nProvider = ({ children, }) => {
47
47
  caches: [],
48
48
  },
49
49
  });
50
- if (!language && !languages?.default && !disableI18n) {
50
+ if (!language && !languages?.default && !disableLanguageDetector) {
51
51
  i18n = i18n.use(LanguageDetector);
52
52
  }
53
53
  i18n.use(initReactI18next).init();
54
54
  return i18n;
55
- }, [disableI18n, language, languageResources, languages]);
55
+ }, [disableLanguageDetector, language, languageResources, languages]);
56
56
  return _jsx(I18nextProvider, { i18n: i18n, children: children });
57
57
  };