@cfxjs/sirius-next-common 0.2.24 → 0.2.25

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 (132) hide show
  1. package/dist/{chunk-R62HRSIY.js → chunk-2KOLEWOS.js} +2 -2
  2. package/dist/{chunk-MWSXXVVL.js → chunk-2PGGAIEP.js} +6 -6
  3. package/dist/{chunk-OFAM2QTT.js → chunk-2PQY4AOY.js} +2 -2
  4. package/dist/{chunk-DASMAZXS.js → chunk-2UN57Q5P.js} +3 -3
  5. package/dist/{chunk-4B7BV62E.js → chunk-442632G5.js} +3 -3
  6. package/dist/{chunk-6C5NQACS.js → chunk-6PDWJNOG.js} +4 -4
  7. package/dist/{chunk-A6B5V6XY.js → chunk-73PNXQWF.js} +2 -2
  8. package/dist/{chunk-UVRMLFMC.js → chunk-75SROBSE.js} +2 -2
  9. package/dist/{chunk-E7FB4S3X.js → chunk-7R6SGHOG.js} +14 -4
  10. package/dist/chunk-7R6SGHOG.js.map +1 -0
  11. package/dist/{chunk-FTAFV6RE.js → chunk-AKS6URWT.js} +5 -5
  12. package/dist/{chunk-C6GUZVQ2.js → chunk-BHL6OY3L.js} +2 -2
  13. package/dist/{chunk-VEK5DLFI.js → chunk-C2BON7HP.js} +2 -2
  14. package/dist/{chunk-FW5ON36S.js → chunk-COMABNT2.js} +5 -5
  15. package/dist/{chunk-ASS6TOFE.js → chunk-D6FWT557.js} +4 -4
  16. package/dist/{chunk-O6BP54O6.js → chunk-DWU7DZBU.js} +3 -3
  17. package/dist/{chunk-OT252GGM.js → chunk-FUZVMDLY.js} +4 -4
  18. package/dist/{chunk-MQY7EQPG.js → chunk-IUL5FJSO.js} +2 -2
  19. package/dist/{chunk-J536GL5G.js → chunk-MBRAYFD4.js} +2 -2
  20. package/dist/{chunk-A46LVI25.js → chunk-NG6K2B3F.js} +2 -2
  21. package/dist/{chunk-FGPRA3A4.js → chunk-NQFK4HOS.js} +4 -4
  22. package/dist/{chunk-HCEXWKMZ.js → chunk-NRHFGPN6.js} +4 -4
  23. package/dist/{chunk-UX6IRX2M.js → chunk-QUEYGZEY.js} +3 -3
  24. package/dist/{chunk-OTSNM4CR.js → chunk-RDIVTGYB.js} +2 -2
  25. package/dist/{chunk-VD73ULXJ.js → chunk-RIWM6DB5.js} +3 -3
  26. package/dist/{chunk-AQFNXW4W.js → chunk-S4M4LBVQ.js} +2 -2
  27. package/dist/{chunk-7WDLTRBN.js → chunk-SWH3CIYY.js} +2 -2
  28. package/dist/{chunk-CNXGYDZG.js → chunk-TNVFEZBN.js} +6 -6
  29. package/dist/{chunk-SIZYE6WH.js → chunk-UAUOFPHA.js} +2 -2
  30. package/dist/{chunk-4BS66NNM.js → chunk-UDR62T6C.js} +2 -2
  31. package/dist/{chunk-EHRGH3HS.js → chunk-UQQJ37UO.js} +4 -4
  32. package/dist/{chunk-FSYB23NA.js → chunk-WBV3BSDG.js} +2 -2
  33. package/dist/{chunk-SNUPCZY7.js → chunk-XASQUPYS.js} +2 -2
  34. package/dist/{chunk-7RLNWQIR.js → chunk-ZTGRS6WM.js} +5 -5
  35. package/dist/components/AAFailedReason/index.js +3 -3
  36. package/dist/components/AceEditor/index.js +4 -4
  37. package/dist/components/AddressContainer/CoreAddressContainer.js +10 -10
  38. package/dist/components/AddressContainer/EVMAddressContainer.js +9 -9
  39. package/dist/components/AddressContainer/addressSwitcher.js +7 -7
  40. package/dist/components/AddressContainer/addressView.js +6 -6
  41. package/dist/components/AddressContainer/label.js +3 -3
  42. package/dist/components/AddressContainer/utils.js +3 -3
  43. package/dist/components/Age/index.js +4 -4
  44. package/dist/components/AutoComplete/index.js +3 -3
  45. package/dist/components/Charts/PreviewChartTemplate.js +1 -1
  46. package/dist/components/Charts/StockChartTemplate.js +1 -1
  47. package/dist/components/CopyButton/index.js +3 -3
  48. package/dist/components/DecimalsSelect/index.js +3 -3
  49. package/dist/components/DownloadCSV/index.js +4 -4
  50. package/dist/components/GasPriceDropdown/index.js +2 -2
  51. package/dist/components/IncreasePercent/index.js +2 -2
  52. package/dist/components/InfoIconWithTooltip/index.js +4 -4
  53. package/dist/components/InputData/AddressLabel.js +8 -8
  54. package/dist/components/InputData/ContractDetail.js +5 -5
  55. package/dist/components/InputData/JsonDecode.js +5 -5
  56. package/dist/components/InputData/OptimizationDecode.js +12 -12
  57. package/dist/components/InputData/UTF8.js +3 -3
  58. package/dist/components/InputData/index.js +16 -16
  59. package/dist/components/List/index.js +1 -1
  60. package/dist/components/List/index.js.map +1 -1
  61. package/dist/components/Modal/index.js +3 -3
  62. package/dist/components/NetworkIcon/index.js +2 -2
  63. package/dist/components/OutputData/ErrorDecode.js +15 -15
  64. package/dist/components/OutputData/index.js +17 -17
  65. package/dist/components/PhishingAddressContainer/index.js +4 -4
  66. package/dist/components/Popover/index.js +3 -3
  67. package/dist/components/Price/index.js +3 -3
  68. package/dist/components/ProxyContractAddress/index.js +6 -6
  69. package/dist/components/Radio/index.js +2 -2
  70. package/dist/components/SearchInput/index.js +4 -4
  71. package/dist/components/Select/index.js +4 -4
  72. package/dist/components/Select/select.js +3 -3
  73. package/dist/components/SmartAccountAddress/index.js +6 -6
  74. package/dist/components/Text/index.js +4 -4
  75. package/dist/components/Tooltip/index.js +3 -3
  76. package/dist/components/TransactionAction/coreTransactionAction.js +10 -10
  77. package/dist/components/TransactionAction/evmTransactionAction.js +9 -9
  78. package/dist/components/TransactionTrace/TraceDetail.js +25 -25
  79. package/dist/components/TransactionTrace/TreeTraceTable.js +26 -26
  80. package/dist/components/TransactionTrace/index.js +26 -26
  81. package/dist/utils/address.js +2 -2
  82. package/dist/utils/contractManagerTool.js +2 -2
  83. package/dist/utils/hooks/useAddressLabel.js +3 -3
  84. package/dist/utils/hooks/useAddressNameMap.js +2 -2
  85. package/dist/utils/hooks/useAutoSetHolderFilterParams.js +2 -2
  86. package/dist/utils/hooks/useContractDetail.js +2 -2
  87. package/dist/utils/hooks/useDecodeFunctionData.js +5 -5
  88. package/dist/utils/hooks/useDecodeFunctionError.js +3 -3
  89. package/dist/utils/hooks/useENS.js +3 -3
  90. package/dist/utils/hooks/useEnhanceDataWithNameMap.js +2 -2
  91. package/dist/utils/hooks/useMethodAbi.js +2 -2
  92. package/dist/utils/hooks/useTableData.js +1 -1
  93. package/dist/utils/hooks/useTxTrace.js +3 -3
  94. package/dist/utils/index.js +2 -2
  95. package/dist/utils/ipfsGateway.d.ts +52 -0
  96. package/dist/utils/ipfsGateway.js +350 -0
  97. package/dist/utils/ipfsGateway.js.map +1 -0
  98. package/dist/utils/request.js +1 -1
  99. package/package.json +3 -3
  100. package/dist/chunk-E7FB4S3X.js.map +0 -1
  101. /package/dist/{chunk-R62HRSIY.js.map → chunk-2KOLEWOS.js.map} +0 -0
  102. /package/dist/{chunk-MWSXXVVL.js.map → chunk-2PGGAIEP.js.map} +0 -0
  103. /package/dist/{chunk-OFAM2QTT.js.map → chunk-2PQY4AOY.js.map} +0 -0
  104. /package/dist/{chunk-DASMAZXS.js.map → chunk-2UN57Q5P.js.map} +0 -0
  105. /package/dist/{chunk-4B7BV62E.js.map → chunk-442632G5.js.map} +0 -0
  106. /package/dist/{chunk-6C5NQACS.js.map → chunk-6PDWJNOG.js.map} +0 -0
  107. /package/dist/{chunk-A6B5V6XY.js.map → chunk-73PNXQWF.js.map} +0 -0
  108. /package/dist/{chunk-UVRMLFMC.js.map → chunk-75SROBSE.js.map} +0 -0
  109. /package/dist/{chunk-FTAFV6RE.js.map → chunk-AKS6URWT.js.map} +0 -0
  110. /package/dist/{chunk-C6GUZVQ2.js.map → chunk-BHL6OY3L.js.map} +0 -0
  111. /package/dist/{chunk-VEK5DLFI.js.map → chunk-C2BON7HP.js.map} +0 -0
  112. /package/dist/{chunk-FW5ON36S.js.map → chunk-COMABNT2.js.map} +0 -0
  113. /package/dist/{chunk-ASS6TOFE.js.map → chunk-D6FWT557.js.map} +0 -0
  114. /package/dist/{chunk-O6BP54O6.js.map → chunk-DWU7DZBU.js.map} +0 -0
  115. /package/dist/{chunk-OT252GGM.js.map → chunk-FUZVMDLY.js.map} +0 -0
  116. /package/dist/{chunk-MQY7EQPG.js.map → chunk-IUL5FJSO.js.map} +0 -0
  117. /package/dist/{chunk-J536GL5G.js.map → chunk-MBRAYFD4.js.map} +0 -0
  118. /package/dist/{chunk-A46LVI25.js.map → chunk-NG6K2B3F.js.map} +0 -0
  119. /package/dist/{chunk-FGPRA3A4.js.map → chunk-NQFK4HOS.js.map} +0 -0
  120. /package/dist/{chunk-HCEXWKMZ.js.map → chunk-NRHFGPN6.js.map} +0 -0
  121. /package/dist/{chunk-UX6IRX2M.js.map → chunk-QUEYGZEY.js.map} +0 -0
  122. /package/dist/{chunk-OTSNM4CR.js.map → chunk-RDIVTGYB.js.map} +0 -0
  123. /package/dist/{chunk-VD73ULXJ.js.map → chunk-RIWM6DB5.js.map} +0 -0
  124. /package/dist/{chunk-AQFNXW4W.js.map → chunk-S4M4LBVQ.js.map} +0 -0
  125. /package/dist/{chunk-7WDLTRBN.js.map → chunk-SWH3CIYY.js.map} +0 -0
  126. /package/dist/{chunk-CNXGYDZG.js.map → chunk-TNVFEZBN.js.map} +0 -0
  127. /package/dist/{chunk-SIZYE6WH.js.map → chunk-UAUOFPHA.js.map} +0 -0
  128. /package/dist/{chunk-4BS66NNM.js.map → chunk-UDR62T6C.js.map} +0 -0
  129. /package/dist/{chunk-EHRGH3HS.js.map → chunk-UQQJ37UO.js.map} +0 -0
  130. /package/dist/{chunk-FSYB23NA.js.map → chunk-WBV3BSDG.js.map} +0 -0
  131. /package/dist/{chunk-SNUPCZY7.js.map → chunk-XASQUPYS.js.map} +0 -0
  132. /package/dist/{chunk-7RLNWQIR.js.map → chunk-ZTGRS6WM.js.map} +0 -0
