@lifi/widget 3.12.1 → 3.12.3-beta.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/CHANGELOG.md +2 -0
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +2 -2
- package/dist/esm/components/AmountInput/AmountInput.js +7 -1
- package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.d.ts +1 -1
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +1 -1
- package/dist/esm/components/AppContainer.d.ts +1 -1
- package/dist/esm/components/Avatar/Avatar.style.d.ts +1 -1
- package/dist/esm/components/Avatar/SmallAvatar.d.ts +1 -1
- package/dist/esm/components/ButtonTertiary.d.ts +1 -1
- package/dist/esm/components/Card/CardHeader.d.ts +1 -1
- package/dist/esm/components/Card/InputCard.d.ts +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.style.d.ts +1 -1
- package/dist/esm/components/Header/Header.style.d.ts +2 -2
- package/dist/esm/components/Header/SettingsButton.style.d.ts +1 -1
- package/dist/esm/components/ListItem/ListItem.d.ts +1 -1
- package/dist/esm/components/PageContainer.d.ts +1 -1
- package/dist/esm/components/Routes/Routes.js +7 -2
- package/dist/esm/components/Routes/Routes.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.js +7 -4
- package/dist/esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
- package/dist/esm/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js +5 -2
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +3 -3
- package/dist/esm/components/StepActions/StepActions.style.d.ts +1 -1
- package/dist/esm/components/StepDivider/StepDivider.style.d.ts +1 -1
- package/dist/esm/components/Tabs/Tabs.style.d.ts +1 -1
- package/dist/esm/components/TokenList/TokenList.style.d.ts +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/config/version.js.map +1 -1
- package/dist/esm/hooks/useGasRefuel.js +6 -9
- package/dist/esm/hooks/useGasRefuel.js.map +1 -1
- package/dist/esm/hooks/useIsContractAddress.js.map +1 -1
- package/dist/esm/i18n/en.json +2 -0
- package/dist/esm/i18n/zh.json +53 -53
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pages/MainPage/MainPage.js +2 -1
- package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
- package/dist/esm/pages/MainPage/MainPage.style.d.ts +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +4 -4
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/AmountInput/AmountInput.tsx +9 -1
- package/src/components/Routes/Routes.tsx +10 -4
- package/src/components/Routes/RoutesExpanded.tsx +9 -4
- package/src/components/SendToWallet/SendToWalletButton.tsx +14 -4
- package/src/config/version.ts +1 -1
- package/src/hooks/useGasRefuel.ts +6 -18
- package/src/hooks/useIsContractAddress.ts +1 -0
- package/src/i18n/en.json +2 -0
- package/src/i18n/i18next.d.ts +4 -8
- package/src/i18n/zh.json +53 -53
- package/src/index.ts +1 -1
- package/src/pages/MainPage/MainPage.tsx +9 -8
- package/tsconfig.json +4 -2
|
@@ -10,18 +10,15 @@ export const useGasRefuel = () => {
|
|
|
10
10
|
const [fromChainId, fromTokenAddress, toChainId, toAddress] = useFieldValues('fromChain', 'fromToken', 'toChain', 'toAddress');
|
|
11
11
|
const toChain = getChainById(toChainId);
|
|
12
12
|
const fromChain = getChainById(fromChainId);
|
|
13
|
-
const {
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const isToContractAddress = useIsContractAddress(toAddress, toChainId, toChain?.chainType);
|
|
18
|
-
const { token: destinationNativeToken } = useTokenBalance(toAddress || toAccount?.address, toChainId ? toChain?.nativeToken : undefined);
|
|
13
|
+
const { account: toAccount } = useAccount({ chainType: toChain?.chainType });
|
|
14
|
+
const effectiveToAddress = toAddress || toAccount?.address;
|
|
15
|
+
const isToContractAddress = useIsContractAddress(effectiveToAddress, toChainId, toChain?.chainType);
|
|
16
|
+
const { token: destinationNativeToken } = useTokenBalance(effectiveToAddress, toChainId ? toChain?.nativeToken : undefined);
|
|
19
17
|
const { data: gasRecommendation, isLoading } = useGasRecommendation(toChainId, fromChainId, fromTokenAddress);
|
|
20
18
|
// When we bridge between ecosystems we need to be sure toAddress is set
|
|
21
19
|
const isChainTypeSatisfied = fromChain?.chainType !== toChain?.chainType ? Boolean(toAddress) : true;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
: true;
|
|
20
|
+
// We should not refuel to the contract address
|
|
21
|
+
const isToAddressSatisfied = effectiveToAddress && !isToContractAddress;
|
|
25
22
|
const enabled = useMemo(() => {
|
|
26
23
|
if (
|
|
27
24
|
// We don't allow same chain refuel.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGasRefuel.js","sourceRoot":"","sources":["../../../src/hooks/useGasRefuel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAA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QACD,WAAW;QACX,iBAAiB;QACjB,oBAAoB;QACpB,oBAAoB;QACpB,sBAAsB;QACtB,SAAS;KACV,CAAC,CAAA;IAEF,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,iBAAiB,EAAE,SAAS;QACtC,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,OAAO;QACd,UAAU,EAAE,iBAAiB,EAAE,SAAS;YACtC,CAAC,CAAC,iBAAiB,CAAC,UAAU;YAC9B,CAAC,CAAC,SAAS;KACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsContractAddress.js","sourceRoot":"","sources":["../../../src/hooks/useIsContractAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEnC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,OAAgB,EAChB,OAAgB,EAChB,SAAqB,EACrB,EAAE;IACF,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,WAAW,CAAC;QACzC,OAAO,EAAE,OAAkB;QAC3B,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE;YACL,eAAe,EAAE,MAAO;YACxB,SAAS,EAAE,MAAO;YAClB,OAAO,EAAE,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,GAAG,IAAI,OAAO,CAAC;SACzD;KACF,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"useIsContractAddress.js","sourceRoot":"","sources":["../../../src/hooks/useIsContractAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEnC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,OAAgB,EAChB,OAAgB,EAChB,SAAqB,EACrB,EAAE;IACF,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,WAAW,CAAC;QACzC,OAAO,EAAE,OAAkB;QAC3B,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE;YACL,eAAe,EAAE,MAAO;YACxB,SAAS,EAAE,MAAO;YAClB,OAAO,EAAE,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,GAAG,IAAI,OAAO,CAAC;SACzD;KACF,CAAC,CAAA;IAEF,MAAM,iBAAiB,GAAG,CAAC,CAAC,YAAY,CAAA;IACxC,OAAO,iBAAiB,CAAA;AAC1B,CAAC,CAAA"}
|
package/dist/esm/i18n/en.json
CHANGED
|
@@ -52,12 +52,14 @@
|
|
|
52
52
|
},
|
|
53
53
|
"header": {
|
|
54
54
|
"activeTransactions": "Active transactions",
|
|
55
|
+
"amount": "Amount",
|
|
55
56
|
"bookmarkedWallets": "Bookmarked wallets",
|
|
56
57
|
"bridge": "Bridge",
|
|
57
58
|
"checkout": "Checkout",
|
|
58
59
|
"checkoutDetails": "Checkout details",
|
|
59
60
|
"deposit": "Deposit",
|
|
60
61
|
"depositDetails": "Deposit details",
|
|
62
|
+
"depositTo": "Deposit to",
|
|
61
63
|
"exchange": "Exchange",
|
|
62
64
|
"from": "Exchange from",
|
|
63
65
|
"gas": "Gas",
|
package/dist/esm/i18n/zh.json
CHANGED
|
@@ -4,30 +4,30 @@
|
|
|
4
4
|
"title": "语言"
|
|
5
5
|
},
|
|
6
6
|
"format": {
|
|
7
|
-
"currency": "",
|
|
7
|
+
"currency": "{{value, currencyExt(currency: USD)}}",
|
|
8
8
|
"number": "{{value, number(maximumFractionDigits: 9)}}",
|
|
9
|
-
"percent": ""
|
|
9
|
+
"percent": "{{value, percent(maximumFractionDigits: 2)}}"
|
|
10
10
|
},
|
|
11
11
|
"button": {
|
|
12
12
|
"auto": "自动",
|
|
13
13
|
"bookmark": "收藏",
|
|
14
14
|
"bookmarks": "收藏夹",
|
|
15
15
|
"bridge": "跨链",
|
|
16
|
-
"bridgeReview": "",
|
|
16
|
+
"bridgeReview": "查看跨链详情",
|
|
17
17
|
"buy": "购买",
|
|
18
18
|
"cancel": "取消",
|
|
19
|
-
"checkoutReview": "",
|
|
19
|
+
"checkoutReview": "查看购买详情",
|
|
20
20
|
"close": "关闭",
|
|
21
21
|
"confirm": "确认",
|
|
22
|
-
"connectAnotherWallet": "",
|
|
22
|
+
"connectAnotherWallet": "连接另一个钱包",
|
|
23
23
|
"connectWallet": "关联钱包",
|
|
24
24
|
"contactSupport": "联系技术支持",
|
|
25
25
|
"continue": "继续",
|
|
26
26
|
"copyAddress": "复制地址",
|
|
27
27
|
"dark": "深色主题",
|
|
28
28
|
"delete": "删除",
|
|
29
|
-
"deposit": "",
|
|
30
|
-
"depositReview": "",
|
|
29
|
+
"deposit": "存款",
|
|
30
|
+
"depositReview": "查看存款详情",
|
|
31
31
|
"disconnect": "断开连接",
|
|
32
32
|
"done": "确认",
|
|
33
33
|
"exchange": "兑换",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"startBridging": "开始跨链",
|
|
46
46
|
"startSwapping": "开始兑换",
|
|
47
47
|
"swap": "兑换",
|
|
48
|
-
"swapReview": "",
|
|
48
|
+
"swapReview": "查看兑换详情",
|
|
49
49
|
"tryAgain": "重试",
|
|
50
50
|
"viewCoverage": "查看我们的覆盖范围",
|
|
51
51
|
"viewOnExplorer": "在区块链浏览器上查看"
|
|
@@ -55,18 +55,18 @@
|
|
|
55
55
|
"bookmarkedWallets": "已收藏的钱包",
|
|
56
56
|
"bridge": "跨链",
|
|
57
57
|
"checkout": "支付",
|
|
58
|
-
"checkoutDetails": "",
|
|
59
|
-
"deposit": "",
|
|
60
|
-
"depositDetails": "",
|
|
58
|
+
"checkoutDetails": "交易细节",
|
|
59
|
+
"deposit": "存款",
|
|
60
|
+
"depositDetails": "存款详情",
|
|
61
61
|
"exchange": "兑换",
|
|
62
62
|
"from": "兑换自",
|
|
63
63
|
"gas": "燃气费",
|
|
64
64
|
"payWith": "支付方式",
|
|
65
|
-
"receive": "",
|
|
65
|
+
"receive": "接收",
|
|
66
66
|
"recentWallets": "最近使用的钱包",
|
|
67
67
|
"selectChain": "选择网络",
|
|
68
68
|
"selectWallet": "选择你的钱包",
|
|
69
|
-
"send": "",
|
|
69
|
+
"send": "发送",
|
|
70
70
|
"sendToWallet": "发送到该钱包",
|
|
71
71
|
"settings": "设置",
|
|
72
72
|
"swap": "兑换",
|
|
@@ -75,23 +75,23 @@
|
|
|
75
75
|
"transactionHistory": "交易记录",
|
|
76
76
|
"walletConnected": "连接钱包",
|
|
77
77
|
"youGet": "您获得",
|
|
78
|
-
"youPay": ""
|
|
78
|
+
"youPay": "需要支付"
|
|
79
79
|
},
|
|
80
80
|
"info": {
|
|
81
81
|
"message": {
|
|
82
82
|
"autoRefuel": "您在 {{chainName}} 链上的燃气费很低。如果启用该选项,您将获得足够的燃气费完成此次兑换。",
|
|
83
83
|
"emptyActiveTransactions": "正在进行的兑换将在这里显示。一旦完成,你可在兑换记录中找到它们。",
|
|
84
84
|
"emptyTokenList": "我们无法在 {{chainName}} 链上找到这些代币,或者你的钱包内没有这些代币。请再次搜索或者选择其他链再试一次。",
|
|
85
|
-
"emptyChainList": "",
|
|
86
|
-
"emptyBridgesList": "",
|
|
87
|
-
"emptyExchangesList": "",
|
|
85
|
+
"emptyChainList": "我们找不到任何匹配的链",
|
|
86
|
+
"emptyBridgesList": "我们找不到任何匹配的桥",
|
|
87
|
+
"emptyExchangesList": "我们找不到任何匹配的交易所",
|
|
88
88
|
"emptyTransactionHistory": "交易记录只存储在本地,如果您清除浏览器数据,交易记录将被删除。",
|
|
89
89
|
"fundsToExchange": "发送到交易所的资金可能会丢失",
|
|
90
90
|
"toAddressIsRequired": "请提供收款的钱包地址。",
|
|
91
91
|
"routeNotFound": "导致其的原因可能是:流动性低,所选定代币的数额太低,燃气费过高,或者当前没有合适的交易路径。"
|
|
92
92
|
},
|
|
93
93
|
"title": {
|
|
94
|
-
"autoRefuel": "",
|
|
94
|
+
"autoRefuel": "获得 {{chainName}} 链的燃气费",
|
|
95
95
|
"emptyActiveTransactions": "没有正在进行的交易",
|
|
96
96
|
"emptyTransactionHistory": "近期无交易",
|
|
97
97
|
"routeNotFound": "没有可用的路由"
|
|
@@ -99,15 +99,15 @@
|
|
|
99
99
|
},
|
|
100
100
|
"success": {
|
|
101
101
|
"message": {
|
|
102
|
-
"exchangePartiallySuccessful": "",
|
|
102
|
+
"exchangePartiallySuccessful": "我们尝试执行这笔交易,但是因为滑点设置的问题或者 {{tokenSymbol}} 代币流动性不足,{{tool}} 无法完成交易",
|
|
103
103
|
"exchangeSuccessful": "{{walletAddress}} 钱包在 {{chainName}} 链上收到 {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}}",
|
|
104
|
-
"checkoutSuccessful": ""
|
|
104
|
+
"checkoutSuccessful": "您的 {{walletAddress}} 钱包在 {{chainName}} 链上拥有该 {{assetName}} 财产"
|
|
105
105
|
},
|
|
106
106
|
"title": {
|
|
107
107
|
"bridgePartiallySuccessful": "跨链部分成功",
|
|
108
108
|
"bridgeSuccessful": "跨链成功",
|
|
109
|
-
"depositSuccessful": "",
|
|
110
|
-
"checkoutSuccessful": "",
|
|
109
|
+
"depositSuccessful": "存款成功",
|
|
110
|
+
"checkoutSuccessful": "购买成功",
|
|
111
111
|
"refundIssued": "退款已受理",
|
|
112
112
|
"swapPartiallySuccessful": "兑换部分完成",
|
|
113
113
|
"swapSuccessful": "兑换成功"
|
|
@@ -142,13 +142,13 @@
|
|
|
142
142
|
"signatureRejected": "需要您签名来完成此次交易。不用担心,{{chainName}} 链上 {{amount, number(maximumFractionDigits: 9)}} 个 {{tokenSymbol}} 仍在您的钱包里。",
|
|
143
143
|
"slippageThreshold": "滑点大于预设值,请选择其他路由并获取新的价格。",
|
|
144
144
|
"transactionCanceled": "交易已被取消。",
|
|
145
|
-
"transactionConflict": "",
|
|
146
|
-
"transactionExpired": "",
|
|
145
|
+
"transactionConflict": "交易无法处理,因为它与使用相同资金的另一个待处理交易相冲突。 请等待交易确认或检查您的交易历史,然后再次尝试。",
|
|
146
|
+
"transactionExpired": "区块高度已超过允许的最大值,或者交易哈希值已经过期。",
|
|
147
147
|
"transactionFailed": "请查看区块浏览器以了解更多信息。",
|
|
148
148
|
"transactionNotSent": "交易未能发送。",
|
|
149
|
-
"transactionSimulationFailed": "",
|
|
149
|
+
"transactionSimulationFailed": "该交易模拟执行失败。",
|
|
150
150
|
"unknown": "请再试一次或者联系支持。",
|
|
151
|
-
"walletChangedDuringExecution": ""
|
|
151
|
+
"walletChangedDuringExecution": "询价的钱包地址与试图签署交易的钱包地址不匹配,请确保在整个交易执行过程中使用相同的钱包地址。"
|
|
152
152
|
},
|
|
153
153
|
"title": {
|
|
154
154
|
"allowanceRequired": "余额不足",
|
|
@@ -162,10 +162,10 @@
|
|
|
162
162
|
"signatureRejected": "交易需要签名。",
|
|
163
163
|
"slippageNotMet": "滑点未满足",
|
|
164
164
|
"transactionCanceled": "交易取消",
|
|
165
|
-
"transactionConflict": "",
|
|
166
|
-
"transactionExpired": "",
|
|
165
|
+
"transactionConflict": "交易冲突",
|
|
166
|
+
"transactionExpired": "交易过期",
|
|
167
167
|
"transactionFailed": "交易失败",
|
|
168
|
-
"transactionSimulationFailed": "",
|
|
168
|
+
"transactionSimulationFailed": "交易模拟失败",
|
|
169
169
|
"transactionUnderpriced": "交易定价过低",
|
|
170
170
|
"transactionUnprepared": "无法开始该交易",
|
|
171
171
|
"unknown": "未知错误",
|
|
@@ -173,24 +173,24 @@
|
|
|
173
173
|
"walletAddressInvalid_chain": "钱包地址或者域名在所选中的 {{chainName}} 链无效",
|
|
174
174
|
"walletAddressRequired": "请输入钱包地址。",
|
|
175
175
|
"walletChainTypeInvalid": "钱包地址与所选中目标的 {{chainName}} 链不匹配",
|
|
176
|
-
"walletMismatch": ""
|
|
176
|
+
"walletMismatch": "钱包地址不匹配"
|
|
177
177
|
}
|
|
178
178
|
},
|
|
179
179
|
"tooltip": {
|
|
180
180
|
"deselectAll": "取消全选",
|
|
181
|
-
"estimatedTime": "",
|
|
182
|
-
"feeCollection": "",
|
|
183
|
-
"minReceived": "",
|
|
181
|
+
"estimatedTime": "预计完成兑换或者跨链的时间,但不涵盖切换链和批准代币的时间。",
|
|
182
|
+
"feeCollection": "该手续费适用于选定的代币对,保证使用 {{tool}} 交易顺畅。",
|
|
183
|
+
"minReceived": "在签署兑换或者跨链交易之前, 预估的最低代币数量可能会变化,对于两步交易,这适用于第二步交易签署之前。",
|
|
184
184
|
"notFound": {
|
|
185
185
|
"text": "我们找不到这个页面。",
|
|
186
186
|
"title": "404"
|
|
187
187
|
},
|
|
188
|
-
"numberOfSteps": "",
|
|
189
|
-
"priceImpact": "",
|
|
188
|
+
"numberOfSteps": "每次代币兑换包含了一到两次需要签名的交易。",
|
|
189
|
+
"priceImpact": "源代币和目标代币之间的估计差值。",
|
|
190
190
|
"progressToNextUpdate": "数据将在{{value}} 秒后自动刷新,点击这里可以手动更新。",
|
|
191
191
|
"selectAll": "全选",
|
|
192
192
|
"settingsModified": "设置(已修改)",
|
|
193
|
-
"slippage": ""
|
|
193
|
+
"slippage": "真实的成交价位与预设的成交价位间相差的最大百分比。该值可以在设置中更改。"
|
|
194
194
|
},
|
|
195
195
|
"main": {
|
|
196
196
|
"allTokens": "所有代币",
|
|
@@ -200,22 +200,22 @@
|
|
|
200
200
|
"depositStepDetails": "通过 {{tool}} 存入资金",
|
|
201
201
|
"featuredTokens": "精选代币",
|
|
202
202
|
"fees": {
|
|
203
|
-
"defaultIntegrator": "",
|
|
204
|
-
"estimated": "",
|
|
205
|
-
"integrator": "",
|
|
206
|
-
"network": "",
|
|
207
|
-
"paid": "",
|
|
208
|
-
"provider": ""
|
|
203
|
+
"defaultIntegrator": "集成商费用",
|
|
204
|
+
"estimated": "预估总费用",
|
|
205
|
+
"integrator": "{{tool}} 费用",
|
|
206
|
+
"network": "网络费用",
|
|
207
|
+
"paid": "已支付的费用",
|
|
208
|
+
"provider": "供应商费用"
|
|
209
209
|
},
|
|
210
210
|
"from": "从",
|
|
211
211
|
"inProgress": "进行中",
|
|
212
|
-
"maxSlippage": "",
|
|
213
|
-
"minReceived": "",
|
|
212
|
+
"maxSlippage": "最大滑点",
|
|
213
|
+
"minReceived": "最少收到",
|
|
214
214
|
"myTokens": "我的代币",
|
|
215
215
|
"onChain": "在{{chainName}} 上",
|
|
216
216
|
"ownedBy": "属于",
|
|
217
217
|
"popularTokens": "热门代币",
|
|
218
|
-
"priceImpact": "",
|
|
218
|
+
"priceImpact": "价格冲击",
|
|
219
219
|
"process": {
|
|
220
220
|
"bridge": {
|
|
221
221
|
"actionRequired": "请签署此交易",
|
|
@@ -264,26 +264,26 @@
|
|
|
264
264
|
"sentToAddress": "发送到{{address}}",
|
|
265
265
|
"stepBridge": "跨链",
|
|
266
266
|
"stepBridgeAndBuy": "跨链并购买",
|
|
267
|
-
"stepBridgeAndDeposit": "",
|
|
267
|
+
"stepBridgeAndDeposit": "跨链并存款",
|
|
268
268
|
"stepDetails": "通过 LI.FI {{tool}}",
|
|
269
269
|
"stepSwap": "兑换",
|
|
270
270
|
"stepSwapAndBridge": "兑换和跨链",
|
|
271
271
|
"stepSwapAndBuy": "兑换并购买",
|
|
272
|
-
"stepSwapAndDeposit": "",
|
|
273
|
-
"transferId": "",
|
|
272
|
+
"stepSwapAndDeposit": "兑换并存款",
|
|
273
|
+
"transferId": "交易 ID",
|
|
274
274
|
"swapStepDetails": "通过{{tool}}在{{chain}}链上兑换代币",
|
|
275
275
|
"tags": {
|
|
276
276
|
"cheapest": "最佳报价",
|
|
277
|
-
"fastest": "
|
|
277
|
+
"fastest": "速度最快"
|
|
278
278
|
},
|
|
279
279
|
"to": "到",
|
|
280
280
|
"tokenOnChain": "{{chainName}}链上的{{tokenSymbol}}",
|
|
281
281
|
"tokenOnChainAmount": "{{chainName}} 链上{{amount, number(maximumFractionDigits: 9)}} 个{{tokenSymbol}}",
|
|
282
282
|
"tokenSearch": "按代币名称或者地址搜索",
|
|
283
283
|
"valueLoss": "资金损失",
|
|
284
|
-
"searchChains": "",
|
|
285
|
-
"searchBridges": "",
|
|
286
|
-
"searchExchanges": ""
|
|
284
|
+
"searchChains": "搜索链",
|
|
285
|
+
"searchBridges": "搜索跨链桥",
|
|
286
|
+
"searchExchanges": "搜索交易所"
|
|
287
287
|
},
|
|
288
288
|
"settings": {
|
|
289
289
|
"theme": "主题",
|
|
@@ -296,7 +296,7 @@
|
|
|
296
296
|
"title": "燃气费"
|
|
297
297
|
},
|
|
298
298
|
"routePriority": "路由优先级",
|
|
299
|
-
"slippage": "",
|
|
299
|
+
"slippage": "最大滑点",
|
|
300
300
|
"custom": "自定义",
|
|
301
301
|
"resetSettings": "您正在使用自定义设置来过滤可用路由。"
|
|
302
302
|
},
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type * from '@lifi/sdk';
|
|
2
|
-
export { ChainType, ChainId } from '@lifi/sdk';
|
|
2
|
+
export { ChainType, ChainId, CoinKey } from '@lifi/sdk';
|
|
3
3
|
export { App as LiFiWidget } from './App.js';
|
|
4
4
|
export type { WidgetDrawer } from './AppDrawer.js';
|
|
5
5
|
export * from './components/ContractComponent/ItemPrice.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ChainType, ChainId } from '@lifi/sdk';
|
|
1
|
+
export { ChainType, ChainId, CoinKey } from '@lifi/sdk';
|
|
2
2
|
export { App as LiFiWidget } from './App.js';
|
|
3
3
|
export * from './components/ContractComponent/ItemPrice.js';
|
|
4
4
|
export * from './components/ContractComponent/NFT/NFT.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,GAAG,IAAI,UAAU,EAAE,MAAM,UAAU,CAAA;AAE5C,cAAc,6CAA6C,CAAA;AAC3D,cAAc,2CAA2C,CAAA;AACzD,cAAc,+CAA+C,CAAA;AAC7D,cAAc,6CAA6C,CAAA;AAC3D,cAAc,yCAAyC,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,qBAAqB,CAAA;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC1E,cAAc,wBAAwB,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,cAAc,6BAA6B,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,cAAc,sBAAsB,CAAA;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,cAAc,mBAAmB,CAAA;AAEjC,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA"}
|
|
@@ -29,6 +29,7 @@ export const MainPage = () => {
|
|
|
29
29
|
? t('header.gas')
|
|
30
30
|
: t('header.exchange');
|
|
31
31
|
useHeader(title);
|
|
32
|
-
|
|
32
|
+
const marginSx = { marginBottom: 2 };
|
|
33
|
+
return (_jsxs(PageContainer, { children: [_jsx(ActiveTransactions, { sx: marginSx }), custom ? (_jsx(ContractComponent, { sx: marginSx, children: contractComponent })) : null, _jsx(SelectChainAndToken, { mb: 2 }), !custom || subvariantOptions?.custom === 'deposit' ? (_jsx(AmountInput, { formType: "from", sx: marginSx })) : null, !wideVariant ? _jsx(Routes, { sx: marginSx }) : null, _jsx(SendToWalletButton, { sx: marginSx }), _jsx(GasRefuelMessage, { mb: 2 }), _jsx(MainMessages, { mb: 2 }), _jsxs(Box, { display: "flex", mb: showPoweredBy ? 1 : 3, gap: 1.5, children: [_jsx(ReviewButton, {}), _jsx(SendToWalletExpandButton, {})] }), showPoweredBy ? _jsx(PoweredBy, {}) : null] }));
|
|
33
34
|
};
|
|
34
35
|
//# sourceMappingURL=MainPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainPage.js","sourceRoot":"","sources":["../../../../src/pages/MainPage/MainPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAA;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAA;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAA;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAA;AACpG,OAAO,EAAE,SAAS,EAAE,MAAM,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declare const FormContainer: import("@emotion/styled").StyledComponent<import("@mui/material").ContainerOwnProps & import("@mui/material/OverridableComponent.js").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2
2
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
3
|
-
}, "maxWidth" | "children" | "sx" | "style" | "className" | "
|
|
3
|
+
}, "fixed" | "maxWidth" | "children" | "sx" | "style" | "className" | "classes" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -5,16 +5,16 @@ export declare const BookmarkInputFields: import("@emotion/styled").StyledCompon
|
|
|
5
5
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
6
6
|
export declare const SendToWalletPageContainer: import("@emotion/styled").StyledComponent<import("@mui/material").ContainerOwnProps & import("@mui/material/OverridableComponent.js").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
7
7
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
8
|
-
}, "maxWidth" | "children" | "sx" | "style" | "className" | "
|
|
8
|
+
}, "fixed" | "maxWidth" | "children" | "sx" | "style" | "className" | "classes" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & PageContainerProps, {}, {}>;
|
|
9
9
|
interface FullHeightAdjustablePageContainerProps extends PageContainerProps {
|
|
10
10
|
enableFullHeight?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export declare const FullHeightAdjustablePageContainer: import("@emotion/styled").StyledComponent<import("@mui/material").ContainerOwnProps & import("@mui/material/OverridableComponent.js").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
13
13
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
14
|
-
}, "maxWidth" | "children" | "sx" | "style" | "className" | "
|
|
14
|
+
}, "fixed" | "maxWidth" | "children" | "sx" | "style" | "className" | "classes" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & PageContainerProps & FullHeightAdjustablePageContainerProps, {}, {}>;
|
|
15
15
|
export declare const SendToWalletCard: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").CardOwnProps & import("@mui/material/OverridableComponent.js").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
16
16
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
17
|
-
}, "children" | "sx" | "style" | "className" | "elevation" | "classes" | "variant" | "square" | "raised"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & import("../../components/Card/Card.js").CardProps, "color" | "content" | "translate" | "children" | "component" | "ref" | "sx" | "slot" | "style" | "
|
|
17
|
+
}, "children" | "sx" | "style" | "className" | "elevation" | "classes" | "variant" | "square" | "raised"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & import("../../components/Card/Card.js").CardProps, "title" | "theme" | "color" | "content" | "translate" | "children" | "component" | "ref" | "sx" | "slot" | "style" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "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-rowindextext" | "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" | "onResize" | "onResizeCapture" | "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" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "type" | "elevation" | "as" | "classes" | "variant" | "square" | "raised" | "selectionColor" | "indented"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
18
18
|
export declare const SendToWalletSheetContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
19
19
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
20
20
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -23,7 +23,7 @@ export declare const SendToWalletButtonRow: import("@emotion/styled").StyledComp
|
|
|
23
23
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
24
24
|
export declare const SendToWalletIconButton: import("@emotion/styled").StyledComponent<import("@mui/lab").LoadingButtonOwnProps & Omit<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes">, "classes"> & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent.js").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
25
25
|
ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
26
|
-
}, "color" | "children" | "sx" | "style" | "className" | "tabIndex" | "href" | "disabled" | "action" | "loading" | "size" | "classes" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "
|
|
26
|
+
}, "color" | "children" | "sx" | "style" | "className" | "tabIndex" | "href" | "disabled" | "action" | "loading" | "size" | "classes" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "startIcon" | "loadingIndicator" | "loadingPosition"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
27
27
|
export declare const IconContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
28
28
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
29
29
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -3,4 +3,4 @@ export declare const SettingsList: import("@emotion/styled").StyledComponent<imp
|
|
|
3
3
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
4
4
|
export declare const Badge: import("@emotion/styled").StyledComponent<import("@mui/material").BadgeOwnProps & import("@mui/material/OverridableComponent.js").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
5
5
|
ref?: ((instance: HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
6
|
-
}, "color" | "children" | "sx" | "style" | "className" | "
|
|
6
|
+
}, "max" | "color" | "children" | "sx" | "style" | "className" | "classes" | "variant" | "slots" | "slotProps" | "componentsProps" | "anchorOrigin" | "badgeContent" | "components" | "invisible" | "overlap" | "showZero"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.3-beta.0",
|
|
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
|
"type": "module",
|
|
6
6
|
"main": "./dist/esm/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"viem": "^2.21.43",
|
|
57
57
|
"wagmi": "^2.12.29",
|
|
58
58
|
"zustand": "^4.5.5",
|
|
59
|
-
"@lifi/wallet-management": "^3.4.
|
|
59
|
+
"@lifi/wallet-management": "^3.4.6-beta.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"react": ">=18",
|
|
@@ -70,6 +70,7 @@ export const AmountInputBase: React.FC<
|
|
|
70
70
|
...props
|
|
71
71
|
}) => {
|
|
72
72
|
const { t } = useTranslation()
|
|
73
|
+
const { subvariant, subvariantOptions } = useWidgetConfig()
|
|
73
74
|
const ref = useRef<HTMLInputElement>(null)
|
|
74
75
|
const amountKey = FormKeyHelper.getAmountKey(formType)
|
|
75
76
|
const { onChange, onBlur, value } = useFieldController({ name: amountKey })
|
|
@@ -98,9 +99,16 @@ export const AmountInputBase: React.FC<
|
|
|
98
99
|
}
|
|
99
100
|
}, [value])
|
|
100
101
|
|
|
102
|
+
const title =
|
|
103
|
+
subvariant === 'custom'
|
|
104
|
+
? subvariantOptions?.custom === 'deposit'
|
|
105
|
+
? t('header.amount')
|
|
106
|
+
: t('header.youPay')
|
|
107
|
+
: t('header.send')
|
|
108
|
+
|
|
101
109
|
return (
|
|
102
110
|
<InputCard {...props}>
|
|
103
|
-
<CardTitle>{
|
|
111
|
+
<CardTitle>{title}</CardTitle>
|
|
104
112
|
<FormContainer>
|
|
105
113
|
<AmountInputStartAdornment formType={formType} />
|
|
106
114
|
<FormControl fullWidth>
|
|
@@ -16,7 +16,8 @@ import { RouteNotFoundCard } from '../RouteCard/RouteNotFoundCard.js'
|
|
|
16
16
|
export const Routes: React.FC<CardProps> = (props) => {
|
|
17
17
|
const { t } = useTranslation()
|
|
18
18
|
const navigate = useNavigate()
|
|
19
|
-
const { subvariant, useRecommendedRoute } =
|
|
19
|
+
const { subvariant, subvariantOptions, useRecommendedRoute } =
|
|
20
|
+
useWidgetConfig()
|
|
20
21
|
const {
|
|
21
22
|
routes,
|
|
22
23
|
isLoading,
|
|
@@ -42,11 +43,16 @@ export const Routes: React.FC<CardProps> = (props) => {
|
|
|
42
43
|
const showAll =
|
|
43
44
|
!onlyRecommendedRoute && !routeNotFound && (routes?.length ?? 0) > 1
|
|
44
45
|
|
|
46
|
+
const title =
|
|
47
|
+
subvariant === 'custom'
|
|
48
|
+
? subvariantOptions?.custom === 'deposit'
|
|
49
|
+
? t('header.deposit')
|
|
50
|
+
: t('header.youPay')
|
|
51
|
+
: t('header.receive')
|
|
52
|
+
|
|
45
53
|
return (
|
|
46
54
|
<Card {...props}>
|
|
47
|
-
<CardTitle>
|
|
48
|
-
{subvariant === 'custom' ? t('header.youPay') : t('header.receive')}
|
|
49
|
-
</CardTitle>
|
|
55
|
+
<CardTitle>{title}</CardTitle>
|
|
50
56
|
<ProgressToNextUpdate
|
|
51
57
|
updatedAt={dataUpdatedAt || new Date().getTime()}
|
|
52
58
|
timeToUpdate={refetchTime}
|
|
@@ -64,7 +64,7 @@ export const RoutesExpanded = () => {
|
|
|
64
64
|
export const RoutesExpandedElement = () => {
|
|
65
65
|
const { t } = useTranslation()
|
|
66
66
|
const navigate = useNavigate()
|
|
67
|
-
const { subvariant } = useWidgetConfig()
|
|
67
|
+
const { subvariant, subvariantOptions } = useWidgetConfig()
|
|
68
68
|
const routesRef = useRef<Route[]>()
|
|
69
69
|
const emitter = useWidgetEvents()
|
|
70
70
|
const routesActiveRef = useRef(false)
|
|
@@ -118,6 +118,13 @@ export const RoutesExpandedElement = () => {
|
|
|
118
118
|
emitter.emit(WidgetEvent.WidgetExpanded, expanded)
|
|
119
119
|
}, [emitter, expanded])
|
|
120
120
|
|
|
121
|
+
const title =
|
|
122
|
+
subvariant === 'custom'
|
|
123
|
+
? subvariantOptions?.custom === 'deposit'
|
|
124
|
+
? t('header.deposit')
|
|
125
|
+
: t('header.youPay')
|
|
126
|
+
: t('header.receive')
|
|
127
|
+
|
|
121
128
|
return (
|
|
122
129
|
<RoutesExpandedCollapse
|
|
123
130
|
timeout={timeout.enter}
|
|
@@ -130,9 +137,7 @@ export const RoutesExpandedElement = () => {
|
|
|
130
137
|
<ScrollableContainer>
|
|
131
138
|
<Header>
|
|
132
139
|
<Typography fontSize={18} fontWeight="700" flex={1} noWrap>
|
|
133
|
-
{
|
|
134
|
-
? t('header.youPay')
|
|
135
|
-
: t('header.receive')}
|
|
140
|
+
{title}
|
|
136
141
|
</Typography>
|
|
137
142
|
<ProgressToNextUpdate
|
|
138
143
|
updatedAt={dataUpdatedAt || new Date().getTime()}
|
|
@@ -28,7 +28,14 @@ import { SendToWalletCardHeader } from './SendToWallet.style.js'
|
|
|
28
28
|
export const SendToWalletButton: React.FC<CardProps> = (props) => {
|
|
29
29
|
const { t } = useTranslation()
|
|
30
30
|
const navigate = useNavigate()
|
|
31
|
-
const {
|
|
31
|
+
const {
|
|
32
|
+
disabledUI,
|
|
33
|
+
hiddenUI,
|
|
34
|
+
toAddress,
|
|
35
|
+
toAddresses,
|
|
36
|
+
subvariant,
|
|
37
|
+
subvariantOptions,
|
|
38
|
+
} = useWidgetConfig()
|
|
32
39
|
const { showSendToWallet } = useSendToWalletStore()
|
|
33
40
|
const [toAddressFieldValue, toChainId, toTokenAddress] = useFieldValues(
|
|
34
41
|
'toAddress',
|
|
@@ -114,6 +121,11 @@ export const SendToWalletButton: React.FC<CardProps> = (props) => {
|
|
|
114
121
|
const isOpenCollapse =
|
|
115
122
|
requiredToAddress || (showSendToWallet && !hiddenToAddress)
|
|
116
123
|
|
|
124
|
+
const title =
|
|
125
|
+
subvariant === 'custom' && subvariantOptions?.custom === 'deposit'
|
|
126
|
+
? t('header.depositTo')
|
|
127
|
+
: t('header.sendToWallet')
|
|
128
|
+
|
|
117
129
|
return (
|
|
118
130
|
<Collapse
|
|
119
131
|
timeout={collapseTransitionTime.current}
|
|
@@ -127,9 +139,7 @@ export const SendToWalletButton: React.FC<CardProps> = (props) => {
|
|
|
127
139
|
onClick={disabledForChanges ? undefined : handleOnClick}
|
|
128
140
|
sx={{ width: '100%', ...props.sx }}
|
|
129
141
|
>
|
|
130
|
-
<CardTitle required={requiredToAddress}>
|
|
131
|
-
{t('header.sendToWallet')}
|
|
132
|
-
</CardTitle>
|
|
142
|
+
<CardTitle required={requiredToAddress}>{title}</CardTitle>
|
|
133
143
|
<Box display="flex" justifyContent="center" alignItems="center">
|
|
134
144
|
<SendToWalletCardHeader
|
|
135
145
|
avatar={
|