@lifi/widget 1.27.2 → 1.28.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.
Files changed (189) hide show
  1. package/AppRoutes.js +15 -33
  2. package/README.md +1 -1
  3. package/cjs/AppRoutes.js +15 -33
  4. package/cjs/components/ContractComponent/ContractComponent.d.ts +3 -0
  5. package/cjs/components/ContractComponent/ContractComponent.js +14 -0
  6. package/cjs/components/ContractComponent/index.d.ts +1 -0
  7. package/cjs/components/ContractComponent/index.js +17 -0
  8. package/cjs/components/Header/NavigationHeader.js +10 -2
  9. package/cjs/components/Header/WalletHeader.js +1 -1
  10. package/cjs/components/NFT/NFT.d.ts +4 -0
  11. package/cjs/components/NFT/NFT.js +41 -0
  12. package/cjs/components/NFT/NFT.style.d.ts +16 -0
  13. package/cjs/components/NFT/NFT.style.js +11 -0
  14. package/cjs/components/NFT/index.d.ts +2 -0
  15. package/cjs/components/NFT/index.js +18 -0
  16. package/cjs/components/NFT/types.d.ts +15 -0
  17. package/cjs/components/NFT/types.js +2 -0
  18. package/cjs/components/Select.d.ts +1 -1
  19. package/cjs/components/SelectChainAndToken.js +12 -2
  20. package/cjs/components/SelectTokenButton/SelectTokenButton.js +5 -2
  21. package/cjs/components/StepActions/StepActions.d.ts +6 -7
  22. package/cjs/components/StepActions/StepActions.js +41 -12
  23. package/cjs/components/StepActions/types.d.ts +5 -0
  24. package/cjs/components/SwapInput/SwapInput.d.ts +2 -1
  25. package/cjs/components/SwapInput/SwapInput.js +15 -3
  26. package/cjs/components/SwapRouteCard/SwapRouteCard.js +3 -1
  27. package/cjs/components/Token/Token.d.ts +1 -1
  28. package/cjs/components/Token/Token.js +12 -12
  29. package/cjs/components/TokenAvatar/TokenAvatar.d.ts +5 -3
  30. package/cjs/components/TokenAvatar/TokenAvatar.js +10 -9
  31. package/cjs/components/TokenList/TokenList.style.js +6 -0
  32. package/cjs/components/TokenList/VirtualizedTokenList.js +4 -2
  33. package/cjs/config/version.d.ts +1 -1
  34. package/cjs/config/version.js +1 -1
  35. package/cjs/hooks/useSwapRoutes.d.ts +5 -2
  36. package/cjs/hooks/useSwapRoutes.js +64 -14
  37. package/cjs/hooks/useToken.d.ts +1 -1
  38. package/cjs/hooks/useTokenSearch.d.ts +1 -1
  39. package/cjs/i18n/de.json +214 -214
  40. package/cjs/i18n/en.json +218 -214
  41. package/cjs/i18n/es.json +191 -191
  42. package/cjs/i18n/fr.json +214 -214
  43. package/cjs/i18n/it.json +214 -214
  44. package/cjs/i18n/uk.json +214 -214
  45. package/cjs/i18n/zh.json +214 -214
  46. package/cjs/index.d.ts +2 -0
  47. package/cjs/index.js +4 -1
  48. package/cjs/pages/MainPage/MainPage.js +5 -1
  49. package/cjs/providers/SwapFormProvider/types.d.ts +10 -0
  50. package/cjs/providers/SwapFormProvider/types.js +5 -0
  51. package/cjs/stores/chains/useChainOrderStore.d.ts +1 -1
  52. package/cjs/stores/routes/useRouteExecutionStore.d.ts +1 -1
  53. package/cjs/stores/settings/useSettingsStore.d.ts +1 -1
  54. package/cjs/types/widget.d.ts +9 -4
  55. package/cjs/types/widget.js +2 -0
  56. package/components/ContractComponent/ContractComponent.d.ts +3 -0
  57. package/components/ContractComponent/ContractComponent.js +10 -0
  58. package/components/ContractComponent/index.d.ts +1 -0
  59. package/components/ContractComponent/index.js +1 -0
  60. package/components/Header/NavigationHeader.js +12 -4
  61. package/components/Header/WalletHeader.js +1 -1
  62. package/components/NFT/NFT.d.ts +4 -0
  63. package/components/NFT/NFT.js +37 -0
  64. package/components/NFT/NFT.style.d.ts +16 -0
  65. package/components/NFT/NFT.style.js +8 -0
  66. package/components/NFT/index.d.ts +2 -0
  67. package/components/NFT/index.js +2 -0
  68. package/components/NFT/types.d.ts +15 -0
  69. package/components/NFT/types.js +1 -0
  70. package/components/Select.d.ts +1 -1
  71. package/components/SelectChainAndToken.js +12 -2
  72. package/components/SelectTokenButton/SelectTokenButton.js +5 -2
  73. package/components/StepActions/StepActions.d.ts +6 -7
  74. package/components/StepActions/StepActions.js +40 -12
  75. package/components/StepActions/types.d.ts +5 -0
  76. package/components/SwapInput/SwapInput.d.ts +2 -1
  77. package/components/SwapInput/SwapInput.js +15 -3
  78. package/components/SwapRouteCard/SwapRouteCard.js +3 -1
  79. package/components/Token/Token.d.ts +1 -1
  80. package/components/Token/Token.js +13 -13
  81. package/components/TokenAvatar/TokenAvatar.d.ts +5 -3
  82. package/components/TokenAvatar/TokenAvatar.js +10 -9
  83. package/components/TokenList/TokenList.style.js +6 -0
  84. package/components/TokenList/VirtualizedTokenList.js +4 -2
  85. package/config/version.d.ts +1 -1
  86. package/config/version.js +1 -1
  87. package/hooks/useSwapRoutes.d.ts +5 -2
  88. package/hooks/useSwapRoutes.js +64 -14
  89. package/hooks/useToken.d.ts +1 -1
  90. package/hooks/useTokenSearch.d.ts +1 -1
  91. package/i18n/de.json +214 -214
  92. package/i18n/en.json +218 -214
  93. package/i18n/es.json +191 -191
  94. package/i18n/fr.json +214 -214
  95. package/i18n/it.json +214 -214
  96. package/i18n/uk.json +214 -214
  97. package/i18n/zh.json +214 -214
  98. package/index.d.ts +2 -0
  99. package/index.js +2 -0
  100. package/package.json +15 -13
  101. package/pages/MainPage/MainPage.js +5 -1
  102. package/providers/SwapFormProvider/types.d.ts +10 -0
  103. package/providers/SwapFormProvider/types.js +5 -0
  104. package/stores/chains/useChainOrderStore.d.ts +1 -1
  105. package/stores/routes/useRouteExecutionStore.d.ts +1 -1
  106. package/stores/settings/useSettingsStore.d.ts +1 -1
  107. package/tsconfig.cjs.tsbuildinfo +1 -1
  108. package/types/widget.d.ts +9 -4
  109. package/types/widget.js +2 -0
  110. package/cjs/fonts/Inter-Black.woff +0 -0
  111. package/cjs/fonts/Inter-Black.woff2 +0 -0
  112. package/cjs/fonts/Inter-BlackItalic.woff +0 -0
  113. package/cjs/fonts/Inter-BlackItalic.woff2 +0 -0
  114. package/cjs/fonts/Inter-Bold.woff +0 -0
  115. package/cjs/fonts/Inter-Bold.woff2 +0 -0
  116. package/cjs/fonts/Inter-BoldItalic.woff +0 -0
  117. package/cjs/fonts/Inter-BoldItalic.woff2 +0 -0
  118. package/cjs/fonts/Inter-ExtraBold.woff +0 -0
  119. package/cjs/fonts/Inter-ExtraBold.woff2 +0 -0
  120. package/cjs/fonts/Inter-ExtraBoldItalic.woff +0 -0
  121. package/cjs/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
  122. package/cjs/fonts/Inter-ExtraLight.woff +0 -0
  123. package/cjs/fonts/Inter-ExtraLight.woff2 +0 -0
  124. package/cjs/fonts/Inter-ExtraLightItalic.woff +0 -0
  125. package/cjs/fonts/Inter-ExtraLightItalic.woff2 +0 -0
  126. package/cjs/fonts/Inter-Italic.woff +0 -0
  127. package/cjs/fonts/Inter-Italic.woff2 +0 -0
  128. package/cjs/fonts/Inter-Light.woff +0 -0
  129. package/cjs/fonts/Inter-Light.woff2 +0 -0
  130. package/cjs/fonts/Inter-LightItalic.woff +0 -0
  131. package/cjs/fonts/Inter-LightItalic.woff2 +0 -0
  132. package/cjs/fonts/Inter-Medium.woff +0 -0
  133. package/cjs/fonts/Inter-Medium.woff2 +0 -0
  134. package/cjs/fonts/Inter-MediumItalic.woff +0 -0
  135. package/cjs/fonts/Inter-MediumItalic.woff2 +0 -0
  136. package/cjs/fonts/Inter-Regular.woff +0 -0
  137. package/cjs/fonts/Inter-Regular.woff2 +0 -0
  138. package/cjs/fonts/Inter-SemiBold.woff +0 -0
  139. package/cjs/fonts/Inter-SemiBold.woff2 +0 -0
  140. package/cjs/fonts/Inter-SemiBoldItalic.woff +0 -0
  141. package/cjs/fonts/Inter-SemiBoldItalic.woff2 +0 -0
  142. package/cjs/fonts/Inter-Thin.woff +0 -0
  143. package/cjs/fonts/Inter-Thin.woff2 +0 -0
  144. package/cjs/fonts/Inter-ThinItalic.woff +0 -0
  145. package/cjs/fonts/Inter-ThinItalic.woff2 +0 -0
  146. package/cjs/fonts/Inter-italic.var.woff2 +0 -0
  147. package/cjs/fonts/Inter-roman.var.woff2 +0 -0
  148. package/cjs/fonts/Inter.var.woff2 +0 -0
  149. package/cjs/fonts/inter.css +0 -200
  150. package/fonts/Inter-Black.woff +0 -0
  151. package/fonts/Inter-Black.woff2 +0 -0
  152. package/fonts/Inter-BlackItalic.woff +0 -0
  153. package/fonts/Inter-BlackItalic.woff2 +0 -0
  154. package/fonts/Inter-Bold.woff +0 -0
  155. package/fonts/Inter-Bold.woff2 +0 -0
  156. package/fonts/Inter-BoldItalic.woff +0 -0
  157. package/fonts/Inter-BoldItalic.woff2 +0 -0
  158. package/fonts/Inter-ExtraBold.woff +0 -0
  159. package/fonts/Inter-ExtraBold.woff2 +0 -0
  160. package/fonts/Inter-ExtraBoldItalic.woff +0 -0
  161. package/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
  162. package/fonts/Inter-ExtraLight.woff +0 -0
  163. package/fonts/Inter-ExtraLight.woff2 +0 -0
  164. package/fonts/Inter-ExtraLightItalic.woff +0 -0
  165. package/fonts/Inter-ExtraLightItalic.woff2 +0 -0
  166. package/fonts/Inter-Italic.woff +0 -0
  167. package/fonts/Inter-Italic.woff2 +0 -0
  168. package/fonts/Inter-Light.woff +0 -0
  169. package/fonts/Inter-Light.woff2 +0 -0
  170. package/fonts/Inter-LightItalic.woff +0 -0
  171. package/fonts/Inter-LightItalic.woff2 +0 -0
  172. package/fonts/Inter-Medium.woff +0 -0
  173. package/fonts/Inter-Medium.woff2 +0 -0
  174. package/fonts/Inter-MediumItalic.woff +0 -0
  175. package/fonts/Inter-MediumItalic.woff2 +0 -0
  176. package/fonts/Inter-Regular.woff +0 -0
  177. package/fonts/Inter-Regular.woff2 +0 -0
  178. package/fonts/Inter-SemiBold.woff +0 -0
  179. package/fonts/Inter-SemiBold.woff2 +0 -0
  180. package/fonts/Inter-SemiBoldItalic.woff +0 -0
  181. package/fonts/Inter-SemiBoldItalic.woff2 +0 -0
  182. package/fonts/Inter-Thin.woff +0 -0
  183. package/fonts/Inter-Thin.woff2 +0 -0
  184. package/fonts/Inter-ThinItalic.woff +0 -0
  185. package/fonts/Inter-ThinItalic.woff2 +0 -0
  186. package/fonts/Inter-italic.var.woff2 +0 -0
  187. package/fonts/Inter-roman.var.woff2 +0 -0
  188. package/fonts/Inter.var.woff2 +0 -0
  189. package/fonts/inter.css +0 -200