@@ -1,56 +1,56 @@
1
1
  import {
2
2
  TreeTraceTable
3
- } from "../../chunk-A46LVI25.js";
3
+ } from "../../chunk-NG6K2B3F.js";
4
4
  import {
5
5
  TraceDetail
6
- } from "../../chunk-7RLNWQIR.js";
7
- import "../../chunk-6C5NQACS.js";
8
- import "../../chunk-7WDLTRBN.js";
6
+ } from "../../chunk-ZTGRS6WM.js";
7
+ import "../../chunk-6PDWJNOG.js";
8
+ import "../../chunk-SWH3CIYY.js";
9
9
  import "../../chunk-UM5J477V.js";
10
10
  import "../../chunk-XZ7IV2FF.js";
11
- import "../../chunk-VD73ULXJ.js";
12
- import "../../chunk-SIZYE6WH.js";
11
+ import "../../chunk-RIWM6DB5.js";
12
+ import "../../chunk-UAUOFPHA.js";
13
13
  import "../../chunk-NWVSTRCG.js";
14
- import "../../chunk-ASS6TOFE.js";
15
- import "../../chunk-HCEXWKMZ.js";
16
- import "../../chunk-OT252GGM.js";
14
+ import "../../chunk-D6FWT557.js";
15
+ import "../../chunk-NRHFGPN6.js";
16
+ import "../../chunk-FUZVMDLY.js";
17
17
  import "../../chunk-OYESIV3F.js";
