@cfxjs/sirius-next-common 0.1.26 → 0.1.28

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 (307) hide show
  1. package/dist/chunk-24MUZRQJ.js +108 -0
  2. package/dist/chunk-24MUZRQJ.js.map +1 -0
  3. package/dist/chunk-24Z2NTKQ.js +43 -0
  4. package/dist/chunk-24Z2NTKQ.js.map +1 -0
  5. package/dist/chunk-26ABIFHL.js +127 -0
  6. package/dist/chunk-26ABIFHL.js.map +1 -0
  7. package/dist/chunk-27S75HVO.js +108 -0
  8. package/dist/chunk-27S75HVO.js.map +1 -0
  9. package/dist/chunk-2ATI4GSO.js +130 -0
  10. package/dist/chunk-2ATI4GSO.js.map +1 -0
  11. package/dist/chunk-2RR4CX3F.js +141 -0
  12. package/dist/chunk-2RR4CX3F.js.map +1 -0
  13. package/dist/chunk-2S6T3LVP.js +212 -0
  14. package/dist/chunk-2S6T3LVP.js.map +1 -0
  15. package/dist/chunk-3357K7AW.js +108 -0
  16. package/dist/chunk-3357K7AW.js.map +1 -0
  17. package/dist/chunk-3BLNV3M6.js +49 -0
  18. package/dist/chunk-3BLNV3M6.js.map +1 -0
  19. package/dist/chunk-3DOLNPRU.js +27 -0
  20. package/dist/chunk-3DOLNPRU.js.map +1 -0
  21. package/dist/chunk-3MYGXIHH.js +108 -0
  22. package/dist/chunk-3MYGXIHH.js.map +1 -0
  23. package/dist/chunk-3PCM3OLN.js +141 -0
  24. package/dist/chunk-3PCM3OLN.js.map +1 -0
  25. package/dist/chunk-3TBXOB3R.js +141 -0
  26. package/dist/chunk-3TBXOB3R.js.map +1 -0
  27. package/dist/chunk-3XY72AXV.js +49 -0
  28. package/dist/chunk-3XY72AXV.js.map +1 -0
  29. package/dist/chunk-3YBIEQO6.js +212 -0
  30. package/dist/chunk-3YBIEQO6.js.map +1 -0
  31. package/dist/chunk-4A4J7WSV.js +86 -0
  32. package/dist/chunk-4A4J7WSV.js.map +1 -0
  33. package/dist/chunk-4ESGRQGT.js +108 -0
  34. package/dist/chunk-4ESGRQGT.js.map +1 -0
  35. package/dist/chunk-5BIMFEMU.js +1478 -0
  36. package/dist/chunk-5BIMFEMU.js.map +1 -0
  37. package/dist/chunk-5SRYL5WC.js +212 -0
  38. package/dist/chunk-5SRYL5WC.js.map +1 -0
  39. package/dist/chunk-62YQFYHZ.js +3629 -0
  40. package/dist/chunk-62YQFYHZ.js.map +1 -0
  41. package/dist/chunk-6HKZB5HS.js +49 -0
  42. package/dist/chunk-6HKZB5HS.js.map +1 -0
  43. package/dist/chunk-6NC6XI6T.js +108 -0
  44. package/dist/chunk-6NC6XI6T.js.map +1 -0
  45. package/dist/chunk-6VGNSL3V.js +108 -0
  46. package/dist/chunk-6VGNSL3V.js.map +1 -0
  47. package/dist/chunk-74Z6QJ2V.js +108 -0
  48. package/dist/chunk-74Z6QJ2V.js.map +1 -0
  49. package/dist/chunk-77BWMAR2.js +105 -0
  50. package/dist/chunk-77BWMAR2.js.map +1 -0
  51. package/dist/chunk-7EX3S2AT.js +2324 -0
  52. package/dist/chunk-7EX3S2AT.js.map +1 -0
  53. package/dist/chunk-7LU43J6Y.js +2199 -0
  54. package/dist/chunk-7LU43J6Y.js.map +1 -0
  55. package/dist/chunk-7ONFLU6G.js +127 -0
  56. package/dist/chunk-7ONFLU6G.js.map +1 -0
  57. package/dist/chunk-7S7HFNGN.js +49 -0
  58. package/dist/chunk-7S7HFNGN.js.map +1 -0
  59. package/dist/chunk-7T3QFG4C.js +108 -0
  60. package/dist/chunk-7T3QFG4C.js.map +1 -0
  61. package/dist/chunk-ACI4CZ3N.js +141 -0
  62. package/dist/chunk-ACI4CZ3N.js.map +1 -0
  63. package/dist/chunk-AF3NCC5P.js +127 -0
  64. package/dist/chunk-AF3NCC5P.js.map +1 -0
  65. package/dist/chunk-AFTE3PC6.js +141 -0
  66. package/dist/chunk-AFTE3PC6.js.map +1 -0
  67. package/dist/chunk-ARSX76AK.js +49 -0
  68. package/dist/chunk-ARSX76AK.js.map +1 -0
  69. package/dist/chunk-AVOJOQXO.js +108 -0
  70. package/dist/chunk-AVOJOQXO.js.map +1 -0
  71. package/dist/chunk-AWLKSOKJ.js +49 -0
  72. package/dist/chunk-AWLKSOKJ.js.map +1 -0
  73. package/dist/chunk-B5CBBNRH.js +141 -0
  74. package/dist/chunk-B5CBBNRH.js.map +1 -0
  75. package/dist/chunk-BJAVQP5F.js +212 -0
  76. package/dist/chunk-BJAVQP5F.js.map +1 -0
  77. package/dist/chunk-C4DWCONF.js +212 -0
  78. package/dist/chunk-C4DWCONF.js.map +1 -0
  79. package/dist/chunk-CM2VKLWZ.js +127 -0
  80. package/dist/chunk-CM2VKLWZ.js.map +1 -0
  81. package/dist/chunk-CRPUM7SJ.js +212 -0
  82. package/dist/chunk-CRPUM7SJ.js.map +1 -0
  83. package/dist/chunk-CSBHWPRR.js +105 -0
  84. package/dist/chunk-CSBHWPRR.js.map +1 -0
  85. package/dist/chunk-CT7PENLL.js +105 -0
  86. package/dist/chunk-CT7PENLL.js.map +1 -0
  87. package/dist/chunk-DIAD272J.js +49 -0
  88. package/dist/chunk-DIAD272J.js.map +1 -0
  89. package/dist/chunk-DXONM5CJ.js +141 -0
  90. package/dist/chunk-DXONM5CJ.js.map +1 -0
  91. package/dist/chunk-E4LV6EXS.js +108 -0
  92. package/dist/chunk-E4LV6EXS.js.map +1 -0
  93. package/dist/chunk-E6E6MHRM.js +212 -0
  94. package/dist/chunk-E6E6MHRM.js.map +1 -0
  95. package/dist/chunk-E77PCJ2L.js +141 -0
  96. package/dist/chunk-E77PCJ2L.js.map +1 -0
  97. package/dist/chunk-E7F44FIR.js +105 -0
  98. package/dist/chunk-E7F44FIR.js.map +1 -0
  99. package/dist/chunk-EK2YUTFC.js +141 -0
  100. package/dist/chunk-EK2YUTFC.js.map +1 -0
  101. package/dist/chunk-EKQJYLLX.js +212 -0
  102. package/dist/chunk-EKQJYLLX.js.map +1 -0
  103. package/dist/chunk-FA77TXZD.js +127 -0
  104. package/dist/chunk-FA77TXZD.js.map +1 -0
  105. package/dist/chunk-FAFYYMFU.js +108 -0
  106. package/dist/chunk-FAFYYMFU.js.map +1 -0
  107. package/dist/chunk-FHTHKUN5.js +126 -0
  108. package/dist/chunk-FHTHKUN5.js.map +1 -0
  109. package/dist/chunk-GAWACXC2.js +127 -0
  110. package/dist/chunk-GAWACXC2.js.map +1 -0
  111. package/dist/chunk-GR3BLVJV.js +212 -0
  112. package/dist/chunk-GR3BLVJV.js.map +1 -0
  113. package/dist/chunk-GRCSAYBS.js +141 -0
  114. package/dist/chunk-GRCSAYBS.js.map +1 -0
  115. package/dist/chunk-GTRGNGUL.js +212 -0
  116. package/dist/chunk-GTRGNGUL.js.map +1 -0
  117. package/dist/chunk-H6EWZ7XZ.js +105 -0
  118. package/dist/chunk-H6EWZ7XZ.js.map +1 -0
  119. package/dist/chunk-HH3OPBBE.js +108 -0
  120. package/dist/chunk-HH3OPBBE.js.map +1 -0
  121. package/dist/chunk-HRVIZJEA.js +63 -0
  122. package/dist/chunk-HRVIZJEA.js.map +1 -0
  123. package/dist/chunk-I5GYABMO.js +141 -0
  124. package/dist/chunk-I5GYABMO.js.map +1 -0
  125. package/dist/chunk-I5J6GFME.js +141 -0
  126. package/dist/chunk-I5J6GFME.js.map +1 -0
  127. package/dist/chunk-IHFBGGHI.js +2297 -0
  128. package/dist/chunk-IHFBGGHI.js.map +1 -0
  129. package/dist/chunk-IHHNRYGC.js +108 -0
  130. package/dist/chunk-IHHNRYGC.js.map +1 -0
  131. package/dist/chunk-IPF6TU3K.js +212 -0
  132. package/dist/chunk-IPF6TU3K.js.map +1 -0
  133. package/dist/chunk-JNSJK2TR.js +2323 -0
  134. package/dist/chunk-JNSJK2TR.js.map +1 -0
  135. package/dist/chunk-JY62VTMC.js +49 -0
  136. package/dist/chunk-JY62VTMC.js.map +1 -0
  137. package/dist/chunk-KKC3SV7X.js +212 -0
  138. package/dist/chunk-KKC3SV7X.js.map +1 -0
  139. package/dist/chunk-KLKFSFIO.js +127 -0
  140. package/dist/chunk-KLKFSFIO.js.map +1 -0
  141. package/dist/chunk-KLXG7TWR.js +212 -0
  142. package/dist/chunk-KLXG7TWR.js.map +1 -0
  143. package/dist/chunk-KONLD7QH.js +108 -0
  144. package/dist/chunk-KONLD7QH.js.map +1 -0
  145. package/dist/chunk-KVZ4GBCQ.js +212 -0
  146. package/dist/chunk-KVZ4GBCQ.js.map +1 -0
  147. package/dist/chunk-LCX6G6UD.js +49 -0
  148. package/dist/chunk-LCX6G6UD.js.map +1 -0
  149. package/dist/chunk-LTJESAOY.js +49 -0
  150. package/dist/chunk-LTJESAOY.js.map +1 -0
  151. package/dist/chunk-LVOIDBQG.js +5083 -0
  152. package/dist/chunk-LVOIDBQG.js.map +1 -0
  153. package/dist/chunk-M7MZHGIW.js +141 -0
  154. package/dist/chunk-M7MZHGIW.js.map +1 -0
  155. package/dist/chunk-MFLND54Z.js +105 -0
  156. package/dist/chunk-MFLND54Z.js.map +1 -0
  157. package/dist/chunk-MU2VXMVI.js +105 -0
  158. package/dist/chunk-MU2VXMVI.js.map +1 -0
  159. package/dist/chunk-MYFQGX4G.js +130 -0
  160. package/dist/chunk-MYFQGX4G.js.map +1 -0
  161. package/dist/chunk-NIVSHXEJ.js +141 -0
  162. package/dist/chunk-NIVSHXEJ.js.map +1 -0
  163. package/dist/chunk-NJMWUDSI.js +2323 -0
  164. package/dist/chunk-NJMWUDSI.js.map +1 -0
  165. package/dist/chunk-NP4YOCMX.js +127 -0
  166. package/dist/chunk-NP4YOCMX.js.map +1 -0
  167. package/dist/chunk-NVIXO3FX.js +127 -0
  168. package/dist/chunk-NVIXO3FX.js.map +1 -0
  169. package/dist/chunk-OB5SKTJ7.js +2294 -0
  170. package/dist/chunk-OB5SKTJ7.js.map +1 -0
  171. package/dist/chunk-OWG3KRZJ.js +108 -0
  172. package/dist/chunk-OWG3KRZJ.js.map +1 -0
  173. package/dist/chunk-P3FVYMA6.js +127 -0
  174. package/dist/chunk-P3FVYMA6.js.map +1 -0
  175. package/dist/chunk-PJDWYUHP.js +3629 -0
  176. package/dist/chunk-PJDWYUHP.js.map +1 -0
  177. package/dist/chunk-PS6RUUUK.js +86 -0
  178. package/dist/chunk-PS6RUUUK.js.map +1 -0
  179. package/dist/chunk-QAFEK7IY.js +105 -0
  180. package/dist/chunk-QAFEK7IY.js.map +1 -0
  181. package/dist/chunk-QFPKRXR3.js +108 -0
  182. package/dist/chunk-QFPKRXR3.js.map +1 -0
  183. package/dist/chunk-R3N37XCV.js +212 -0
  184. package/dist/chunk-R3N37XCV.js.map +1 -0
  185. package/dist/chunk-R4E42CNE.js +2324 -0
  186. package/dist/chunk-R4E42CNE.js.map +1 -0
  187. package/dist/chunk-R4FMLRKR.js +105 -0
  188. package/dist/chunk-R4FMLRKR.js.map +1 -0
  189. package/dist/chunk-R4ISWFAU.js +2323 -0
  190. package/dist/chunk-R4ISWFAU.js.map +1 -0
  191. package/dist/chunk-R5KOPIFI.js +127 -0
  192. package/dist/chunk-R5KOPIFI.js.map +1 -0
  193. package/dist/chunk-RHM7WSYL.js +127 -0
  194. package/dist/chunk-RHM7WSYL.js.map +1 -0
  195. package/dist/chunk-RMOYI7RJ.js +212 -0
  196. package/dist/chunk-RMOYI7RJ.js.map +1 -0
  197. package/dist/chunk-RQB4FWW7.js +2296 -0
  198. package/dist/chunk-RQB4FWW7.js.map +1 -0
  199. package/dist/chunk-RRQLWLKC.js +127 -0
  200. package/dist/chunk-RRQLWLKC.js.map +1 -0
  201. package/dist/chunk-S7BWR5IZ.js +212 -0
  202. package/dist/chunk-S7BWR5IZ.js.map +1 -0
  203. package/dist/chunk-SUHRSNAI.js +63 -0
  204. package/dist/chunk-SUHRSNAI.js.map +1 -0
  205. package/dist/chunk-T5J4XBWF.js +127 -0
  206. package/dist/chunk-T5J4XBWF.js.map +1 -0
  207. package/dist/chunk-T5OKHLM7.js +86 -0
  208. package/dist/chunk-T5OKHLM7.js.map +1 -0
  209. package/dist/chunk-T6TINFBB.js +49 -0
  210. package/dist/chunk-T6TINFBB.js.map +1 -0
  211. package/dist/chunk-TK4FIUGX.js +105 -0
  212. package/dist/chunk-TK4FIUGX.js.map +1 -0
  213. package/dist/chunk-TSYM32RM.js +2218 -0
  214. package/dist/chunk-TSYM32RM.js.map +1 -0
  215. package/dist/chunk-TYLFHFBL.js +127 -0
  216. package/dist/chunk-TYLFHFBL.js.map +1 -0
  217. package/dist/chunk-TZ6FCCCJ.js +105 -0
  218. package/dist/chunk-TZ6FCCCJ.js.map +1 -0
  219. package/dist/chunk-UFO7XI55.js +212 -0
  220. package/dist/chunk-UFO7XI55.js.map +1 -0
  221. package/dist/chunk-UHGU5YPX.js +127 -0
  222. package/dist/chunk-UHGU5YPX.js.map +1 -0
  223. package/dist/chunk-UTXIA4ZA.js +105 -0
  224. package/dist/chunk-UTXIA4ZA.js.map +1 -0
  225. package/dist/chunk-UYI6WFT7.js +105 -0
  226. package/dist/chunk-UYI6WFT7.js.map +1 -0
  227. package/dist/chunk-VENIIRNN.js +49 -0
  228. package/dist/chunk-VENIIRNN.js.map +1 -0
  229. package/dist/chunk-VIX553CW.js +108 -0
  230. package/dist/chunk-VIX553CW.js.map +1 -0
  231. package/dist/chunk-VLYJFH7W.js +49 -0
  232. package/dist/chunk-VLYJFH7W.js.map +1 -0
  233. package/dist/chunk-VOXSIPTX.js +141 -0
  234. package/dist/chunk-VOXSIPTX.js.map +1 -0
  235. package/dist/chunk-VZNGE73T.js +105 -0
  236. package/dist/chunk-VZNGE73T.js.map +1 -0
  237. package/dist/chunk-W2J2VZEP.js +108 -0
  238. package/dist/chunk-W2J2VZEP.js.map +1 -0
  239. package/dist/chunk-X3QTCV4Q.js +212 -0
  240. package/dist/chunk-X3QTCV4Q.js.map +1 -0
  241. package/dist/chunk-X5ZOQIDW.js +108 -0
  242. package/dist/chunk-X5ZOQIDW.js.map +1 -0
  243. package/dist/chunk-XHG32AO6.js +141 -0
  244. package/dist/chunk-XHG32AO6.js.map +1 -0
  245. package/dist/chunk-XJSNK6B3.js +127 -0
  246. package/dist/chunk-XJSNK6B3.js.map +1 -0
  247. package/dist/chunk-XRKRGNVZ.js +141 -0
  248. package/dist/chunk-XRKRGNVZ.js.map +1 -0
  249. package/dist/chunk-XVA5MO4M.js +2324 -0
  250. package/dist/chunk-XVA5MO4M.js.map +1 -0
  251. package/dist/chunk-XXEJA3Q7.js +86 -0
  252. package/dist/chunk-XXEJA3Q7.js.map +1 -0
  253. package/dist/chunk-XZAEVXPG.js +108 -0
  254. package/dist/chunk-XZAEVXPG.js.map +1 -0
  255. package/dist/chunk-YCVZY6JX.js +141 -0
  256. package/dist/chunk-YCVZY6JX.js.map +1 -0
  257. package/dist/chunk-YQAMFHXE.js +212 -0
  258. package/dist/chunk-YQAMFHXE.js.map +1 -0
  259. package/dist/chunk-YRB4D655.js +141 -0
  260. package/dist/chunk-YRB4D655.js.map +1 -0
  261. package/dist/chunk-YVPSUVSB.js +141 -0
  262. package/dist/chunk-YVPSUVSB.js.map +1 -0
  263. package/dist/chunk-YWEJJEJY.js +105 -0
  264. package/dist/chunk-YWEJJEJY.js.map +1 -0
  265. package/dist/chunk-YXOEPMQS.js +127 -0
  266. package/dist/chunk-YXOEPMQS.js.map +1 -0
  267. package/dist/chunk-ZBNO57AP.js +141 -0
  268. package/dist/chunk-ZBNO57AP.js.map +1 -0
  269. package/dist/chunk-ZZDH4KPF.js +212 -0
  270. package/dist/chunk-ZZDH4KPF.js.map +1 -0
  271. package/dist/components/AddressContainer/CoreAddressContainer.js +6 -6
  272. package/dist/components/AddressContainer/EVMAddressContainer.js +6 -6
  273. package/dist/components/AddressContainer/addressSwitcher.js +4 -4
  274. package/dist/components/AddressContainer/addressView.js +3 -3
  275. package/dist/components/AddressContainer/label.js +2 -2
  276. package/dist/components/Age/index.js +2 -2
  277. package/dist/components/CopyButton/index.js +1 -1
  278. package/dist/components/DownloadCSV/index.js +1 -1
  279. package/dist/components/Highlight/index.js +12 -2
  280. package/dist/components/Highlight/index.js.map +1 -1
  281. package/dist/components/InfoIconWithTooltip/index.js +1 -1
  282. package/dist/components/PhishingAddressContainer/PhishingWarningIcon.d.ts +6 -0
  283. package/dist/components/PhishingAddressContainer/PhishingWarningIcon.js +7 -0
  284. package/dist/components/PhishingAddressContainer/PhishingWarningIcon.js.map +1 -0
  285. package/dist/components/PhishingAddressContainer/index.d.ts +15 -0
  286. package/dist/components/PhishingAddressContainer/index.js +124 -0
  287. package/dist/components/PhishingAddressContainer/index.js.map +1 -0
  288. package/dist/components/PhishingAddressContainer/phishing-warning.svg.svg +3 -0
  289. package/dist/components/Price/index.js +1 -1
  290. package/dist/components/Select/index.js +1 -1
  291. package/dist/components/Select/select.js +1 -1
  292. package/dist/components/Text/index.js +2 -2
  293. package/dist/components/Tooltip/index.d.ts +1 -1
  294. package/dist/components/Tooltip/index.js +1 -1
  295. package/dist/components/Tooltip/tt.d.ts +28 -0
  296. package/dist/components/Tooltip/tt.js +8 -0
  297. package/dist/components/Tooltip/tt.js.map +1 -0
  298. package/dist/components/TransactionAction/coreTransactionAction.js +6 -6
  299. package/dist/components/TransactionAction/evmTransactionAction.js +6 -6
  300. package/dist/contants/cssVariable.d.ts +20 -0
  301. package/dist/contants/cssVariable.js +41 -0
  302. package/dist/contants/cssVariable.js.map +1 -0
  303. package/dist/uno.css +6 -4
  304. package/dist/utils/contractManagerTool.d.ts +50 -0
  305. package/dist/utils/contractManagerTool.js +92 -0
  306. package/dist/utils/contractManagerTool.js.map +1 -0
  307. package/package.json +5 -5