package/cjs/i18n/zh.json CHANGED
@@ -1,223 +1,223 @@
1
1
  {
2
- "button": {
3
- "auto": "自动",
4
- "cancel": "取消",
5
- "connectWallet": "连接钱包",
6
- "contactSupport": "联系我们",
7
- "continue": "继续",
8
- "copyAddress": "复制地址",
9
- "dark": "深色模式",
10
- "delete": "删除",
11
- "disconnectWallet": "断开钱包",
12
- "done": "已完成",
13
- "getGas": "Get gas",
14
- "hide": "隐藏",
15
- "lifiSwap": "LI.FI代币兑换",
16
- "light": "浅色模式",
17
- "max": "最大",
18
- "ok": "确认",
19
- "okay": "确认",
20
- "removeSwap": "删除该兑换",
21
- "restartSwap": "重新兑换",
22
- "reviewSwap": "查看该兑换",
23
- "seeDetails": "查看详情",
24
- "showAll": "显示所有",
25
- "startGasSwap": "Start gas swap",
26
- "startSwap": "开始兑换",
27
- "swap": "兑换",
28
- "tryAgain": "再试一次"
29
- },
30
- "format": {
31
- "currency": "{{value, currency(currency: USD)}}",
32
- "number": "{{value, number(maximumFractionDigits: 4)}}"
33
- },
34
- "header": {
35
- "activeSwaps": "正在进行的兑换",
36
- "from": "兑换自",
37
- "gas": "Gas",
38
- "gasSwap": "Gas swap",
39
- "routes": "你会得到",
40
- "selectChain": "选择链",
41
- "selectWallet": "选择你的钱包",
42
- "settings": "设置",
43
- "swap": "兑换",
44
- "swapDetails": "兑换详情",
45
- "swapHistory": "兑换历史记录",
46
- "to": "兑换为",
47
- "walletConnected": "连接钱包"
48
- },
49
- "language": {
50
- "name": "中文",
51
- "title": "语言"
52
- },
53
- "settings": {
54
- "advancedPreferences": "偏好设置",
55
- "enabledBridges": "已选中的跨链桥",
56
- "enabledExchanges": "已选中的交易所",
57
- "gasPrice": {
58
- "fast": "快速",
59
- "normal": "正常",
60
- "slow": "缓慢",
61
- "title": "手续费"
2
+ "button": {
3
+ "auto": "自动",
4
+ "cancel": "取消",
5
+ "connectWallet": "连接钱包",
6
+ "contactSupport": "联系我们",
7
+ "continue": "继续",
8
+ "copyAddress": "复制地址",
9
+ "dark": "深色模式",
10
+ "delete": "删除",
11
+ "disconnectWallet": "断开钱包",
12
+ "done": "已完成",
13
+ "getGas": "Get gas",
14
+ "hide": "隐藏",
15
+ "lifiSwap": "LI.FI代币兑换",
16
+ "light": "浅色模式",
17
+ "max": "最大",
18
+ "ok": "确认",
19
+ "okay": "确认",
20
+ "removeSwap": "删除该兑换",
21
+ "restartSwap": "重新兑换",
22
+ "reviewSwap": "查看该兑换",
23
+ "seeDetails": "查看详情",
24
+ "showAll": "显示所有",
25
+ "startGasSwap": "Start gas swap",
26
+ "startSwap": "开始兑换",
27
+ "swap": "兑换",
28
+ "tryAgain": "再试一次"
62
29
  },
63
- "resetToDefault": "重置为默认值",
64
- "routePriority": "路由优先级",
65
- "selectEnabledBridges": "选择要使用的跨链桥",
66
- "selectEnabledExchanges": "选择要使用的交易所",
67
- "showDestinationWallet": "显示收款钱包",
68
- "slippage": "滑点"
69
- },
70
- "swap": {
71
- "crossStepDetails": "通过{{tool}}把资产从{{from}}链跨到{{to}}链上",
72
- "currentAmount": "Current amount",
73
- "error": {
74
- "message": {
75
- "slippageThreshold": "The slippage is larger than the defined threshold. Please request a new route to get a fresh quote.",
76
- "transactionFailed": "请查看区块浏览器以了解更多信息。",
77
- "transactionNotSent": "交易未发送,资金仍在您的钱包中({{chainName}}链上{{amount, number(maximumFractionDigits: 4)}}个{{tokenSymbol}})。",
78
- "transactionRejected": "需要您签名来完成此次交易。不用担心,{{chainName}}链上{{amount, number(maximumFractionDigits: 4)}}个{{tokenSymbol}}仍在您的钱包里。",
79
- "unknown": "Please try again or contact support."
80
- },
81
- "title": {
82
- "balanceIsTooLow": "The balance is too low",
83
- "chainSwitch": "需要切换当前链",
84
- "failed": "兑换失败。",
85
- "gasLimitIsTooLow": "The gas limit is too low",
86
- "slippageNotMet": "Slippage conditions not met",
87
- "transactionCanceled": "Transaction canceled",
88
- "transactionFailed": "交易失败。",
89
- "transactionRejected": "交易需要签名。",
90
- "transactionUnderpriced": "交易价格过低。",
91
- "transactionUnprepared": "无法准备该交易。",
92
- "unknown": "未知错误。",
93
- "walletAddressInvalid": "钱包地址无效。",
94
- "walletEnsAddressInvalid": "钱包地址无效或者当前网络不支持ENS。"
95
- }
30
+ "format": {
31
+ "currency": "{{value, currency(currency: USD)}}",
32
+ "number": "{{value, number(maximumFractionDigits: 4)}}"
96
33
  },
97
- "estimatedTime": "{{value}}分钟",
98
- "featuredTokens": "精选代币",
99
- "from": "",
100
- "fromAmount": "需要支付",
101
- "gasCost": "交易费",
102
- "gasFeeEstimated": "estimated gas fee",
103
- "gasFeePaid": "gas fee paid",
104
- "inProgress": "进行中",
105
- "info": {
106
- "message": {
107
- "emptyActiveSwaps": "正在进行的兑换将出现在这里。一旦完成,你可在兑换记录中找到它们。",
108
- "emptySwapHistory": "兑换历史记录只存储在本地,如果你清除浏览器数据,他们将被删除。",
109
- "emptyTokenList": "我们无法在{{chainName}}链上找到这些代币,或者你的钱包内没有这些代币。请再次搜索或者选择其他链再试一次。",
110
- "routeNotFound": "试试另一个路由。"
111
- },
112
- "title": {
113
- "emptyActiveSwaps": "没有正在进行的兑换",
114
- "emptySwapHistory": "空兑换历史记录",
115
- "routeNotFound": "没有可用的路由"
116
- }
34
+ "header": {
35
+ "activeSwaps": "正在进行的兑换",
36
+ "from": "兑换自",
37
+ "gas": "Gas",
38
+ "gasSwap": "Gas swap",
39
+ "routes": "你会得到",
40
+ "selectChain": "选择链",
41
+ "selectWallet": "选择你的钱包",
42
+ "settings": "设置",
43
+ "swap": "兑换",
44
+ "swapDetails": "兑换详情",
45
+ "swapHistory": "兑换历史记录",
46
+ "to": "兑换为",
47
+ "walletConnected": "连接钱包"
117
48
  },
118
- "onChain": "on {{chainName}}",
119
- "otherTokens": "其他代币",
120
- "process": {
121
- "crossChain": {
122
- "actionRequired": "请签署此交易。",
123
- "done": "交易已批准。",
124
- "pending": "等待交易完成。",
125
- "started": "准备执行交易。"
126
- },
127
- "receivingChain": {
128
- "done": "资金已到账。",
129
- "partial": "Bridge partially completed",
130
- "pending": "等待接收链。",
131
- "refunded": "Bridge transaction refunded"
132
- },
133
- "swap": {
134
- "actionRequired": "请签署此交易。",
135
- "done": "兑换完成。",
136
- "pending": "代币兑换中。",
137
- "started": "准备兑换。"
138
- },
139
- "switchChain": {
140
- "actionRequired": "需要切换当前链。",
141
- "done": "链切换成功。"
142
- },
143
- "tokenAllowance": {
144
- "done": "已批准代币限额。",
145
- "pending": "等待代币限额批准完成。",
146
- "started": "设置代币限额。"
147
- }
49
+ "language": {
50
+ "name": "中文",
51
+ "title": "语言"
148
52
  },
149
- "quotedAmount": "Quoted amount",
150
- "rateChange": "Rate change",
151
- "receiving": "接收",
152
- "routes": "你会得到",
153
- "selectChain": "链",
154
- "selectChainAndToken": "选择链和代币",
155
- "selectToken": "代币",
156
- "sendToAddress": "Send to {{address}}",
157
- "sendToWallet": "发送到另外的钱包",
158
- "sentToAddress": "Sent to {{address}}",
159
- "stepBridge": "跨链",
160
- "stepSwap": "兑换",
161
- "stepSwapAndBridge": "兑换和跨链",
162
- "success": {
163
- "message": {
164
- "swapPartiallySuccessful": "We've tried to complete the swap, but {{tool}} ran out of liquidity for {{tokenSymbol}} token.",
165
- "swapSuccessful": "现在有 {{amount, number(maximumFractionDigits: 4)}}个{{tokenSymbol}}在{{chainName}}链上的{{walletAddress}}钱包。"
166
- },
167
- "title": {
168
- "gasSwapSuccessful": "Gas swap successful",
169
- "refundIssued": "Refund issued",
170
- "swapPartiallySuccessful": "Swap partially successful",
171
- "swapSuccessful": "兑换成功"
172
- }
53
+ "settings": {
54
+ "advancedPreferences": "偏好设置",
55
+ "enabledBridges": "已选中的跨链桥",
56
+ "enabledExchanges": "已选中的交易所",
57
+ "gasPrice": {
58
+ "fast": "快速",
59
+ "normal": "正常",
60
+ "slow": "缓慢",
61
+ "title": "手续费"
62
+ },
63
+ "resetToDefault": "重置为默认值",
64
+ "routePriority": "路由优先级",
65
+ "selectEnabledBridges": "选择要使用的跨链桥",
66
+ "selectEnabledExchanges": "选择要使用的交易所",
67
+ "showDestinationWallet": "显示收款钱包",
68
+ "slippage": "滑点"
173
69
  },
174
- "supportId": "支持ID",
175
- "swapStepDetails": "通过{{tool}}{{chain}}链上兑换代币",
176
- "swapping": "兑换",
177
- "tags": {
178
- "ALTERNATIVE": "可用",
179
- "CHEAPEST": "便宜",
180
- "FASTEST": "快捷",
181
- "RECOMMENDED": "推荐",
182
- "SAFEST": "安全"
70
+ "swap": {
71
+ "crossStepDetails": "通过{{tool}}把资产从{{from}}链跨到{{to}}链上",
72
+ "currentAmount": "Current amount",
73
+ "error": {
74
+ "message": {
75
+ "slippageThreshold": "The slippage is larger than the defined threshold. Please request a new route to get a fresh quote.",
76
+ "transactionFailed": "请查看区块浏览器以了解更多信息。",
77
+ "transactionNotSent": "交易未发送,资金仍在您的钱包中({{chainName}}链上{{amount, number(maximumFractionDigits: 4)}}个{{tokenSymbol}})。",
78
+ "transactionRejected": "需要您签名来完成此次交易。不用担心,{{chainName}}链上{{amount, number(maximumFractionDigits: 4)}}个{{tokenSymbol}}仍在您的钱包里。",
79
+ "unknown": "Please try again or contact support."
80
+ },
81
+ "title": {
82
+ "balanceIsTooLow": "The balance is too low",
83
+ "chainSwitch": "需要切换当前链",
84
+ "failed": "兑换失败。",
85
+ "gasLimitIsTooLow": "The gas limit is too low",
86
+ "slippageNotMet": "Slippage conditions not met",
87
+ "transactionCanceled": "Transaction canceled",
88
+ "transactionFailed": "交易失败。",
89
+ "transactionRejected": "交易需要签名。",
90
+ "transactionUnderpriced": "交易价格过低。",
91
+ "transactionUnprepared": "无法准备该交易。",
92
+ "unknown": "未知错误。",
93
+ "walletAddressInvalid": "钱包地址无效。",
94
+ "walletEnsAddressInvalid": "钱包地址无效或者当前网络不支持ENS。"
95
+ }
96
+ },
97
+ "estimatedTime": "{{value}}分钟",
98
+ "featuredTokens": "精选代币",
99
+ "from": "从",
100
+ "fromAmount": "需要支付",
101
+ "gasCost": "交易费",
102
+ "gasFeeEstimated": "estimated gas fee",
103
+ "gasFeePaid": "gas fee paid",
104
+ "inProgress": "进行中",
105
+ "info": {
106
+ "message": {
107
+ "emptyActiveSwaps": "正在进行的兑换将出现在这里。一旦完成,你可在兑换记录中找到它们。",
108
+ "emptySwapHistory": "兑换历史记录只存储在本地,如果你清除浏览器数据,他们将被删除。",
109
+ "emptyTokenList": "我们无法在{{chainName}}链上找到这些代币,或者你的钱包内没有这些代币。请再次搜索或者选择其他链再试一次。",
110
+ "routeNotFound": "试试另一个路由。"
111
+ },
112
+ "title": {
113
+ "emptyActiveSwaps": "没有正在进行的兑换",
114
+ "emptySwapHistory": "空兑换历史记录",
115
+ "routeNotFound": "没有可用的路由"
116
+ }
117
+ },
118
+ "onChain": "on {{chainName}}",
119
+ "otherTokens": "其他代币",
120
+ "process": {
121
+ "crossChain": {
122
+ "actionRequired": "请签署此交易。",
123
+ "done": "交易已批准。",
124
+ "pending": "等待交易完成。",
125
+ "started": "准备执行交易。"
126
+ },
127
+ "receivingChain": {
128
+ "done": "资金已到账。",
129
+ "partial": "Bridge partially completed",
130
+ "pending": "等待接收链。",
131
+ "refunded": "Bridge transaction refunded"
132
+ },
133
+ "swap": {
134
+ "actionRequired": "请签署此交易。",
135
+ "done": "兑换完成。",
136
+ "pending": "代币兑换中。",
137
+ "started": "准备兑换。"
138
+ },
139
+ "switchChain": {
140
+ "actionRequired": "需要切换当前链。",
141
+ "done": "链切换成功。"
142
+ },
143
+ "tokenAllowance": {
144
+ "done": "已批准代币限额。",
145
+ "pending": "等待代币限额批准完成。",
146
+ "started": "设置代币限额。"
147
+ }
148
+ },
149
+ "quotedAmount": "Quoted amount",
150
+ "rateChange": "Rate change",
151
+ "receiving": "接收",
152
+ "routes": "你会得到",
153
+ "selectChain": "链",
154
+ "selectChainAndToken": "选择链和代币",
155
+ "selectToken": "代币",
156
+ "sendToAddress": "Send to {{address}}",
157
+ "sendToWallet": "发送到另外的钱包",
158
+ "sentToAddress": "Sent to {{address}}",
159
+ "stepBridge": "跨链",
160
+ "stepSwap": "兑换",
161
+ "stepSwapAndBridge": "兑换和跨链",
162
+ "success": {
163
+ "message": {
164
+ "swapPartiallySuccessful": "We've tried to complete the swap, but {{tool}} ran out of liquidity for {{tokenSymbol}} token.",
165
+ "swapSuccessful": "现在有 {{amount, number(maximumFractionDigits: 4)}}个{{tokenSymbol}}在{{chainName}}链上的{{walletAddress}}钱包。"
166
+ },
167
+ "title": {
168
+ "gasSwapSuccessful": "Gas swap successful",
169
+ "refundIssued": "Refund issued",
170
+ "swapPartiallySuccessful": "Swap partially successful",
171
+ "swapSuccessful": "兑换成功"
172
+ }
173
+ },
174
+ "supportId": "支持ID",
175
+ "swapStepDetails": "通过{{tool}}在{{chain}}链上兑换代币",
176
+ "swapping": "兑换",
177
+ "tags": {
178
+ "ALTERNATIVE": "可用",
179
+ "CHEAPEST": "便宜",
180
+ "FASTEST": "快捷",
181
+ "RECOMMENDED": "推荐",
182
+ "SAFEST": "安全"
183
+ },
184
+ "to": "到",
185
+ "tokenOnChain": "{{chainName}}链上的{{tokenSymbol}}",
186
+ "tokenOnChainAmount": "{{chainName}}链上{{amount, number(maximumFractionDigits: 4)}}个{{tokenSymbol}}",
187
+ "tokenSearch": "搜索代币",
188
+ "valueLoss": "资金损失",
189
+ "walletAddressOrEns": "钱包地址或ENS名称",
190
+ "warning": {
191
+ "message": {
192
+ "deleteActiveSwaps": "正在进行的兑换记录只存储在本地,如果删除它们,我们将无法恢复这些记录。",
193
+ "deleteSwapHistory": "兑换历史记录只存储在本地,如果你删除它,我们将无法恢复这些记录。",
194
+ "highValueLoss": "收到的代币的价值明显低于要被兑换代币和交易成本。",
195
+ "insufficientFunds": "你没有足够的资金来执行这笔交易。",
196
+ "insufficientGas": "你至少需要:",
197
+ "rateChanged": "The exchange rate has changed. By continuing the swap, you'll accept the new rate."
198
+ },
199
+ "title": {
200
+ "deleteActiveSwaps": "确定要清空正在进行的兑换记录?",
201
+ "deleteSwap": "确定要删除这个兑换记录?",
202
+ "deleteSwapHistory": "确定要清空兑换历史记录?",
203
+ "highValueLoss": "大额资金损失",
204
+ "insufficientGas": "手续费不足",
205
+ "rateChanged": "Rate changed"
206
+ }
207
+ }
183
208
  },
184
- "to": "到",
185
- "tokenOnChain": "{{chainName}}链上的{{tokenSymbol}}",
186
- "tokenOnChainAmount": "{{chainName}}链上{{amount, number(maximumFractionDigits: 4)}}个{{tokenSymbol}}",
187
- "tokenSearch": "搜索代币",
188
- "valueLoss": "资金损失",
189
- "walletAddressOrEns": "钱包地址或ENS名称",
190
- "warning": {
191
- "message": {
192
- "deleteActiveSwaps": "正在进行的兑换记录只存储在本地,如果删除它们,我们将无法恢复这些记录。",
193
- "deleteSwapHistory": "兑换历史记录只存储在本地,如果你删除它,我们将无法恢复这些记录。",
194
- "highValueLoss": "收到的代币的价值明显低于要被兑换代币和交易成本。",
195
- "insufficientFunds": "你没有足够的资金来执行这笔交易。",
196
- "insufficientGas": "你至少需要:",
197
- "rateChanged": "The exchange rate has changed. By continuing the swap, you'll accept the new rate."
198
- },
199
- "title": {
200
- "deleteActiveSwaps": "确定要清空正在进行的兑换记录?",
201
- "deleteSwap": "确定要删除这个兑换记录?",
202
- "deleteSwapHistory": "确定要清空兑换历史记录?",
203
- "highValueLoss": "大额资金损失",
204
- "insufficientGas": "手续费不足",
205
- "rateChanged": "Rate changed"
206
- }
207
- }
208
- },
209
- "tooltip": {
210
- "estimatedNetworkFee": "预估网络手续费。",
211
- "estimatedTime": "预计兑换的执行时间(分钟)。",
212
- "notFound": {
213
- "text": "我们找不到这个页面。",
214
- "title": "404"
209
+ "tooltip": {
210
+ "estimatedNetworkFee": "预估网络手续费。",
211
+ "estimatedTime": "预计兑换的执行时间(分钟)。",
212
+ "notFound": {
213
+ "text": "我们找不到这个页面。",
214
+ "title": "404"
215
+ },
216
+ "numberOfSteps": "兑换步骤。每个步骤可以包含1-2个需要签名的交易。",
217
+ "progressToNextUpdate": "数据将在{{value}}秒后自动刷新。点击这里可以手动更新。",
218
+ "settingsModified": "设置(已修改)"
215
219
  },
216
- "numberOfSteps": "兑换步骤。每个步骤可以包含1-2个需要签名的交易。",
217
- "progressToNextUpdate": "数据将在{{value}}秒后自动刷新。点击这里可以手动更新。",
218
- "settingsModified": "设置(已修改)"
219
- },
220
- "wallet": {
221
- "extensionNotFound": "在选择钱包之前,请确保只有{{name}}浏览器的扩展应用处于激活状态。"
222
- }
220
+ "wallet": {
221
+ "extensionNotFound": "在选择钱包之前,请确保只有{{name}}浏览器的扩展应用处于激活状态。"
222
+ }
223
223
  }
package/cjs/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import './fonts/inter.css';
3
3
  export type { WidgetDrawer } from './AppDrawer';
4
+ export * from './components/NFT';
4
5
  export { useWidgetEvents, widgetEvents } from './hooks';
6
+ export { useWallet } from './providers/WalletProvider';
5
7
  export * from './types';
6
8
  export declare const LiFiWidget: import("react").FC<import("./types").WidgetProps>;
7
9
  /**
package/cjs/index.js CHANGED
@@ -14,13 +14,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.LiFiWidgetDrawer = exports.LiFiWidget = exports.widgetEvents = exports.useWidgetEvents = void 0;
17
+ exports.LiFiWidgetDrawer = exports.LiFiWidget = exports.useWallet = exports.widgetEvents = exports.useWidgetEvents = void 0;
18
18
  const App_1 = require("./App");
19
19
  const AppDrawer_1 = require("./AppDrawer");
20
20
  require("./fonts/inter.css");
21
+ __exportStar(require("./components/NFT"), exports);
21
22
  var hooks_1 = require("./hooks");
22
23
  Object.defineProperty(exports, "useWidgetEvents", { enumerable: true, get: function () { return hooks_1.useWidgetEvents; } });
23
24
  Object.defineProperty(exports, "widgetEvents", { enumerable: true, get: function () { return hooks_1.widgetEvents; } });
25
+ var WalletProvider_1 = require("./providers/WalletProvider");
26
+ Object.defineProperty(exports, "useWallet", { enumerable: true, get: function () { return WalletProvider_1.useWallet; } });
24
27
  __exportStar(require("./types"), exports);
25
28
  // ClassNameGenerator.configure((componentName) =>
26
29
  // componentName.replace('Mui', 'LiFi'),
@@ -4,16 +4,20 @@ exports.MainPage = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
6
  const ActiveSwaps_1 = require("../../components/ActiveSwaps");
7
+ const ContractComponent_1 = require("../../components/ContractComponent");
7
8
  const GasSufficiencyMessage_1 = require("../../components/GasSufficiencyMessage");
8
9
  const SelectChainAndToken_1 = require("../../components/SelectChainAndToken");
9
10
  const SendToWallet_1 = require("../../components/SendToWallet");
10
11
  const SwapInput_1 = require("../../components/SwapInput");
11
12
  const SwapRoutes_1 = require("../../components/SwapRoutes");
12
13
  const hooks_1 = require("../../hooks");
14
+ const providers_1 = require("../../providers");
13
15
  const MainPage_style_1 = require("./MainPage.style");
14
16
  const MainSwapButton_1 = require("./MainSwapButton");
15
17
  const MainPage = () => {
16
18
  const expandable = (0, hooks_1.useExpandableVariant)();
17
- return ((0, jsx_runtime_1.jsxs)(MainPage_style_1.FormContainer, Object.assign({ disableGutters: true }, { children: [(0, jsx_runtime_1.jsx)(ActiveSwaps_1.ActiveSwaps, { mx: 3, mt: 1, mb: 2 }), (0, jsx_runtime_1.jsx)(SelectChainAndToken_1.SelectChainAndToken, { mt: 1, mx: 3, mb: 3 }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mx: 3, mb: 3 }, { children: (0, jsx_runtime_1.jsx)(SwapInput_1.SwapInput, { formType: "from" }) })), !expandable ? (0, jsx_runtime_1.jsx)(SwapRoutes_1.SwapRoutes, { mx: 3, mb: 3 }) : null, (0, jsx_runtime_1.jsx)(GasSufficiencyMessage_1.GasSufficiencyMessage, { mx: 3, mb: 3 }), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ mx: 3, mb: 1 }, { children: [(0, jsx_runtime_1.jsx)(SendToWallet_1.SendToWallet, { mb: 3 }), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { display: 'flex' } }, { children: [(0, jsx_runtime_1.jsx)(MainSwapButton_1.MainSwapButton, {}), (0, jsx_runtime_1.jsx)(SendToWallet_1.SendToWalletButton, {})] }))] }))] })));
19
+ const { variant } = (0, providers_1.useWidgetConfig)();
20
+ const nft = variant === 'nft';
21
+ return ((0, jsx_runtime_1.jsxs)(MainPage_style_1.FormContainer, Object.assign({ disableGutters: true }, { children: [(0, jsx_runtime_1.jsx)(ActiveSwaps_1.ActiveSwaps, { mx: 3, mt: 1, mb: 2 }), nft ? (0, jsx_runtime_1.jsx)(ContractComponent_1.ContractComponent, { mx: 3, mt: 1, mb: 1 }) : null, (0, jsx_runtime_1.jsx)(SelectChainAndToken_1.SelectChainAndToken, { mt: 1, mx: 3, mb: 3 }), !nft ? (0, jsx_runtime_1.jsx)(SwapInput_1.SwapInput, { formType: "from", mx: 3, mb: 3 }) : null, !expandable ? (0, jsx_runtime_1.jsx)(SwapRoutes_1.SwapRoutes, { mx: 3, mb: 3 }) : null, (0, jsx_runtime_1.jsx)(GasSufficiencyMessage_1.GasSufficiencyMessage, { mx: 3, mb: 3 }), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ mx: 3, mb: 1 }, { children: [(0, jsx_runtime_1.jsx)(SendToWallet_1.SendToWallet, { mb: 3 }), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { display: 'flex' } }, { children: [(0, jsx_runtime_1.jsx)(MainSwapButton_1.MainSwapButton, {}), (0, jsx_runtime_1.jsx)(SendToWallet_1.SendToWalletButton, {})] }))] }))] })));
18
22
  };
19
23
  exports.MainPage = MainPage;
@@ -1,18 +1,28 @@
1
1
  export declare enum SwapFormKey {
2
+ ContractOutputsToken = "contractOutputsToken",
2
3
  FromAmount = "fromAmount",
3
4
  FromChain = "fromChain",
4
5
  FromToken = "fromToken",
5
6
  ToAddress = "toAddress",
7
+ ToAmount = "toAmount",
6
8
  ToChain = "toChain",
9
+ ToContractAddress = "toContractAddress",
10
+ ToContractCallData = "toContractCallData",
11
+ ToContractGasLimit = "ToContractGasLimit",
7
12
  ToToken = "toToken",
8
13
  TokenSearchFilter = "tokenSearchFilter"
9
14
  }
10
15
  export type SwapFormValues = {
16
+ [SwapFormKey.ContractOutputsToken]: string;
11
17
  [SwapFormKey.FromAmount]: string;
12
18
  [SwapFormKey.FromChain]: number;
13
19
  [SwapFormKey.FromToken]: string;
14
20
  [SwapFormKey.ToAddress]: string;
21
+ [SwapFormKey.ToAmount]: string;
15
22
  [SwapFormKey.ToChain]: number;
23
+ [SwapFormKey.ToContractAddress]: string;
24
+ [SwapFormKey.ToContractCallData]: string;
25
+ [SwapFormKey.ToContractGasLimit]: string;
16
26
  [SwapFormKey.ToToken]: string;
17
27
  [SwapFormKey.TokenSearchFilter]: string;
18
28
  };
@@ -3,11 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SwapFormKeyHelper = exports.SwapFormKey = void 0;
4
4
  var SwapFormKey;
5
5
  (function (SwapFormKey) {
6
+ SwapFormKey["ContractOutputsToken"] = "contractOutputsToken";
6
7
  SwapFormKey["FromAmount"] = "fromAmount";
7
8
  SwapFormKey["FromChain"] = "fromChain";
8
9
  SwapFormKey["FromToken"] = "fromToken";
9
10
  SwapFormKey["ToAddress"] = "toAddress";
11
+ SwapFormKey["ToAmount"] = "toAmount";
10
12
  SwapFormKey["ToChain"] = "toChain";
13
+ SwapFormKey["ToContractAddress"] = "toContractAddress";
14
+ SwapFormKey["ToContractCallData"] = "toContractCallData";
15
+ SwapFormKey["ToContractGasLimit"] = "ToContractGasLimit";
11
16
  SwapFormKey["ToToken"] = "toToken";
12
17
  SwapFormKey["TokenSearchFilter"] = "tokenSearchFilter";
13
18
  })(SwapFormKey = exports.SwapFormKey || (exports.SwapFormKey = {}));
@@ -6,7 +6,7 @@ export declare const useChainOrderStore: import("zustand").UseBoundStore<Omit<im
6
6
  chainOrder: number[];
7
7
  }>>) => void;
8
8
  clearStorage: () => void;
9
- rehydrate: () => Promise<void>;
9
+ rehydrate: () => void | Promise<void>;
10
10
  hasHydrated: () => boolean;
11
11
  onHydrate: (fn: (state: ChainOrderStore) => void) => () => void;
12
12
  onFinishHydration: (fn: (state: ChainOrderStore) => void) => () => void;
@@ -5,7 +5,7 @@ export declare const useRouteExecutionStore: import("zustand").UseBoundStore<Omi
5
5
  routes: Partial<Record<string, import("./types").RouteExecution>>;
6
6
  }>>) => void;
7
7
  clearStorage: () => void;
8
- rehydrate: () => Promise<void>;
8
+ rehydrate: () => void | Promise<void>;
9
9
  hasHydrated: () => boolean;
10
10
  onHydrate: (fn: (state: RouteExecutionStore) => void) => () => void;
11
11
  onFinishHydration: (fn: (state: RouteExecutionStore) => void) => () => void;
@@ -20,7 +20,7 @@ export declare const useSettingsStore: import("zustand").UseBoundStore<Omit<impo
20
20
  _enabledExchanges?: Record<string, boolean> | undefined;
21
21
  }>>) => void;
22
22
  clearStorage: () => void;
23
- rehydrate: () => Promise<void>;
23
+ rehydrate: () => void | Promise<void>;
24
24
  hasHydrated: () => boolean;
25
25
  onHydrate: (fn: (state: SettingsStore) => void) => () => void;
26
26
  onFinishHydration: (fn: (state: SettingsStore) => void) => () => void;
@@ -4,7 +4,7 @@ import type { Components, PaletteMode, PaletteOptions, Shape, Theme } from '@mui
4
4
  import type { TypographyOptions } from '@mui/material/styles/createTypography';
5
5
  import type { CSSProperties, ReactNode, RefObject } from 'react';
6
6
  import type { LanguageKey, LanguageResources } from '../providers';
7
- export type WidgetVariant = 'default' | 'expandable' | 'drawer' | 'refuel';
7
+ export type WidgetVariant = 'default' | 'expandable' | 'drawer' | 'refuel' | 'nft';
8
8
  export declare enum DisabledUI {
9
9
  FromAmount = "fromAmount",
10
10
  FromToken = "fromToken",
@@ -37,10 +37,14 @@ export interface WidgetWalletManagement {
37
37
  export interface SDKConfig extends Omit<ConfigUpdate, 'defaultExecutionSettings' | 'defaultRouteOptions' | 'disableVersionCheck'> {
38
38
  defaultRouteOptions?: Omit<RouteOptions, 'bridges' | 'exchanges'>;
39
39
  }
40
+ export interface WidgetContractTool {
41
+ logoURI: string;
42
+ name: string;
43
+ }
40
44
  export interface WidgetContract {
41
- address: string;
42
- callData: string;
43
- gasLimit: string;
45
+ address?: string;
46
+ callData?: string;
47
+ gasLimit?: string;
44
48
  approvalAddress?: string;
45
49
  outputToken?: string;
46
50
  fallbackAddress?: string;
@@ -56,6 +60,7 @@ export interface WidgetConfig {
56
60
  contract?: WidgetContract;
57
61
  contractComponent?: ReactNode;
58
62
  contractCompactComponent?: ReactNode;
63
+ contractTool?: WidgetContractTool;
59
64
  fee?: number;
60
65
  integrator?: string;
61
66
  referrer?: string;
@@ -11,7 +11,9 @@ var DisabledUI;
11
11
  var HiddenUI;
12
12
  (function (HiddenUI) {
13
13
  HiddenUI["Appearance"] = "appearance";
14
+ // FromAmount = 'fromAmount',
14
15
  HiddenUI["Language"] = "language";
15
16
  HiddenUI["PoweredBy"] = "poweredBy";
16
17
  HiddenUI["ToAddress"] = "toAddress";
18
+ // ToToken = 'toToken',
17
19
  })(HiddenUI = exports.HiddenUI || (exports.HiddenUI = {}));
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { BoxProps } from '@mui/material';
3
+ export declare const ContractComponent: React.FC<BoxProps>;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useWidgetConfig } from '../../providers';
3
+ import { Card } from '../Card';
4
+ export const ContractComponent = (props) => {
5
+ const { contractComponent } = useWidgetConfig();
6
+ if (!contractComponent) {
7
+ return null;
8
+ }
9
+ return (_jsx(Card, Object.assign({ flex: 1 }, props, { children: contractComponent })));
10
+ };
@@ -0,0 +1 @@
1
+ export * from './ContractComponent';