18
- import "../../chunk-DASMAZXS.js";
19
- import "../../chunk-MWSXXVVL.js";
20
- import "../../chunk-EHRGH3HS.js";
21
- import "../../chunk-VEK5DLFI.js";
22
- import "../../chunk-FGPRA3A4.js";
23
- import "../../chunk-4BS66NNM.js";
18
+ import "../../chunk-2UN57Q5P.js";
19
+ import "../../chunk-2PGGAIEP.js";
20
+ import "../../chunk-UQQJ37UO.js";
21
+ import "../../chunk-C2BON7HP.js";
22
+ import "../../chunk-NQFK4HOS.js";
23
+ import "../../chunk-UDR62T6C.js";
24
24
  import "../../chunk-FYLAXC3R.js";
25
25
  import "../../chunk-XI5WO2NW.js";
26
26
  import "../../chunk-5AM5HM3B.js";
27
- import "../../chunk-UVRMLFMC.js";
27
+ import "../../chunk-75SROBSE.js";
28
28
  import "../../chunk-XBEBAU77.js";
29
29
  import "../../chunk-Y7OVL5US.js";
30
30
  import "../../chunk-O6NJ56NA.js";
31
31
  import "../../chunk-XCKMXAL2.js";
32
32
  import "../../chunk-2Y57U43P.js";
33
33
  import "../../chunk-TGK5LP2H.js";
34
- import "../../chunk-C6GUZVQ2.js";
34
+ import "../../chunk-BHL6OY3L.js";
35
35
  import "../../chunk-6SXAFSBF.js";
36
36
  import "../../chunk-JIRLY7OG.js";
37
37
  import "../../chunk-4B6ASBYQ.js";
38
- import "../../chunk-OFAM2QTT.js";
38
+ import "../../chunk-2PQY4AOY.js";
39
39
  import "../../chunk-5TGK2EA2.js";
40
40
  import "../../chunk-ADNS57X5.js";
41
- import "../../chunk-R62HRSIY.js";
42
- import "../../chunk-O6BP54O6.js";
43
- import "../../chunk-OTSNM4CR.js";
41
+ import "../../chunk-2KOLEWOS.js";
42
+ import "../../chunk-DWU7DZBU.js";
43
+ import "../../chunk-RDIVTGYB.js";
44
44
  import "../../chunk-MWAD4CIG.js";
45
- import "../../chunk-MQY7EQPG.js";
46
- import "../../chunk-4B7BV62E.js";
45
+ import "../../chunk-IUL5FJSO.js";
46
+ import "../../chunk-442632G5.js";
47
47
  import "../../chunk-TOKKKTFG.js";
48
- import "../../chunk-J536GL5G.js";
48
+ import "../../chunk-MBRAYFD4.js";
49
49
  import "../../chunk-BMO4IZHV.js";
50
50
  import "../../chunk-LRCAKRPK.js";
51
- import "../../chunk-SNUPCZY7.js";
51
+ import "../../chunk-XASQUPYS.js";
52
52
  import "../../chunk-WIB76E7O.js";
53
- import "../../chunk-E7FB4S3X.js";
53
+ import "../../chunk-7R6SGHOG.js";
54
54
  import "../../chunk-J2I22Q2M.js";
55
55
  import "../../chunk-YEINMVAR.js";
