@cfxjs/sirius-next-common 0.1.31 → 0.1.33
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-2P6RNTXI.js +141 -0
- package/dist/chunk-2P6RNTXI.js.map +1 -0
- package/dist/chunk-3MZJYUNS.js +212 -0
- package/dist/chunk-3MZJYUNS.js.map +1 -0
- package/dist/chunk-4WJIMFI5.js +141 -0
- package/dist/chunk-4WJIMFI5.js.map +1 -0
- package/dist/chunk-5PYSDWGQ.js +127 -0
- package/dist/chunk-5PYSDWGQ.js.map +1 -0
- package/dist/chunk-5Z5K44KU.js +108 -0
- package/dist/chunk-5Z5K44KU.js.map +1 -0
- package/dist/chunk-6CR7KJMU.js +141 -0
- package/dist/chunk-6CR7KJMU.js.map +1 -0
- package/dist/chunk-6Q2ML33K.js +141 -0
- package/dist/chunk-6Q2ML33K.js.map +1 -0
- package/dist/chunk-7TTJMYA4.js +108 -0
- package/dist/chunk-7TTJMYA4.js.map +1 -0
- package/dist/chunk-CL6X23Y3.js +108 -0
- package/dist/chunk-CL6X23Y3.js.map +1 -0
- package/dist/chunk-E7KZNWOF.js +150 -0
- package/dist/chunk-E7KZNWOF.js.map +1 -0
- package/dist/chunk-EF2N45TZ.js +49 -0
- package/dist/chunk-EF2N45TZ.js.map +1 -0
- package/dist/chunk-FRW235T3.js +213 -0
- package/dist/chunk-FRW235T3.js.map +1 -0
- package/dist/chunk-GJCBWNU5.js +127 -0
- package/dist/chunk-GJCBWNU5.js.map +1 -0
- package/dist/chunk-GL4KHAZB.js +105 -0
- package/dist/chunk-GL4KHAZB.js.map +1 -0
- package/dist/chunk-GYK27Y5X.js +796 -0
- package/dist/chunk-GYK27Y5X.js.map +1 -0
- package/dist/chunk-H63H7IRY.js +141 -0
- package/dist/chunk-H63H7IRY.js.map +1 -0
- package/dist/chunk-HMP3NSJX.js +3629 -0
- package/dist/chunk-HMP3NSJX.js.map +1 -0
- package/dist/chunk-JEBXQSTA.js +108 -0
- package/dist/chunk-JEBXQSTA.js.map +1 -0
- package/dist/chunk-JMM6NFUN.js +212 -0
- package/dist/chunk-JMM6NFUN.js.map +1 -0
- package/dist/chunk-LC3NZF3B.js +3629 -0
- package/dist/chunk-LC3NZF3B.js.map +1 -0
- package/dist/chunk-LSIWDRKV.js +105 -0
- package/dist/chunk-LSIWDRKV.js.map +1 -0
- package/dist/chunk-LXPKK77D.js +213 -0
- package/dist/chunk-LXPKK77D.js.map +1 -0
- package/dist/chunk-MN3Y4WII.js +2324 -0
- package/dist/chunk-MN3Y4WII.js.map +1 -0
- package/dist/chunk-OBYGZKWE.js +796 -0
- package/dist/chunk-OBYGZKWE.js.map +1 -0
- package/dist/chunk-PH7BGJ6R.js +150 -0
- package/dist/chunk-PH7BGJ6R.js.map +1 -0
- package/dist/chunk-PKSF74ZF.js +49 -0
- package/dist/chunk-PKSF74ZF.js.map +1 -0
- package/dist/chunk-QSLCIDOR.js +212 -0
- package/dist/chunk-QSLCIDOR.js.map +1 -0
- package/dist/chunk-XAIU7RPV.js +108 -0
- package/dist/chunk-XAIU7RPV.js.map +1 -0
- package/dist/chunk-XEK7EJTM.js +2324 -0
- package/dist/chunk-XEK7EJTM.js.map +1 -0
- 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/Age/index.js +3 -3
- package/dist/components/CopyButton/index.js +2 -2
- package/dist/components/DownloadCSV/index.js +3 -3
- package/dist/components/GasPriceDropdown/index.js +1 -1
- package/dist/components/IncreasePercent/index.js +1 -1
- package/dist/components/InfoIconWithTooltip/index.js +2 -2
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/NetworkIcon/index.js +1 -1
- package/dist/components/PhishingAddressContainer/index.js +4 -4
- package/dist/components/Price/index.js +2 -2
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Select/select.js +2 -2
- package/dist/components/Text/index.js +3 -3
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/TransactionAction/coreTransactionAction.js +10 -10
- package/dist/components/TransactionAction/evmTransactionAction.js +9 -9
- package/dist/utils/address.js +2 -2
- package/dist/utils/contractManagerTool.js +1 -1
- package/dist/utils/hooks/useENS.js +3 -3
- package/dist/utils/index.d.ts +15 -1
- package/dist/utils/index.js +7 -3
- package/dist/utils/rpcRequest.d.ts +1 -1
- package/dist/utils/rpcRequest.js +1 -1
- package/dist/utils/tx.d.ts +2 -0
- package/dist/utils/tx.js +95 -0
- package/dist/utils/tx.js.map +1 -0
- package/package.json +8 -4
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RenderAddress
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-5PYSDWGQ.js";
|
|
4
|
+
import "../../chunk-OJQKHBLY.js";
|
|
5
|
+
import "../../chunk-SAXB4ZDO.js";
|
|
6
|
+
import "../../chunk-GL4KHAZB.js";
|
|
7
7
|
import "../../chunk-TOKKKTFG.js";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-XEK7EJTM.js";
|
|
9
9
|
import "../../chunk-LRCAKRPK.js";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-OBYGZKWE.js";
|
|
11
11
|
import "../../chunk-7RH7LJYB.js";
|
|
12
12
|
import "../../chunk-BTGKYV55.js";
|
|
13
13
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getLabelInfo
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-EF2N45TZ.js";
|
|
4
|
+
import "../../chunk-XEK7EJTM.js";
|
|
5
5
|
import "../../chunk-LRCAKRPK.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-OBYGZKWE.js";
|
|
7
7
|
import "../../chunk-7RH7LJYB.js";
|
|
8
8
|
import "../../chunk-BTGKYV55.js";
|
|
9
9
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Text
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-GL4KHAZB.js";
|
|
4
4
|
import "../../chunk-TOKKKTFG.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-XEK7EJTM.js";
|
|
6
6
|
import "../../chunk-LRCAKRPK.js";
|
|
7
7
|
import {
|
|
8
8
|
getDuration
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-OBYGZKWE.js";
|
|
10
10
|
import "../../chunk-7RH7LJYB.js";
|
|
11
11
|
import "../../chunk-BTGKYV55.js";
|
|
12
12
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tooltip
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-XEK7EJTM.js";
|
|
4
4
|
import "../../chunk-LRCAKRPK.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-OBYGZKWE.js";
|
|
6
6
|
import "../../chunk-7RH7LJYB.js";
|
|
7
7
|
import "../../chunk-BTGKYV55.js";
|
|
8
8
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Modal
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-PH7BGJ6R.js";
|
|
4
4
|
import "../../chunk-XCKMXAL2.js";
|
|
5
5
|
import {
|
|
6
6
|
Link
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
import "../../chunk-TGK5LP2H.js";
|
|
9
9
|
import {
|
|
10
10
|
Tooltip
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-XEK7EJTM.js";
|
|
12
12
|
import "../../chunk-LRCAKRPK.js";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-OBYGZKWE.js";
|
|
14
14
|
import "../../chunk-7RH7LJYB.js";
|
|
15
15
|
import "../../chunk-BTGKYV55.js";
|
|
16
16
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
} from "../../chunk-65X53DMW.js";
|
|
4
4
|
import {
|
|
5
5
|
Tooltip
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-XEK7EJTM.js";
|
|
7
7
|
import "../../chunk-LRCAKRPK.js";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-OBYGZKWE.js";
|
|
9
9
|
import "../../chunk-7RH7LJYB.js";
|
|
10
10
|
import "../../chunk-BTGKYV55.js";
|
|
11
11
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Modal
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-PH7BGJ6R.js";
|
|
4
4
|
import "../../chunk-XCKMXAL2.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-OBYGZKWE.js";
|
|
6
6
|
import "../../chunk-7RH7LJYB.js";
|
|
7
7
|
import "../../chunk-BTGKYV55.js";
|
|
8
8
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "../../chunk-3DOLNPRU.js";
|
|
4
4
|
import {
|
|
5
5
|
convertCheckSum
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-OJQKHBLY.js";
|
|
7
|
+
import "../../chunk-SAXB4ZDO.js";
|
|
8
8
|
import {
|
|
9
9
|
Tooltip
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-XEK7EJTM.js";
|
|
11
11
|
import "../../chunk-LRCAKRPK.js";
|
|
12
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-OBYGZKWE.js";
|
|
13
13
|
import "../../chunk-7RH7LJYB.js";
|
|
14
14
|
import "../../chunk-BTGKYV55.js";
|
|
15
15
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tooltip
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-XEK7EJTM.js";
|
|
4
4
|
import "../../chunk-LRCAKRPK.js";
|
|
5
5
|
import {
|
|
6
6
|
formatPrice
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-OBYGZKWE.js";
|
|
8
8
|
import "../../chunk-7RH7LJYB.js";
|
|
9
9
|
import "../../chunk-BTGKYV55.js";
|
|
10
10
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
SelectItem,
|
|
6
6
|
SelectTrigger,
|
|
7
7
|
SelectValue
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-LC3NZF3B.js";
|
|
9
9
|
import "../../chunk-LRCAKRPK.js";
|
|
10
10
|
import {
|
|
11
11
|
cn
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-OBYGZKWE.js";
|
|
13
13
|
import "../../chunk-7RH7LJYB.js";
|
|
14
14
|
import "../../chunk-BTGKYV55.js";
|
|
15
15
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
SelectSeparator,
|
|
9
9
|
SelectTrigger,
|
|
10
10
|
SelectValue
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-LC3NZF3B.js";
|
|
12
12
|
import "../../chunk-LRCAKRPK.js";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-OBYGZKWE.js";
|
|
14
14
|
import "../../chunk-7RH7LJYB.js";
|
|
15
15
|
import "../../chunk-BTGKYV55.js";
|
|
16
16
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Text
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-GL4KHAZB.js";
|
|
4
4
|
import "../../chunk-TOKKKTFG.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-XEK7EJTM.js";
|
|
6
6
|
import "../../chunk-LRCAKRPK.js";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-OBYGZKWE.js";
|
|
8
8
|
import "../../chunk-7RH7LJYB.js";
|
|
9
9
|
import "../../chunk-BTGKYV55.js";
|
|
10
10
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tooltip
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-XEK7EJTM.js";
|
|
4
4
|
import "../../chunk-LRCAKRPK.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-OBYGZKWE.js";
|
|
6
6
|
import "../../chunk-7RH7LJYB.js";
|
|
7
7
|
import "../../chunk-BTGKYV55.js";
|
|
8
8
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -10,20 +10,20 @@ import {
|
|
|
10
10
|
import "../../chunk-TGK5LP2H.js";
|
|
11
11
|
import {
|
|
12
12
|
CoreAddressContainer
|
|
13
|
-
} from "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
20
|
-
import "../../chunk-
|
|
13
|
+
} from "../../chunk-H63H7IRY.js";
|
|
14
|
+
import "../../chunk-3UXPRBHP.js";
|
|
15
|
+
import "../../chunk-QSLCIDOR.js";
|
|
16
|
+
import "../../chunk-5PYSDWGQ.js";
|
|
17
|
+
import "../../chunk-OJQKHBLY.js";
|
|
18
|
+
import "../../chunk-SAXB4ZDO.js";
|
|
19
|
+
import "../../chunk-EF2N45TZ.js";
|
|
20
|
+
import "../../chunk-GL4KHAZB.js";
|
|
21
21
|
import "../../chunk-TOKKKTFG.js";
|
|
22
|
-
import "../../chunk-
|
|
22
|
+
import "../../chunk-XEK7EJTM.js";
|
|
23
23
|
import "../../chunk-LRCAKRPK.js";
|
|
24
24
|
import {
|
|
25
25
|
formatBalance
|
|
26
|
-
} from "../../chunk-
|
|
26
|
+
} from "../../chunk-OBYGZKWE.js";
|
|
27
27
|
import "../../chunk-7RH7LJYB.js";
|
|
28
28
|
import {
|
|
29
29
|
reqContractAndToken,
|
|
@@ -10,21 +10,21 @@ import {
|
|
|
10
10
|
import "../../chunk-TGK5LP2H.js";
|
|
11
11
|
import {
|
|
12
12
|
EVMAddressContainer
|
|
13
|
-
} from "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
13
|
+
} from "../../chunk-CL6X23Y3.js";
|
|
14
|
+
import "../../chunk-QSLCIDOR.js";
|
|
15
|
+
import "../../chunk-5PYSDWGQ.js";
|
|
16
16
|
import {
|
|
17
17
|
formatAddress
|
|
18
|
-
} from "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
18
|
+
} from "../../chunk-OJQKHBLY.js";
|
|
19
|
+
import "../../chunk-SAXB4ZDO.js";
|
|
20
|
+
import "../../chunk-EF2N45TZ.js";
|
|
21
|
+
import "../../chunk-GL4KHAZB.js";
|
|
22
22
|
import "../../chunk-TOKKKTFG.js";
|
|
23
|
-
import "../../chunk-
|
|
23
|
+
import "../../chunk-XEK7EJTM.js";
|
|
24
24
|
import "../../chunk-LRCAKRPK.js";
|
|
25
25
|
import {
|
|
26
26
|
formatBalance
|
|
27
|
-
} from "../../chunk-
|
|
27
|
+
} from "../../chunk-OBYGZKWE.js";
|
|
28
28
|
import "../../chunk-7RH7LJYB.js";
|
|
29
29
|
import {
|
|
30
30
|
reqContractAndToken,
|
package/dist/utils/address.js
CHANGED
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
isSimplyZeroAddress,
|
|
24
24
|
isSpecialAddress,
|
|
25
25
|
isZeroAddress
|
|
26
|
-
} from "../chunk-
|
|
27
|
-
import "../chunk-
|
|
26
|
+
} from "../chunk-OJQKHBLY.js";
|
|
27
|
+
import "../chunk-SAXB4ZDO.js";
|
|
28
28
|
import "../chunk-7RH7LJYB.js";
|
|
29
29
|
import "../chunk-J2I22Q2M.js";
|
|
30
30
|
import "../chunk-DQGLZCIG.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useENS
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-3UXPRBHP.js";
|
|
4
|
+
import "../../chunk-OJQKHBLY.js";
|
|
5
|
+
import "../../chunk-SAXB4ZDO.js";
|
|
6
6
|
import "../../chunk-7RH7LJYB.js";
|
|
7
7
|
import "../../chunk-BTGKYV55.js";
|
|
8
8
|
import "../../chunk-J2I22Q2M.js";
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
|
+
import { utils } from 'ethers';
|
|
4
5
|
import { GlobalDataType, NetworksType, NetworkSpace } from '../store/types.js';
|
|
5
6
|
import '@cfxjs/sirius-next-i18n/types';
|
|
6
7
|
import './constants.js';
|
|
@@ -131,5 +132,18 @@ declare const getIncreasePercent: (_base: string | number | BigNumber, prev: str
|
|
|
131
132
|
percent: string;
|
|
132
133
|
isNegative: boolean;
|
|
133
134
|
};
|
|
135
|
+
declare const viewJson: (json: object) => Promise<void>;
|
|
136
|
+
type FragmentType = 'function' | 'event' | 'constructor' | 'error';
|
|
137
|
+
interface FormatABIOptions {
|
|
138
|
+
allowEmpty?: boolean;
|
|
139
|
+
nameRequired?: boolean;
|
|
140
|
+
minimal?: boolean;
|
|
141
|
+
json?: boolean;
|
|
142
|
+
allowTypes?: FragmentType[];
|
|
143
|
+
}
|
|
144
|
+
declare function formatABI(_abi: ConstructorParameters<typeof utils.Interface>[0], options: FormatABIOptions & {
|
|
145
|
+
json: true;
|
|
146
|
+
}): string;
|
|
147
|
+
declare function formatABI(_abi: ConstructorParameters<typeof utils.Interface>[0], options?: FormatABIOptions): string[];
|
|
134
148
|
|
|
135
|
-
export { HIDE_IN_DOT_NET, addIPFSGateway, byteToKb, checkBytes, checkCfxType, checkInt, checkUint, cn, constprocessResultArray, convertBigNumbersToStrings, convertObjBigNumbersToStrings, coreCorrespondsToEspace, 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 };
|
|
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 };
|
package/dist/utils/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
convertBigNumbersToStrings,
|
|
12
12
|
convertObjBigNumbersToStrings,
|
|
13
13
|
coreCorrespondsToEspace,
|
|
14
|
+
formatABI,
|
|
14
15
|
formatBalance,
|
|
15
16
|
formatLargeNumber,
|
|
16
17
|
formatNumber,
|
|
@@ -49,8 +50,9 @@ import {
|
|
|
49
50
|
toThousands,
|
|
50
51
|
transferRisk,
|
|
51
52
|
transferToLowerCase,
|
|
52
|
-
validURL
|
|
53
|
-
|
|
53
|
+
validURL,
|
|
54
|
+
viewJson
|
|
55
|
+
} from "../chunk-OBYGZKWE.js";
|
|
54
56
|
import "../chunk-7RH7LJYB.js";
|
|
55
57
|
import "../chunk-BTGKYV55.js";
|
|
56
58
|
import "../chunk-J2I22Q2M.js";
|
|
@@ -68,6 +70,7 @@ export {
|
|
|
68
70
|
convertBigNumbersToStrings,
|
|
69
71
|
convertObjBigNumbersToStrings,
|
|
70
72
|
coreCorrespondsToEspace,
|
|
73
|
+
formatABI,
|
|
71
74
|
formatBalance,
|
|
72
75
|
formatLargeNumber,
|
|
73
76
|
formatNumber,
|
|
@@ -106,6 +109,7 @@ export {
|
|
|
106
109
|
toThousands,
|
|
107
110
|
transferRisk,
|
|
108
111
|
transferToLowerCase,
|
|
109
|
-
validURL
|
|
112
|
+
validURL,
|
|
113
|
+
viewJson
|
|
110
114
|
};
|
|
111
115
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/rpcRequest.js
CHANGED
package/dist/utils/tx.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NETWORK_ID
|
|
3
|
+
} from "../chunk-7RH7LJYB.js";
|
|
4
|
+
import "../chunk-DQGLZCIG.js";
|
|
5
|
+
|
|
6
|
+
// src/utils/tx.ts
|
|
7
|
+
import SDK from "js-conflux-sdk";
|
|
8
|
+
var getAddress = (data) => SDK.format.address(data, NETWORK_ID);
|
|
9
|
+
var formatData = (data, type, option) => {
|
|
10
|
+
if (!data)
|
|
11
|
+
return "";
|
|
12
|
+
const _option = option || {
|
|
13
|
+
space: 4
|
|
14
|
+
};
|
|
15
|
+
try {
|
|
16
|
+
if (type.startsWith("bytes")) {
|
|
17
|
+
if (Array.isArray(data)) {
|
|
18
|
+
return JSON.stringify(
|
|
19
|
+
data.map((d) => formatData(d, "bytes")),
|
|
20
|
+
null,
|
|
21
|
+
4
|
|
22
|
+
);
|
|
23
|
+
} else {
|
|
24
|
+
return SDK.format.hex(data);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (data.sign !== void 0) {
|
|
28
|
+
return data.toString();
|
|
29
|
+
}
|
|
30
|
+
if (Object.prototype.toString.call(data) === "[object Array]") {
|
|
31
|
+
return JSON.stringify(data, null, _option.space);
|
|
32
|
+
}
|
|
33
|
+
return data.toString();
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.log("format data error: ", e);
|
|
36
|
+
return data.toString();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var disassembleEvent = (decodedLog, log) => {
|
|
40
|
+
try {
|
|
41
|
+
var r = /(.*?)(?=\()(\((.*)\))$/;
|
|
42
|
+
const result = r.exec(decodedLog.fullName);
|
|
43
|
+
if (result !== null) {
|
|
44
|
+
let args = result[3];
|
|
45
|
+
let indexCount = 1;
|
|
46
|
+
args = args.split(", ").filter((a) => a !== "").map((i, index) => {
|
|
47
|
+
let item = i.trim().split(" ");
|
|
48
|
+
const type = item[0];
|
|
49
|
+
let r2 = {
|
|
50
|
+
argName: "",
|
|
51
|
+
type,
|
|
52
|
+
indexed: 0,
|
|
53
|
+
// 0 is mean not indexed
|
|
54
|
+
value: null,
|
|
55
|
+
originalValue: "",
|
|
56
|
+
hexValue: "",
|
|
57
|
+
hexAddress: "",
|
|
58
|
+
cfxAddress: ""
|
|
59
|
+
};
|
|
60
|
+
let valueIndex = 1;
|
|
61
|
+
if (item.length === 3) {
|
|
62
|
+
r2.indexed = indexCount;
|
|
63
|
+
r2.hexValue = log.topics ? log.topics[indexCount] : "";
|
|
64
|
+
valueIndex = 2;
|
|
65
|
+
indexCount += 1;
|
|
66
|
+
}
|
|
67
|
+
const argName = item[valueIndex] === "undefined" ? `arg${index}` : item[valueIndex];
|
|
68
|
+
const originalValue = decodedLog.array[index];
|
|
69
|
+
const value = formatData(originalValue, r2.type);
|
|
70
|
+
r2.argName = argName;
|
|
71
|
+
r2.originalValue = originalValue;
|
|
72
|
+
r2.value = value;
|
|
73
|
+
if (r2.type === "address") {
|
|
74
|
+
try {
|
|
75
|
+
r2.hexAddress = SDK.format.hexAddress(r2.value);
|
|
76
|
+
r2.cfxAddress = getAddress(r2.value);
|
|
77
|
+
} catch (e) {
|
|
78
|
+
console.log("disassembleEvent error: ", e);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return r2;
|
|
82
|
+
}).filter((b) => b.originalValue !== void 0);
|
|
83
|
+
return args;
|
|
84
|
+
} else {
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
} catch (e) {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
disassembleEvent,
|
|
93
|
+
formatData
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=tx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/tx.ts"],"sourcesContent":["import SDK from 'js-conflux-sdk';\nimport { NETWORK_ID } from './constants';\n\nconst getAddress = (data: unknown) => SDK.format.address(data, NETWORK_ID);\n\n/**\n *\n * @param data\n * @param type\n * @returns\n * @todo\n * 1. handle JSON.stringify issue\n */\nexport const formatData = (data, type, option?) => {\n if (!data) return '';\n const _option = option || {\n space: 4,\n };\n\n try {\n // handle string type specially, translate to hex format\n // if (type === 'string') {\n // const bytes = SDK.format.bytes(data); // SDK.format.bytes should update, not accept string\n // const hex = SDK.format.hex(bytes);\n // return hex;\n // }\n // bytes is formatted to hex\n if (type.startsWith('bytes')) {\n if (Array.isArray(data)) {\n return JSON.stringify(\n data.map(d => formatData(d, 'bytes')),\n null,\n 4,\n );\n } else {\n return SDK.format.hex(data);\n }\n }\n // bigint value, should convert first, because Object.prototype.toString.call(data) = '[object Array]'\n if (data.sign !== undefined) {\n return data.toString();\n }\n // bytes[], uint[], int[], tuple\n // @todo use JSON.stringify to decode data, will cause inner value to be wrapped with quotation mark, like \"string\" type\n if (Object.prototype.toString.call(data) === '[object Array]') {\n return JSON.stringify(data, null, _option.space);\n }\n // others: address, uint, int,\n return data.toString();\n } catch (e) {\n console.log('format data error: ', e);\n return data.toString();\n }\n};\n\nexport interface DecodedParams {\n argName: string;\n type: string;\n indexed: number;\n originalValue?: any; // original value\n value?: any; // decoded value with formatData method, equal to value\n hexValue?: string; // @todo, hex formatted value\n hexAddress?: string; // hex formatted address\n cfxAddress?: string; // base32 formatted address\n}\n\n// @todo, use this for eventlogs\nexport const disassembleEvent = (decodedLog, log) => {\n try {\n var r = /(.*?)(?=\\()(\\((.*)\\))$/;\n const result = r.exec(decodedLog.fullName);\n\n if (result !== null) {\n let args: string | Array<DecodedParams> = result[3];\n let indexCount = 1;\n\n args = args\n .split(', ')\n .filter(a => a !== '')\n .map((i, index) => {\n let item = i.trim().split(' ');\n const type = item[0];\n\n let r = {\n argName: '',\n type: type,\n indexed: 0, // 0 is mean not indexed\n value: null,\n originalValue: '',\n hexValue: '',\n hexAddress: '',\n cfxAddress: '',\n };\n\n let valueIndex = 1;\n\n // for eventlog topic decode\n if (item.length === 3) {\n r.indexed = indexCount;\n r.hexValue = log.topics ? log.topics[indexCount] : '';\n\n valueIndex = 2;\n indexCount += 1;\n }\n\n // support minimal format abi, which is't have argName\n const argName =\n item[valueIndex] === 'undefined' ? `arg${index}` : item[valueIndex];\n const originalValue = decodedLog.array[index];\n const value = formatData(originalValue, r.type);\n\n r.argName = argName;\n r.originalValue = originalValue;\n r.value = value;\n\n // try to get hex address and base32 address\n if (r.type === 'address') {\n try {\n r.hexAddress = SDK.format.hexAddress(r.value); // try to format cfx address to hex address\n r.cfxAddress = getAddress(r.value);\n } catch (e) {\n console.log('disassembleEvent error: ', e);\n }\n }\n\n return r;\n })\n .filter(b => b.originalValue !== undefined);\n\n return args;\n } else {\n return [];\n }\n } catch (e) {\n return [];\n }\n};\n"],"mappings":";;;;;;AAAA,OAAO,SAAS;AAGhB,IAAM,aAAa,CAAC,SAAkB,IAAI,OAAO,QAAQ,MAAM,UAAU;AAUlE,IAAM,aAAa,CAAC,MAAM,MAAM,WAAY;AACjD,MAAI,CAAC;AAAM,WAAO;AAClB,QAAM,UAAU,UAAU;AAAA,IACxB,OAAO;AAAA,EACT;AAEA,MAAI;AAQF,QAAI,KAAK,WAAW,OAAO,GAAG;AAC5B,UAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,eAAO,KAAK;AAAA,UACV,KAAK,IAAI,OAAK,WAAW,GAAG,OAAO,CAAC;AAAA,UACpC;AAAA,UACA;AAAA,QACF;AAAA,MACF,OAAO;AACL,eAAO,IAAI,OAAO,IAAI,IAAI;AAAA,MAC5B;AAAA,IACF;AAEA,QAAI,KAAK,SAAS,QAAW;AAC3B,aAAO,KAAK,SAAS;AAAA,IACvB;AAGA,QAAI,OAAO,UAAU,SAAS,KAAK,IAAI,MAAM,kBAAkB;AAC7D,aAAO,KAAK,UAAU,MAAM,MAAM,QAAQ,KAAK;AAAA,IACjD;AAEA,WAAO,KAAK,SAAS;AAAA,EACvB,SAAS,GAAP;AACA,YAAQ,IAAI,uBAAuB,CAAC;AACpC,WAAO,KAAK,SAAS;AAAA,EACvB;AACF;AAcO,IAAM,mBAAmB,CAAC,YAAY,QAAQ;AACnD,MAAI;AACF,QAAI,IAAI;AACR,UAAM,SAAS,EAAE,KAAK,WAAW,QAAQ;AAEzC,QAAI,WAAW,MAAM;AACnB,UAAI,OAAsC,OAAO,CAAC;AAClD,UAAI,aAAa;AAEjB,aAAO,KACJ,MAAM,IAAI,EACV,OAAO,OAAK,MAAM,EAAE,EACpB,IAAI,CAAC,GAAG,UAAU;AACjB,YAAI,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG;AAC7B,cAAM,OAAO,KAAK,CAAC;AAEnB,YAAIA,KAAI;AAAA,UACN,SAAS;AAAA,UACT;AAAA,UACA,SAAS;AAAA;AAAA,UACT,OAAO;AAAA,UACP,eAAe;AAAA,UACf,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,YAAY;AAAA,QACd;AAEA,YAAI,aAAa;AAGjB,YAAI,KAAK,WAAW,GAAG;AACrB,UAAAA,GAAE,UAAU;AACZ,UAAAA,GAAE,WAAW,IAAI,SAAS,IAAI,OAAO,UAAU,IAAI;AAEnD,uBAAa;AACb,wBAAc;AAAA,QAChB;AAGA,cAAM,UACJ,KAAK,UAAU,MAAM,cAAc,MAAM,UAAU,KAAK,UAAU;AACpE,cAAM,gBAAgB,WAAW,MAAM,KAAK;AAC5C,cAAM,QAAQ,WAAW,eAAeA,GAAE,IAAI;AAE9C,QAAAA,GAAE,UAAU;AACZ,QAAAA,GAAE,gBAAgB;AAClB,QAAAA,GAAE,QAAQ;AAGV,YAAIA,GAAE,SAAS,WAAW;AACxB,cAAI;AACF,YAAAA,GAAE,aAAa,IAAI,OAAO,WAAWA,GAAE,KAAK;AAC5C,YAAAA,GAAE,aAAa,WAAWA,GAAE,KAAK;AAAA,UACnC,SAAS,GAAP;AACA,oBAAQ,IAAI,4BAA4B,CAAC;AAAA,UAC3C;AAAA,QACF;AAEA,eAAOA;AAAA,MACT,CAAC,EACA,OAAO,OAAK,EAAE,kBAAkB,MAAS;AAE5C,aAAO;AAAA,IACT,OAAO;AACL,aAAO,CAAC;AAAA,IACV;AAAA,EACF,SAAS,GAAP;AACA,WAAO,CAAC;AAAA,EACV;AACF;","names":["r"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cfxjs/sirius-next-common",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**"
|
|
@@ -22,14 +22,16 @@
|
|
|
22
22
|
"clsx": "^2.1.0",
|
|
23
23
|
"copyfiles": "^2.4.1",
|
|
24
24
|
"dayjs": "^1.11.10",
|
|
25
|
+
"ethers": "5.7.0",
|
|
25
26
|
"highcharts": "^10.0.0",
|
|
26
27
|
"highcharts-react-official": "^3.1.0",
|
|
27
28
|
"i18next": "^19.3.4",
|
|
28
29
|
"i18next-browser-languagedetector": "^7.2.1",
|
|
29
30
|
"jest-environment-jsdom": "^29.7.0",
|
|
30
|
-
"js-conflux-sdk": "
|
|
31
|
+
"js-conflux-sdk": "2.5.0",
|
|
31
32
|
"lodash": "^4.17.21",
|
|
32
33
|
"lucide-react": "^0.379.0",
|
|
34
|
+
"pako": "2.0.2",
|
|
33
35
|
"query-string": "6.13.1",
|
|
34
36
|
"react-google-recaptcha": "^3.1.0",
|
|
35
37
|
"react-i18next": "^11.18.6",
|
|
@@ -48,6 +50,7 @@
|
|
|
48
50
|
"@types/eslint": "^8.56.5",
|
|
49
51
|
"@types/jest": "^29.5.12",
|
|
50
52
|
"@types/node": "^20.11.24",
|
|
53
|
+
"@types/pako": "2.0.2",
|
|
51
54
|
"@types/react": "^18.2.61",
|
|
52
55
|
"@types/react-dom": "^18.2.19",
|
|
53
56
|
"@unocss/cli": "0.58.6",
|
|
@@ -60,7 +63,8 @@
|
|
|
60
63
|
"ts-jest": "^29.1.2",
|
|
61
64
|
"typescript": "^5.4.2",
|
|
62
65
|
"unocss": "0.58.6",
|
|
63
|
-
"
|
|
66
|
+
"vitest": "3.2.3",
|
|
67
|
+
"@cfxjs/sirius-next-i18n": "0.1.24",
|
|
64
68
|
"@cfxjs/sirius-next-eslint-config": "0.0.0",
|
|
65
69
|
"@cfxjs/sirius-next-typescript-config": "0.0.0"
|
|
66
70
|
},
|
|
@@ -76,6 +80,6 @@
|
|
|
76
80
|
"dev:css": "unocss -w",
|
|
77
81
|
"generate:component": "turbo gen react-component",
|
|
78
82
|
"lint": "eslint . --max-warnings 0",
|
|
79
|
-
"test": "
|
|
83
|
+
"test": "vitest"
|
|
80
84
|
}
|
|
81
85
|
}
|