@@ -0,0 +1,141 @@
1
+ import {
2
+ useENS
3
+ } from "./chunk-5CJCDS5F.js";
4
+ import {
5
+ ContractAddress,
6
+ ContractCreatedAddress,
7
+ CoreHexAddress,
8
+ InvalidAddress,
9
+ MyAddress,
10
+ PosAddress
11
+ } from "./chunk-S7BWR5IZ.js";
12
+ import {
13
+ RenderAddress
14
+ } from "./chunk-P3FVYMA6.js";
15
+ import {
16
+ formatAddress,
17
+ isCoreAddress,
18
+ isCoreContractAddress,
19
+ isZeroAddress
20
+ } from "./chunk-RTFAJGPO.js";
21
+ import {
22
+ getLabelInfo
23
+ } from "./chunk-JY62VTMC.js";
24
+ import {
25
+ getTranslations,
26
+ useGlobalData
27
+ } from "./chunk-DQGLZCIG.js";
28
+
29
+ // src/components/AddressContainer/CoreAddressContainer.tsx
30
+ import { memo } from "react";
31
+ import { withTranslation } from "react-i18next";
32
+ import _ from "lodash";
33
+ import { Fragment, jsx } from "react/jsx-runtime";
34
+ var parseProps = (props, globalData) => {
35
+ const {
36
+ alias,
37
+ ensInfo,
38
+ t,
39
+ showAddressLabel,
40
+ showNametag,
41
+ nametagInfo,
42
+ showENSLabel
43
+ } = props;
44
+ const value = props.value || "";
45
+ const cfxAddress = formatAddress(value, "base32");
46
+ let ENSMap = ensInfo || {};
47
+ const translations = getTranslations();
48
+ let aliasLabel = alias;
49
+ if (!alias && isZeroAddress(cfxAddress)) {
50
+ aliasLabel = t(translations.general.zeroAddress);
51
+ }
52
+ let prefixIcon = null;
53
+ let officalNametag = null;
54
+ let addressLabel = null;
55
+ let ENSLabel = null;
56
+ const gENSLabel = cfxAddress && ENSMap[cfxAddress]?.name;
57
+ if (cfxAddress && showAddressLabel) {
58
+ const addressLabels = globalData?.["CONFLUX_SCAN_ADDRESS_LABELS" /* addressLabel */];
59
+ const gAddressLabel = addressLabels?.[cfxAddress];
60
+ if (gAddressLabel) {
61
+ const { label } = getLabelInfo(gAddressLabel, "tag");
62
+ addressLabel = label;
63
+ }
64
+ }
65
+ if (cfxAddress && showNametag) {
66
+ const nametags = nametagInfo?.[cfxAddress];
67
+ if (nametags) {
68
+ const nametag = nametags?.nametag ?? "";
69
+ const { label } = getLabelInfo(nametag, "nametag");
70
+ officalNametag = label;
71
+ }
72
+ }
73
+ if (showENSLabel && gENSLabel) {
74
+ const { label, icon } = getLabelInfo(gENSLabel, "ens");
75
+ ENSLabel = label;
76
+ prefixIcon = icon;
77
+ }
78
+ return {
79
+ alias: aliasLabel,
80
+ prefix: prefixIcon,
81
+ nametag: officalNametag,
82
+ addressLabel,
83
+ ENSLabel,
84
+ cfxAddress
85
+ };
86
+ };
87
+ var CoreAddressContainer = withTranslation()(
88
+ memo((props) => {
89
+ const { globalData } = useGlobalData();
90
+ const unnecessaryEns = props.ensInfo || props.showENSLabel === false;
91
+ const { ens } = useENS(unnecessaryEns ? null : props.value);
92
+ if (!props.value && !props.contractCreated) {
93
+ return /* @__PURE__ */ jsx(Fragment, { children: "--" });
94
+ }
95
+ const defaultProps = {
96
+ isFull: false,
97
+ isFullNameTag: false,
98
+ link: true,
99
+ isMe: false,
100
+ showIcon: true,
101
+ verify: false,
102
+ showAddressLabel: true,
103
+ showENSLabel: true,
104
+ showNametag: true,
105
+ ensInfo: ens
106
+ };
107
+ const mergeDefaultProps = _.assign({}, defaultProps, props);
108
+ const mergeParseProps = _.merge(
109
+ {},
110
+ mergeDefaultProps,
111
+ parseProps(mergeDefaultProps, globalData)
112
+ );
113
+ if (mergeParseProps.isPosAddress) {
114
+ return PosAddress(mergeParseProps);
115
+ }
116
+ if (!mergeParseProps.value && mergeParseProps.contractCreated) {
117
+ return ContractCreatedAddress({
118
+ ...mergeParseProps,
119
+ outputType: "base32"
120
+ });
121
+ }
122
+ if (mergeParseProps.isEspaceAddress) {
123
+ return CoreHexAddress(mergeParseProps);
124
+ }
125
+ if (!isCoreAddress(mergeParseProps.value)) {
126
+ return InvalidAddress(mergeParseProps);
127
+ }
128
+ if (isCoreContractAddress(mergeParseProps.cfxAddress)) {
129
+ return ContractAddress(mergeParseProps);
130
+ }
131
+ if (mergeParseProps.isMe) {
132
+ return MyAddress(mergeParseProps);
133
+ }
134
+ return RenderAddress(mergeParseProps);
135
+ })
136
+ );
137
+
138
+ export {
139
+ CoreAddressContainer
140
+ };
141
+ //# sourceMappingURL=chunk-2RR4CX3F.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/AddressContainer/CoreAddressContainer.tsx"],"sourcesContent":["import { memo } from 'react';\nimport { WithTranslation, withTranslation } from 'react-i18next';\nimport _ from 'lodash';\nimport {\n formatAddress,\n isCoreAddress,\n isCoreContractAddress,\n isZeroAddress,\n convertCheckSum,\n} from '../../utils/address';\nimport { useGlobalData, getTranslations } from '../../store';\nimport { LOCALSTORAGE_KEYS_MAP } from '../../utils/constants';\nimport { getLabelInfo } from './label';\nimport { useENS } from '../../utils/hooks/useENS';\n\nimport { RenderAddress } from './addressView';\nimport {\n ContractCreatedAddress,\n CoreHexAddress,\n InvalidAddress,\n ContractAddress,\n MyAddress,\n PosAddress,\n} from './addressSwitcher';\nimport { GlobalDataType } from 'src/store/types';\nimport { CoreAddressContainerProps } from './types';\n\nconst parseProps = (\n props: CoreAddressContainerProps & WithTranslation,\n globalData: GlobalDataType,\n) => {\n const {\n alias,\n ensInfo,\n t,\n showAddressLabel,\n showNametag,\n nametagInfo,\n showENSLabel,\n } = props;\n const value: string = props.value || '';\n const cfxAddress = formatAddress(value, 'base32');\n\n let ENSMap = ensInfo || {};\n\n const translations = getTranslations();\n\n let aliasLabel = alias;\n if (!alias && isZeroAddress(cfxAddress)) {\n aliasLabel = t(translations.general.zeroAddress);\n }\n\n let prefixIcon: React.ReactNode = null;\n // official name tag\n let officalNametag: React.ReactNode = null;\n // private name tag\n let addressLabel: React.ReactNode = null;\n // ens name tag\n let ENSLabel: React.ReactNode = null;\n // global ens name tag\n const gENSLabel = cfxAddress && ENSMap[cfxAddress]?.name;\n\n if (cfxAddress && showAddressLabel) {\n // global private name tag\n const addressLabels = globalData?.[LOCALSTORAGE_KEYS_MAP.addressLabel];\n const gAddressLabel = addressLabels?.[cfxAddress];\n\n if (gAddressLabel) {\n const { label } = getLabelInfo(gAddressLabel, 'tag');\n addressLabel = label;\n }\n }\n\n if (cfxAddress && showNametag) {\n const nametags = nametagInfo?.[cfxAddress];\n\n if (nametags) {\n const nametag = nametags?.nametag ?? '';\n const { label } = getLabelInfo(nametag, 'nametag');\n officalNametag = label;\n }\n }\n\n if (showENSLabel && gENSLabel) {\n const { label, icon } = getLabelInfo(gENSLabel, 'ens');\n ENSLabel = label;\n prefixIcon = icon;\n }\n\n return {\n alias: aliasLabel,\n prefix: prefixIcon,\n nametag: officalNametag,\n addressLabel,\n ENSLabel,\n cfxAddress,\n };\n};\n\nexport const CoreAddressContainer = withTranslation()(\n memo((props: CoreAddressContainerProps & WithTranslation) => {\n const { globalData } = useGlobalData();\n\n // If the interface returns Ens content, there is no need to obtain it separately, or disable the display of Ens content (in most cases on the list page).\n const unnecessaryEns = props.ensInfo || props.showENSLabel === false;\n const { ens } = useENS(unnecessaryEns ? null : props.value);\n\n // If a txn receipt has no 'to' address or 'contractCreated', show -- for temp\n if (!props.value && !props.contractCreated) {\n return <>--</>;\n }\n\n const defaultProps = {\n isFull: false,\n isFullNameTag: false,\n link: true,\n isMe: false,\n showIcon: true,\n verify: false,\n showAddressLabel: true,\n showENSLabel: true,\n showNametag: true,\n ensInfo: ens,\n };\n\n const mergeDefaultProps = _.assign({}, defaultProps, props);\n\n const mergeParseProps = _.merge(\n {},\n mergeDefaultProps,\n parseProps(mergeDefaultProps, globalData),\n );\n\n if (mergeParseProps.isPosAddress) {\n return PosAddress(mergeParseProps);\n }\n\n if (!mergeParseProps.value && mergeParseProps.contractCreated) {\n return ContractCreatedAddress({\n ...mergeParseProps,\n outputType: 'base32',\n });\n }\n\n if (mergeParseProps.isEspaceAddress) {\n return CoreHexAddress(mergeParseProps);\n }\n\n if (!isCoreAddress(mergeParseProps.value)) {\n return InvalidAddress(mergeParseProps);\n }\n\n if (isCoreContractAddress(mergeParseProps.cfxAddress)) {\n return ContractAddress(mergeParseProps);\n }\n\n if (mergeParseProps.isMe) {\n return MyAddress(mergeParseProps);\n }\n\n return RenderAddress(mergeParseProps);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY;AACrB,SAA0B,uBAAuB;AACjD,OAAO,OAAO;AA2GD;AAlFb,IAAM,aAA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AM,iBAAiB;AAC/D,UAAM,EAAE,IAAI,IAAI,OAAO,iBAAiB,OAAO,MAAM,KAAK;AAG1D,QAAI,CAAC,MAAM,SAAS,CAAC,MAAM,iBAAiB;AAC1C,aAAO,gCAAE,gBAAE;AAAA,IACb;AAEA,UAAM,eAAe;AAAA,MACnB,QAAQ;AAAA,MACR,eAAe;AAAA,MACf,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,kBAAkB;AAAA,MAClB,cAAc;AAAA,MACd,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAEA,UAAM,oBAAoB,EAAE,OAAO,CAAC,GAAG,cAAc,KAAK;AAE1D,UAAM,kBAAkB,EAAE;AAAA,MACxB,CAAC;AAAA,MACD;AAAA,MACA,WAAW,mBAAmB,UAAU;AAAA,IAC1C;AAEA,QAAI,gBAAgB,cAAc;AAChC,aAAO,WAAW,eAAe;AAAA,IACnC;AAEA,QAAI,CAAC,gBAAgB,SAAS,gBAAgB,iBAAiB;AAC7D,aAAO,uBAAuB;AAAA,QAC5B,GAAG;AAAA,QACH,YAAY;AAAA,MACd,CAAC;AAAA,IACH;AAEA,QAAI,gBAAgB,iBAAiB;AACnC,aAAO,eAAe,eAAe;AAAA,IACvC;AAEA,QAAI,CAAC,cAAc,gBAAgB,KAAK,GAAG;AACzC,aAAO,eAAe,eAAe;AAAA,IACvC;AAEA,QAAI,sBAAsB,gBAAgB,UAAU,GAAG;AACrD,aAAO,gBAAgB,eAAe;AAAA,IACxC;AAEA,QAAI,gBAAgB,MAAM;AACxB,aAAO,UAAU,eAAe;AAAA,IAClC;AAEA,WAAO,cAAc,eAAe;AAAA,EACtC,CAAC;AACH;","names":[]}
@@ -0,0 +1,212 @@
1
+ import {
2
+ RenderAddress
3
+ } from "./chunk-NP4YOCMX.js";
4
+ import {
5
+ formatAddress,
6
+ isInnerContractAddress
7
+ } from "./chunk-RTFAJGPO.js";
8
+ import {
9
+ Tooltip
10
+ } from "./chunk-XVA5MO4M.js";
11
+ import {
12
+ coreCorrespondsToEspace,
13
+ formatString,
14
+ getNetwork
15
+ } from "./chunk-4WJBUQY7.js";
16
+ import {
17
+ getEnvConfig,
18
+ getTranslations,
19
+ useGlobalData
20
+ } from "./chunk-DQGLZCIG.js";
21
+
22
+ // src/components/AddressContainer/addressSwitcher.tsx
23
+ import { AlertTriangle, File } from "@zeit-ui/react-icons";
24
+ import InternalContractIcon from "./internal-contract-icon-ZH2RG3CU.png";
25
+ import ContractIcon from "./contract-icon-P3W2HUAA.png";
26
+ import VerifiedIcon from "./verified-VJRHZNN7.png";
27
+ import isMeIcon from "./me-SIV36SR7.png";
28
+ import { isPosAddress } from "@cfx-kit/dapp-utils/dist/address";
29
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
30
+ var ContractCreatedAddress = (props) => {
31
+ const { contractCreated = "", outputType, t, isFull } = props;
32
+ const translations = getTranslations();
33
+ const contractAddress = formatAddress(contractCreated, outputType);
34
+ const customProps = {
35
+ content: t(translations.transaction.contractCreation),
36
+ alias: t(translations.transaction.contractCreation),
37
+ hrefAddress: contractAddress,
38
+ cfxAddress: contractAddress,
39
+ maxWidth: 160
40
+ };
41
+ const mergedProps = { ...props, ...customProps };
42
+ return RenderAddress({
43
+ ...mergedProps,
44
+ prefix: /* @__PURE__ */ jsx("div", { className: `mr-[2px] flex-shrink-0 ${isFull ? "icon" : ""}`, children: /* @__PURE__ */ jsx(Tooltip, { title: mergedProps.content, children: /* @__PURE__ */ jsx("div", { className: "relative w-[16px] h-[16px]", children: /* @__PURE__ */ jsx(
45
+ "img",
46
+ {
47
+ className: "w-[16px] h-[16px] align-bottom mb-[3px]",
48
+ src: ContractIcon,
49
+ alt: mergedProps.content
50
+ }
51
+ ) }) }) })
52
+ });
53
+ };
54
+ var CoreHexAddress = (props) => {
55
+ const { value, t, isFull, maxWidth } = props;
56
+ const { globalData } = useGlobalData();
57
+ const ENV_CONFIG = getEnvConfig();
58
+ const translations = getTranslations();
59
+ const hexAddress = formatAddress(value, "hex");
60
+ const network = getNetwork(
61
+ globalData?.networks,
62
+ coreCorrespondsToEspace(ENV_CONFIG.ENV_NETWORK_ID)
63
+ );
64
+ const url = `${window.location.protocol}${network.url}/address/${hexAddress}`;
65
+ return RenderAddress({
66
+ cfxAddress: hexAddress,
67
+ hoverValue: hexAddress,
68
+ link: url,
69
+ isFull,
70
+ maxWidth,
71
+ suffixSize: 0,
72
+ prefix: /* @__PURE__ */ jsx("div", { className: "mr-[2px] flex-shrink-0", children: /* @__PURE__ */ jsx(Tooltip, { title: t(translations.general.eSpaceAddress), children: /* @__PURE__ */ jsx(File, { size: 16, color: "#17B38A" }) }) })
73
+ });
74
+ };
75
+ var InvalidAddress = (props) => {
76
+ const {
77
+ value,
78
+ alias,
79
+ t,
80
+ isFull,
81
+ maxWidth,
82
+ isFullNameTag,
83
+ hideAliasPrefixInHover
84
+ } = props;
85
+ const translations = getTranslations();
86
+ const tip = t(translations.general.invalidAddress);
87
+ return RenderAddress({
88
+ cfxAddress: value,
89
+ alias,
90
+ hoverValue: `${tip}: ${value}`,
91
+ content: alias ? formatString(alias, "tag") : value,
92
+ link: false,
93
+ isFull,
94
+ isFullNameTag,
95
+ maxWidth,
96
+ style: { color: "#e00909" },
97
+ prefix: /* @__PURE__ */ jsx("div", { className: "mr-[2px] flex-shrink-0", children: /* @__PURE__ */ jsx(Tooltip, { title: tip, children: /* @__PURE__ */ jsx(AlertTriangle, { size: 16, color: "#e00909" }) }) }),
98
+ hideAliasPrefixInHover
99
+ });
100
+ };
101
+ var ContractAddress = (props) => {
102
+ const { showIcon, verify, t, cfxAddress, isFull } = props;
103
+ const translations = getTranslations();
104
+ const isInnerContract = cfxAddress && isInnerContractAddress(cfxAddress);
105
+ const typeText = t(
106
+ isInnerContract ? translations.general.internalContract : verify ? translations.general.verifiedContract : translations.general.unverifiedContract
107
+ );
108
+ return RenderAddress({
109
+ ...props,
110
+ prefix: showIcon ? /* @__PURE__ */ jsx("div", { className: `mr-[2px] flex-shrink-0 ${isFull ? "icon" : ""}`, children: /* @__PURE__ */ jsx(Tooltip, { title: typeText, children: /* @__PURE__ */ jsx("div", { className: "relative w-[16px] h-[16px]", children: isInnerContract ? /* @__PURE__ */ jsx(
111
+ "img",
112
+ {
113
+ className: "w-[16px] h-[16px] align-bottom mb-[5px]",
114
+ src: InternalContractIcon,
115
+ alt: typeText
116
+ }
117
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
118
+ /* @__PURE__ */ jsx(
119
+ "img",
120
+ {
121
+ className: "w-[16px] h-[16px] align-bottom mb-[5px]",
122
+ src: ContractIcon,
123
+ alt: typeText
124
+ }
125
+ ),
126
+ verify ? /* @__PURE__ */ jsx(
127
+ "img",
128
+ {
129
+ className: "w-[8px] h-[8px] absolute bottom-[-1px] right-[1px]",
130
+ src: VerifiedIcon,
131
+ alt: ""
132
+ }
133
+ ) : /* @__PURE__ */ jsx(Fragment, {})
134
+ ] }) }) }) }) : /* @__PURE__ */ jsx(Fragment, {})
135
+ });
136
+ };
137
+ var MyAddress = (props) => {
138
+ const { isFull } = props;
139
+ return RenderAddress({
140
+ ...props,
141
+ suffix: /* @__PURE__ */ jsx("div", { className: "mr-[2px] flex-shrink-0", children: /* @__PURE__ */ jsx(
142
+ "img",
143
+ {
144
+ className: "w-[38.5px] h-[16px] ml-[3px] align-bottom",
145
+ src: isMeIcon,
146
+ alt: "is me",
147
+ style: {
148
+ marginBottom: isFull ? "6px" : "4px"
149
+ }
150
+ }
151
+ ) })
152
+ });
153
+ };
154
+ var PosAddress = (props) => {
155
+ const {
156
+ alias,
157
+ isFull,
158
+ isFullNameTag,
159
+ maxWidth,
160
+ t,
161
+ link,
162
+ isMe,
163
+ hideAliasPrefixInHover
164
+ } = props;
165
+ const value = props.value;
166
+ if (!value) {
167
+ return /* @__PURE__ */ jsx(Fragment, { children: "--" });
168
+ }
169
+ if (isMe) {
170
+ return MyAddress(props);
171
+ }
172
+ const translations = getTranslations();
173
+ const content = alias ? formatString(alias, "tag") : formatString(value, "posAddress");
174
+ if (!isPosAddress(value)) {
175
+ const tip = t(translations.general.invalidPosAddress);
176
+ return RenderAddress({
177
+ cfxAddress: value,
178
+ alias,
179
+ hoverValue: `${tip}: ${value}`,
180
+ content,
181
+ link: false,
182
+ isFull,
183
+ isFullNameTag,
184
+ maxWidth,
185
+ style: { color: "#e00909" },
186
+ prefix: /* @__PURE__ */ jsx("div", { className: "mr-[2px] flex-shrink-0", children: /* @__PURE__ */ jsx(Tooltip, { title: tip, children: /* @__PURE__ */ jsx(AlertTriangle, { size: 16, color: "#e00909" }) }) }),
187
+ type: "pos",
188
+ hideAliasPrefixInHover
189
+ });
190
+ }
191
+ return RenderAddress({
192
+ cfxAddress: value,
193
+ alias,
194
+ link,
195
+ isFull,
196
+ isFullNameTag,
197
+ maxWidth,
198
+ type: "pos",
199
+ content,
200
+ hideAliasPrefixInHover
201
+ });
202
+ };
203
+
204
+ export {
205
+ ContractCreatedAddress,
206
+ CoreHexAddress,
207
+ InvalidAddress,
208
+ ContractAddress,
209
+ MyAddress,
210
+ PosAddress
211
+ };
212
+ //# sourceMappingURL=chunk-2S6T3LVP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/AddressContainer/addressSwitcher.tsx"],"sourcesContent":["import { WithTranslation } from 'react-i18next';\nimport { AlertTriangle, File } from '@zeit-ui/react-icons';\nimport InternalContractIcon from '../../images/internal-contract-icon.png';\nimport ContractIcon from '../../images/contract-icon.png';\nimport VerifiedIcon from '../../images/verified.png';\nimport isMeIcon from '../../images/me.png';\nimport { Tooltip } from '../Tooltip';\nimport { isPosAddress } from '@cfx-kit/dapp-utils/dist/address';\nimport { formatAddress, isInnerContractAddress } from '../../utils/address';\nimport { getTranslations, getEnvConfig, useGlobalData } from '../../store';\nimport { getNetwork, formatString, coreCorrespondsToEspace } from 'src/utils';\nimport { Props } from './types';\nimport { RenderAddress } from './addressView';\n\n// common\nexport const ContractCreatedAddress = (\n props: Props & WithTranslation & { outputType: 'hex' | 'base32' },\n) => {\n const { contractCreated = '', outputType, t, isFull } = props;\n\n const translations = getTranslations();\n\n const contractAddress = formatAddress(contractCreated, outputType);\n\n const customProps = {\n content: t(translations.transaction.contractCreation),\n alias: t(translations.transaction.contractCreation),\n hrefAddress: contractAddress,\n cfxAddress: contractAddress,\n maxWidth: 160,\n };\n\n const mergedProps = { ...props, ...customProps };\n return RenderAddress({\n ...mergedProps,\n prefix: (\n <div className={`mr-[2px] flex-shrink-0 ${isFull ? 'icon' : ''}`}>\n <Tooltip title={mergedProps.content}>\n <div className=\"relative w-[16px] h-[16px]\">\n <img\n className=\"w-[16px] h-[16px] align-bottom mb-[3px]\"\n src={ContractIcon}\n alt={mergedProps.content}\n />\n </div>\n </Tooltip>\n </div>\n ),\n });\n};\n\n// core\nexport const CoreHexAddress = (props: Props & WithTranslation) => {\n const { value, t, isFull, maxWidth } = props;\n const { globalData } = useGlobalData();\n\n const ENV_CONFIG = getEnvConfig();\n const translations = getTranslations();\n const hexAddress = formatAddress(value, 'hex');\n const network = getNetwork(\n globalData?.networks,\n coreCorrespondsToEspace(ENV_CONFIG.ENV_NETWORK_ID),\n );\n const url = `${window.location.protocol}${network.url}/address/${hexAddress}`;\n\n return RenderAddress({\n cfxAddress: hexAddress,\n hoverValue: hexAddress,\n link: url,\n isFull,\n maxWidth,\n suffixSize: 0,\n prefix: (\n <div className=\"mr-[2px] flex-shrink-0\">\n <Tooltip title={t((translations as any).general.eSpaceAddress)}>\n <File size={16} color=\"#17B38A\" />\n </Tooltip>\n </div>\n ),\n });\n};\n\n// common\nexport const InvalidAddress = (props: Props & WithTranslation) => {\n const {\n value,\n alias,\n t,\n isFull,\n maxWidth,\n isFullNameTag,\n hideAliasPrefixInHover,\n } = props;\n\n const translations = getTranslations();\n\n const tip = t(translations.general.invalidAddress);\n\n return RenderAddress({\n cfxAddress: value,\n alias,\n hoverValue: `${tip}: ${value}`,\n content: alias ? formatString(alias, 'tag') : value,\n link: false,\n isFull,\n isFullNameTag,\n maxWidth,\n style: { color: '#e00909' },\n prefix: (\n <div className=\"mr-[2px] flex-shrink-0\">\n <Tooltip title={tip}>\n <AlertTriangle size={16} color=\"#e00909\" />\n </Tooltip>\n </div>\n ),\n hideAliasPrefixInHover,\n });\n};\n\n// common\nexport const ContractAddress = (props: Props & WithTranslation) => {\n const { showIcon, verify, t, cfxAddress, isFull } = props;\n\n const translations = getTranslations();\n\n const isInnerContract = cfxAddress && isInnerContractAddress(cfxAddress);\n\n const typeText = t(\n isInnerContract\n ? translations.general.internalContract\n : verify\n ? translations.general.verifiedContract\n : translations.general.unverifiedContract,\n );\n\n return RenderAddress({\n ...props,\n prefix: showIcon ? (\n <div className={`mr-[2px] flex-shrink-0 ${isFull ? 'icon' : ''}`}>\n <Tooltip title={typeText}>\n <div className=\"relative w-[16px] h-[16px]\">\n {isInnerContract ? (\n <img\n className=\"w-[16px] h-[16px] align-bottom mb-[5px]\"\n src={InternalContractIcon}\n alt={typeText}\n />\n ) : (\n <>\n <img\n className=\"w-[16px] h-[16px] align-bottom mb-[5px]\"\n src={ContractIcon}\n alt={typeText}\n />\n {verify ? (\n <img\n className=\"w-[8px] h-[8px] absolute bottom-[-1px] right-[1px]\"\n src={VerifiedIcon}\n alt={''}\n />\n ) : (\n <></>\n )}\n </>\n )}\n </div>\n </Tooltip>\n </div>\n ) : (\n <></>\n ),\n });\n};\n\n// common\nexport const MyAddress = (props: Props & WithTranslation) => {\n const { isFull } = props;\n return RenderAddress({\n ...props,\n suffix: (\n <div className=\"mr-[2px] flex-shrink-0\">\n <img\n className=\"w-[38.5px] h-[16px] ml-[3px] align-bottom\"\n src={isMeIcon}\n alt=\"is me\"\n style={{\n marginBottom: isFull ? '6px' : '4px',\n }}\n />\n </div>\n ),\n });\n};\n\n// core\nexport const PosAddress = (props: Props & WithTranslation) => {\n const {\n alias,\n isFull,\n isFullNameTag,\n maxWidth,\n t,\n link,\n isMe,\n hideAliasPrefixInHover,\n } = props;\n const value = props.value;\n if (!value) {\n return <>--</>;\n }\n if (isMe) {\n return MyAddress(props);\n }\n const translations = getTranslations();\n const content = alias\n ? formatString(alias, 'tag')\n : formatString(value, 'posAddress');\n if (!isPosAddress(value)) {\n const tip = t(translations.general.invalidPosAddress);\n return RenderAddress({\n cfxAddress: value,\n alias,\n hoverValue: `${tip}: ${value}`,\n content,\n link: false,\n isFull,\n isFullNameTag,\n maxWidth,\n style: { color: '#e00909' },\n prefix: (\n <div className=\"mr-[2px] flex-shrink-0\">\n <Tooltip title={tip}>\n <AlertTriangle size={16} color=\"#e00909\" />\n </Tooltip>\n </div>\n ),\n type: 'pos',\n hideAliasPrefixInHover,\n });\n }\n\n return RenderAddress({\n cfxAddress: value,\n alias,\n link,\n isFull,\n isFullNameTag,\n maxWidth,\n type: 'pos',\n content,\n hideAliasPrefixInHover,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,eAAe,YAAY;AACpC,OAAO,0BAA0B;AACjC,OAAO,kBAAkB;AACzB,OAAO,kBAAkB;AACzB,OAAO,cAAc;AAErB,SAAS,oBAAoB;AAgCjB,SA0HM,UA1HN,KA6GE,YA7GF;AAxBL,IAAM,yBAAyB,CACpC,UACG;AACH,QAAM,EAAE,kBAAkB,IAAI,YAAY,GAAG,OAAO,IAAI;AAExD,QAAM,eAAe,gBAAgB;AAErC,QAAM,kBAAkB,cAAc,iBAAiB,UAAU;AAEjE,QAAM,cAAc;AAAA,IAClB,SAAS,EAAE,aAAa,YAAY,gBAAgB;AAAA,IACpD,OAAO,EAAE,aAAa,YAAY,gBAAgB;AAAA,IAClD,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AAEA,QAAM,cAAc,EAAE,GAAG,OAAO,GAAG,YAAY;AAC/C,SAAO,cAAc;AAAA,IACnB,GAAG;AAAA,IACH,QACE,oBAAC,SAAI,WAAW,0BAA0B,SAAS,SAAS,MAC1D,8BAAC,WAAQ,OAAO,YAAY,SA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AC;AACH;AAGO,IAAM,aAAa,CAAC,UAAmC;AAC5D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,QAAQ,MAAM;AACpB,MAAI,CAAC,OAAO;AACV,WAAO,gCAAE,gBAAE;AAAA,EACb;AACA,MAAI,MAAM;AACR,WAAO,UAAU,KAAK;AAAA,EACxB;AACA,QAAM,eAAe,gBAAgB;AACrC,QAAM,UAAU,QACZ,aAAa,OAAO,KAAK,IACzB,aAAa,OAAO,YAAY;AACpC,MAAI,CAAC,aAAa,KAAK,GAAG;AACxB,UAAM,MAAM,EAAE,aAAa,QAAQ,iBAAiB;AACpD,WAAO,cAAc;AAAA,MACnB,YAAY;AAAA,MACZ;AAAA,MACA,YAAY,GAAG,QAAQ;AAAA,MACvB;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,EAAE,OAAO,UAAU;AAAA,MAC1B,QACE,oBAAC,SAAI,WAAU,0BACb,8BAAC,WAAQ,OAAO,KACd,8BAAC,iBAAc,MAAM,IAAI,OAAM,WAAU,GAC3C,GACF;AAAA,MAEF,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO,cAAc;AAAA,IACnB,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -0,0 +1,108 @@
1
+ import {
2
+ ContractAddress,
3
+ ContractCreatedAddress,
4
+ InvalidAddress,
5
+ MyAddress
6
+ } from "./chunk-5SRYL5WC.js";
7
+ import {
8
+ RenderAddress
9
+ } from "./chunk-2ATI4GSO.js";
10
+ import {
11
+ convertCheckSum,
12
+ formatAddress,
13
+ isEvmAddress,
14
+ isZeroAddress
15
+ } from "./chunk-RTFAJGPO.js";
16
+ import {
17
+ getLabelInfo
18
+ } from "./chunk-CRLSK4N6.js";
19
+ import {
20
+ getTranslations,
21
+ useGlobalData
22
+ } from "./chunk-DQGLZCIG.js";
23
+
24
+ // src/components/AddressContainer/EVMAddressContainer.tsx
25
+ import { memo } from "react";
26
+ import { withTranslation } from "react-i18next";
27
+ import _ from "lodash";
28
+ import { Fragment, jsx } from "react/jsx-runtime";
29
+ var parseProps = (props, globalData) => {
30
+ const { alias, t, showAddressLabel, showNametag, nametagInfo } = props;
31
+ const value = props.value || "";
32
+ const cfxAddress = formatAddress(value, "hex");
33
+ const translations = getTranslations();
34
+ let aliasLabel = alias;
35
+ if (!alias && isZeroAddress(cfxAddress)) {
36
+ aliasLabel = t(translations.general.zeroAddress);
37
+ }
38
+ let officalNametag = null;
39
+ let addressLabel = null;
40
+ if (cfxAddress && showAddressLabel) {
41
+ const addressLabels = globalData?.["CONFLUX_SCAN_ADDRESS_LABELS" /* addressLabel */];
42
+ const gAddressLabel = addressLabels?.[convertCheckSum(cfxAddress)] || addressLabels?.[cfxAddress.toLowerCase()];
43
+ if (gAddressLabel) {
44
+ const { label } = getLabelInfo(gAddressLabel, "tag");
45
+ addressLabel = label;
46
+ }
47
+ }
48
+ if (cfxAddress && showNametag) {
49
+ const nametags = nametagInfo?.[convertCheckSum(cfxAddress)] || nametagInfo?.[cfxAddress.toLowerCase()];
50
+ if (nametags) {
51
+ const nametag = nametags?.nametag ?? "";
52
+ const { label } = getLabelInfo(nametag, "nametag");
53
+ officalNametag = label;
54
+ }
55
+ }
56
+ return {
57
+ alias: aliasLabel,
58
+ nametag: officalNametag,
59
+ addressLabel,
60
+ cfxAddress
61
+ };
62
+ };
63
+ var EVMAddressContainer = withTranslation()(
64
+ memo((props) => {
65
+ const { globalData } = useGlobalData();
66
+ if (!props.value && !props.contractCreated) {
67
+ return /* @__PURE__ */ jsx(Fragment, { children: "--" });
68
+ }
69
+ const defaultProps = {
70
+ isFull: false,
71
+ isFullNameTag: false,
72
+ link: true,
73
+ isMe: false,
74
+ showIcon: true,
75
+ verify: false,
76
+ showAddressLabel: true,
77
+ showENSLabel: true,
78
+ showNametag: true
79
+ };
80
+ const mergeDefaultProps = _.assign({}, defaultProps, props);
81
+ const mergeParseProps = _.merge(
82
+ {},
83
+ mergeDefaultProps,
84
+ parseProps(mergeDefaultProps, globalData)
85
+ );
86
+ if (!mergeParseProps.value && mergeParseProps.contractCreated) {
87
+ return ContractCreatedAddress({
88
+ ...mergeParseProps,
89
+ outputType: "hex"
90
+ });
91
+ }
92
+ if (!isEvmAddress(mergeParseProps.value)) {
93
+ return InvalidAddress(mergeParseProps);
94
+ }
95
+ if (mergeParseProps.isContract) {
96
+ return ContractAddress(mergeParseProps);
97
+ }
98
+ if (mergeParseProps.isMe) {
99
+ return MyAddress(mergeParseProps);
100
+ }
101
+ return RenderAddress(mergeParseProps);
102
+ })
103
+ );
104
+
105
+ export {
106
+ EVMAddressContainer
107
+ };
108
+ //# sourceMappingURL=chunk-3357K7AW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/AddressContainer/EVMAddressContainer.tsx"],"sourcesContent":["import { memo } from 'react';\nimport { WithTranslation, withTranslation } from 'react-i18next';\nimport _ from 'lodash';\nimport {\n formatAddress,\n isEvmAddress,\n isZeroAddress,\n convertCheckSum,\n} from '../../utils/address';\nimport { useGlobalData, getTranslations } from '../../store';\nimport { LOCALSTORAGE_KEYS_MAP } from '../../utils/constants';\nimport { getLabelInfo } from './label';\n\nimport { RenderAddress } from './addressView';\nimport {\n ContractCreatedAddress,\n InvalidAddress,\n ContractAddress,\n MyAddress,\n} from './addressSwitcher';\nimport { GlobalDataType } from 'src/store/types';\nimport { EVMAddressContainerProps } from './types';\n\nconst parseProps = (\n props: EVMAddressContainerProps & WithTranslation,\n globalData: GlobalDataType,\n) => {\n const { alias, t, showAddressLabel, showNametag, nametagInfo } = props;\n const value: string = props.value || '';\n const cfxAddress = formatAddress(value, 'hex');\n\n const translations = getTranslations();\n\n let aliasLabel = alias;\n if (!alias && isZeroAddress(cfxAddress)) {\n aliasLabel = t(translations.general.zeroAddress);\n }\n\n // official name tag\n let officalNametag: React.ReactNode = null;\n // private name tag\n let addressLabel: React.ReactNode = null;\n\n if (cfxAddress && showAddressLabel) {\n // global private name tag\n const addressLabels = globalData?.[LOCALSTORAGE_KEYS_MAP.addressLabel];\n const gAddressLabel =\n addressLabels?.[convertCheckSum(cfxAddress)] ||\n addressLabels?.[cfxAddress.toLowerCase()];\n\n if (gAddressLabel) {\n const { label } = getLabelInfo(gAddressLabel, 'tag');\n addressLabel = label;\n }\n }\n\n if (cfxAddress && showNametag) {\n const nametags =\n nametagInfo?.[convertCheckSum(cfxAddress)] ||\n nametagInfo?.[cfxAddress.toLowerCase()];\n\n if (nametags) {\n const nametag = nametags?.nametag ?? '';\n const { label } = getLabelInfo(nametag, 'nametag');\n officalNametag = label;\n }\n }\n\n return {\n alias: aliasLabel,\n nametag: officalNametag,\n addressLabel,\n cfxAddress,\n };\n};\n\nexport const EVMAddressContainer = withTranslation()(\n memo((props: EVMAddressContainerProps & WithTranslation) => {\n const { globalData } = useGlobalData();\n\n // If a txn receipt has no 'to' address or 'contractCreated', show -- for temp\n if (!props.value && !props.contractCreated) {\n return <>--</>;\n }\n\n const defaultProps = {\n isFull: false,\n isFullNameTag: false,\n link: true,\n isMe: false,\n showIcon: true,\n verify: false,\n showAddressLabel: true,\n showENSLabel: true,\n showNametag: true,\n };\n\n const mergeDefaultProps = _.assign({}, defaultProps, props);\n\n const mergeParseProps = _.merge(\n {},\n mergeDefaultProps,\n parseProps(mergeDefaultProps, globalData),\n );\n\n if (!mergeParseProps.value && mergeParseProps.contractCreated) {\n return ContractCreatedAddress({\n ...mergeParseProps,\n outputType: 'hex',\n });\n }\n\n if (!isEvmAddress(mergeParseProps.value)) {\n return InvalidAddress(mergeParseProps);\n }\n\n if (mergeParseProps.isContract) {\n return ContractAddress(mergeParseProps);\n }\n\n if (mergeParseProps.isM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AAE;AAAA,IACb;AAEA,UAAM,eAAe;AAAA,MACnB,QAAQ;AAAA,MACR,eAAe;AAAA,MACf,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,kBAAkB;AAAA,MAClB,cAAc;AAAA,MACd,aAAa;AAAA,IACf;AAEA,UAAM,oBAAoB,EAAE,OAAO,CAAC,GAAG,cAAc,KAAK;AAE1D,UAAM,kBAAkB,EAAE;AAAA,MACxB,CAAC;AAAA,MACD;AAAA,MACA,WAAW,mBAAmB,UAAU;AAAA,IAC1C;AAEA,QAAI,CAAC,gBAAgB,SAAS,gBAAgB,iBAAiB;AAC7D,aAAO,uBAAuB;AAAA,QAC5B,GAAG;AAAA,QACH,YAAY;AAAA,MACd,CAAC;AAAA,IACH;AAEA,QAAI,CAAC,aAAa,gBAAgB,KAAK,GAAG;AACxC,aAAO,eAAe,eAAe;AAAA,IACvC;AAEA,QAAI,gBAAgB,YAAY;AAC9B,aAAO,gBAAgB,eAAe;AAAA,IACxC;AAEA,QAAI,gBAAgB,MAAM;AACxB,aAAO,UAAU,eAAe;AAAA,IAClC;AAEA,WAAO,cAAc,eAAe;AAAA,EACtC,CAAC;AACH;","names":[]}
@@ -0,0 +1,49 @@
1
+ import {
2
+ Tooltip
3
+ } from "./chunk-XXEJA3Q7.js";
4
+ import {
5
+ getTranslations
6
+ } from "./chunk-DQGLZCIG.js";
7
+
8
+ // src/components/AddressContainer/label.tsx
9
+ import { Translation } from "react-i18next";
10
+ import { Bookmark, Hash } from "@zeit-ui/react-icons";
11
+ import ICON_ENS from "./logo-cns-7CXISC6I.svg";
12
+ import { jsx } from "react/jsx-runtime";
13
+ var getLabelInfo = (label, type) => {
14
+ const translations = getTranslations();
15
+ if (label) {
16
+ let trans = "";
17
+ let icon = null;
18
+ if (type === "tag") {
19
+ trans = translations.profile.tip.label;
20
+ icon = /* @__PURE__ */ jsx(Bookmark, { color: "var(--theme-color-gray2)", size: 16 });
21
+ } else if (type === "ens") {
22
+ trans = translations.ens.label;
23
+ icon = /* @__PURE__ */ jsx(
24
+ "img",
25
+ {
26
+ src: ICON_ENS,
27
+ className: "w-[16px] h-[16px] mb-[3px] mr-[2px]",
28
+ alt: ""
29
+ }
30
+ );
31
+ } else if (type === "nametag") {
32
+ trans = translations.nametag.label;
33
+ icon = /* @__PURE__ */ jsx(Hash, { color: "var(--theme-color-gray2)", size: 16 });
34
+ }
35
+ return {
36
+ label,
37
+ icon: /* @__PURE__ */ jsx("span", { className: "mr-[2px]", children: /* @__PURE__ */ jsx(Tooltip, { title: /* @__PURE__ */ jsx(Translation, { children: (t) => t(trans) }), children: icon }) })
38
+ };
39
+ }
40
+ return {
41
+ label: "",
42
+ icon: null
43
+ };
44
+ };
45
+
46
+ export {
47
+ getLabelInfo
48
+ };
49
+ //# sourceMappingURL=chunk-3BLNV3M6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/AddressContainer/label.tsx"],"sourcesContent":["import { Translation } from 'react-i18next';\nimport { Bookmark, Hash } from '@zeit-ui/react-icons';\nimport { Tooltip } from '../Tooltip';\nimport { getTranslations } from '../../store';\nimport ICON_ENS from '../../images/logo-cns.svg';\n\nexport const getLabelInfo = (label: string, type: string) => {\n const translations = getTranslations();\n if (label) {\n let trans: string = '';\n let icon: React.ReactNode = null;\n\n if (type === 'tag') {\n trans = translations.profile.tip.label;\n icon = <Bookmark color=\"var(--theme-color-gray2)\" size={16} />;\n } else if (type === 'ens') {\n trans = (translations as any).ens.label;\n icon = (\n <img\n src={ICON_ENS}\n className=\"w-[16px] h-[16px] mb-[3px] mr-[2px]\"\n alt=\"\"\n />\n );\n // nametag from official operational staff\n } else if (type === 'nametag') {\n trans = translations.nametag.label;\n icon = <Hash color=\"var(--theme-color-gray2)\" size={16} />;\n }\n\n return {\n label,\n icon: (\n <span className=\"mr-[2px]\">\n <Tooltip title={<Translation>{t => t(trans)}</Translation>}>\n {icon}\n </Tooltip>\n </span>\n ),\n };\n }\n\n return {\n label: '',\n icon: null,\n };\n};\n"],"mappings":";;;;;;;;AAAA,SAAS,mBAAmB;AAC5B,SAAS,UAAU,YAAY;AAG/B,OAAO,cAAc;AAUR;AARN,IAAM,eAAe,CAAC,OAAe,SAAiB;AAC3D,QAAM,eAAe,gBAAgB;AACrC,MAAI,OAAO;AACT,QAAI,QAAgB;AACpB,QAAI,OAAwB;AAE5B,QAAI,SAAS,OAAO;AAClB,cAAQ,aAAa,QAAQ,IAAI;AACjC,aAAO,oBAAC,YAAS,OAAM,4BAA2B,MAAM,IAAI;AAAA,IAC9D,WAAW,SAAS,OAAO;AACzB,cAAS,aAAqB,IAAI;AAClC,aACE;AAAA,QAAC;AAAA;AAAA,UACC,KAAK;AAAA,UACL,WAAU;AAAA,UACV,KAAI;AAAA;AAAA,MACN;AAAA,IAGJ,WAAW,SAAS,WAAW;AAC7B,cAAQ,aAAa,QAAQ;AAC7B,aAAO,oBAAC,QAAK,OAAM,4BAA2B,MAAM,IAAI;AAAA,IAC1D;AAEA,WAAO;AAAA,MACL;AAAA,MACA,MACE,oBAAC,UAAK,WAAU,YACd,8BAAC,WAAQ,OAAO,oBAAC,eAAa,iBAAK,EAAE,KAAK,GAAE,GACzC,gBACH,GACF;AAAA,IAEJ;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AACF;","names":[]}
@@ -0,0 +1,27 @@
1
+ // src/components/PhishingAddressContainer/PhishingWarningIcon.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ var PhishingWarningIcon = ({ ...props }) => {
4
+ return /* @__PURE__ */ jsx(
5
+ "svg",
6
+ {
7
+ width: "16",
8
+ height: "16",
9
+ viewBox: "0 0 16 16",
10
+ fill: "none",
11
+ xmlns: "http://www.w3.org/2000/svg",
12
+ ...props,
13
+ children: /* @__PURE__ */ jsx(
14
+ "path",
15
+ {
16
+ d: "M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8 1.54883C4.43687 1.54883 1.54883 4.43687 1.54883 8C1.54883 11.5631 4.43687 14.4512 8 14.4512C11.5631 14.4512 14.4512 11.5631 14.4512 8C14.4512 4.43687 11.5631 1.54883 8 1.54883ZM8 7.22559C8.39182 7.22559 8.71616 7.51682 8.76758 7.89453L8.77441 8V10.8906C8.77425 11.3181 8.42747 11.6641 8 11.6641C7.60806 11.6641 7.28369 11.373 7.23242 10.9951L7.22559 10.8906V8C7.22559 7.57242 7.57242 7.22559 8 7.22559ZM8.00684 4.33594C8.43431 4.33594 8.78109 4.68194 8.78125 5.10938C8.78125 5.50132 8.49019 5.82569 8.1123 5.87695L8.00684 5.88379C7.57222 5.88358 7.22559 5.53682 7.22559 5.10938C7.22574 4.71772 7.51696 4.39422 7.89453 4.34277L8.00684 4.33594Z",
17
+ fill: "currentColor"
18
+ }
19
+ )
20
+ }
21
+ );
22
+ };
23
+
24
+ export {
25
+ PhishingWarningIcon
26
+ };
27
+ //# sourceMappingURL=chunk-3DOLNPRU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/PhishingAddressContainer/PhishingWarningIcon.tsx"],"sourcesContent":["import { SVGProps } from 'react';\n\nexport const PhishingWarningIcon = ({ ...props }: SVGProps<SVGSVGElement>) => {\n return (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8 1.54883C4.43687 1.54883 1.54883 4.43687 1.54883 8C1.54883 11.5631 4.43687 14.4512 8 14.4512C11.5631 14.4512 14.4512 11.5631 14.4512 8C14.4512 4.43687 11.5631 1.54883 8 1.54883ZM8 7.22559C8.39182 7.22559 8.71616 7.51682 8.76758 7.89453L8.77441 8V10.8906C8.77425 11.3181 8.42747 11.6641 8 11.6641C7.60806 11.6641 7.28369 11.373 7.23242 10.9951L7.22559 10.8906V8C7.22559 7.57242 7.57242 7.22559 8 7.22559ZM8.00684 4.33594C8.43431 4.33594 8.78109 4.68194 8.78125 5.10938C8.78125 5.50132 8.49019 5.82569 8.1123 5.87695L8.00684 5.88379C7.57222 5.88358 7.22559 5.53682 7.22559 5.10938C7.22574 4.71772 7.51696 4.39422 7.89453 4.34277L8.00684 4.33594Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n};\n"],"mappings":";AAYM;AAVC,IAAM,sBAAsB,CAAC,EAAE,GAAG,MAAM,MAA+B;AAC5E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,OAAM;AAAA,MACL,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACC,GAAE;AAAA,UACF,MAAK;AAAA;AAAA,MACP;AAAA;AAAA,EACF;AAEJ;","names":[]}