56
56
  import "../../chunk-DQGLZCIG.js";
@@ -23,9 +23,9 @@ import {
23
23
  isSimplyZeroAddress,
24
24
  isSpecialAddress,
25
25
  isZeroAddress
26
- } from "../chunk-MQY7EQPG.js";
26
+ } from "../chunk-IUL5FJSO.js";
27
27
  import "../chunk-WIB76E7O.js";
28
- import "../chunk-E7FB4S3X.js";
28
+ import "../chunk-7R6SGHOG.js";
29
29
  import "../chunk-J2I22Q2M.js";
30
30
  import "../chunk-YEINMVAR.js";
31
31
  import "../chunk-DQGLZCIG.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  parseString
3
- } from "../chunk-SNUPCZY7.js";
3
+ } from "../chunk-XASQUPYS.js";
4
4
  import "../chunk-WIB76E7O.js";
5
- import "../chunk-E7FB4S3X.js";
5
+ import "../chunk-7R6SGHOG.js";
6
6
  import "../chunk-J2I22Q2M.js";
7
7
  import "../chunk-YEINMVAR.js";
8
8
  import "../chunk-DQGLZCIG.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  useAddressLabel
3
- } from "../../chunk-VEK5DLFI.js";
4
- import "../../chunk-MQY7EQPG.js";
3
+ } from "../../chunk-C2BON7HP.js";
4
+ import "../../chunk-IUL5FJSO.js";
5
5
  import "../../chunk-WIB76E7O.js";
6
- import "../../chunk-E7FB4S3X.js";
6
+ import "../../chunk-7R6SGHOG.js";
7
7
  import "../../chunk-J2I22Q2M.js";
8
8
  import "../../chunk-YEINMVAR.js";
9
9
  import "../../chunk-DQGLZCIG.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  transformNameMapKeysToLowerCase,
3
3
  useAddressNameMap
4
- } from "../../chunk-4BS66NNM.js";
5
- import "../../chunk-E7FB4S3X.js";
4
+ } from "../../chunk-UDR62T6C.js";
5
+ import "../../chunk-7R6SGHOG.js";
6
6
  import "../../chunk-J2I22Q2M.js";
7
7
  import "../../chunk-YEINMVAR.js";
8
8
  import "../../chunk-DQGLZCIG.js";
@@ -3,9 +3,9 @@ import {
3
3
  } from "../../chunk-CPSXYQJ7.js";
4
4
  import {
5
5
  isAddressEqual
6
- } from "../../chunk-MQY7EQPG.js";
6
+ } from "../../chunk-IUL5FJSO.js";
7
7
  import "../../chunk-WIB76E7O.js";
8
- import "../../chunk-E7FB4S3X.js";
8
+ import "../../chunk-7R6SGHOG.js";
9
9
  import "../../chunk-J2I22Q2M.js";
10
10
  import "../../chunk-YEINMVAR.js";
11
11
  import "../../chunk-DQGLZCIG.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  useContractDetail
3
- } from "../../chunk-OFAM2QTT.js";
4
- import "../../chunk-E7FB4S3X.js";
3
+ } from "../../chunk-2PQY4AOY.js";
4
+ import "../../chunk-7R6SGHOG.js";
5
5
  import "../../chunk-J2I22Q2M.js";
6
6
  import "../../chunk-YEINMVAR.js";
7
7
  import "../../chunk-DQGLZCIG.js";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  useDecodeFunctionData
3
- } from "../../chunk-6C5NQACS.js";
4
- import "../../chunk-7WDLTRBN.js";
3
+ } from "../../chunk-6PDWJNOG.js";
4
+ import "../../chunk-SWH3CIYY.js";
5
5
  import "../../chunk-6SXAFSBF.js";
6
6
  import "../../chunk-JIRLY7OG.js";
7
7
  import "../../chunk-4B6ASBYQ.js";
8
- import "../../chunk-OFAM2QTT.js";
9
- import "../../chunk-SNUPCZY7.js";
8
+ import "../../chunk-2PQY4AOY.js";
9
+ import "../../chunk-XASQUPYS.js";
10
10
  import "../../chunk-WIB76E7O.js";
11
- import "../../chunk-E7FB4S3X.js";
11
+ import "../../chunk-7R6SGHOG.js";
12
12
  import "../../chunk-J2I22Q2M.js";
13
13
  import "../../chunk-YEINMVAR.js";
14
14
  import "../../chunk-DQGLZCIG.js";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  useDecodeFunctionError
3
- } from "../../chunk-C6GUZVQ2.js";
3
+ } from "../../chunk-BHL6OY3L.js";
4
4
  import "../../chunk-6SXAFSBF.js";
5
5
  import "../../chunk-JIRLY7OG.js";
6
6
  import "../../chunk-4B6ASBYQ.js";
7
- import "../../chunk-OFAM2QTT.js";
7
+ import "../../chunk-2PQY4AOY.js";
8
8
  import "../../chunk-5TGK2EA2.js";
9
9
  import "../../chunk-ADNS57X5.js";
10
10
  import "../../chunk-WIB76E7O.js";
11
- import "../../chunk-E7FB4S3X.js";
11
+ import "../../chunk-7R6SGHOG.js";
12
12
  import "../../chunk-J2I22Q2M.js";
13
13
  import "../../chunk-YEINMVAR.js";
14
14
  import "../../chunk-DQGLZCIG.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  useENS
3
- } from "../../chunk-O6BP54O6.js";
4
- import "../../chunk-MQY7EQPG.js";
3
+ } from "../../chunk-DWU7DZBU.js";
4
+ import "../../chunk-IUL5FJSO.js";
5
5
  import "../../chunk-WIB76E7O.js";
