@cfxjs/sirius-next-common 0.2.20 → 0.2.22
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-XUKHHB5L.js → chunk-2KBVDLVC.js} +5 -5
- package/dist/{chunk-7VQL3G7K.js → chunk-2TO4UOX3.js} +8 -8
- package/dist/chunk-2TO4UOX3.js.map +1 -0
- package/dist/chunk-5AM5HM3B.js +10 -0
- package/dist/chunk-5AM5HM3B.js.map +1 -0
- package/dist/{chunk-ELF2EOGF.js → chunk-6KG65RIO.js} +2 -2
- package/dist/{chunk-6L4ZEJQI.js → chunk-6TKFGXSA.js} +2 -2
- package/dist/{chunk-2WEBXRNL.js → chunk-6XLSWPR3.js} +28 -32
- package/dist/chunk-6XLSWPR3.js.map +1 -0
- package/dist/{chunk-W64AF7LA.js → chunk-7IGZGPFM.js} +9 -9
- package/dist/chunk-7IGZGPFM.js.map +1 -0
- package/dist/{chunk-BEI5TWJL.js → chunk-7P6KYI3Z.js} +2 -2
- package/dist/{chunk-RUU22F7R.js → chunk-7PQ6YKBC.js} +2 -2
- package/dist/{chunk-H5ZJBRIK.js → chunk-ABO5SDB4.js} +10 -10
- package/dist/chunk-ABO5SDB4.js.map +1 -0
- package/dist/{chunk-XZL5CZFT.js → chunk-CRTD2R3I.js} +6 -6
- package/dist/chunk-CRTD2R3I.js.map +1 -0
- package/dist/{chunk-CMOP3BKX.js → chunk-DEZ6AV62.js} +3 -3
- package/dist/{chunk-LCIBOT5P.js → chunk-DV3GFG5Q.js} +2 -2
- package/dist/{chunk-4LSM4TMM.js → chunk-E7ZFE6KT.js} +3 -3
- package/dist/{chunk-C6CGZ6KN.js → chunk-EQWC4NEP.js} +3 -3
- package/dist/{chunk-C6CGZ6KN.js.map → chunk-EQWC4NEP.js.map} +1 -1
- package/dist/{chunk-YEAWH772.js → chunk-FTRICVXA.js} +2 -2
- package/dist/{chunk-YVV32ON3.js → chunk-FUKVDD7K.js} +2 -2
- package/dist/{chunk-NM3BMITL.js → chunk-G246NFI4.js} +19 -3
- package/dist/{chunk-NM3BMITL.js.map → chunk-G246NFI4.js.map} +1 -1
- package/dist/{chunk-UZALXR3J.js → chunk-KHUI4JLS.js} +7 -7
- package/dist/chunk-KHUI4JLS.js.map +1 -0
- package/dist/{chunk-OT7NZ4PK.js → chunk-KZ2KYINT.js} +3 -3
- package/dist/{chunk-HF7RD7UD.js → chunk-LQCS5PT5.js} +3 -3
- package/dist/chunk-LQCS5PT5.js.map +1 -0
- package/dist/{chunk-GHHUAWSG.js → chunk-MF6LAIGP.js} +3 -3
- package/dist/{chunk-AYCHKB2Y.js → chunk-N5X4DZS3.js} +2 -2
- package/dist/{chunk-DYNSSHD5.js → chunk-OMU7JQ6Y.js} +11 -38
- package/dist/chunk-OMU7JQ6Y.js.map +1 -0
- package/dist/{chunk-UF5BN4QN.js → chunk-P7M7B7ER.js} +2 -2
- package/dist/{chunk-DCQANK66.js → chunk-RJOY6FMD.js} +2 -2
- package/dist/{chunk-WZIT54AU.js → chunk-SQI2F34Q.js} +2 -2
- package/dist/{chunk-LCV3NUFR.js → chunk-TJZKPAAH.js} +5 -5
- package/dist/{chunk-BHAXBHVC.js → chunk-TTNJMHOJ.js} +4 -4
- package/dist/{chunk-C7OIVXE3.js → chunk-VVEA44KS.js} +3 -3
- package/dist/{chunk-GQRCW7WX.js → chunk-VXHLESK7.js} +2 -2
- package/dist/{chunk-7AVQOIDM.js → chunk-XF2CMO2A.js} +7 -5
- package/dist/chunk-XF2CMO2A.js.map +1 -0
- package/dist/{chunk-J6ZC77OY.js → chunk-YXREYDKU.js} +6 -6
- package/dist/{chunk-VGYNHJFT.js → chunk-ZSOMTVP5.js} +2 -2
- package/dist/chunk-ZSOMTVP5.js.map +1 -0
- package/dist/components/AAFailedReason/index.d.ts +11 -0
- package/dist/components/AAFailedReason/index.js +41 -0
- package/dist/components/AAFailedReason/index.js.map +1 -0
- package/dist/components/AceEditor/index.js +4 -4
- package/dist/components/AddressContainer/CoreAddressContainer.js +10 -10
- package/dist/components/AddressContainer/EVMAddressContainer.js +9 -9
- package/dist/components/AddressContainer/addressSwitcher.js +7 -7
- package/dist/components/AddressContainer/addressView.js +6 -6
- package/dist/components/AddressContainer/label.js +3 -3
- package/dist/components/AddressContainer/utils.js +3 -3
- package/dist/components/Age/index.js +4 -4
- package/dist/components/AutoComplete/index.js +3 -3
- package/dist/components/Charts/PreviewChartTemplate.js +3 -3
- package/dist/components/Charts/StockChartTemplate.js +6 -6
- package/dist/components/CopyButton/index.js +3 -3
- package/dist/components/DecimalsSelect/index.js +3 -3
- package/dist/components/DownloadCSV/index.js +4 -4
- package/dist/components/GasPriceDropdown/index.js +2 -2
- package/dist/components/IncreasePercent/index.js +2 -2
- package/dist/components/InfoIconWithTooltip/index.js +4 -4
- package/dist/components/InputData/AddressLabel.js +8 -8
- package/dist/components/InputData/ContractDetail.d.ts +3 -16
- package/dist/components/InputData/ContractDetail.js +7 -7
- package/dist/components/InputData/JsonDecode.js +5 -5
- package/dist/components/InputData/OptimizationDecode.js +12 -10
- package/dist/components/InputData/Original.js +1 -1
- package/dist/components/InputData/UTF8.js +3 -3
- package/dist/components/InputData/index.d.ts +1 -1
- package/dist/components/InputData/index.js +17 -15
- package/dist/components/List/index.js +3 -3
- package/dist/components/Modal/index.js +3 -3
- package/dist/components/NetworkIcon/index.js +2 -2
- package/dist/components/OutputData/ErrorDecode.d.ts +3 -6
- package/dist/components/OutputData/ErrorDecode.js +19 -17
- package/dist/components/OutputData/index.d.ts +2 -5
- package/dist/components/OutputData/index.js +21 -19
- package/dist/components/PhishingAddressContainer/index.js +4 -4
- package/dist/components/Popover/index.js +3 -3
- package/dist/components/Price/index.js +3 -3
- package/dist/components/ProxyContractAddress/index.js +7 -7
- package/dist/components/ProxyContractAddress/index.js.map +1 -1
- package/dist/components/Radio/index.js +2 -2
- package/dist/components/SearchInput/index.js +4 -4
- package/dist/components/Select/index.js +4 -4
- package/dist/components/Select/select.js +3 -3
- package/dist/components/SmartAccountAddress/index.d.ts +11 -0
- package/dist/components/SmartAccountAddress/index.js +94 -0
- package/dist/components/SmartAccountAddress/index.js.map +1 -0
- package/dist/components/Text/index.js +4 -4
- package/dist/components/Tooltip/index.js +3 -3
- package/dist/components/TransactionAction/coreTransactionAction.js +23 -18
- package/dist/components/TransactionAction/coreTransactionAction.js.map +1 -1
- package/dist/components/TransactionAction/evmTransactionAction.js +22 -17
- package/dist/components/TransactionAction/evmTransactionAction.js.map +1 -1
- package/dist/components/TransactionTrace/TraceDetail.d.ts +1 -4
- package/dist/components/TransactionTrace/TraceDetail.js +29 -27
- package/dist/components/TransactionTrace/TreeTraceTable.js +30 -28
- package/dist/components/TransactionTrace/index.js +30 -28
- package/dist/uno.css +1 -0
- package/dist/utils/address.js +2 -2
- package/dist/utils/contractManagerTool.js +2 -2
- package/dist/utils/hooks/useAddressLabel.js +3 -3
- package/dist/utils/hooks/useAddressNameMap.js +2 -2
- package/dist/utils/hooks/useAutoSetHolderFilterParams.js +2 -2
- package/dist/utils/hooks/useContractDetail.js +2 -2
- package/dist/utils/hooks/useDecodeFunctionData.js +5 -5
- package/dist/utils/hooks/useDecodeFunctionError.d.ts +1 -1
- package/dist/utils/hooks/useDecodeFunctionError.js +3 -3
- package/dist/utils/hooks/useENS.js +3 -3
- package/dist/utils/hooks/useEnhanceDataWithNameMap.js +2 -2
- package/dist/utils/hooks/useMethodAbi.js +2 -2
- package/dist/utils/hooks/useTableData.js +1 -1
- package/dist/utils/hooks/useTxTrace.d.ts +8 -10
- package/dist/utils/hooks/useTxTrace.js +11 -16
- package/dist/utils/hooks/useTxTrace.js.map +1 -1
- package/dist/utils/index.d.ts +7 -1
- package/dist/utils/index.js +4 -2
- package/dist/utils/request.d.ts +1 -1
- package/dist/utils/request.js +1 -1
- package/package.json +6 -5
- package/dist/chunk-2WEBXRNL.js.map +0 -1
- package/dist/chunk-7AVQOIDM.js.map +0 -1
- package/dist/chunk-7VQL3G7K.js.map +0 -1
- package/dist/chunk-DYNSSHD5.js.map +0 -1
- package/dist/chunk-H5ZJBRIK.js.map +0 -1
- package/dist/chunk-HF7RD7UD.js.map +0 -1
- package/dist/chunk-UZALXR3J.js.map +0 -1
- package/dist/chunk-VGYNHJFT.js.map +0 -1
- package/dist/chunk-W64AF7LA.js.map +0 -1
- package/dist/chunk-XZL5CZFT.js.map +0 -1
- package/dist/chunk-YBQQ72FQ.js +0 -10
- package/dist/chunk-YBQQ72FQ.js.map +0 -1
- /package/dist/{chunk-XUKHHB5L.js.map → chunk-2KBVDLVC.js.map} +0 -0
- /package/dist/{chunk-ELF2EOGF.js.map → chunk-6KG65RIO.js.map} +0 -0
- /package/dist/{chunk-6L4ZEJQI.js.map → chunk-6TKFGXSA.js.map} +0 -0
- /package/dist/{chunk-BEI5TWJL.js.map → chunk-7P6KYI3Z.js.map} +0 -0
- /package/dist/{chunk-RUU22F7R.js.map → chunk-7PQ6YKBC.js.map} +0 -0
- /package/dist/{chunk-CMOP3BKX.js.map → chunk-DEZ6AV62.js.map} +0 -0
- /package/dist/{chunk-LCIBOT5P.js.map → chunk-DV3GFG5Q.js.map} +0 -0
- /package/dist/{chunk-4LSM4TMM.js.map → chunk-E7ZFE6KT.js.map} +0 -0
- /package/dist/{chunk-YEAWH772.js.map → chunk-FTRICVXA.js.map} +0 -0
- /package/dist/{chunk-YVV32ON3.js.map → chunk-FUKVDD7K.js.map} +0 -0
- /package/dist/{chunk-OT7NZ4PK.js.map → chunk-KZ2KYINT.js.map} +0 -0
- /package/dist/{chunk-GHHUAWSG.js.map → chunk-MF6LAIGP.js.map} +0 -0
- /package/dist/{chunk-AYCHKB2Y.js.map → chunk-N5X4DZS3.js.map} +0 -0
- /package/dist/{chunk-UF5BN4QN.js.map → chunk-P7M7B7ER.js.map} +0 -0
- /package/dist/{chunk-DCQANK66.js.map → chunk-RJOY6FMD.js.map} +0 -0
- /package/dist/{chunk-WZIT54AU.js.map → chunk-SQI2F34Q.js.map} +0 -0
- /package/dist/{chunk-LCV3NUFR.js.map → chunk-TJZKPAAH.js.map} +0 -0
- /package/dist/{chunk-BHAXBHVC.js.map → chunk-TTNJMHOJ.js.map} +0 -0
- /package/dist/{chunk-C7OIVXE3.js.map → chunk-VVEA44KS.js.map} +0 -0
- /package/dist/{chunk-GQRCW7WX.js.map → chunk-VXHLESK7.js.map} +0 -0
- /package/dist/{chunk-J6ZC77OY.js.map → chunk-YXREYDKU.js.map} +0 -0
|
@@ -1,52 +1,54 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TreeTraceTable
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-EQWC4NEP.js";
|
|
4
|
+
import "../../chunk-7IGZGPFM.js";
|
|
5
|
+
import "../../chunk-CRTD2R3I.js";
|
|
6
|
+
import "../../chunk-7P6KYI3Z.js";
|
|
6
7
|
import "../../chunk-UM5J477V.js";
|
|
7
|
-
import "../../chunk-BEI5TWJL.js";
|
|
8
8
|
import "../../chunk-XZ7IV2FF.js";
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-MF6LAIGP.js";
|
|
10
|
+
import "../../chunk-7PQ6YKBC.js";
|
|
11
11
|
import "../../chunk-NWVSTRCG.js";
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-6SXAFSBF.js";
|
|
16
|
-
import "../../chunk-JIRLY7OG.js";
|
|
17
|
-
import "../../chunk-4B6ASBYQ.js";
|
|
18
|
-
import "../../chunk-LCIBOT5P.js";
|
|
19
|
-
import "../../chunk-7VQL3G7K.js";
|
|
12
|
+
import "../../chunk-KHUI4JLS.js";
|
|
13
|
+
import "../../chunk-ABO5SDB4.js";
|
|
14
|
+
import "../../chunk-2TO4UOX3.js";
|
|
20
15
|
import "../../chunk-OYESIV3F.js";
|
|
21
|
-
import "../../chunk-
|
|
22
|
-
import "../../chunk-
|
|
23
|
-
import "../../chunk-
|
|
16
|
+
import "../../chunk-KZ2KYINT.js";
|
|
17
|
+
import "../../chunk-OMU7JQ6Y.js";
|
|
18
|
+
import "../../chunk-TTNJMHOJ.js";
|
|
19
|
+
import "../../chunk-RJOY6FMD.js";
|
|
20
|
+
import "../../chunk-6XLSWPR3.js";
|
|
21
|
+
import "../../chunk-LQCS5PT5.js";
|
|
24
22
|
import "../../chunk-FYLAXC3R.js";
|
|
25
23
|
import "../../chunk-SFCNLOQ5.js";
|
|
26
|
-
import "../../chunk-
|
|
27
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-5AM5HM3B.js";
|
|
25
|
+
import "../../chunk-P7M7B7ER.js";
|
|
28
26
|
import "../../chunk-XBEBAU77.js";
|
|
29
|
-
import "../../chunk-BHAXBHVC.js";
|
|
30
|
-
import "../../chunk-DCQANK66.js";
|
|
31
27
|
import "../../chunk-Y7OVL5US.js";
|
|
32
28
|
import "../../chunk-O6NJ56NA.js";
|
|
33
29
|
import "../../chunk-XCKMXAL2.js";
|
|
34
30
|
import "../../chunk-2Y57U43P.js";
|
|
35
31
|
import "../../chunk-TGK5LP2H.js";
|
|
32
|
+
import "../../chunk-XF2CMO2A.js";
|
|
33
|
+
import "../../chunk-6SXAFSBF.js";
|
|
34
|
+
import "../../chunk-JIRLY7OG.js";
|
|
35
|
+
import "../../chunk-4B6ASBYQ.js";
|
|
36
|
+
import "../../chunk-DV3GFG5Q.js";
|
|
36
37
|
import "../../chunk-5TGK2EA2.js";
|
|
37
38
|
import "../../chunk-ADNS57X5.js";
|
|
38
|
-
import "../../chunk-
|
|
39
|
-
import "../../chunk-
|
|
39
|
+
import "../../chunk-FTRICVXA.js";
|
|
40
|
+
import "../../chunk-DEZ6AV62.js";
|
|
41
|
+
import "../../chunk-SQI2F34Q.js";
|
|
40
42
|
import "../../chunk-MWAD4CIG.js";
|
|
41
|
-
import "../../chunk-
|
|
42
|
-
import "../../chunk-
|
|
43
|
+
import "../../chunk-6TKFGXSA.js";
|
|
44
|
+
import "../../chunk-VVEA44KS.js";
|
|
43
45
|
import "../../chunk-TOKKKTFG.js";
|
|
44
|
-
import "../../chunk-
|
|
46
|
+
import "../../chunk-VXHLESK7.js";
|
|
45
47
|
import "../../chunk-BMO4IZHV.js";
|
|
46
48
|
import "../../chunk-LRCAKRPK.js";
|
|
47
|
-
import "../../chunk-
|
|
49
|
+
import "../../chunk-G246NFI4.js";
|
|
48
50
|
import "../../chunk-WIB76E7O.js";
|
|
49
|
-
import "../../chunk-
|
|
51
|
+
import "../../chunk-ZSOMTVP5.js";
|
|
50
52
|
import "../../chunk-J2I22Q2M.js";
|
|
51
53
|
import "../../chunk-YEINMVAR.js";
|
|
52
54
|
import "../../chunk-DQGLZCIG.js";
|
|
@@ -1,54 +1,56 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TreeTraceTable
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-EQWC4NEP.js";
|
|
4
4
|
import {
|
|
5
5
|
TraceDetail
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-7IGZGPFM.js";
|
|
7
|
+
import "../../chunk-CRTD2R3I.js";
|
|
8
|
+
import "../../chunk-7P6KYI3Z.js";
|
|
8
9
|
import "../../chunk-UM5J477V.js";
|
|
9
|
-
import "../../chunk-BEI5TWJL.js";
|
|
10
10
|
import "../../chunk-XZ7IV2FF.js";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-MF6LAIGP.js";
|
|
12
|
+
import "../../chunk-7PQ6YKBC.js";
|
|
13
13
|
import "../../chunk-NWVSTRCG.js";
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-6SXAFSBF.js";
|
|
18
|
-
import "../../chunk-JIRLY7OG.js";
|
|
19
|
-
import "../../chunk-4B6ASBYQ.js";
|
|
20
|
-
import "../../chunk-LCIBOT5P.js";
|
|
21
|
-
import "../../chunk-7VQL3G7K.js";
|
|
14
|
+
import "../../chunk-KHUI4JLS.js";
|
|
15
|
+
import "../../chunk-ABO5SDB4.js";
|
|
16
|
+
import "../../chunk-2TO4UOX3.js";
|
|
22
17
|
import "../../chunk-OYESIV3F.js";
|
|
23
|
-
import "../../chunk-
|
|
24
|
-
import "../../chunk-
|
|
25
|
-
import "../../chunk-
|
|
18
|
+
import "../../chunk-KZ2KYINT.js";
|
|
19
|
+
import "../../chunk-OMU7JQ6Y.js";
|
|
20
|
+
import "../../chunk-TTNJMHOJ.js";
|
|
21
|
+
import "../../chunk-RJOY6FMD.js";
|
|
22
|
+
import "../../chunk-6XLSWPR3.js";
|
|
23
|
+
import "../../chunk-LQCS5PT5.js";
|
|
26
24
|
import "../../chunk-FYLAXC3R.js";
|
|
27
25
|
import "../../chunk-SFCNLOQ5.js";
|
|
28
|
-
import "../../chunk-
|
|
29
|
-
import "../../chunk-
|
|
26
|
+
import "../../chunk-5AM5HM3B.js";
|
|
27
|
+
import "../../chunk-P7M7B7ER.js";
|
|
30
28
|
import "../../chunk-XBEBAU77.js";
|
|
31
|
-
import "../../chunk-BHAXBHVC.js";
|
|
32
|
-
import "../../chunk-DCQANK66.js";
|
|
33
29
|
import "../../chunk-Y7OVL5US.js";
|
|
34
30
|
import "../../chunk-O6NJ56NA.js";
|
|
35
31
|
import "../../chunk-XCKMXAL2.js";
|
|
36
32
|
import "../../chunk-2Y57U43P.js";
|
|
37
33
|
import "../../chunk-TGK5LP2H.js";
|
|
34
|
+
import "../../chunk-XF2CMO2A.js";
|
|
35
|
+
import "../../chunk-6SXAFSBF.js";
|
|
36
|
+
import "../../chunk-JIRLY7OG.js";
|
|
37
|
+
import "../../chunk-4B6ASBYQ.js";
|
|
38
|
+
import "../../chunk-DV3GFG5Q.js";
|
|
38
39
|
import "../../chunk-5TGK2EA2.js";
|
|
39
40
|
import "../../chunk-ADNS57X5.js";
|
|
40
|
-
import "../../chunk-
|
|
41
|
-
import "../../chunk-
|
|
41
|
+
import "../../chunk-FTRICVXA.js";
|
|
42
|
+
import "../../chunk-DEZ6AV62.js";
|
|
43
|
+
import "../../chunk-SQI2F34Q.js";
|
|
42
44
|
import "../../chunk-MWAD4CIG.js";
|
|
43
|
-
import "../../chunk-
|
|
44
|
-
import "../../chunk-
|
|
45
|
+
import "../../chunk-6TKFGXSA.js";
|
|
46
|
+
import "../../chunk-VVEA44KS.js";
|
|
45
47
|
import "../../chunk-TOKKKTFG.js";
|
|
46
|
-
import "../../chunk-
|
|
48
|
+
import "../../chunk-VXHLESK7.js";
|
|
47
49
|
import "../../chunk-BMO4IZHV.js";
|
|
48
50
|
import "../../chunk-LRCAKRPK.js";
|
|
49
|
-
import "../../chunk-
|
|
51
|
+
import "../../chunk-G246NFI4.js";
|
|
50
52
|
import "../../chunk-WIB76E7O.js";
|
|
51
|
-
import "../../chunk-
|
|
53
|
+
import "../../chunk-ZSOMTVP5.js";
|
|
52
54
|
import "../../chunk-J2I22Q2M.js";
|
|
53
55
|
import "../../chunk-YEINMVAR.js";
|
|
54
56
|
import "../../chunk-DQGLZCIG.js";
|
package/dist/uno.css
CHANGED
package/dist/utils/address.js
CHANGED
|
@@ -23,9 +23,9 @@ import {
|
|
|
23
23
|
isSimplyZeroAddress,
|
|
24
24
|
isSpecialAddress,
|
|
25
25
|
isZeroAddress
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-6TKFGXSA.js";
|
|
27
27
|
import "../chunk-WIB76E7O.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-ZSOMTVP5.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-
|
|
3
|
+
} from "../chunk-G246NFI4.js";
|
|
4
4
|
import "../chunk-WIB76E7O.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-ZSOMTVP5.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-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-RJOY6FMD.js";
|
|
4
|
+
import "../../chunk-6TKFGXSA.js";
|
|
5
5
|
import "../../chunk-WIB76E7O.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-ZSOMTVP5.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-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-LQCS5PT5.js";
|
|
5
|
+
import "../../chunk-ZSOMTVP5.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-
|
|
6
|
+
} from "../../chunk-6TKFGXSA.js";
|
|
7
7
|
import "../../chunk-WIB76E7O.js";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-ZSOMTVP5.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-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-DV3GFG5Q.js";
|
|
4
|
+
import "../../chunk-ZSOMTVP5.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-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-CRTD2R3I.js";
|
|
4
|
+
import "../../chunk-7P6KYI3Z.js";
|
|
5
5
|
import "../../chunk-6SXAFSBF.js";
|
|
6
6
|
import "../../chunk-JIRLY7OG.js";
|
|
7
7
|
import "../../chunk-4B6ASBYQ.js";
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-DV3GFG5Q.js";
|
|
9
|
+
import "../../chunk-G246NFI4.js";
|
|
10
10
|
import "../../chunk-WIB76E7O.js";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-ZSOMTVP5.js";
|
|
12
12
|
import "../../chunk-J2I22Q2M.js";
|
|
13
13
|
import "../../chunk-YEINMVAR.js";
|
|
14
14
|
import "../../chunk-DQGLZCIG.js";
|
|
@@ -8,7 +8,7 @@ interface Result {
|
|
|
8
8
|
failed?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const useDecodeFunctionError: ({ to, implementation: _implementation, errorData, space, }: {
|
|
11
|
-
errorData
|
|
11
|
+
errorData?: `0x${string}` | undefined;
|
|
12
12
|
to?: string | undefined;
|
|
13
13
|
implementation?: string | undefined;
|
|
14
14
|
space: 'evm' | 'core';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDecodeFunctionError
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-XF2CMO2A.js";
|
|
4
4
|
import "../../chunk-6SXAFSBF.js";
|
|
5
5
|
import "../../chunk-JIRLY7OG.js";
|
|
6
6
|
import "../../chunk-4B6ASBYQ.js";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-DV3GFG5Q.js";
|
|
8
8
|
import "../../chunk-5TGK2EA2.js";
|
|
9
9
|
import "../../chunk-ADNS57X5.js";
|
|
10
10
|
import "../../chunk-WIB76E7O.js";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-ZSOMTVP5.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-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-DEZ6AV62.js";
|
|
4
|
+
import "../../chunk-6TKFGXSA.js";
|
|
5
5
|
import "../../chunk-WIB76E7O.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-ZSOMTVP5.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-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-LQCS5PT5.js";
|
|
5
|
+
import "../../chunk-ZSOMTVP5.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-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-7P6KYI3Z.js";
|
|
4
|
+
import "../../chunk-ZSOMTVP5.js";
|
|
5
5
|
import "../../chunk-J2I22Q2M.js";
|
|
6
6
|
import "../../chunk-YEINMVAR.js";
|
|
7
7
|
import "../../chunk-DQGLZCIG.js";
|
|
@@ -39,9 +39,10 @@ interface OriginTreeTrace {
|
|
|
39
39
|
type ProxyType = 'BeaconProxy' | 'Proxy';
|
|
40
40
|
interface OriginTraceData {
|
|
41
41
|
addressArray: string[];
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
authMap?: Record<string, string>;
|
|
43
|
+
proxyMap?: Record<string, ProxyType>;
|
|
44
|
+
methodMap?: Record<string, Record<string, string>>;
|
|
45
|
+
nameMap?: Record<string, AddressNameMap>;
|
|
45
46
|
traceTree: OriginTreeTrace[];
|
|
46
47
|
}
|
|
47
48
|
interface ListTraceForUI {
|
|
@@ -65,12 +66,7 @@ interface ListTraceForUI {
|
|
|
65
66
|
};
|
|
66
67
|
isCallBeacon?: boolean;
|
|
67
68
|
isCallImpl?: boolean;
|
|
68
|
-
|
|
69
|
-
address?: string;
|
|
70
|
-
};
|
|
71
|
-
fromESpaceInfo?: {
|
|
72
|
-
address?: string;
|
|
73
|
-
};
|
|
69
|
+
delegatedTo?: string;
|
|
74
70
|
fromPocket?: Pocket;
|
|
75
71
|
toPocket?: Pocket;
|
|
76
72
|
}
|
|
@@ -79,7 +75,9 @@ interface TreeTraceForUI extends ListTraceForUI {
|
|
|
79
75
|
}
|
|
80
76
|
declare const treeTraceToList: (data: TreeTraceForUI[], showProxyCall?: boolean) => ListTraceForUI[];
|
|
81
77
|
declare const hideProxyCallInTreeTrace: (data: TreeTraceForUI[]) => TreeTraceForUI[];
|
|
82
|
-
declare const useTxTrace: (hash: string, space: 'evm' | 'core'
|
|
78
|
+
declare const useTxTrace: (hash: string, space: 'evm' | 'core', { isAATx, }?: {
|
|
79
|
+
isAATx?: boolean | undefined;
|
|
80
|
+
}) => swr.SWRResponse<void | {
|
|
83
81
|
list: TreeTraceForUI[];
|
|
84
82
|
total: number;
|
|
85
83
|
} | undefined, any, any>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatAddress
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-6TKFGXSA.js";
|
|
4
4
|
import {
|
|
5
5
|
formatABI
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-G246NFI4.js";
|
|
7
7
|
import "../../chunk-WIB76E7O.js";
|
|
8
8
|
import {
|
|
9
9
|
fetchWithPrefix
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-ZSOMTVP5.js";
|
|
11
11
|
import {
|
|
12
12
|
publishRequestError
|
|
13
13
|
} from "../../chunk-J2I22Q2M.js";
|
|
@@ -22,6 +22,7 @@ var formatTraceData = (data, space) => {
|
|
|
22
22
|
const proxyMap = data.proxyMap || {};
|
|
23
23
|
const methodMap = data.methodMap || {};
|
|
24
24
|
const nameMap = data.nameMap || {};
|
|
25
|
+
const authMap = data.authMap || {};
|
|
25
26
|
let total = 0;
|
|
26
27
|
const formatList = (t, parent) => {
|
|
27
28
|
total += t.length;
|
|
@@ -31,9 +32,10 @@ var formatTraceData = (data, space) => {
|
|
|
31
32
|
const methodId = t.action.input?.slice(0, 10);
|
|
32
33
|
const from = formatAddress(t.action.from, addressType);
|
|
33
34
|
const to = formatAddress(t.action.to, addressType);
|
|
35
|
+
const delegatedTo = to && authMap[to];
|
|
34
36
|
let method = methodId;
|
|
35
37
|
let abi = void 0;
|
|
36
|
-
const methodABI = methodId && to ? methodMap[methodId]?.[to] : void 0;
|
|
38
|
+
const methodABI = methodId && (delegatedTo || to) ? methodMap[methodId]?.[delegatedTo || to] : void 0;
|
|
37
39
|
if (methodABI) {
|
|
38
40
|
try {
|
|
39
41
|
const result = formatABI(`["${methodABI}"]`, {
|
|
@@ -61,20 +63,11 @@ var formatTraceData = (data, space) => {
|
|
|
61
63
|
abi,
|
|
62
64
|
contractCreated: isContractCreated ? t.result?.addr : void 0,
|
|
63
65
|
nameMap,
|
|
66
|
+
delegatedTo,
|
|
64
67
|
isCallImpl: t.isCallImpl,
|
|
65
68
|
fromPocket: t.action.fromPocket,
|
|
66
69
|
toPocket: t.action.toPocket
|
|
67
70
|
};
|
|
68
|
-
if (t.action.fromSpace === "evm") {
|
|
69
|
-
item.fromESpaceInfo = {
|
|
70
|
-
address: formatAddress(from, "hex")
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
if (t.action.toSpace === "evm") {
|
|
74
|
-
item.toESpaceInfo = {
|
|
75
|
-
address: formatAddress(to, "hex")
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
71
|
if (parent && parent.to && proxyMap[parent.to] && from === parent.to && to) {
|
|
79
72
|
if (index === 0 && proxyMap[parent.to] === "Proxy" && t.action.callType === "delegatecall") {
|
|
80
73
|
parent.proxy = {
|
|
@@ -138,8 +131,10 @@ var hideProxyCallInTreeTrace = (data) => {
|
|
|
138
131
|
};
|
|
139
132
|
return handler(data);
|
|
140
133
|
};
|
|
141
|
-
var useTxTrace = (hash, space
|
|
142
|
-
|
|
134
|
+
var useTxTrace = (hash, space, {
|
|
135
|
+
isAATx = false
|
|
136
|
+
} = {}) => {
|
|
137
|
+
const url = `/transferTree/${hash}${isAATx ? "?txType=aa" : ""}`;
|
|
143
138
|
return useSWRImmutable(
|
|
144
139
|
[url, space],
|
|
145
140
|
() => fetchWithPrefix(url).then((resp) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/hooks/useTxTrace.ts"],"sourcesContent":["import useSWRImmutable from 'swr/immutable';\nimport { fetchWithPrefix } from 'src/utils/request';\nimport { publishRequestError } from '../pubsub';\nimport type { AbiFunctionWithoutGas } from 'src/utils/sdk';\nimport { formatABI } from '..';\nimport { formatAddress } from '../address';\nimport { AddressNameMap, Pocket } from '../request.types';\n\nexport interface TraceAction {\n createType: string;\n callType: string;\n from: string;\n to?: string;\n input?: `0x${string}`;\n value: string;\n gas?: string;\n space: string;\n\n // ↓↓↓↓↓↓↓↓ only for core space ↓↓↓↓↓↓↓↓\n fromPocket?: Pocket;\n toPocket?: Pocket;\n fromSpace?: 'evm' | 'none' | 'native';\n toSpace?: 'evm' | 'none' | 'native';\n}\nexport interface TraceResult {\n addr?: string;\n gasLeft: string;\n outcome: 'success' | 'fail' | 'reverted';\n returnData: `0x${string}`;\n}\n\nexport interface OriginTreeTrace {\n calls: OriginTreeTrace[];\n action: TraceAction;\n result?: TraceResult;\n blockHash: string;\n epochHash: string;\n epochNumber: number;\n transactionHash: string;\n transactionPosition: number;\n type: string;\n valid: boolean;\n // added by frontend\n isCallImpl?: boolean;\n}\n\nexport type ProxyType = 'BeaconProxy' | 'Proxy';\n\nexport interface OriginTraceData {\n addressArray: string[];\n proxyMap: Record<string, ProxyType>;\n methodMap: Record<string, Record<string, string>>;\n nameMap: Record<string, AddressNameMap>;\n traceTree: OriginTreeTrace[];\n}\n\nexport interface ListTraceForUI {\n index: string;\n type: string;\n from: string;\n to?: string;\n value: string;\n input?: `0x${string}`;\n result?: TraceResult;\n gas?: string;\n isProxyCall?: boolean;\n method?: string;\n contractCreated?: string;\n abi?: AbiFunctionWithoutGas[];\n nameMap: Record<string, AddressNameMap>;\n proxy?: {\n type: ProxyType;\n beaconAddress?: string;\n implAddress: string;\n };\n isCallBeacon?: boolean;\n isCallImpl?: boolean;\n // only for core space ↓↓↓↓↓↓↓↓\n toESpaceInfo?: {\n address?: string;\n };\n fromESpaceInfo?: {\n address?: string;\n };\n fromPocket?: Pocket;\n toPocket?: Pocket;\n}\n\nexport interface TreeTraceForUI extends ListTraceForUI {\n calls?: TreeTraceForUI[];\n}\n\nconst formatTraceData = (data: OriginTraceData, space: 'evm' | 'core') => {\n const addressType = space === 'core' ? 'base32' : 'hex';\n const proxyMap = data.proxyMap || {};\n const methodMap = data.methodMap || {};\n const nameMap = data.nameMap || {};\n\n let total = 0;\n\n const formatList = (\n t: OriginTreeTrace[],\n parent?: TreeTraceForUI,\n ): TreeTraceForUI[] => {\n total += t.length;\n return t.map((item, index) => formatItem(item, index, parent, t));\n };\n const formatItem = (\n t: OriginTreeTrace,\n index: number,\n parent: TreeTraceForUI | undefined,\n list: OriginTreeTrace[],\n ): TreeTraceForUI => {\n const methodId = t.action.input?.slice(0, 10);\n const from = formatAddress(t.action.from, addressType);\n const to = formatAddress(t.action.to, addressType);\n let method = methodId;\n let abi: AbiFunctionWithoutGas[] | undefined = undefined;\n const methodABI = methodId && to ? methodMap[methodId]?.[to] : undefined;\n if (methodABI) {\n try {\n const result = formatABI(`[\"${methodABI}\"]`, {\n json: true,\n allowEmpty: true,\n });\n abi = JSON.parse(result) as AbiFunctionWithoutGas[];\n const jsonABI = abi[0];\n method = jsonABI?.name || methodId;\n } catch (error) {\n console.log('parse method abi error: ', methodABI, error);\n }\n }\n\n const isContractCreated = !!t.action.createType;\n\n const item: TreeTraceForUI = {\n index: `${parent?.index ? `${parent.index}_` : ''}${index}`,\n type: `${t.action.callType || t.type}`,\n from: from,\n to: to,\n input: t.action.input,\n value: t.action.value,\n result: t.result,\n gas: t.action.gas,\n method,\n abi,\n contractCreated: isContractCreated ? t.result?.addr : undefined,\n nameMap,\n isCallImpl: t.isCallImpl,\n fromPocket: t.action.fromPocket,\n toPocket: t.action.toPocket,\n };\n if (t.action.fromSpace === 'evm') {\n // TODO\n item.fromESpaceInfo = {\n address: formatAddress(from, 'hex'),\n };\n }\n if (t.action.toSpace === 'evm') {\n // TODO\n item.toESpaceInfo = {\n address: formatAddress(to, 'hex'),\n };\n }\n if (\n parent &&\n parent.to &&\n proxyMap[parent.to] &&\n from === parent.to &&\n to\n ) {\n // proxy call\n if (\n index === 0 &&\n proxyMap[parent.to] === 'Proxy' &&\n t.action.callType === 'delegatecall'\n ) {\n parent.proxy = {\n type: 'Proxy',\n implAddress: to,\n };\n item.isCallImpl = true;\n }\n // beacon proxy call\n const second = list[1];\n if (\n index === 0 &&\n proxyMap[parent.to] === 'BeaconProxy' &&\n t.action.callType === 'staticcall' &&\n second &&\n second.action.to &&\n second.action.from === parent.to &&\n second.action.callType === 'delegatecall'\n ) {\n parent.proxy = {\n type: 'BeaconProxy',\n beaconAddress: to,\n implAddress: second.action.to,\n };\n item.isCallBeacon = true;\n second.isCallImpl = true;\n }\n }\n if (t.calls) {\n item.calls = formatList(t.calls, item);\n }\n return item;\n };\n const list = formatList(data.traceTree);\n return {\n total,\n list,\n };\n};\n\nexport const treeTraceToList = (\n data: TreeTraceForUI[],\n showProxyCall = false,\n) => {\n const result: ListTraceForUI[] = [];\n const handler = (list: TreeTraceForUI[]) => {\n list.forEach(item => {\n if (showProxyCall || (!item.isCallBeacon && !item.isCallImpl)) {\n result.push(item);\n }\n if (item.calls) {\n handler(item.calls);\n }\n });\n };\n handler(data);\n return result;\n};\n\nexport const hideProxyCallInTreeTrace = (data: TreeTraceForUI[]) => {\n const handler = (list: TreeTraceForUI[]) => {\n const result: TreeTraceForUI[] = [];\n list.forEach(item => {\n const newTrace = { ...item };\n if (!newTrace.isCallBeacon && !newTrace.isCallImpl) {\n result.push(newTrace);\n if (newTrace.calls) {\n newTrace.calls = handler(newTrace.calls);\n }\n } else if (newTrace.calls) {\n result.push(...handler(newTrace.calls));\n }\n });\n return result;\n };\n return handler(data);\n};\n\nexport const useTxTrace = (hash: string, space: 'evm' | 'core') => {\n const url = `/transferTree/${hash}`;\n\n return useSWRImmutable([url, space], () =>\n fetchWithPrefix(url)\n .then((resp: any) => {\n if (resp?.traceTree) {\n const { list, total } = formatTraceData(resp, space);\n return { list, total };\n }\n })\n .catch(e => {\n publishRequestError({ code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M;AAAA,IACjE,CAAC;AAAA,EACL;AACF;","names":["list"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/hooks/useTxTrace.ts"],"sourcesContent":["import useSWRImmutable from 'swr/immutable';\nimport { fetchWithPrefix } from 'src/utils/request';\nimport { publishRequestError } from '../pubsub';\nimport type { AbiFunctionWithoutGas } from 'src/utils/sdk';\nimport { formatABI } from '..';\nimport { formatAddress } from '../address';\nimport { AddressNameMap, Pocket } from '../request.types';\n\nexport interface TraceAction {\n createType: string;\n callType: string;\n from: string;\n to?: string;\n input?: `0x${string}`;\n value: string;\n gas?: string;\n space: string;\n\n // ↓↓↓↓↓↓↓↓ only for core space ↓↓↓↓↓↓↓↓\n fromPocket?: Pocket;\n toPocket?: Pocket;\n fromSpace?: 'evm' | 'none' | 'native';\n toSpace?: 'evm' | 'none' | 'native';\n}\nexport interface TraceResult {\n addr?: string;\n gasLeft: string;\n outcome: 'success' | 'fail' | 'reverted';\n returnData: `0x${string}`;\n}\n\nexport interface OriginTreeTrace {\n calls: OriginTreeTrace[];\n action: TraceAction;\n result?: TraceResult;\n blockHash: string;\n epochHash: string;\n epochNumber: number;\n transactionHash: string;\n transactionPosition: number;\n type: string;\n valid: boolean;\n // added by frontend\n isCallImpl?: boolean;\n}\n\nexport type ProxyType = 'BeaconProxy' | 'Proxy';\n\nexport interface OriginTraceData {\n addressArray: string[];\n authMap?: Record<string, string>;\n proxyMap?: Record<string, ProxyType>;\n methodMap?: Record<string, Record<string, string>>;\n nameMap?: Record<string, AddressNameMap>;\n traceTree: OriginTreeTrace[];\n}\n\nexport interface ListTraceForUI {\n index: string;\n type: string;\n from: string;\n to?: string;\n value: string;\n input?: `0x${string}`;\n result?: TraceResult;\n gas?: string;\n isProxyCall?: boolean;\n method?: string;\n contractCreated?: string;\n abi?: AbiFunctionWithoutGas[];\n nameMap: Record<string, AddressNameMap>;\n proxy?: {\n type: ProxyType;\n beaconAddress?: string;\n implAddress: string;\n };\n isCallBeacon?: boolean;\n isCallImpl?: boolean;\n // only for evm space ↓↓↓↓↓↓↓↓\n delegatedTo?: string;\n // only for core space ↓↓↓↓↓↓↓↓\n fromPocket?: Pocket;\n toPocket?: Pocket;\n}\n\nexport interface TreeTraceForUI extends ListTraceForUI {\n calls?: TreeTraceForUI[];\n}\n\nconst formatTraceData = (data: OriginTraceData, space: 'evm' | 'core') => {\n const addressType = space === 'core' ? 'base32' : 'hex';\n const proxyMap = data.proxyMap || {};\n const methodMap = data.methodMap || {};\n const nameMap = data.nameMap || {};\n const authMap = data.authMap || {};\n\n let total = 0;\n\n const formatList = (\n t: OriginTreeTrace[],\n parent?: TreeTraceForUI,\n ): TreeTraceForUI[] => {\n total += t.length;\n return t.map((item, index) => formatItem(item, index, parent, t));\n };\n const formatItem = (\n t: OriginTreeTrace,\n index: number,\n parent: TreeTraceForUI | undefined,\n list: OriginTreeTrace[],\n ): TreeTraceForUI => {\n const methodId = t.action.input?.slice(0, 10);\n const from = formatAddress(t.action.from, addressType);\n const to = formatAddress(t.action.to, addressType);\n const delegatedTo = to && authMap[to];\n let method = methodId;\n let abi: AbiFunctionWithoutGas[] | undefined = undefined;\n const methodABI =\n methodId && (delegatedTo || to)\n ? methodMap[methodId]?.[delegatedTo || to]\n : undefined;\n if (methodABI) {\n try {\n const result = formatABI(`[\"${methodABI}\"]`, {\n json: true,\n allowEmpty: true,\n });\n abi = JSON.parse(result) as AbiFunctionWithoutGas[];\n const jsonABI = abi[0];\n method = jsonABI?.name || methodId;\n } catch (error) {\n console.log('parse method abi error: ', methodABI, error);\n }\n }\n\n const isContractCreated = !!t.action.createType;\n\n const item: TreeTraceForUI = {\n index: `${parent?.index ? `${parent.index}_` : ''}${index}`,\n type: `${t.action.callType || t.type}`,\n from: from,\n to: to,\n input: t.action.input,\n value: t.action.value,\n result: t.result,\n gas: t.action.gas,\n method,\n abi,\n contractCreated: isContractCreated ? t.result?.addr : undefined,\n nameMap,\n delegatedTo,\n isCallImpl: t.isCallImpl,\n fromPocket: t.action.fromPocket,\n toPocket: t.action.toPocket,\n };\n if (\n parent &&\n parent.to &&\n proxyMap[parent.to] &&\n from === parent.to &&\n to\n ) {\n // proxy call\n if (\n index === 0 &&\n proxyMap[parent.to] === 'Proxy' &&\n t.action.callType === 'delegatecall'\n ) {\n parent.proxy = {\n type: 'Proxy',\n implAddress: to,\n };\n item.isCallImpl = true;\n }\n // beacon proxy call\n const second = list[1];\n if (\n index === 0 &&\n proxyMap[parent.to] === 'BeaconProxy' &&\n t.action.callType === 'staticcall' &&\n second &&\n second.action.to &&\n second.action.from === parent.to &&\n second.action.callType === 'delegatecall'\n ) {\n parent.proxy = {\n type: 'BeaconProxy',\n beaconAddress: to,\n implAddress: second.action.to,\n };\n item.isCallBeacon = true;\n second.isCallImpl = true;\n }\n }\n if (t.calls) {\n item.calls = formatList(t.calls, item);\n }\n return item;\n };\n const list = formatList(data.traceTree);\n return {\n total,\n list,\n };\n};\n\nexport const treeTraceToList = (\n data: TreeTraceForUI[],\n showProxyCall = false,\n) => {\n const result: ListTraceForUI[] = [];\n const handler = (list: TreeTraceForUI[]) => {\n list.forEach(item => {\n if (showProxyCall || (!item.isCallBeacon && !item.isCallImpl)) {\n result.push(item);\n }\n if (item.calls) {\n handler(item.calls);\n }\n });\n };\n handler(data);\n return result;\n};\n\nexport const hideProxyCallInTreeTrace = (data: TreeTraceForUI[]) => {\n const handler = (list: TreeTraceForUI[]) => {\n const result: TreeTraceForUI[] = [];\n list.forEach(item => {\n const newTrace = { ...item };\n if (!newTrace.isCallBeacon && !newTrace.isCallImpl) {\n result.push(newTrace);\n if (newTrace.calls) {\n newTrace.calls = handler(newTrace.calls);\n }\n } else if (newTrace.calls) {\n result.push(...handler(newTrace.calls));\n }\n });\n return result;\n };\n return handler(data);\n};\n\nexport const useTxTrace = (\n hash: string,\n space: 'evm' | 'core',\n {\n isAATx = false,\n }: {\n isAATx?: boolean;\n } = {},\n) => {\n const url = `/transferTree/${hash}${isAATx ? '?txType=aa' : ''}`;\n\n return useSWRImmutable([url, space], () =>\n fetchWithPrefix(url)\n .then((resp: any) => {\n if (resp?.traceTree) {\n const { list, total } = formatTraceData(resp, space);\n return { list, total };\n }\n })\n .catch(e => {\n publishRequestError({ code: 60002, message: e.message }, 'code');\n }),\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,qBAAqB;AAyF5B,IAAM,kBAAkB,CAAC,MAAuB,UAA0B;AACxE,QAAM,cAAc,UAAU,SAAS,WAAW;AAClD,QAAM,WAAW,KAAK,YAAY,CAAC;AACnC,QAAM,YAAY,KAAK,aAAa,CAAC;AACrC,QAAM,UAAU,KAAK,WAAW,CAAC;AACjC,QAAM,UAAU,KAAK,WAAW,CAAC;AAEjC,MAAI,QAAQ;AAEZ,QAAM,aAAa,CACjB,GACA,WACqB;AACrB,aAAS,EAAE;AACX,WAAO,EAAE,IAAI,CAAC,MAAM,UAAU,WAAW,MAAM,OAAO,QAAQ,CAAC,CAAC;AAAA,EAClE;AACA,QAAM,aAAa,CACjB,GACA,OACA,QACAA,UACmB;AACnB,UAAM,WAAW,EAAE,OAAO,OAAO,MAAM,GAAG,EAAE;AAC5C,UAAM,OAAO,cAAc,EAAE,OAAO,MAAM,WAAW;AACrD,UAAM,KAAK,cAAc,EAAE,OAAO,IAAI,WAAW;AACjD,UAAM,cAAc,MAAM,QAAQ,EAAE;AACpC,QAAI,SAAS;AACb,QAAI,MAA2C;AAC/C,UAAM,YACJ,aAAa,eAAe,MACxB,UAAU,QAAQ,IAAI,eAAe,EAAE,IACvC;AACN,QAAI,WAAW;AACb,UAAI;AACF,cAAM,SAAS,UAAU,KAAK,eAAe;AAAA,UAC3C,MAAM;AAAA,UACN,YAAY;AAAA,QACd,CAAC;AACD,cAAM,KAAK,MAAM,MAAM;AACvB,cAAM,UAAU,IAAI,CAAC;AACrB,iBAAS,SAAS,QAAQ;AAAA,MAC5B,SAAS,OAAP;AACA,gBAAQ,IAAI,4BAA4B,WAAW,KAAK;AAAA,MAC1D;AAA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B,EAAE,MAAM,OAAO,SAAS,EAAE,QAAQ,GAAG,MAAM;AAAA,IACjE,CAAC;AAAA,EACL;AACF;","names":["list"]}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -145,5 +145,11 @@ declare function formatABI(_abi: ConstructorParameters<typeof utils.Interface>[0
|
|
|
145
145
|
json: true;
|
|
146
146
|
}): string;
|
|
147
147
|
declare function formatABI(_abi: ConstructorParameters<typeof utils.Interface>[0], options?: FormatABIOptions): string[];
|
|
148
|
+
declare function decodeAANonce(nonceInput: string | BigNumber): {
|
|
149
|
+
originNonce: string;
|
|
150
|
+
key: string;
|
|
151
|
+
nonce: string;
|
|
152
|
+
keyHex: string;
|
|
153
|
+
};
|
|
148
154
|
|
|
149
|
-
export { HIDE_IN_DOT_NET, addIPFSGateway, byteToKb, checkBytes, checkCfxType, checkInt, checkUint, cn, constprocessResultArray, convertBigNumbersToStrings, convertObjBigNumbersToStrings, coreCorrespondsToEspace, formatABI, formatBalance, formatLargeNumber, formatNumber, formatPrice, formatString, formatTimeStamp, fromCfxToDrip, fromDripToCfx, fromDripToGdrip, fromGdripToDrip, getDuration, getEllipsStr, getIncreasePercent, getInitialDate, getNetwork, getNetworkIcon, getPercent, getTimeByBlockInterval, gotoNetwork, hex2utf8, isBlockHash, isEvenLength, isHash, isHex, isLikeBigNumber, isObject, isSafeNumberOrNumericStringInput, isTxHash, isZeroOrPositiveInteger, mergeDeep, parseString, replaceAll, roundToFixedPrecision, selectText, sleep, toThousands, transferRisk, transferToLowerCase, validURL, viewJson };
|
|
155
|
+
export { HIDE_IN_DOT_NET, addIPFSGateway, byteToKb, checkBytes, checkCfxType, checkInt, checkUint, cn, constprocessResultArray, convertBigNumbersToStrings, convertObjBigNumbersToStrings, coreCorrespondsToEspace, decodeAANonce, formatABI, formatBalance, formatLargeNumber, formatNumber, formatPrice, formatString, formatTimeStamp, fromCfxToDrip, fromDripToCfx, fromDripToGdrip, fromGdripToDrip, getDuration, getEllipsStr, getIncreasePercent, getInitialDate, getNetwork, getNetworkIcon, getPercent, getTimeByBlockInterval, gotoNetwork, hex2utf8, isBlockHash, isEvenLength, isHash, isHex, isLikeBigNumber, isObject, isSafeNumberOrNumericStringInput, isTxHash, isZeroOrPositiveInteger, mergeDeep, parseString, replaceAll, roundToFixedPrecision, selectText, sleep, toThousands, transferRisk, transferToLowerCase, validURL, viewJson };
|
package/dist/utils/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
convertBigNumbersToStrings,
|
|
12
12
|
convertObjBigNumbersToStrings,
|
|
13
13
|
coreCorrespondsToEspace,
|
|
14
|
+
decodeAANonce,
|
|
14
15
|
formatABI,
|
|
15
16
|
formatBalance,
|
|
16
17
|
formatLargeNumber,
|
|
@@ -52,9 +53,9 @@ import {
|
|
|
52
53
|
transferToLowerCase,
|
|
53
54
|
validURL,
|
|
54
55
|
viewJson
|
|
55
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-G246NFI4.js";
|
|
56
57
|
import "../chunk-WIB76E7O.js";
|
|
57
|
-
import "../chunk-
|
|
58
|
+
import "../chunk-ZSOMTVP5.js";
|
|
58
59
|
import "../chunk-J2I22Q2M.js";
|
|
59
60
|
import "../chunk-YEINMVAR.js";
|
|
60
61
|
import "../chunk-DQGLZCIG.js";
|
|
@@ -72,6 +73,7 @@ export {
|
|
|
72
73
|
convertBigNumbersToStrings,
|
|
73
74
|
convertObjBigNumbersToStrings,
|
|
74
75
|
coreCorrespondsToEspace,
|
|
76
|
+
decodeAANonce,
|
|
75
77
|
formatABI,
|
|
76
78
|
formatBalance,
|
|
77
79
|
formatLargeNumber,
|
package/dist/utils/request.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare const fetch: <T>(url: string, options?: FetchOptions) => Promise<T>;
|
|
|
7
7
|
declare const appendApiPrefix: (url: string) => string;
|
|
8
8
|
declare const fetchWithPrefix: <T>(url: string, opts?: FetchOptions) => Promise<T>;
|
|
9
9
|
declare const fetchWithOpenApi: <T>(url: string, opts?: FetchOptions) => Promise<T>;
|
|
10
|
-
declare const simpleGetFetcher: <T>(
|
|
10
|
+
declare const simpleGetFetcher: <T>(args: any[]) => Promise<T>;
|
|
11
11
|
type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';
|
|
12
12
|
interface QueryParams {
|
|
13
13
|
[key: string]: string | undefined;
|
package/dist/utils/request.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cfxjs/sirius-next-common",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**"
|
|
@@ -79,18 +79,19 @@
|
|
|
79
79
|
"unocss": "0.58.6",
|
|
80
80
|
"vitest": "3.2.3",
|
|
81
81
|
"@cfxjs/sirius-next-eslint-config": "0.0.0",
|
|
82
|
-
"@cfxjs/sirius-next-i18n": "0.2.
|
|
82
|
+
"@cfxjs/sirius-next-i18n": "0.2.11",
|
|
83
83
|
"@cfxjs/sirius-next-typescript-config": "0.0.0"
|
|
84
84
|
},
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|
|
87
87
|
},
|
|
88
88
|
"scripts": {
|
|
89
|
-
"
|
|
89
|
+
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
90
|
+
"build": "pnpm clean && pnpm build:lib && pnpm build:css",
|
|
90
91
|
"build:lib": "tsup",
|
|
91
92
|
"build:css": "unocss",
|
|
92
|
-
"dev": "concurrently 'pnpm dev:lib' 'pnpm dev:css'",
|
|
93
|
-
"dev:lib": "
|
|
93
|
+
"dev": "pnpm clean && concurrently 'pnpm dev:lib' 'pnpm dev:css'",
|
|
94
|
+
"dev:lib": "tsup --watch src",
|
|
94
95
|
"dev:css": "unocss -w",
|
|
95
96
|
"generate:component": "turbo gen react-component",
|
|
96
97
|
"lint": "eslint . --max-warnings 0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/InputData/ContractDetail.tsx"],"sourcesContent":["import React from 'react';\nimport { formatAddress } from '../../utils/address';\nimport { Link } from '../Link';\nimport { DefaultTokenIcon } from '../Icons';\nimport clsx from 'clsx';\n\nexport const formatContractAndTokenInfoMap = (\n m: any,\n addressType: 'hex' | 'base32',\n): Record<string, ContractAndTokenInfo> => {\n try {\n return Object.entries<ContractAndTokenInfo>(m)\n .map(a => ({\n [formatAddress(a[0], addressType)]: a[1],\n [a[0]]: a[1],\n }))\n .reduce((prev, curr) => Object.assign(prev, curr), {});\n } catch (error) {\n return {};\n }\n};\n\nexport interface ContractAndTokenInfo {\n contract: {\n name?: string;\n address: string;\n };\n token: {\n name?: string;\n symbol?: string;\n iconUrl?: string;\n address: string;\n };\n}\n\nconst Icon = ({ icon, className }: { icon?: string; className?: string }) => {\n return icon ? (\n <img\n src={icon}\n alt=\"icon\"\n className={clsx('w-1.1429rem mr-2px mb-3px', className)}\n />\n ) : (\n <DefaultTokenIcon\n className={clsx('w-1.1429rem mr-2px mb-3px', className)}\n />\n );\n};\n\ninterface Props {\n info?: ContractAndTokenInfo;\n addressType: 'hex' | 'base32';\n}\n\nexport const ContractDetail = ({ info, addressType }: Props) => {\n if (info) {\n const { contract, token } = info;\n let child: React.ReactNode = null;\n\n if (token && (token.name || token.symbol)) {\n const name = token['name'] || '--';\n let symbol = token['symbol'];\n symbol = `(${symbol ? symbol : '--'})`;\n const icon = token['iconUrl'];\n\n child = (\n <>\n <Icon icon={icon} />\n <Link href={`/token/${formatAddress(token.address, addressType)}`}>\n {name} {symbol}\n </Link>{' '}\n </>\n );\n } else if (contract && contract.name) {\n const name = contract['name'];\n const icon = token && token['iconUrl'];\n\n child = (\n <>\n <Icon icon={icon} />\n <Link\n href={`/address/${formatAddress(contract.address, addressType)}`}\n >\n {name}\n </Link>{' '}\n </>\n );\n }\n\n return <> {child}</>;\n }\n return null;\n};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