@cfxjs/sirius-next-common 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ODPPKXIV.js → chunk-2PHHS2RO.js} +2 -2
- package/dist/chunk-6A3FV7ST.js +106 -0
- package/dist/chunk-6A3FV7ST.js.map +1 -0
- package/dist/{chunk-TTMMIWXR.js → chunk-6B2K5TEW.js} +3 -3
- package/dist/{chunk-LUHISU5F.js → chunk-6CSKHPNW.js} +2 -2
- package/dist/{chunk-CPSXYQJ7.js → chunk-6R34R4GT.js} +6 -3
- package/dist/{chunk-CPSXYQJ7.js.map → chunk-6R34R4GT.js.map} +1 -1
- package/dist/{chunk-4MVQ3JTN.js → chunk-7XTWMLAL.js} +2 -2
- package/dist/{chunk-M7G2HHUU.js → chunk-A66ETOJQ.js} +12 -10
- package/dist/{chunk-M7G2HHUU.js.map → chunk-A66ETOJQ.js.map} +1 -1
- package/dist/chunk-ATKGS22K.js +22 -0
- package/dist/chunk-ATKGS22K.js.map +1 -0
- package/dist/{chunk-4MEAKY73.js → chunk-BE7ARWED.js} +2 -2
- package/dist/{chunk-TAEXZ5LI.js → chunk-BVUDZX7G.js} +2 -2
- package/dist/{chunk-EGXD2GDI.js → chunk-DG5UBEHF.js} +2 -2
- package/dist/{chunk-7FIPVSHQ.js → chunk-DYXED7QQ.js} +2 -2
- package/dist/{chunk-WYM7FWXA.js → chunk-ESZKQ6TN.js} +2 -2
- package/dist/{chunk-NBMABBMG.js → chunk-EXHT4Z5W.js} +5 -5
- package/dist/{chunk-XGSBVC7P.js → chunk-FDTENXEV.js} +2 -2
- package/dist/{chunk-OAUFBUYV.js → chunk-G5X35MKG.js} +5 -5
- package/dist/{chunk-TIWELXT7.js → chunk-I2P6ZCOL.js} +5 -5
- package/dist/{chunk-XIQH26WA.js → chunk-IGKHPUYH.js} +2 -2
- package/dist/{chunk-B74PZXOZ.js → chunk-IZPVE2KL.js} +6 -6
- package/dist/{chunk-CTCBKNSN.js → chunk-JY3EDI6L.js} +3 -3
- package/dist/{chunk-QCA4QRD4.js → chunk-KEXEB4J3.js} +5 -3
- package/dist/chunk-KEXEB4J3.js.map +1 -0
- package/dist/{chunk-LMY5VYFP.js → chunk-KJGWBTHN.js} +2 -2
- package/dist/{chunk-2WY3J56A.js → chunk-KTHEE74W.js} +2 -2
- package/dist/{chunk-GGLZLKNJ.js → chunk-NQXQI7SA.js} +5 -5
- package/dist/{chunk-3XNQKM2D.js → chunk-OBAIINAG.js} +2 -2
- package/dist/{chunk-UBHTXZWS.js → chunk-OJKUPTS6.js} +2 -2
- package/dist/{chunk-S2C6VOUJ.js → chunk-ONKMQT55.js} +2 -2
- package/dist/{chunk-ZUO2WVSN.js → chunk-OZQ7HC6E.js} +2 -2
- package/dist/{chunk-2RVLHSYV.js → chunk-P56G5URI.js} +4 -4
- package/dist/{chunk-LZF26HB6.js → chunk-R6M4UPAP.js} +2 -2
- package/dist/{chunk-EIDH56XO.js → chunk-ROINL4AD.js} +5 -5
- package/dist/{chunk-RX44WEW6.js → chunk-RPJ6QLNG.js} +5 -5
- package/dist/{chunk-OVGNIKRY.js → chunk-SBFEY7I7.js} +74 -4
- package/dist/{chunk-OVGNIKRY.js.map → chunk-SBFEY7I7.js.map} +1 -1
- package/dist/{chunk-RK632STC.js → chunk-SW7XEZSP.js} +4 -4
- package/dist/{chunk-YLBHOAH5.js → chunk-SWXU6RIW.js} +3 -3
- package/dist/{chunk-YL3I4UMA.js → chunk-TLB3MT66.js} +5 -5
- package/dist/{chunk-XJPWKT2J.js → chunk-URGXFUYM.js} +3 -3
- package/dist/{chunk-36EB4LRH.js → chunk-V63T5THG.js} +4 -4
- package/dist/{chunk-D5HJCIRL.js → chunk-VHVK63XA.js} +2 -2
- package/dist/{chunk-2T3VTZXW.js → chunk-VTQN4OFN.js} +3 -3
- package/dist/{chunk-2BLHJLZO.js → chunk-VYC4H34V.js} +6 -6
- package/dist/{chunk-6XQWKKL5.js → chunk-WOL4GXHM.js} +5 -5
- package/dist/chunk-X6IIYPI2.js +5801 -0
- package/dist/chunk-X6IIYPI2.js.map +1 -0
- package/dist/{chunk-OUQEXLFQ.js → chunk-XD4ERIC5.js} +3 -3
- package/dist/{chunk-QL4NKKTA.js → chunk-XF3VAJAR.js} +2 -2
- package/dist/components/AAFailedReason/index.js +8 -6
- package/dist/components/AAFailedReason/index.js.map +1 -1
- package/dist/components/AceEditor/index.js +6 -4
- package/dist/components/AddressContainer/CoreAddressContainer.js +12 -10
- package/dist/components/AddressContainer/EVMAddressContainer.js +11 -9
- package/dist/components/AddressContainer/addressSwitcher.js +9 -7
- package/dist/components/AddressContainer/addressView.js +8 -6
- package/dist/components/AddressContainer/label.js +5 -3
- package/dist/components/AddressContainer/label.js.map +1 -1
- package/dist/components/AddressContainer/utils.js +4 -3
- package/dist/components/Age/index.js +6 -4
- package/dist/components/Age/index.js.map +1 -1
- package/dist/components/AutoComplete/index.js +4 -3
- package/dist/components/AutoComplete/index.js.map +1 -1
- package/dist/components/Charts/PreviewChartTemplate.js +2 -1
- package/dist/components/Charts/PreviewChartTemplate.js.map +1 -1
- package/dist/components/Charts/StockChartTemplate.js +2 -1
- package/dist/components/Charts/StockChartTemplate.js.map +1 -1
- package/dist/components/ContractAbi/IntValueFormatter.js +6 -5
- package/dist/components/ContractAbi/ParamTitle.js +7 -5
- package/dist/components/ContractAbi/index.js +11 -9
- package/dist/components/ContractAbi/utils.js +4 -3
- package/dist/components/CopyButton/index.js +5 -3
- package/dist/components/CopyButton/index.js.map +1 -1
- package/dist/components/DecimalsSelect/index.js +5 -4
- package/dist/components/DownloadCSV/index.js +6 -4
- package/dist/components/DownloadCSV/index.js.map +1 -1
- package/dist/components/Dropdown/index.js +9 -5
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/GasPriceDropdown/index.js +3 -2
- package/dist/components/GasPriceDropdown/index.js.map +1 -1
- package/dist/components/IncreasePercent/index.js +3 -2
- package/dist/components/IncreasePercent/index.js.map +1 -1
- package/dist/components/InfoIconWithTooltip/index.js +6 -4
- package/dist/components/InputData/AddressLabel.js +10 -8
- package/dist/components/InputData/ContractDetail.js +6 -5
- package/dist/components/InputData/JsonDecode.js +7 -5
- package/dist/components/InputData/OptimizationDecode.js +14 -12
- package/dist/components/InputData/Original.js +4 -3
- package/dist/components/InputData/UTF8.js +4 -3
- package/dist/components/InputData/index.js +19 -17
- package/dist/components/Modal/index.js +4 -3
- package/dist/components/NetworkIcon/index.js +3 -2
- package/dist/components/NetworkIcon/index.js.map +1 -1
- package/dist/components/OutputData/ErrorDecode.js +21 -18
- package/dist/components/OutputData/index.js +23 -20
- package/dist/components/PhishingAddressContainer/index.js +6 -4
- package/dist/components/PhishingAddressContainer/index.js.map +1 -1
- package/dist/components/Popover/index.js +4 -3
- package/dist/components/Price/index.js +5 -3
- package/dist/components/Price/index.js.map +1 -1
- package/dist/components/ProxyContractAddress/index.js +8 -6
- package/dist/components/ProxyContractAddress/index.js.map +1 -1
- package/dist/components/Radio/index.js +3 -2
- package/dist/components/Radio/index.js.map +1 -1
- package/dist/components/SearchInput/index.js +6 -4
- package/dist/components/SearchInput/index.js.map +1 -1
- package/dist/components/Select/index.js +5 -4
- package/dist/components/Select/select.js +4 -3
- package/dist/components/SmartAccountAddress/index.js +8 -6
- package/dist/components/SmartAccountAddress/index.js.map +1 -1
- package/dist/components/Text/index.js +6 -4
- package/dist/components/Tooltip/index.js +5 -3
- package/dist/components/TransactionAction/coreTransactionAction.js +12 -10
- package/dist/components/TransactionAction/coreTransactionAction.js.map +1 -1
- package/dist/components/TransactionAction/evmTransactionAction.js +11 -9
- package/dist/components/TransactionAction/evmTransactionAction.js.map +1 -1
- package/dist/components/TransactionTrace/TraceDetail.js +31 -28
- package/dist/components/TransactionTrace/TreeTraceTable.js +32 -29
- package/dist/components/TransactionTrace/index.js +32 -29
- package/dist/utils/address.js +3 -2
- package/dist/utils/contractManagerTool.js +3 -2
- package/dist/utils/contractManagerTool.js.map +1 -1
- package/dist/utils/hooks/useAbiItemById.js +3 -2
- package/dist/utils/hooks/useAddressLabel.js +4 -3
- package/dist/utils/hooks/useAddressNameMap.js +3 -2
- package/dist/utils/hooks/useAutoSetHolderFilterParams.js +8 -6
- package/dist/utils/hooks/useAutoSetHolderFilterParams.js.map +1 -1
- package/dist/utils/hooks/useClickAway.d.ts +5 -0
- package/dist/utils/hooks/useClickAway.js +8 -0
- package/dist/utils/hooks/useClickAway.js.map +1 -0
- package/dist/utils/hooks/useContractDetail.js +3 -2
- package/dist/utils/hooks/useContractsStatistics.js +2 -1
- package/dist/utils/hooks/useContractsStatistics.js.map +1 -1
- package/dist/utils/hooks/useDecodeFunctionData.js +8 -6
- package/dist/utils/hooks/useDecodeFunctionError.js +8 -6
- package/dist/utils/hooks/useENS.js +4 -3
- package/dist/utils/hooks/useEnhanceDataWithNameMap.js +3 -2
- package/dist/utils/hooks/useEnhanceDataWithNameMap.js.map +1 -1
- package/dist/utils/hooks/useMethodAbi.js +3 -2
- package/dist/utils/hooks/useSearchParams.js +2 -1
- package/dist/utils/hooks/useSimulateTrace.d.ts +2 -1
- package/dist/utils/hooks/useSimulateTrace.js +31 -17
- package/dist/utils/hooks/useSimulateTrace.js.map +1 -1
- package/dist/utils/hooks/useTableData.js +7 -5
- package/dist/utils/hooks/useTableData.js.map +1 -1
- package/dist/utils/hooks/useTxTrace.js +5 -4
- package/dist/utils/index.js +3 -2
- package/dist/utils/request.js +2 -1
- package/dist/utils/sdk.d.ts +29 -8
- package/dist/utils/sdk.js +2 -1
- package/dist/utils/transactionLists.d.ts +28 -0
- package/dist/utils/transactionLists.js +14 -0
- package/dist/utils/transactionLists.js.map +1 -0
- package/package.json +12 -5
- package/dist/chunk-QCA4QRD4.js.map +0 -1
- /package/dist/{chunk-ODPPKXIV.js.map → chunk-2PHHS2RO.js.map} +0 -0
- /package/dist/{chunk-TTMMIWXR.js.map → chunk-6B2K5TEW.js.map} +0 -0
- /package/dist/{chunk-LUHISU5F.js.map → chunk-6CSKHPNW.js.map} +0 -0
- /package/dist/{chunk-4MVQ3JTN.js.map → chunk-7XTWMLAL.js.map} +0 -0
- /package/dist/{chunk-4MEAKY73.js.map → chunk-BE7ARWED.js.map} +0 -0
- /package/dist/{chunk-TAEXZ5LI.js.map → chunk-BVUDZX7G.js.map} +0 -0
- /package/dist/{chunk-EGXD2GDI.js.map → chunk-DG5UBEHF.js.map} +0 -0
- /package/dist/{chunk-7FIPVSHQ.js.map → chunk-DYXED7QQ.js.map} +0 -0
- /package/dist/{chunk-WYM7FWXA.js.map → chunk-ESZKQ6TN.js.map} +0 -0
- /package/dist/{chunk-NBMABBMG.js.map → chunk-EXHT4Z5W.js.map} +0 -0
- /package/dist/{chunk-XGSBVC7P.js.map → chunk-FDTENXEV.js.map} +0 -0
- /package/dist/{chunk-OAUFBUYV.js.map → chunk-G5X35MKG.js.map} +0 -0
- /package/dist/{chunk-TIWELXT7.js.map → chunk-I2P6ZCOL.js.map} +0 -0
- /package/dist/{chunk-XIQH26WA.js.map → chunk-IGKHPUYH.js.map} +0 -0
- /package/dist/{chunk-B74PZXOZ.js.map → chunk-IZPVE2KL.js.map} +0 -0
- /package/dist/{chunk-CTCBKNSN.js.map → chunk-JY3EDI6L.js.map} +0 -0
- /package/dist/{chunk-LMY5VYFP.js.map → chunk-KJGWBTHN.js.map} +0 -0
- /package/dist/{chunk-2WY3J56A.js.map → chunk-KTHEE74W.js.map} +0 -0
- /package/dist/{chunk-GGLZLKNJ.js.map → chunk-NQXQI7SA.js.map} +0 -0
- /package/dist/{chunk-3XNQKM2D.js.map → chunk-OBAIINAG.js.map} +0 -0
- /package/dist/{chunk-UBHTXZWS.js.map → chunk-OJKUPTS6.js.map} +0 -0
- /package/dist/{chunk-S2C6VOUJ.js.map → chunk-ONKMQT55.js.map} +0 -0
- /package/dist/{chunk-ZUO2WVSN.js.map → chunk-OZQ7HC6E.js.map} +0 -0
- /package/dist/{chunk-2RVLHSYV.js.map → chunk-P56G5URI.js.map} +0 -0
- /package/dist/{chunk-LZF26HB6.js.map → chunk-R6M4UPAP.js.map} +0 -0
- /package/dist/{chunk-EIDH56XO.js.map → chunk-ROINL4AD.js.map} +0 -0
- /package/dist/{chunk-RX44WEW6.js.map → chunk-RPJ6QLNG.js.map} +0 -0
- /package/dist/{chunk-RK632STC.js.map → chunk-SW7XEZSP.js.map} +0 -0
- /package/dist/{chunk-YLBHOAH5.js.map → chunk-SWXU6RIW.js.map} +0 -0
- /package/dist/{chunk-YL3I4UMA.js.map → chunk-TLB3MT66.js.map} +0 -0
- /package/dist/{chunk-XJPWKT2J.js.map → chunk-URGXFUYM.js.map} +0 -0
- /package/dist/{chunk-36EB4LRH.js.map → chunk-V63T5THG.js.map} +0 -0
- /package/dist/{chunk-D5HJCIRL.js.map → chunk-VHVK63XA.js.map} +0 -0
- /package/dist/{chunk-2T3VTZXW.js.map → chunk-VTQN4OFN.js.map} +0 -0
- /package/dist/{chunk-2BLHJLZO.js.map → chunk-VYC4H34V.js.map} +0 -0
- /package/dist/{chunk-6XQWKKL5.js.map → chunk-WOL4GXHM.js.map} +0 -0
- /package/dist/{chunk-OUQEXLFQ.js.map → chunk-XD4ERIC5.js.map} +0 -0
- /package/dist/{chunk-QL4NKKTA.js.map → chunk-XF3VAJAR.js.map} +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TreeTraceTable
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-OZQ7HC6E.js";
|
|
4
4
|
import {
|
|
5
5
|
TraceDetail
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-ROINL4AD.js";
|
|
7
|
+
import "../../chunk-TLB3MT66.js";
|
|
8
|
+
import "../../chunk-DYXED7QQ.js";
|
|
9
9
|
import "../../chunk-UM5J477V.js";
|
|
10
10
|
import "../../chunk-4WLXG7ZY.js";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-URGXFUYM.js";
|
|
12
|
+
import "../../chunk-BVUDZX7G.js";
|
|
13
13
|
import "../../chunk-NWVSTRCG.js";
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
18
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-RPJ6QLNG.js";
|
|
15
|
+
import "../../chunk-NQXQI7SA.js";
|
|
16
|
+
import "../../chunk-I2P6ZCOL.js";
|
|
17
|
+
import "../../chunk-FDTENXEV.js";
|
|
18
|
+
import "../../chunk-7XTWMLAL.js";
|
|
19
19
|
import "../../chunk-GPHUCEN2.js";
|
|
20
20
|
import "../../chunk-JVCFVNGV.js";
|
|
21
|
-
import "../../chunk-
|
|
22
|
-
import "../../chunk-
|
|
23
|
-
import "../../chunk-
|
|
24
|
-
import "../../chunk-
|
|
25
|
-
import "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
21
|
+
import "../../chunk-SWXU6RIW.js";
|
|
22
|
+
import "../../chunk-IZPVE2KL.js";
|
|
23
|
+
import "../../chunk-P56G5URI.js";
|
|
24
|
+
import "../../chunk-OJKUPTS6.js";
|
|
25
|
+
import "../../chunk-SW7XEZSP.js";
|
|
26
|
+
import "../../chunk-XF3VAJAR.js";
|
|
27
27
|
import "../../chunk-GZMSESHY.js";
|
|
28
28
|
import "../../chunk-XI5WO2NW.js";
|
|
29
29
|
import "../../chunk-XCLT7DP4.js";
|
|
@@ -31,31 +31,34 @@ import "../../chunk-O6NJ56NA.js";
|
|
|
31
31
|
import "../../chunk-XCKMXAL2.js";
|
|
32
32
|
import "../../chunk-TPUZ46LY.js";
|
|
33
33
|
import "../../chunk-X35GBAUQ.js";
|
|
34
|
-
import "../../chunk-
|
|
35
|
-
import "../../chunk-
|
|
36
|
-
import "../../chunk-
|
|
37
|
-
import "../../chunk-
|
|
34
|
+
import "../../chunk-WOL4GXHM.js";
|
|
35
|
+
import "../../chunk-SBFEY7I7.js";
|
|
36
|
+
import "../../chunk-6A3FV7ST.js";
|
|
37
|
+
import "../../chunk-KTHEE74W.js";
|
|
38
|
+
import "../../chunk-IGKHPUYH.js";
|
|
38
39
|
import "../../chunk-2ZR25NMU.js";
|
|
39
40
|
import "../../chunk-CGDNDBBP.js";
|
|
40
41
|
import "../../chunk-S6O6Q2GQ.js";
|
|
41
42
|
import "../../chunk-LBAEFEJU.js";
|
|
42
43
|
import "../../chunk-5TGK2EA2.js";
|
|
43
44
|
import "../../chunk-ADNS57X5.js";
|
|
44
|
-
import "../../chunk-
|
|
45
|
-
import "../../chunk-
|
|
46
|
-
import "../../chunk-
|
|
45
|
+
import "../../chunk-6CSKHPNW.js";
|
|
46
|
+
import "../../chunk-VTQN4OFN.js";
|
|
47
|
+
import "../../chunk-ESZKQ6TN.js";
|
|
47
48
|
import "../../chunk-PRKOG6DK.js";
|
|
48
|
-
import "../../chunk-
|
|
49
|
-
import "../../chunk-
|
|
49
|
+
import "../../chunk-2PHHS2RO.js";
|
|
50
|
+
import "../../chunk-6B2K5TEW.js";
|
|
50
51
|
import "../../chunk-TOKKKTFG.js";
|
|
51
|
-
import "../../chunk-
|
|
52
|
+
import "../../chunk-KEXEB4J3.js";
|
|
53
|
+
import "../../chunk-ATKGS22K.js";
|
|
52
54
|
import "../../chunk-BMO4IZHV.js";
|
|
53
55
|
import "../../chunk-LRCAKRPK.js";
|
|
54
|
-
import "../../chunk-
|
|
56
|
+
import "../../chunk-DG5UBEHF.js";
|
|
55
57
|
import "../../chunk-HHJWVVJC.js";
|
|
56
|
-
import "../../chunk-
|
|
58
|
+
import "../../chunk-A66ETOJQ.js";
|
|
57
59
|
import "../../chunk-ON5OBLMV.js";
|
|
58
60
|
import "../../chunk-YEINMVAR.js";
|
|
61
|
+
import "../../chunk-X6IIYPI2.js";
|
|
59
62
|
import "../../chunk-L4AFJGXJ.js";
|
|
60
63
|
import "../../chunk-WQG2LZMB.js";
|
|
61
64
|
export {
|
package/dist/utils/address.js
CHANGED
|
@@ -23,11 +23,12 @@ import {
|
|
|
23
23
|
isSimplyZeroAddress,
|
|
24
24
|
isSpecialAddress,
|
|
25
25
|
isZeroAddress
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-2PHHS2RO.js";
|
|
27
27
|
import "../chunk-HHJWVVJC.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-A66ETOJQ.js";
|
|
29
29
|
import "../chunk-ON5OBLMV.js";
|
|
30
30
|
import "../chunk-YEINMVAR.js";
|
|
31
|
+
import "../chunk-X6IIYPI2.js";
|
|
31
32
|
import "../chunk-L4AFJGXJ.js";
|
|
32
33
|
import "../chunk-WQG2LZMB.js";
|
|
33
34
|
export {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseString
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-DG5UBEHF.js";
|
|
4
4
|
import "../chunk-HHJWVVJC.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-A66ETOJQ.js";
|
|
6
6
|
import "../chunk-ON5OBLMV.js";
|
|
7
7
|
import "../chunk-YEINMVAR.js";
|
|
8
|
+
import "../chunk-X6IIYPI2.js";
|
|
8
9
|
import "../chunk-L4AFJGXJ.js";
|
|
9
10
|
import "../chunk-WQG2LZMB.js";
|
|
10
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/contractManagerTool.ts"],"sourcesContent":["import SDK from 'js-conflux-sdk';\nimport { gzip } from 'pako';\nimport { parseString } from './index';\n\ntype AnyFunction = (...args: any[]) => any;\n\n// fix js-conflux-sdk types\nconst SDKFormat: (\n schema: Record<string, unknown> | Record<string, unknown>[],\n options?: {\n pick?: boolean;\n strict?: boolean;\n },\n) => AnyFunction = SDK.format;\nconst SDKContract: new (\n {\n abi,\n address,\n bytecode,\n decodeByteToHex,\n }: {\n abi: any[];\n address?: string;\n bytecode?: string;\n decodeByteToHex?: boolean;\n },\n conflux?: any,\n) => SDK.Contract = SDK.Contract;\n\nconst zipContractAndToken = SDKFormat(\n {\n address: SDK.format.hexAddress, // cip-37\n name: SDK.format.bytes.$before(parseString).$or(undefined),\n website: SDK.format.bytes.$before(parseString).$or(undefined),\n abi: SDK.format.bytes\n .$before(parseString)\n .$parse(JSON.stringify, Array.isArray)\n .$after(gzip)\n .$or(undefined),\n sourceCode: SDK.format.bytes\n .$before(parseString)\n .$after(gzip)\n .$or(undefined),\n optimizeRuns: SDK.format.uInt.$after(String).$or(undefined),\n icon: SDK.format.bytes.$before(parseString).$after(gzip).$or(undefined),\n tokenIcon: SDK.format.bytes\n .$before(parseString)\n .$after(gzip)\n .$or(undefined),\n tokenWebsite: SDK.format.bytes.$before(parseString).$or(undefined),\n ipfsGateway: SDK.format.bytes.$before(parseString).$or(undefined),\n },\n { pick: true, strict: true },\n);\n\nconst formatAnnounceArray = SDKFormat([\n {\n key: SDK.format.bytes.$before(parseString),\n value: SDK.format.bytes.$before(parseString),\n },\n]);\n\nconst announcement = new SDKContract({\n abi: [\n {\n type: 'function',\n name: 'announce',\n inputs: [\n {\n type: 'tuple[]',\n components: [\n { name: 'key', type: 'bytes' },\n { name: 'value', type: 'bytes' },\n ],\n },\n ],\n outputs: [{ name: 'count', type: 'uint256' }],\n },\n ],\n});\n\nfunction chunk(array: { key: string; value: string }[], maxSize = 150 * 1000) {\n const groupArray: { key: string; value: string }[][] = [];\n\n let group: { key: string; value: string }[] = [];\n let groupSize = 0;\n array.forEach(({ key, value }) => {\n const size = key.length + value.length;\n if (size > maxSize) {\n throw new Error(\n `key \"${key}\" and data size ${size} > maximum bytes ${maxSize}`,\n );\n }\n\n if (groupSize + size > maxSize) {\n groupArray.push(group);\n group = [];\n groupSize = 0;\n }\n\n group.push({ key, value });\n groupSize += size;\n });\n groupArray.push(group);\n\n return groupArray;\n}\n/**\n * Format, zip, split and encode contract&token register information as Announcement transaction data\n *\n * @param options {object}\n * @param options.address {string} - contract address hex\n * @param [options.name] {string} - contract name\n * @param [options.website] {string}\n * @param [options.abi] {object} - contract abi json or array object (will be gzip)\n * @param [options.sourceCode] {string} - contract source code (will be gzip)\n * @param [options.optimizeRuns] {number} - contract code compile optimize runs times\n * @param [options.icon] {Buffer} - contract icon bytes (will be gzip)\n * @param [options.tokenIcon] {Buffer} - token icon bytes (will be gzip)\n * @param [options.tokenWebsite] {string}\n * @param [options.ipfsGateway] {string}\n * @return {string[]} encoded transaction data, spilt by max transaction size\n *\n * @example\n * > packContractAndToken({\n address: '0x01234567890123456789012345678901A3456789',\n name: 'MiniERC20',\n abi: [\n {\n type: 'function',\n name: 'decimals',\n inputs: [],\n outputs: [{ type: 'uint8' }],\n },\n ],\n optimizeRuns: 10,\n icon: Buffer.from([1, 2, 3, 4, 5]),\n tokenIcon: Buffer.from([1, 2, 3, 4, 5]),\n })\n [\n '0xcf7bb3090000...'\n ]\n */\nexport function packContractAndToken(options: {\n address: string;\n name?: string;\n website?: string;\n abi?: object;\n sourceCode?: string;\n optimizeRuns?: number;\n icon?: string;\n tokenIcon?: string;\n tokenWebsite?: string;\n ipfsGateway?: string;\n}): string[] {\n const { address, tokenIcon, tokenWebsite, ipfsGateway, ...object } =\n zipContractAndToken(options);\n const array = [{ key: `contract/list/${address}`, value: address }];\n Object.entries(object).forEach(([field, value]) => {\n array.push({ key: `contract/${address}/${field}`, value });\n });\n // push token info\n array.push({ key: `token/list/${address}`, value: address });\n array.push({ key: `token/${address}/icon`, value: tokenIcon });\n array.push({ key: `token/${address}/website`, value: tokenWebsite });\n array.push({ key: `token/${address}/ipfsGateway`, value: ipfsGateway });\n\n const announceArray = formatAnnounceArray(array);\n return chunk(announceArray).map(\n group => (announcement as any).announce(group).data,\n );\n}\n\nconst zipContractABI = SDKFormat(\n {\n abi: SDK.format.bytes\n .$before(parseString)\n .$parse(JSON.stringify, Array.isArray),\n },\n { pick: true, strict: true },\n);\n\n/**\n * Format, zip, split and encode contract abi as Announcement transaction data\n *\n * @param options {object}\n * @param options.abi {string[]} - contract abi array object\n * @return {string[]} encoded transaction data, spilt by max transaction size\n *\n * @example\n * > packContractAbi({\n abi: [\"function transfer(address, uint256)\", \"event Transfer(address indexed from, address indexed to, address value)\"],\n })\n [\n '0xcf7bb3090000...'\n ]\n */\nexport function packContractABI(options: { abi?: string[] }): string[] {\n const { abi } = zipContractABI(options);\n const array = [{ key: `contract/abi`, value: abi }];\n const announceArray = formatAnnounceArray(array);\n return chunk(announceArray).map(\n group => (announcement as any).announce(group).data,\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/utils/contractManagerTool.ts"],"sourcesContent":["import SDK from 'js-conflux-sdk';\nimport { gzip } from 'pako';\nimport { parseString } from './index';\n\ntype AnyFunction = (...args: any[]) => any;\n\n// fix js-conflux-sdk types\nconst SDKFormat: (\n schema: Record<string, unknown> | Record<string, unknown>[],\n options?: {\n pick?: boolean;\n strict?: boolean;\n },\n) => AnyFunction = SDK.format;\nconst SDKContract: new (\n {\n abi,\n address,\n bytecode,\n decodeByteToHex,\n }: {\n abi: any[];\n address?: string;\n bytecode?: string;\n decodeByteToHex?: boolean;\n },\n conflux?: any,\n) => SDK.Contract = SDK.Contract;\n\nconst zipContractAndToken = SDKFormat(\n {\n address: SDK.format.hexAddress, // cip-37\n name: SDK.format.bytes.$before(parseString).$or(undefined),\n website: SDK.format.bytes.$before(parseString).$or(undefined),\n abi: SDK.format.bytes\n .$before(parseString)\n .$parse(JSON.stringify, Array.isArray)\n .$after(gzip)\n .$or(undefined),\n sourceCode: SDK.format.bytes\n .$before(parseString)\n .$after(gzip)\n .$or(undefined),\n optimizeRuns: SDK.format.uInt.$after(String).$or(undefined),\n icon: SDK.format.bytes.$before(parseString).$after(gzip).$or(undefined),\n tokenIcon: SDK.format.bytes\n .$before(parseString)\n .$after(gzip)\n .$or(undefined),\n tokenWebsite: SDK.format.bytes.$before(parseString).$or(undefined),\n ipfsGateway: SDK.format.bytes.$before(parseString).$or(undefined),\n },\n { pick: true, strict: true },\n);\n\nconst formatAnnounceArray = SDKFormat([\n {\n key: SDK.format.bytes.$before(parseString),\n value: SDK.format.bytes.$before(parseString),\n },\n]);\n\nconst announcement = new SDKContract({\n abi: [\n {\n type: 'function',\n name: 'announce',\n inputs: [\n {\n type: 'tuple[]',\n components: [\n { name: 'key', type: 'bytes' },\n { name: 'value', type: 'bytes' },\n ],\n },\n ],\n outputs: [{ name: 'count', type: 'uint256' }],\n },\n ],\n});\n\nfunction chunk(array: { key: string; value: string }[], maxSize = 150 * 1000) {\n const groupArray: { key: string; value: string }[][] = [];\n\n let group: { key: string; value: string }[] = [];\n let groupSize = 0;\n array.forEach(({ key, value }) => {\n const size = key.length + value.length;\n if (size > maxSize) {\n throw new Error(\n `key \"${key}\" and data size ${size} > maximum bytes ${maxSize}`,\n );\n }\n\n if (groupSize + size > maxSize) {\n groupArray.push(group);\n group = [];\n groupSize = 0;\n }\n\n group.push({ key, value });\n groupSize += size;\n });\n groupArray.push(group);\n\n return groupArray;\n}\n/**\n * Format, zip, split and encode contract&token register information as Announcement transaction data\n *\n * @param options {object}\n * @param options.address {string} - contract address hex\n * @param [options.name] {string} - contract name\n * @param [options.website] {string}\n * @param [options.abi] {object} - contract abi json or array object (will be gzip)\n * @param [options.sourceCode] {string} - contract source code (will be gzip)\n * @param [options.optimizeRuns] {number} - contract code compile optimize runs times\n * @param [options.icon] {Buffer} - contract icon bytes (will be gzip)\n * @param [options.tokenIcon] {Buffer} - token icon bytes (will be gzip)\n * @param [options.tokenWebsite] {string}\n * @param [options.ipfsGateway] {string}\n * @return {string[]} encoded transaction data, spilt by max transaction size\n *\n * @example\n * > packContractAndToken({\n address: '0x01234567890123456789012345678901A3456789',\n name: 'MiniERC20',\n abi: [\n {\n type: 'function',\n name: 'decimals',\n inputs: [],\n outputs: [{ type: 'uint8' }],\n },\n ],\n optimizeRuns: 10,\n icon: Buffer.from([1, 2, 3, 4, 5]),\n tokenIcon: Buffer.from([1, 2, 3, 4, 5]),\n })\n [\n '0xcf7bb3090000...'\n ]\n */\nexport function packContractAndToken(options: {\n address: string;\n name?: string;\n website?: string;\n abi?: object;\n sourceCode?: string;\n optimizeRuns?: number;\n icon?: string;\n tokenIcon?: string;\n tokenWebsite?: string;\n ipfsGateway?: string;\n}): string[] {\n const { address, tokenIcon, tokenWebsite, ipfsGateway, ...object } =\n zipContractAndToken(options);\n const array = [{ key: `contract/list/${address}`, value: address }];\n Object.entries(object).forEach(([field, value]) => {\n array.push({ key: `contract/${address}/${field}`, value });\n });\n // push token info\n array.push({ key: `token/list/${address}`, value: address });\n array.push({ key: `token/${address}/icon`, value: tokenIcon });\n array.push({ key: `token/${address}/website`, value: tokenWebsite });\n array.push({ key: `token/${address}/ipfsGateway`, value: ipfsGateway });\n\n const announceArray = formatAnnounceArray(array);\n return chunk(announceArray).map(\n group => (announcement as any).announce(group).data,\n );\n}\n\nconst zipContractABI = SDKFormat(\n {\n abi: SDK.format.bytes\n .$before(parseString)\n .$parse(JSON.stringify, Array.isArray),\n },\n { pick: true, strict: true },\n);\n\n/**\n * Format, zip, split and encode contract abi as Announcement transaction data\n *\n * @param options {object}\n * @param options.abi {string[]} - contract abi array object\n * @return {string[]} encoded transaction data, spilt by max transaction size\n *\n * @example\n * > packContractAbi({\n abi: [\"function transfer(address, uint256)\", \"event Transfer(address indexed from, address indexed to, address value)\"],\n })\n [\n '0xcf7bb3090000...'\n ]\n */\nexport function packContractABI(options: { abi?: string[] }): string[] {\n const { abi } = zipContractABI(options);\n const array = [{ key: `contract/abi`, value: abi }];\n const announceArray = formatAnnounceArray(array);\n return chunk(announceArray).map(\n group => (announcement as any).announce(group).data,\n );\n}\n"],"mappings":"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","names":[]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAbiItemById
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-IGKHPUYH.js";
|
|
4
|
+
import "../../chunk-A66ETOJQ.js";
|
|
5
5
|
import "../../chunk-ON5OBLMV.js";
|
|
6
6
|
import "../../chunk-YEINMVAR.js";
|
|
7
|
+
import "../../chunk-X6IIYPI2.js";
|
|
7
8
|
import "../../chunk-L4AFJGXJ.js";
|
|
8
9
|
import "../../chunk-WQG2LZMB.js";
|
|
9
10
|
export {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAddressLabel
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-OJKUPTS6.js";
|
|
4
|
+
import "../../chunk-2PHHS2RO.js";
|
|
5
5
|
import "../../chunk-HHJWVVJC.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-A66ETOJQ.js";
|
|
7
7
|
import "../../chunk-ON5OBLMV.js";
|
|
8
8
|
import "../../chunk-YEINMVAR.js";
|
|
9
|
+
import "../../chunk-X6IIYPI2.js";
|
|
9
10
|
import "../../chunk-L4AFJGXJ.js";
|
|
10
11
|
import "../../chunk-WQG2LZMB.js";
|
|
11
12
|
export {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
transformNameMapKeysToLowerCase,
|
|
3
3
|
useAddressNameMap
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-XF3VAJAR.js";
|
|
5
|
+
import "../../chunk-A66ETOJQ.js";
|
|
6
6
|
import "../../chunk-ON5OBLMV.js";
|
|
7
7
|
import "../../chunk-YEINMVAR.js";
|
|
8
|
+
import "../../chunk-X6IIYPI2.js";
|
|
8
9
|
import "../../chunk-L4AFJGXJ.js";
|
|
9
10
|
import "../../chunk-WQG2LZMB.js";
|
|
10
11
|
export {
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useSearchParams
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-6R34R4GT.js";
|
|
4
4
|
import {
|
|
5
5
|
isAddressEqual
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-2PHHS2RO.js";
|
|
7
7
|
import "../../chunk-HHJWVVJC.js";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-A66ETOJQ.js";
|
|
9
9
|
import "../../chunk-ON5OBLMV.js";
|
|
10
10
|
import "../../chunk-YEINMVAR.js";
|
|
11
|
+
import {
|
|
12
|
+
query_string_default
|
|
13
|
+
} from "../../chunk-X6IIYPI2.js";
|
|
11
14
|
import "../../chunk-L4AFJGXJ.js";
|
|
12
15
|
import "../../chunk-WQG2LZMB.js";
|
|
13
16
|
|
|
14
17
|
// src/utils/hooks/useAutoSetHolderFilterParams.ts
|
|
15
18
|
import { useEffect, useState } from "react";
|
|
16
19
|
import { useLocation, useHistory } from "react-router-dom";
|
|
17
|
-
import qs from "query-string";
|
|
18
20
|
var useAutoSetHolderFilterParams = (keys) => {
|
|
19
21
|
const [inHolderFilter, setInHolderFilter] = useState(false);
|
|
20
22
|
const history = useHistory();
|
|
@@ -36,7 +38,7 @@ var useAutoSetHolderFilterParams = (keys) => {
|
|
|
36
38
|
);
|
|
37
39
|
setInHolderFilter(true);
|
|
38
40
|
history.replace(
|
|
39
|
-
|
|
41
|
+
query_string_default.stringifyUrl({
|
|
40
42
|
url: pathname,
|
|
41
43
|
query: {
|
|
42
44
|
...query,
|
|
@@ -56,7 +58,7 @@ var useAutoSetHolderFilterParams = (keys) => {
|
|
|
56
58
|
})) {
|
|
57
59
|
setInHolderFilter(false);
|
|
58
60
|
history.replace(
|
|
59
|
-
|
|
61
|
+
query_string_default.stringifyUrl({
|
|
60
62
|
url: pathname,
|
|
61
63
|
query: {
|
|
62
64
|
...query
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/hooks/useAutoSetHolderFilterParams.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { useLocation, useHistory } from 'react-router-dom';\nimport qs from 'query-string';\nimport { useSearchParams } from './useSearchParams';\nimport { isAddressEqual } from '../address';\n\nexport const useAutoSetHolderFilterParams = (keys: string[]) => {\n const [inHolderFilter, setInHolderFilter] = useState(false);\n const history = useHistory();\n const { pathname } = useLocation();\n const { a: holder, ...query } = useSearchParams() as Record<string, string>;\n // enter holder filter\n useEffect(() => {\n if (\n holder &&\n keys.every(key => {\n const value = query[key];\n return (\n !value ||\n isAddressEqual(value, holder, {\n isAddress: () => true,\n })\n );\n })\n ) {\n const newParams = keys.reduce(\n (prev, curr) => {\n prev[curr] = holder;\n return prev;\n },\n {} as Record<string, string>,\n );\n setInHolderFilter(true);\n history.replace(\n qs.stringifyUrl({\n url: pathname,\n query: {\n ...query,\n a: holder,\n ...newParams,\n },\n }),\n );\n }\n }, [holder]);\n\n // exit holder filter if holder is not equal to query[key]\n useEffect(() => {\n if (\n holder &&\n inHolderFilter &&\n keys.some(key => {\n const value = query[key];\n return (\n !value ||\n !isAddressEqual(value, holder, {\n isAddress: () => true,\n })\n );\n })\n ) {\n setInHolderFilter(false);\n history.replace(\n qs.stringifyUrl({\n url: pathname,\n query: {\n ...query,\n },\n }),\n );\n }\n }, [holder, history, pathname, query, inHolderFilter]);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/hooks/useAutoSetHolderFilterParams.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { useLocation, useHistory } from 'react-router-dom';\nimport qs from 'query-string';\nimport { useSearchParams } from './useSearchParams';\nimport { isAddressEqual } from '../address';\n\nexport const useAutoSetHolderFilterParams = (keys: string[]) => {\n const [inHolderFilter, setInHolderFilter] = useState(false);\n const history = useHistory();\n const { pathname } = useLocation();\n const { a: holder, ...query } = useSearchParams() as Record<string, string>;\n // enter holder filter\n useEffect(() => {\n if (\n holder &&\n keys.every(key => {\n const value = query[key];\n return (\n !value ||\n isAddressEqual(value, holder, {\n isAddress: () => true,\n })\n );\n })\n ) {\n const newParams = keys.reduce(\n (prev, curr) => {\n prev[curr] = holder;\n return prev;\n },\n {} as Record<string, string>,\n );\n setInHolderFilter(true);\n history.replace(\n qs.stringifyUrl({\n url: pathname,\n query: {\n ...query,\n a: holder,\n ...newParams,\n },\n }),\n );\n }\n }, [holder]);\n\n // exit holder filter if holder is not equal to query[key]\n useEffect(() => {\n if (\n holder &&\n inHolderFilter &&\n keys.some(key => {\n const value = query[key];\n return (\n !value ||\n !isAddressEqual(value, holder, {\n isAddress: () => true,\n })\n );\n })\n ) {\n setInHolderFilter(false);\n history.replace(\n qs.stringifyUrl({\n url: pathname,\n query: {\n ...query,\n },\n }),\n );\n }\n }, [holder, history, pathname, query, inHolderFilter]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,WAAW,gBAAgB;AACpC,SAAS,aAAa,kBAAkB;AAKjC,IAAM,+BAA+B,CAAC,SAAmB;AAC9D,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,KAAK;AAC1D,QAAM,UAAU,WAAW;AAC3B,QAAM,EAAE,SAAS,IAAI,YAAY;AACjC,QAAM,EAAE,GAAG,QAAQ,GAAG,MAAM,IAAI,gBAAgB;AAEhD,YAAU,MAAM;AACd,QACE,UACA,KAAK,MAAM,SAAO;AAChB,YAAM,QAAQ,MAAM,GAAG;AACvB,aACE,CAAC,SACD,eAAe,OAAO,QAAQ;AAAA,QAC5B,WAAW,MAAM;AAAA,MACnB,CAAC;AAAA,IAEL,CAAC,GACD;AACA,YAAM,YAAY,KAAK;AAAA,QACrB,CAAC,MAAM,SAAS;AACd,eAAK,IAAI,IAAI;AACb,iBAAO;AAAA,QACT;AAAA,QACA,CAAC;AAAA,MACH;AACA,wBAAkB,IAAI;AACtB,cAAQ;AAAA,QACN,qBAAG,aAAa;AAAA,UACd,KAAK;AAAA,UACL,OAAO;AAAA,YACL,GAAG;AAAA,YACH,GAAG;AAAA,YACH,GAAG;AAAA,UACL;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAGX,YAAU,MAAM;AACd,QACE,UACA,kBACA,KAAK,KAAK,SAAO;AACf,YAAM,QAAQ,MAAM,GAAG;AACvB,aACE,CAAC,SACD,CAAC,eAAe,OAAO,QAAQ;AAAA,QAC7B,WAAW,MAAM;AAAA,MACnB,CAAC;AAAA,IAEL,CAAC,GACD;AACA,wBAAkB,KAAK;AACvB,cAAQ;AAAA,QACN,qBAAG,aAAa;AAAA,UACd,KAAK;AAAA,UACL,OAAO;AAAA,YACL,GAAG;AAAA,UACL;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,SAAS,UAAU,OAAO,cAAc,CAAC;AACvD;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useContractDetail
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-KTHEE74W.js";
|
|
4
|
+
import "../../chunk-A66ETOJQ.js";
|
|
5
5
|
import "../../chunk-ON5OBLMV.js";
|
|
6
6
|
import "../../chunk-YEINMVAR.js";
|
|
7
|
+
import "../../chunk-X6IIYPI2.js";
|
|
7
8
|
import "../../chunk-L4AFJGXJ.js";
|
|
8
9
|
import "../../chunk-WQG2LZMB.js";
|
|
9
10
|
export {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
reqContractsStatistics,
|
|
3
3
|
reqVerifiedContractsStatistics
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-A66ETOJQ.js";
|
|
5
5
|
import "../../chunk-ON5OBLMV.js";
|
|
6
6
|
import "../../chunk-YEINMVAR.js";
|
|
7
|
+
import "../../chunk-X6IIYPI2.js";
|
|
7
8
|
import "../../chunk-L4AFJGXJ.js";
|
|
8
9
|
import "../../chunk-WQG2LZMB.js";
|
|
9
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/hooks/useContractsStatistics.ts"],"sourcesContent":["import useSWR from 'swr';\nimport {\n reqContractsStatistics,\n reqVerifiedContractsStatistics,\n} from '../request';\nimport { useMemo } from 'react';\n\nexport const useContractsStatistics = () => {\n const { data: contractsStatistics, isLoading: contractsStatisticsLoading } =\n useSWR('contracts-statistics', () =>\n reqContractsStatistics({ limit: '2' }),\n );\n const {\n data: verifiedContractsStatistics,\n isLoading: verifiedContractsStatisticsLoading,\n } = useSWR('verified-contracts-statistics', () =>\n reqVerifiedContractsStatistics({ limit: '2' }),\n );\n return useMemo(() => {\n const [todayContracts, yesterdayContracts] =\n contractsStatistics?.list ?? [];\n const [todayVerifiedContracts, yesterdayVerifiedContracts] =\n verifiedContractsStatistics?.list ?? [];\n return [\n {\n totalContractsDeployed: todayContracts?.total,\n newContractsDeployed: yesterdayContracts?.count,\n totalContractsVerified: todayVerifiedContracts?.total,\n newContractsVerified: yesterdayVerifiedContracts?.count,\n },\n contractsStatisticsLoading || verifiedContractsStatisticsLoading,\n ] as const;\n }, [\n contractsStatistics,\n contractsStatisticsLoading,\n verifiedContractsStatistics,\n verifiedContractsStatisticsLoading,\n ]);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/hooks/useContractsStatistics.ts"],"sourcesContent":["import useSWR from 'swr';\nimport {\n reqContractsStatistics,\n reqVerifiedContractsStatistics,\n} from '../request';\nimport { useMemo } from 'react';\n\nexport const useContractsStatistics = () => {\n const { data: contractsStatistics, isLoading: contractsStatisticsLoading } =\n useSWR('contracts-statistics', () =>\n reqContractsStatistics({ limit: '2' }),\n );\n const {\n data: verifiedContractsStatistics,\n isLoading: verifiedContractsStatisticsLoading,\n } = useSWR('verified-contracts-statistics', () =>\n reqVerifiedContractsStatistics({ limit: '2' }),\n );\n return useMemo(() => {\n const [todayContracts, yesterdayContracts] =\n contractsStatistics?.list ?? [];\n const [todayVerifiedContracts, yesterdayVerifiedContracts] =\n verifiedContractsStatistics?.list ?? [];\n return [\n {\n totalContractsDeployed: todayContracts?.total,\n newContractsDeployed: yesterdayContracts?.count,\n totalContractsVerified: todayVerifiedContracts?.total,\n newContractsVerified: yesterdayVerifiedContracts?.count,\n },\n contractsStatisticsLoading || verifiedContractsStatisticsLoading,\n ] as const;\n }, [\n contractsStatistics,\n contractsStatisticsLoading,\n verifiedContractsStatistics,\n verifiedContractsStatisticsLoading,\n ]);\n};\n"],"mappings":";;;;;;;;;;;AAAA,OAAO,YAAY;AAKnB,SAAS,eAAe;AAEjB,IAAM,yBAAyB,MAAM;AAC1C,QAAM,EAAE,MAAM,qBAAqB,WAAW,2BAA2B,IACvE;AAAA,IAAO;AAAA,IAAwB,MAC7B,uBAAuB,EAAE,OAAO,IAAI,CAAC;AAAA,EACvC;AACF,QAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA,EACb,IAAI;AAAA,IAAO;AAAA,IAAiC,MAC1C,+BAA+B,EAAE,OAAO,IAAI,CAAC;AAAA,EAC/C;AACA,SAAO,QAAQ,MAAM;AACnB,UAAM,CAAC,gBAAgB,kBAAkB,IACvC,qBAAqB,QAAQ,CAAC;AAChC,UAAM,CAAC,wBAAwB,0BAA0B,IACvD,6BAA6B,QAAQ,CAAC;AACxC,WAAO;AAAA,MACL;AAAA,QACE,wBAAwB,gBAAgB;AAAA,QACxC,sBAAsB,oBAAoB;AAAA,QAC1C,wBAAwB,wBAAwB;AAAA,QAChD,sBAAsB,4BAA4B;AAAA,MACpD;AAAA,MACA,8BAA8B;AAAA,IAChC;AAAA,EACF,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDecodeFunctionData
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-TLB3MT66.js";
|
|
4
|
+
import "../../chunk-DYXED7QQ.js";
|
|
5
|
+
import "../../chunk-SBFEY7I7.js";
|
|
6
|
+
import "../../chunk-6A3FV7ST.js";
|
|
7
|
+
import "../../chunk-KTHEE74W.js";
|
|
7
8
|
import "../../chunk-2ZR25NMU.js";
|
|
8
9
|
import "../../chunk-CGDNDBBP.js";
|
|
9
10
|
import "../../chunk-S6O6Q2GQ.js";
|
|
10
11
|
import "../../chunk-LBAEFEJU.js";
|
|
11
12
|
import "../../chunk-5TGK2EA2.js";
|
|
12
13
|
import "../../chunk-ADNS57X5.js";
|
|
13
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-DG5UBEHF.js";
|
|
14
15
|
import "../../chunk-HHJWVVJC.js";
|
|
15
|
-
import "../../chunk-
|
|
16
|
+
import "../../chunk-A66ETOJQ.js";
|
|
16
17
|
import "../../chunk-ON5OBLMV.js";
|
|
17
18
|
import "../../chunk-YEINMVAR.js";
|
|
19
|
+
import "../../chunk-X6IIYPI2.js";
|
|
18
20
|
import "../../chunk-L4AFJGXJ.js";
|
|
19
21
|
import "../../chunk-WQG2LZMB.js";
|
|
20
22
|
export {
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDecodeFunctionError
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-WOL4GXHM.js";
|
|
4
|
+
import "../../chunk-SBFEY7I7.js";
|
|
5
|
+
import "../../chunk-6A3FV7ST.js";
|
|
6
|
+
import "../../chunk-KTHEE74W.js";
|
|
7
|
+
import "../../chunk-IGKHPUYH.js";
|
|
7
8
|
import "../../chunk-2ZR25NMU.js";
|
|
8
9
|
import "../../chunk-CGDNDBBP.js";
|
|
9
10
|
import "../../chunk-S6O6Q2GQ.js";
|
|
10
11
|
import "../../chunk-LBAEFEJU.js";
|
|
11
12
|
import "../../chunk-5TGK2EA2.js";
|
|
12
13
|
import "../../chunk-ADNS57X5.js";
|
|
13
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-DG5UBEHF.js";
|
|
14
15
|
import "../../chunk-HHJWVVJC.js";
|
|
15
|
-
import "../../chunk-
|
|
16
|
+
import "../../chunk-A66ETOJQ.js";
|
|
16
17
|
import "../../chunk-ON5OBLMV.js";
|
|
17
18
|
import "../../chunk-YEINMVAR.js";
|
|
19
|
+
import "../../chunk-X6IIYPI2.js";
|
|
18
20
|
import "../../chunk-L4AFJGXJ.js";
|
|
19
21
|
import "../../chunk-WQG2LZMB.js";
|
|
20
22
|
export {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useENS
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-VTQN4OFN.js";
|
|
4
|
+
import "../../chunk-2PHHS2RO.js";
|
|
5
5
|
import "../../chunk-HHJWVVJC.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-A66ETOJQ.js";
|
|
7
7
|
import "../../chunk-ON5OBLMV.js";
|
|
8
8
|
import "../../chunk-YEINMVAR.js";
|
|
9
|
+
import "../../chunk-X6IIYPI2.js";
|
|
9
10
|
import "../../chunk-L4AFJGXJ.js";
|
|
10
11
|
import "../../chunk-WQG2LZMB.js";
|
|
11
12
|
export {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
transformNameMapKeysToLowerCase,
|
|
3
3
|
useAddressNameMap
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-XF3VAJAR.js";
|
|
5
|
+
import "../../chunk-A66ETOJQ.js";
|
|
6
6
|
import "../../chunk-ON5OBLMV.js";
|
|
7
7
|
import "../../chunk-YEINMVAR.js";
|
|
8
|
+
import "../../chunk-X6IIYPI2.js";
|
|
8
9
|
import "../../chunk-L4AFJGXJ.js";
|
|
9
10
|
import "../../chunk-WQG2LZMB.js";
|
|
10
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/hooks/useEnhanceDataWithNameMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n transformNameMapKeysToLowerCase,\n useAddressNameMap,\n} from './useAddressNameMap';\nimport { AddressNameMap } from '../request.types';\n\nexport const enhanceDataWithNameMap = (\n list?: Record<string, unknown>[],\n nameMap?: Record<string, AddressNameMap>,\n) => {\n if (!nameMap || !list) return list;\n const normalizedNameMap = transformNameMapKeysToLowerCase(nameMap);\n\n return (\n list.map(item => {\n const newItem = {\n ...item,\n nameMap: normalizedNameMap,\n };\n return newItem;\n }) || []\n );\n};\n\nexport const formatListResponseWithNameMap = <\n T extends Record<string, unknown>,\n>(\n res: T,\n) => {\n return {\n ...res,\n list: enhanceDataWithNameMap(\n res.list as Record<string, unknown>[],\n res.nameMap as Record<string, AddressNameMap>,\n ),\n };\n};\n\nexport const useEnhanceDataWithNameMap = (\n list?: Record<string, unknown>[],\n {\n addressKeys,\n nameMap,\n }: {\n addressKeys?: string[];\n nameMap?: Record<string, AddressNameMap>;\n } = {},\n) => {\n const keys = useMemo(() => addressKeys?.join(',') || '', [addressKeys]);\n const addresses = useMemo(() => {\n const set = new Set<string>();\n list?.forEach(item => {\n addressKeys?.forEach(key => {\n const address = item[key];\n if (address && typeof address === 'string') {\n set.add(address);\n }\n });\n });\n return Array.from(set);\n }, [list, keys]);\n const { data: fetchedNameMap, isLoading } = useAddressNameMap(\n addresses,\n !nameMap,\n );\n const finalNameMap = nameMap || fetchedNameMap;\n return useMemo(() => {\n return {\n data: enhanceDataWithNameMap(list, finalNameMap),\n isLoading,\n };\n }, [list, finalNameMap, isLoading]);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/hooks/useEnhanceDataWithNameMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n transformNameMapKeysToLowerCase,\n useAddressNameMap,\n} from './useAddressNameMap';\nimport { AddressNameMap } from '../request.types';\n\nexport const enhanceDataWithNameMap = (\n list?: Record<string, unknown>[],\n nameMap?: Record<string, AddressNameMap>,\n) => {\n if (!nameMap || !list) return list;\n const normalizedNameMap = transformNameMapKeysToLowerCase(nameMap);\n\n return (\n list.map(item => {\n const newItem = {\n ...item,\n nameMap: normalizedNameMap,\n };\n return newItem;\n }) || []\n );\n};\n\nexport const formatListResponseWithNameMap = <\n T extends Record<string, unknown>,\n>(\n res: T,\n) => {\n return {\n ...res,\n list: enhanceDataWithNameMap(\n res.list as Record<string, unknown>[],\n res.nameMap as Record<string, AddressNameMap>,\n ),\n };\n};\n\nexport const useEnhanceDataWithNameMap = (\n list?: Record<string, unknown>[],\n {\n addressKeys,\n nameMap,\n }: {\n addressKeys?: string[];\n nameMap?: Record<string, AddressNameMap>;\n } = {},\n) => {\n const keys = useMemo(() => addressKeys?.join(',') || '', [addressKeys]);\n const addresses = useMemo(() => {\n const set = new Set<string>();\n list?.forEach(item => {\n addressKeys?.forEach(key => {\n const address = item[key];\n if (address && typeof address === 'string') {\n set.add(address);\n }\n });\n });\n return Array.from(set);\n }, [list, keys]);\n const { data: fetchedNameMap, isLoading } = useAddressNameMap(\n addresses,\n !nameMap,\n );\n const finalNameMap = nameMap || fetchedNameMap;\n return useMemo(() => {\n return {\n data: enhanceDataWithNameMap(list, finalNameMap),\n isLoading,\n };\n }, [list, finalNameMap, isLoading]);\n};\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,eAAe;AAOjB,IAAM,yBAAyB,CACpC,MACA,YACG;AACH,MAAI,CAAC,WAAW,CAAC;AAAM,WAAO;AAC9B,QAAM,oBAAoB,gCAAgC,OAAO;AAEjE,SACE,KAAK,IAAI,UAAQ;AACf,UAAM,UAAU;AAAA,MACd,GAAG;AAAA,MACH,SAAS;AAAA,IACX;AACA,WAAO;AAAA,EACT,CAAC,KAAK,CAAC;AAEX;AAEO,IAAM,gCAAgC,CAG3C,QACG;AACH,SAAO;AAAA,IACL,GAAG;AAAA,IACH,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AACF;AAEO,IAAM,4BAA4B,CACvC,MACA;AAAA,EACE;AAAA,EACA;AACF,IAGI,CAAC,MACF;AACH,QAAM,OAAO,QAAQ,MAAM,aAAa,KAAK,GAAG,KAAK,IAAI,CAAC,WAAW,CAAC;AACtE,QAAM,YAAY,QAAQ,MAAM;AAC9B,UAAM,MAAM,oBAAI,IAAY;AAC5B,UAAM,QAAQ,UAAQ;AACpB,mBAAa,QAAQ,SAAO;AAC1B,cAAM,UAAU,KAAK,GAAG;AACxB,YAAI,WAAW,OAAO,YAAY,UAAU;AAC1C,cAAI,IAAI,OAAO;AAAA,QACjB;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AACD,WAAO,MAAM,KAAK,GAAG;AAAA,EACvB,GAAG,CAAC,MAAM,IAAI,CAAC;AACf,QAAM,EAAE,MAAM,gBAAgB,UAAU,IAAI;AAAA,IAC1C;AAAA,IACA,CAAC;AAAA,EACH;AACA,QAAM,eAAe,WAAW;AAChC,SAAO,QAAQ,MAAM;AACnB,WAAO;AAAA,MACL,MAAM,uBAAuB,MAAM,YAAY;AAAA,MAC/C;AAAA,IACF;AAAA,EACF,GAAG,CAAC,MAAM,cAAc,SAAS,CAAC;AACpC;","names":[]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useMethodAbi
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-DYXED7QQ.js";
|
|
4
|
+
import "../../chunk-A66ETOJQ.js";
|
|
5
5
|
import "../../chunk-ON5OBLMV.js";
|
|
6
6
|
import "../../chunk-YEINMVAR.js";
|
|
7
|
+
import "../../chunk-X6IIYPI2.js";
|
|
7
8
|
import "../../chunk-L4AFJGXJ.js";
|
|
8
9
|
import "../../chunk-WQG2LZMB.js";
|
|
9
10
|
export {
|
|
@@ -2,6 +2,7 @@ import * as swr from 'swr';
|
|
|
2
2
|
import { ProxyType, TreeTraceForUI } from './useTxTrace.js';
|
|
3
3
|
import { AddressNameMap } from '../request.types.js';
|
|
4
4
|
import { Hex, Space } from '../types.js';
|
|
5
|
+
import { TransactionLists } from '../transactionLists.js';
|
|
5
6
|
import '../sdk.js';
|
|
6
7
|
import 'viem';
|
|
7
8
|
import 'cive/accounts';
|
|
@@ -36,7 +37,7 @@ interface SimulateTraceResponse {
|
|
|
36
37
|
methodMap?: Record<string, Record<string, string>>;
|
|
37
38
|
nameMap?: Record<string, AddressNameMap>;
|
|
38
39
|
}
|
|
39
|
-
interface SimulateTraceTxParams {
|
|
40
|
+
interface SimulateTraceTxParams extends TransactionLists {
|
|
40
41
|
from: Hex;
|
|
41
42
|
to?: Hex;
|
|
42
43
|
value?: string;
|
|
@@ -2,10 +2,13 @@ import {
|
|
|
2
2
|
isCreateCall,
|
|
3
3
|
isDelegateCall,
|
|
4
4
|
isStaticCall
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-V63T5THG.js";
|
|
6
6
|
import {
|
|
7
7
|
estimateGas
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-SBFEY7I7.js";
|
|
9
|
+
import {
|
|
10
|
+
normalizeTransactionLists
|
|
11
|
+
} from "../../chunk-6A3FV7ST.js";
|
|
9
12
|
import "../../chunk-2ZR25NMU.js";
|
|
10
13
|
import "../../chunk-CGDNDBBP.js";
|
|
11
14
|
import "../../chunk-S6O6Q2GQ.js";
|
|
@@ -14,17 +17,18 @@ import "../../chunk-5TGK2EA2.js";
|
|
|
14
17
|
import "../../chunk-ADNS57X5.js";
|
|
15
18
|
import {
|
|
16
19
|
formatAddress
|
|
17
|
-
} from "../../chunk-
|
|
20
|
+
} from "../../chunk-2PHHS2RO.js";
|
|
18
21
|
import {
|
|
19
22
|
formatABI,
|
|
20
23
|
generateRandomId
|
|
21
|
-
} from "../../chunk-
|
|
24
|
+
} from "../../chunk-DG5UBEHF.js";
|
|
22
25
|
import "../../chunk-HHJWVVJC.js";
|
|
23
26
|
import {
|
|
24
27
|
fetchWithPrefix
|
|
25
|
-
} from "../../chunk-
|
|
28
|
+
} from "../../chunk-A66ETOJQ.js";
|
|
26
29
|
import "../../chunk-ON5OBLMV.js";
|
|
27
30
|
import "../../chunk-YEINMVAR.js";
|
|
31
|
+
import "../../chunk-X6IIYPI2.js";
|
|
28
32
|
import "../../chunk-L4AFJGXJ.js";
|
|
29
33
|
import "../../chunk-WQG2LZMB.js";
|
|
30
34
|
|
|
@@ -126,7 +130,21 @@ var querySimulateTrace = async (tx, tag = "latest", params = {
|
|
|
126
130
|
}
|
|
127
131
|
}) => {
|
|
128
132
|
const url = `/traceCallView`;
|
|
129
|
-
const { space, ...
|
|
133
|
+
const { space, ...rawTx } = tx;
|
|
134
|
+
if (space !== "evm") {
|
|
135
|
+
throw new Error("Simulate trace only supports EVM Space");
|
|
136
|
+
}
|
|
137
|
+
const simulateTx = { ...rawTx, ...normalizeTransactionLists(rawTx) };
|
|
138
|
+
if (!simulateTx.maxFeePerGas && !simulateTx.gasPrice) {
|
|
139
|
+
let feeCap = 22000000000n;
|
|
140
|
+
if (simulateTx.maxPriorityFeePerGas !== void 0) {
|
|
141
|
+
const priorityFee = BigInt(simulateTx.maxPriorityFeePerGas);
|
|
142
|
+
if (priorityFee > feeCap) {
|
|
143
|
+
feeCap = priorityFee;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
simulateTx.maxFeePerGas = `0x${feeCap.toString(16)}`;
|
|
147
|
+
}
|
|
130
148
|
if (!simulateTx.gas) {
|
|
131
149
|
try {
|
|
132
150
|
const gasLimit = await estimateGas({
|
|
@@ -134,23 +152,19 @@ var querySimulateTrace = async (tx, tag = "latest", params = {
|
|
|
134
152
|
to: simulateTx.to,
|
|
135
153
|
value: simulateTx.value,
|
|
136
154
|
data: simulateTx.data,
|
|
137
|
-
space
|
|
155
|
+
space,
|
|
156
|
+
accessList: simulateTx.accessList,
|
|
157
|
+
authorizationList: simulateTx.authorizationList,
|
|
158
|
+
gasPrice: simulateTx.gasPrice,
|
|
159
|
+
maxFeePerGas: simulateTx.maxFeePerGas,
|
|
160
|
+
maxPriorityFeePerGas: simulateTx.maxPriorityFeePerGas,
|
|
161
|
+
tag
|
|
138
162
|
});
|
|
139
163
|
simulateTx.gas = `0x${gasLimit.toString(16)}`;
|
|
140
164
|
} catch (error) {
|
|
141
165
|
console.log("estimate gas failed:", error);
|
|
142
166
|
}
|
|
143
167
|
}
|
|
144
|
-
if (!simulateTx.maxFeePerGas && !simulateTx.gasPrice) {
|
|
145
|
-
let feeCap = 22000000000n;
|
|
146
|
-
if (simulateTx.maxPriorityFeePerGas !== void 0) {
|
|
147
|
-
const priorityFee = BigInt(simulateTx.maxPriorityFeePerGas);
|
|
148
|
-
if (priorityFee > feeCap) {
|
|
149
|
-
feeCap = priorityFee;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
simulateTx.maxFeePerGas = `0x${feeCap.toString(16)}`;
|
|
153
|
-
}
|
|
154
168
|
const data = JSON.stringify({
|
|
155
169
|
id: generateRandomId(),
|
|
156
170
|
jsonrpc: "2.0",
|