6
- import "../../chunk-E7FB4S3X.js";
6
+ import "../../chunk-7R6SGHOG.js";
7
7
  import "../../chunk-J2I22Q2M.js";
8
8
  import "../../chunk-YEINMVAR.js";
9
9
  import "../../chunk-DQGLZCIG.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  transformNameMapKeysToLowerCase,
3
3
  useAddressNameMap
4
- } from "../../chunk-4BS66NNM.js";
5
- import "../../chunk-E7FB4S3X.js";
4
+ } from "../../chunk-UDR62T6C.js";
5
+ import "../../chunk-7R6SGHOG.js";
6
6
  import "../../chunk-J2I22Q2M.js";
7
7
  import "../../chunk-YEINMVAR.js";
8
8
  import "../../chunk-DQGLZCIG.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  useMethodAbi
3
- } from "../../chunk-7WDLTRBN.js";
4
- import "../../chunk-E7FB4S3X.js";
3
+ } from "../../chunk-SWH3CIYY.js";
4
+ import "../../chunk-7R6SGHOG.js";
5
5
  import "../../chunk-J2I22Q2M.js";
6
6
  import "../../chunk-YEINMVAR.js";
7
7
  import "../../chunk-DQGLZCIG.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "../../chunk-CPSXYQJ7.js";
4
4
  import {
5
5
  fetchWithPrefix
6
- } from "../../chunk-E7FB4S3X.js";
6
+ } from "../../chunk-7R6SGHOG.js";
7
7
  import "../../chunk-J2I22Q2M.js";
8
8
  import "../../chunk-YEINMVAR.js";
9
9
  import "../../chunk-DQGLZCIG.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  formatAddress
3
- } from "../../chunk-MQY7EQPG.js";
3
+ } from "../../chunk-IUL5FJSO.js";
4
4
  import {
5
5
  formatABI
6
- } from "../../chunk-SNUPCZY7.js";
6
+ } from "../../chunk-XASQUPYS.js";
7
7
  import "../../chunk-WIB76E7O.js";
8
8
  import {
9
9
  fetchWithPrefix
10
- } from "../../chunk-E7FB4S3X.js";
10
+ } from "../../chunk-7R6SGHOG.js";
11
11
  import {
12
12
  publishRequestError
13
13
  } from "../../chunk-J2I22Q2M.js";
@@ -53,9 +53,9 @@ import {
53
53
  transferToLowerCase,
54
54
  validURL,
55
55
  viewJson
56
- } from "../chunk-SNUPCZY7.js";
56
+ } from "../chunk-XASQUPYS.js";
57
57
  import "../chunk-WIB76E7O.js";
58
- import "../chunk-E7FB4S3X.js";
58
+ import "../chunk-7R6SGHOG.js";
59
59
  import "../chunk-J2I22Q2M.js";
60
60
  import "../chunk-YEINMVAR.js";
61
61
  import "../chunk-DQGLZCIG.js";
@@ -0,0 +1,52 @@
1
+ declare const IPFS_GATEWAY_LIST_URL = "https://raw.githubusercontent.com/ipfs/public-gateway-checker/refs/heads/main/gateways.json";
2
+ declare const IPFS_GATEWAY_SAMPLE_CID = "bafybeifx7yeb55armcsxwwitkymga5xf53dxiarykms3ygqic223w5sk3m";
3
+ type IPFSGatewayDetectCode = 'OK' | 'NOT_OK';
4
+ interface IPFSGatewayDetectResult {
5
+ code: IPFSGatewayDetectCode;
6
+ message: string;
7
+ data: {
8
+ gateway: string;
9
+ host: string;
10
+ url: string;
11
+ time?: number;
12
+ status?: number;
13
+ contentType?: string | null;
14
+ };
15
+ }
16
+ interface FetchIPFSGatewayListOptions {
17
+ fetcher?: typeof globalThis.fetch;
18
+ listUrl?: string;
19
+ timeout?: number;
20
+ useCache?: boolean;
21
+ }
22
+ interface DetectIPFSGatewayOptions {
23
+ fetcher?: typeof globalThis.fetch;
24
+ cid?: string;
25
+ timeout?: number;
26
+ useDetectCache?: boolean;
27
+ }
28
+ interface DetectIPFSGatewaysOptions extends DetectIPFSGatewayOptions {
29
+ gateways?: string[];
30
+ listUrl?: string;
31
+ pageSize?: number;
32
+ useCache?: boolean;
33
+ }
34
+ interface DetectIPFSGatewaysResult {
35
+ fastest?: string;
36
+ results: IPFSGatewayDetectResult[];
37
+ availableGateways: IPFSGatewayDetectResult[];
38
+ }
39
+ declare const IPFS_GATEWAY_GLOBAL_CACHE_KEY = "__SIRIUS_NEXT_IPFS_GATEWAY_CACHE__";
40
+ declare const IPFS_GATEWAY_LIST_STORAGE_PREFIX = "sirius-next:ipfs-gateway:list:";
41
+ declare const IPFS_GATEWAY_DETECT_STORAGE_PREFIX = "sirius-next:ipfs-gateway:detect:";
42
+ declare const IPFS_GATEWAY_RELOAD_CLEANED_KEY = "sirius-next:ipfs-gateway:reload-cleaned";
43
+ declare const clearIPFSGatewayListCache: () => void;
44
+ declare const clearIPFSGatewayDetectCache: () => void;
45
+ declare const normalizeIPFSGateway: (gateway: string) => string | undefined;
46
+ declare const hostFromIPFSGateway: (gateway: string) => string;
47
+ declare const tmplFromIPFSGateway: (userGateway: string, gatewayList: string[]) => string | undefined;
48
+ declare const fetchIPFSGatewayList: (options?: FetchIPFSGatewayListOptions) => Promise<string[]>;
49
+ declare const detectIPFSGateway: (gateway: string, { fetcher, cid, timeout, useDetectCache, }?: DetectIPFSGatewayOptions) => Promise<IPFSGatewayDetectResult>;
50
+ declare const detectIPFSGateways: ({ gateways, pageSize, fetcher, cid, timeout, listUrl, useCache, }?: DetectIPFSGatewaysOptions) => Promise<DetectIPFSGatewaysResult>;
51
+
52
+ export { DetectIPFSGatewayOptions, DetectIPFSGatewaysOptions, DetectIPFSGatewaysResult, FetchIPFSGatewayListOptions, IPFSGatewayDetectCode, IPFSGatewayDetectResult, IPFS_GATEWAY_DETECT_STORAGE_PREFIX, IPFS_GATEWAY_GLOBAL_CACHE_KEY, IPFS_GATEWAY_LIST_STORAGE_PREFIX, IPFS_GATEWAY_LIST_URL, IPFS_GATEWAY_RELOAD_CLEANED_KEY, IPFS_GATEWAY_SAMPLE_CID, clearIPFSGatewayDetectCache, clearIPFSGatewayListCache, detectIPFSGateway, detectIPFSGateways, fetchIPFSGatewayList, hostFromIPFSGateway, normalizeIPFSGateway, tmplFromIPFSGateway };
@@ -0,0 +1,350 @@
1
+ import "../chunk-WQG2LZMB.js";
2
+
3
+ // src/utils/ipfsGateway.ts
4
+ var IPFS_GATEWAY_LIST_URL = "https://raw.githubusercontent.com/ipfs/public-gateway-checker/refs/heads/main/gateways.json";
5
+ var IPFS_GATEWAY_SAMPLE_CID = "bafybeifx7yeb55armcsxwwitkymga5xf53dxiarykms3ygqic223w5sk3m";
6
+ var DEFAULT_TIMEOUT = 3e3;
7
+ var DEFAULT_PAGE_SIZE = 5;
8
+ var IPFS_GATEWAY_GLOBAL_CACHE_KEY = "__SIRIUS_NEXT_IPFS_GATEWAY_CACHE__";
9
+ var IPFS_GATEWAY_LIST_STORAGE_PREFIX = "sirius-next:ipfs-gateway:list:";
10
+ var IPFS_GATEWAY_DETECT_STORAGE_PREFIX = "sirius-next:ipfs-gateway:detect:";
11
+ var IPFS_GATEWAY_RELOAD_CLEANED_KEY = "sirius-next:ipfs-gateway:reload-cleaned";
12
+ var getIPFSGatewayCache = () => {
13
+ clearSessionCacheOnReload();
14
+ const globalObject = globalThis;
15
+ globalObject[IPFS_GATEWAY_GLOBAL_CACHE_KEY] ?? (globalObject[IPFS_GATEWAY_GLOBAL_CACHE_KEY] = {
16
+ gatewayListPromiseMap: /* @__PURE__ */ new Map(),
17
+ gatewayDetectPromiseMap: /* @__PURE__ */ new Map()
18
+ });
19
+ return globalObject[IPFS_GATEWAY_GLOBAL_CACHE_KEY];
20
+ };
21
+ var clearIPFSGatewayListCache = () => {
22
+ getIPFSGatewayCache().gatewayListPromiseMap.clear();
23
+ clearSessionListCache();
24
+ };
25
+ var clearIPFSGatewayDetectCache = () => {
26
+ getIPFSGatewayCache().gatewayDetectPromiseMap.clear();
27
+ clearSessionDetectCache();
28
+ };
29
+ var normalizeIPFSGateway = (gateway) => {
30
+ if (!gateway || typeof gateway !== "string") {
31
+ return void 0;
32
+ }
33
+ const target = gateway.trim();
34
+ if (!target) {
35
+ return void 0;
36
+ }
37
+ return target.endsWith("/") ? target.slice(0, -1) : target;
38
+ };
39
+ var hostFromIPFSGateway = (gateway) => {
40
+ try {
41
+ return new URL(gateway).host;
42
+ } catch (_) {
43
+ const parts = gateway.split("://");
44
+ const urlExcludeProtocol = (parts.length > 1 ? parts[1] : parts[0]) ?? "";
45
+ return urlExcludeProtocol.split("/")[0] ?? "";
46
+ }
47
+ };
48
+ var tmplFromIPFSGateway = (userGateway, gatewayList) => {
49
+ const target = normalizeIPFSGateway(userGateway);
50
+ if (!target) {
51
+ return void 0;
52
+ }
53
+ return new Set(gatewayList.map((gateway) => normalizeIPFSGateway(gateway))).has(
54
+ target
55
+ ) ? target : void 0;
56
+ };
57
+ var requestWithTimeout = async (url, fetcher, timeout) => {
58
+ const controller = new AbortController();
59
+ const timer = setTimeout(() => controller.abort(), timeout);
60
+ try {
61
+ return await fetcher(url, { signal: controller.signal });
62
+ } finally {
63
+ clearTimeout(timer);
64
+ }
65
+ };
66
+ var getSessionStorage = () => {
67
+ try {
68
+ return globalThis.sessionStorage;
69
+ } catch (_) {
70
+ return void 0;
71
+ }
72
+ };
73
+ var getNavigationType = () => {
74
+ const navigationEntry = globalThis.performance?.getEntriesByType?.(
75
+ "navigation"
76
+ )?.[0];
77
+ if (navigationEntry?.type) {
78
+ return navigationEntry.type;
79
+ }
80
+ return globalThis.performance?.navigation?.type === 1 ? "reload" : void 0;
81
+ };
82
+ var clearSessionCacheOnReload = () => {
83
+ const globalObject = globalThis;
84
+ if (globalObject[IPFS_GATEWAY_RELOAD_CLEANED_KEY]) {
85
+ return;
86
+ }
87
+ globalObject[IPFS_GATEWAY_RELOAD_CLEANED_KEY] = true;
88
+ if (getNavigationType() === "reload") {
89
+ clearSessionListCache();
90
+ clearSessionDetectCache();
91
+ }
92
+ };
93
+ var clearSessionCacheByPrefix = (prefix) => {
94
+ const storage = getSessionStorage();
95
+ if (!storage) {
96
+ return;
97
+ }
98
+ try {
99
+ const keys = Array.from({ length: storage.length }).map((_, index) => storage.key(index)).filter((key) => Boolean(key?.startsWith(prefix)));
100
+ keys.forEach((key) => storage.removeItem(key));
101
+ } catch (_) {
102
+ }
103
+ };
104
+ var clearSessionListCache = () => {
105
+ clearSessionCacheByPrefix(IPFS_GATEWAY_LIST_STORAGE_PREFIX);
106
+ };
107
+ var clearSessionDetectCache = () => {
108
+ clearSessionCacheByPrefix(IPFS_GATEWAY_DETECT_STORAGE_PREFIX);
109
+ };
110
+ var getSessionListCache = (listUrl) => {
111
+ const storage = getSessionStorage();
112
+ if (!storage) {
113
+ return void 0;
114
+ }
115
+ try {
116
+ const item = storage.getItem(
117
+ `${IPFS_GATEWAY_LIST_STORAGE_PREFIX}${listUrl}`
118
+ );
119
+ if (!item) {
120
+ return void 0;
121
+ }
122
+ const data = JSON.parse(item);
123
+ return Array.isArray(data) && data.every((gateway) => typeof gateway === "string") ? data : void 0;
124
+ } catch (_) {
125
+ return void 0;
126
+ }
127
+ };
128
+ var setSessionListCache = (listUrl, gatewayList) => {
129
+ const storage = getSessionStorage();
130
+ if (!storage) {
131
+ return;
132
+ }
133
+ try {
134
+ storage.setItem(
135
+ `${IPFS_GATEWAY_LIST_STORAGE_PREFIX}${listUrl}`,
136
+ JSON.stringify(gatewayList)
137
+ );
138
+ } catch (_) {
139
+ }
140
+ };
141
+ var getSessionDetectCache = (cacheKey) => {
142
+ const storage = getSessionStorage();
143
+ if (!storage) {
144
+ return void 0;
145
+ }
146
+ try {
147
+ const item = storage.getItem(
148
+ `${IPFS_GATEWAY_DETECT_STORAGE_PREFIX}${cacheKey}`
149
+ );
150
+ if (!item) {
151
+ return void 0;
152
+ }
153
+ const result = JSON.parse(item);
154
+ return result?.data?.url === cacheKey ? result : void 0;
155
+ } catch (_) {
156
+ return void 0;
157
+ }
158
+ };
159
+ var setSessionDetectCache = (cacheKey, result) => {
160
+ const storage = getSessionStorage();
161
+ if (!storage) {
162
+ return;
163
+ }
164
+ try {
165
+ storage.setItem(
166
+ `${IPFS_GATEWAY_DETECT_STORAGE_PREFIX}${cacheKey}`,
167
+ JSON.stringify(result)
168
+ );
169
+ } catch (_) {
170
+ }
171
+ };
172
+ var fetchIPFSGatewayListWithoutCache = async ({
173
+ fetcher = globalThis.fetch,
174
+ listUrl = IPFS_GATEWAY_LIST_URL,
175
+ timeout = DEFAULT_TIMEOUT
176
+ } = {}) => {
177
+ const response = await requestWithTimeout(listUrl, fetcher, timeout);
178
+ if (!response.ok) {
179
+ return [];
180
+ }
181
+ const data = await response.json();
182
+ if (!Array.isArray(data)) {
183
+ return [];
184
+ }
185
+ return data.map((gateway) => normalizeIPFSGateway(gateway)).filter((gateway) => Boolean(gateway));
186
+ };
187
+ var fetchIPFSGatewayList = (options = {}) => {
188
+ const listUrl = options.listUrl ?? IPFS_GATEWAY_LIST_URL;
189
+ if (options.useCache === false) {
190
+ return fetchIPFSGatewayListWithoutCache({ ...options, listUrl });
191
+ }
192
+ const { gatewayListPromiseMap } = getIPFSGatewayCache();
193
+ let gatewayListPromise = gatewayListPromiseMap.get(listUrl);
194
+ if (!gatewayListPromise) {
195
+ const storedGatewayList = getSessionListCache(listUrl);
196
+ if (storedGatewayList) {
197
+ gatewayListPromise = Promise.resolve(storedGatewayList);
198
+ gatewayListPromiseMap.set(listUrl, gatewayListPromise);
199
+ return gatewayListPromise;
200
+ }
201
+ gatewayListPromise = fetchIPFSGatewayListWithoutCache({
202
+ ...options,
203
+ listUrl
204
+ }).then((gatewayList) => {
205
+ setSessionListCache(listUrl, gatewayList);
206
+ return gatewayList;
207
+ }).catch((error) => {
208
+ gatewayListPromiseMap.delete(listUrl);
209
+ throw error;
210
+ });
211
+ gatewayListPromiseMap.set(listUrl, gatewayListPromise);
212
+ }
213
+ return gatewayListPromise;
214
+ };
215
+ var detectIPFSGateway = async (gateway, {
216
+ fetcher = globalThis.fetch,
217
+ cid = IPFS_GATEWAY_SAMPLE_CID,
218
+ timeout = DEFAULT_TIMEOUT,
219
+ useDetectCache = true
220
+ } = {}) => {
221
+ const normalizedGateway = normalizeIPFSGateway(gateway) ?? gateway;
222
+ const host = hostFromIPFSGateway(normalizedGateway);
223
+ const url = `${normalizedGateway}/ipfs/${cid}`;
224
+ const cacheKey = url;
225
+ if (useDetectCache) {
226
+ const { gatewayDetectPromiseMap } = getIPFSGatewayCache();
227
+ const cachedResult = gatewayDetectPromiseMap.get(cacheKey);
228
+ if (cachedResult) {
229
+ return cachedResult;
230
+ }
231
+ const storedResult = getSessionDetectCache(cacheKey);
232
+ if (storedResult) {
233
+ const storedPromise = Promise.resolve(storedResult);
234
+ gatewayDetectPromiseMap.set(cacheKey, storedPromise);
235
+ return storedPromise;
236
+ }
237
+ }
238
+ const detectPromise = detectIPFSGatewayWithoutCache({
239
+ fetcher,
240
+ timeout,
241
+ normalizedGateway,
242
+ host,
243
+ url
244
+ }).then((result) => {
245
+ if (useDetectCache) {
246
+ setSessionDetectCache(cacheKey, result);
247
+ }
248
+ return result;
249
+ });
250
+ if (useDetectCache) {
251
+ const { gatewayDetectPromiseMap } = getIPFSGatewayCache();
252
+ gatewayDetectPromiseMap.set(cacheKey, detectPromise);
253
+ }
254
+ return detectPromise;
255
+ };
256
+ var detectIPFSGatewayWithoutCache = async ({
257
+ fetcher,
258
+ timeout,
259
+ normalizedGateway,
260
+ host,
261
+ url
262
+ }) => {
263
+ const startedAt = Date.now();
264
+ const baseResult = {
265
+ data: {
266
+ gateway: normalizedGateway,
267
+ host,
268
+ url
269
+ }
270
+ };
271
+ try {
272
+ const response = await requestWithTimeout(url, fetcher, timeout);
273
+ const time = Date.now() - startedAt;
274
+ const contentType = response.headers.get("content-type");
275
+ const result = {
276
+ data: {
277
+ ...baseResult.data,
278
+ time,
279
+ status: response.status,
280
+ contentType
281
+ }
282
+ };
283
+ if (response.ok && contentType?.startsWith("text/plain")) {
284
+ return {
285
+ ...result,
286
+ code: "OK",
287
+ message: "success"
288
+ };
289
+ }
290
+ return {
291
+ ...result,
292
+ code: "NOT_OK",
293
+ message: "fetch fail"
294
+ };
295
+ } catch (_) {
296
+ return {
297
+ ...baseResult,
298
+ code: "NOT_OK",
299
+ message: "fetch fail"
300
+ };
301
+ }
302
+ };
303
+ var detectIPFSGateways = async ({
304
+ gateways,
305
+ pageSize = DEFAULT_PAGE_SIZE,
306
+ fetcher = globalThis.fetch,
307
+ cid = IPFS_GATEWAY_SAMPLE_CID,
308
+ timeout = DEFAULT_TIMEOUT,
309
+ listUrl = IPFS_GATEWAY_LIST_URL,
310
+ useCache = true
311
+ } = {}) => {
312
+ const gatewayList = gateways ?? await fetchIPFSGatewayList({ fetcher, listUrl, timeout, useCache });
313
+ const results = [];
314
+ const normalizedGatewayList = gatewayList.map((gateway) => normalizeIPFSGateway(gateway)).filter((gateway) => Boolean(gateway));
315
+ const safePageSize = Number.isFinite(pageSize) && pageSize > 0 ? Math.max(1, Math.floor(pageSize)) : DEFAULT_PAGE_SIZE;
316
+ for (let skip = 0; skip < normalizedGatewayList.length; skip += safePageSize) {
317
+ const taskArray = normalizedGatewayList.slice(skip, skip + safePageSize).map(
318
+ (gateway) => detectIPFSGateway(gateway, {
319
+ fetcher,
320
+ cid,
321
+ timeout,
322
+ useDetectCache: useCache
323
+ })
324
+ );
325
+ results.push(...await Promise.all(taskArray));
326
+ }
327
+ const availableGateways = results.filter((result) => result.code === "OK" && result.data.time !== void 0).sort((a, b) => Number(a.data.time) - Number(b.data.time));
328
+ return {
329
+ fastest: availableGateways[0]?.data.gateway,
330
+ results,
331
+ availableGateways
332
+ };
333
+ };
334
+ export {
335
+ IPFS_GATEWAY_DETECT_STORAGE_PREFIX,
336
+ IPFS_GATEWAY_GLOBAL_CACHE_KEY,
337
+ IPFS_GATEWAY_LIST_STORAGE_PREFIX,
338
+ IPFS_GATEWAY_LIST_URL,
339
+ IPFS_GATEWAY_RELOAD_CLEANED_KEY,
340
+ IPFS_GATEWAY_SAMPLE_CID,
341
+ clearIPFSGatewayDetectCache,
342
+ clearIPFSGatewayListCache,
343
+ detectIPFSGateway,
344
+ detectIPFSGateways,
345
+ fetchIPFSGatewayList,
346
+ hostFromIPFSGateway,
347
+ normalizeIPFSGateway,
348
+ tmplFromIPFSGateway
349
+ };
350
+ //# sourceMappingURL=ipfsGateway.js.map