@injectivelabs/utils 1.16.1-alpha.1 → 1.16.1-alpha.3
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/cjs/test-utils/mocks/index.d.ts +5 -5
- package/dist/cjs/test-utils/mocks/index.js +3 -3
- package/dist/cjs/test-utils/msgs.d.ts +5 -5
- package/dist/cjs/test-utils/msgs.js +2 -2
- package/dist/esm/test-utils/mocks/index.d.ts +5 -5
- package/dist/esm/test-utils/mocks/index.js +4 -4
- package/dist/esm/test-utils/msgs.d.ts +5 -5
- package/dist/esm/test-utils/msgs.js +2 -2
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChainId,
|
|
1
|
+
import { ChainId, EthereumChainId } from '@injectivelabs/ts-types';
|
|
2
2
|
export declare const injUsdtSpotMarket: {
|
|
3
3
|
marketId: string;
|
|
4
4
|
marketStatus: string;
|
|
@@ -124,9 +124,9 @@ export declare const mockFactory: {
|
|
|
124
124
|
orderHash: string;
|
|
125
125
|
orderHash2: string;
|
|
126
126
|
MAX_TIMEOUT_HEIGHT: number;
|
|
127
|
-
eip712Tx: ({ chainId,
|
|
127
|
+
eip712Tx: ({ chainId, ethereumChainId, accountNumber, sequence, timeoutHeight, memo, }: {
|
|
128
128
|
chainId?: ChainId;
|
|
129
|
-
|
|
129
|
+
ethereumChainId?: EthereumChainId;
|
|
130
130
|
accountNumber?: number;
|
|
131
131
|
sequence?: number;
|
|
132
132
|
timeoutHeight?: number;
|
|
@@ -136,7 +136,7 @@ export declare const mockFactory: {
|
|
|
136
136
|
memo: string;
|
|
137
137
|
chainId: ChainId;
|
|
138
138
|
sequence: number;
|
|
139
|
-
|
|
139
|
+
ethereumChainId: EthereumChainId;
|
|
140
140
|
accountNumber: number;
|
|
141
141
|
timeoutHeight: number;
|
|
142
142
|
};
|
|
@@ -145,7 +145,7 @@ export declare const mockFactory: {
|
|
|
145
145
|
chainId: ChainId;
|
|
146
146
|
sequence: number;
|
|
147
147
|
accountNumber: number;
|
|
148
|
-
|
|
148
|
+
ethereumChainId: EthereumChainId;
|
|
149
149
|
timeoutHeight: number;
|
|
150
150
|
};
|
|
151
151
|
};
|
|
@@ -85,12 +85,12 @@ exports.mockFactory = {
|
|
|
85
85
|
orderHash,
|
|
86
86
|
orderHash2,
|
|
87
87
|
MAX_TIMEOUT_HEIGHT,
|
|
88
|
-
eip712Tx: ({ chainId = ts_types_1.ChainId.Devnet,
|
|
88
|
+
eip712Tx: ({ chainId = ts_types_1.ChainId.Devnet, ethereumChainId = ts_types_1.EthereumChainId.Sepolia, accountNumber = 1, sequence = 0, timeoutHeight = 999999999, memo = '', }) => ({
|
|
89
89
|
tx: {
|
|
90
90
|
memo,
|
|
91
91
|
chainId,
|
|
92
92
|
sequence,
|
|
93
|
-
|
|
93
|
+
ethereumChainId,
|
|
94
94
|
accountNumber,
|
|
95
95
|
timeoutHeight,
|
|
96
96
|
},
|
|
@@ -99,7 +99,7 @@ exports.mockFactory = {
|
|
|
99
99
|
chainId,
|
|
100
100
|
sequence,
|
|
101
101
|
accountNumber,
|
|
102
|
-
|
|
102
|
+
ethereumChainId,
|
|
103
103
|
timeoutHeight,
|
|
104
104
|
},
|
|
105
105
|
}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Network, NetworkEndpoints } from '@injectivelabs/networks';
|
|
2
|
-
import { ChainId, Coin,
|
|
2
|
+
import { ChainId, Coin, EthereumChainId } from '@injectivelabs/ts-types';
|
|
3
3
|
export declare const prepareEip712: <T>({ messages, gas, network, injectiveAddress, ethereumAddress, endpoints, accountNumber, sequence, timeoutHeight, memo, }: {
|
|
4
4
|
ethereumAddress?: string;
|
|
5
5
|
messages: T;
|
|
@@ -19,11 +19,11 @@ export declare const prepareEip712: <T>({ messages, gas, network, injectiveAddre
|
|
|
19
19
|
memo: string;
|
|
20
20
|
chainId: ChainId;
|
|
21
21
|
sequence: string;
|
|
22
|
-
|
|
22
|
+
ethereumChainId: EthereumChainId;
|
|
23
23
|
accountNumber: string;
|
|
24
24
|
timeoutHeight: string;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
ethereumChainId: EthereumChainId;
|
|
27
27
|
fee: {
|
|
28
28
|
amount: Coin[];
|
|
29
29
|
gas: string;
|
|
@@ -31,13 +31,13 @@ export declare const prepareEip712: <T>({ messages, gas, network, injectiveAddre
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
prepareEip712Request: {
|
|
34
|
-
chainId:
|
|
34
|
+
chainId: EthereumChainId;
|
|
35
35
|
message: any[];
|
|
36
36
|
address: string;
|
|
37
37
|
memo: string;
|
|
38
38
|
sequence: number;
|
|
39
39
|
accountNumber: number;
|
|
40
|
-
|
|
40
|
+
ethereumChainId: EthereumChainId;
|
|
41
41
|
timeoutHeight: number;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
@@ -37,11 +37,11 @@ const prepareEip712 = ({ messages, gas = constants_js_1.DEFAULT_GAS_LIMIT, netwo
|
|
|
37
37
|
timeoutHeight: timeoutHeight.toString(),
|
|
38
38
|
accountNumber: accountNumber.toString(),
|
|
39
39
|
},
|
|
40
|
-
|
|
40
|
+
ethereumChainId: eip712.ethereumChainId,
|
|
41
41
|
};
|
|
42
42
|
const prepareEip712Request = {
|
|
43
43
|
...eip712,
|
|
44
|
-
chainId: eip712.
|
|
44
|
+
chainId: eip712.ethereumChainId,
|
|
45
45
|
message: web3Msgs,
|
|
46
46
|
gasLimit: gas,
|
|
47
47
|
address: ethereumAddress,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChainId,
|
|
1
|
+
import { ChainId, EthereumChainId } from '@injectivelabs/ts-types';
|
|
2
2
|
export declare const injUsdtSpotMarket: {
|
|
3
3
|
marketId: string;
|
|
4
4
|
marketStatus: string;
|
|
@@ -124,9 +124,9 @@ export declare const mockFactory: {
|
|
|
124
124
|
orderHash: string;
|
|
125
125
|
orderHash2: string;
|
|
126
126
|
MAX_TIMEOUT_HEIGHT: number;
|
|
127
|
-
eip712Tx: ({ chainId,
|
|
127
|
+
eip712Tx: ({ chainId, ethereumChainId, accountNumber, sequence, timeoutHeight, memo, }: {
|
|
128
128
|
chainId?: ChainId;
|
|
129
|
-
|
|
129
|
+
ethereumChainId?: EthereumChainId;
|
|
130
130
|
accountNumber?: number;
|
|
131
131
|
sequence?: number;
|
|
132
132
|
timeoutHeight?: number;
|
|
@@ -136,7 +136,7 @@ export declare const mockFactory: {
|
|
|
136
136
|
memo: string;
|
|
137
137
|
chainId: ChainId;
|
|
138
138
|
sequence: number;
|
|
139
|
-
|
|
139
|
+
ethereumChainId: EthereumChainId;
|
|
140
140
|
accountNumber: number;
|
|
141
141
|
timeoutHeight: number;
|
|
142
142
|
};
|
|
@@ -145,7 +145,7 @@ export declare const mockFactory: {
|
|
|
145
145
|
chainId: ChainId;
|
|
146
146
|
sequence: number;
|
|
147
147
|
accountNumber: number;
|
|
148
|
-
|
|
148
|
+
ethereumChainId: EthereumChainId;
|
|
149
149
|
timeoutHeight: number;
|
|
150
150
|
};
|
|
151
151
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChainId,
|
|
1
|
+
import { ChainId, EthereumChainId } from '@injectivelabs/ts-types';
|
|
2
2
|
const ethereumAddress = '0xaf79152ac5df276d9a8e1e2e22822f9713474902';
|
|
3
3
|
const injectiveAddress = 'inj14au322k9munkmx5wrchz9q30juf5wjgz2cfqku';
|
|
4
4
|
const injectiveAddress2 = 'inj14au322k9munkmx5wrchz9q30juf5wjgz2cfqku';
|
|
@@ -82,12 +82,12 @@ export const mockFactory = {
|
|
|
82
82
|
orderHash,
|
|
83
83
|
orderHash2,
|
|
84
84
|
MAX_TIMEOUT_HEIGHT,
|
|
85
|
-
eip712Tx: ({ chainId = ChainId.Devnet,
|
|
85
|
+
eip712Tx: ({ chainId = ChainId.Devnet, ethereumChainId = EthereumChainId.Sepolia, accountNumber = 1, sequence = 0, timeoutHeight = 999999999, memo = '', }) => ({
|
|
86
86
|
tx: {
|
|
87
87
|
memo,
|
|
88
88
|
chainId,
|
|
89
89
|
sequence,
|
|
90
|
-
|
|
90
|
+
ethereumChainId,
|
|
91
91
|
accountNumber,
|
|
92
92
|
timeoutHeight,
|
|
93
93
|
},
|
|
@@ -96,7 +96,7 @@ export const mockFactory = {
|
|
|
96
96
|
chainId,
|
|
97
97
|
sequence,
|
|
98
98
|
accountNumber,
|
|
99
|
-
|
|
99
|
+
ethereumChainId,
|
|
100
100
|
timeoutHeight,
|
|
101
101
|
},
|
|
102
102
|
}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Network, NetworkEndpoints } from '@injectivelabs/networks';
|
|
2
|
-
import { ChainId, Coin,
|
|
2
|
+
import { ChainId, Coin, EthereumChainId } from '@injectivelabs/ts-types';
|
|
3
3
|
export declare const prepareEip712: <T>({ messages, gas, network, injectiveAddress, ethereumAddress, endpoints, accountNumber, sequence, timeoutHeight, memo, }: {
|
|
4
4
|
ethereumAddress?: string;
|
|
5
5
|
messages: T;
|
|
@@ -19,11 +19,11 @@ export declare const prepareEip712: <T>({ messages, gas, network, injectiveAddre
|
|
|
19
19
|
memo: string;
|
|
20
20
|
chainId: ChainId;
|
|
21
21
|
sequence: string;
|
|
22
|
-
|
|
22
|
+
ethereumChainId: EthereumChainId;
|
|
23
23
|
accountNumber: string;
|
|
24
24
|
timeoutHeight: string;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
ethereumChainId: EthereumChainId;
|
|
27
27
|
fee: {
|
|
28
28
|
amount: Coin[];
|
|
29
29
|
gas: string;
|
|
@@ -31,13 +31,13 @@ export declare const prepareEip712: <T>({ messages, gas, network, injectiveAddre
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
prepareEip712Request: {
|
|
34
|
-
chainId:
|
|
34
|
+
chainId: EthereumChainId;
|
|
35
35
|
message: any[];
|
|
36
36
|
address: string;
|
|
37
37
|
memo: string;
|
|
38
38
|
sequence: number;
|
|
39
39
|
accountNumber: number;
|
|
40
|
-
|
|
40
|
+
ethereumChainId: EthereumChainId;
|
|
41
41
|
timeoutHeight: number;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
@@ -34,11 +34,11 @@ export const prepareEip712 = ({ messages, gas = DEFAULT_GAS_LIMIT, network = Net
|
|
|
34
34
|
timeoutHeight: timeoutHeight.toString(),
|
|
35
35
|
accountNumber: accountNumber.toString(),
|
|
36
36
|
},
|
|
37
|
-
|
|
37
|
+
ethereumChainId: eip712.ethereumChainId,
|
|
38
38
|
};
|
|
39
39
|
const prepareEip712Request = {
|
|
40
40
|
...eip712,
|
|
41
|
-
chainId: eip712.
|
|
41
|
+
chainId: eip712.ethereumChainId,
|
|
42
42
|
message: web3Msgs,
|
|
43
43
|
gasLimit: gas,
|
|
44
44
|
address: ethereumAddress,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/utils",
|
|
3
3
|
"description": "List of utils and helper functions that can be reused throughout Injective's projects.",
|
|
4
|
-
"version": "1.16.1-alpha.
|
|
4
|
+
"version": "1.16.1-alpha.3",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": {
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"~utils": "dist"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
|
-
"build": "
|
|
64
|
+
"build": "yarn build:cjs && yarn build:esm && yarn build:post",
|
|
65
65
|
"build:cjs": "tsc --build --force tsconfig.build.json",
|
|
66
66
|
"build:esm": "tsc --build --force tsconfig.build.esm.json",
|
|
67
|
-
"build:watch": "tsc --build -w tsconfig.build.json && tsc -w --build tsconfig.build.esm.json &&
|
|
67
|
+
"build:watch": "tsc --build -w tsconfig.build.json && tsc -w --build tsconfig.build.esm.json && yarn build:post",
|
|
68
68
|
"build:post": "shx cp ../../etc/stub/package.json.stub dist/cjs/package.json && shx cp ../../etc/stub/package.esm.json.stub dist/esm/package.json",
|
|
69
69
|
"clean": "tsc --build tsconfig.build.json --clean && tsc --build tsconfig.build.esm.json --clean && shx rm -rf coverage *.log junit.xml dist && jest --clearCache && shx mkdir -p dist",
|
|
70
70
|
"test": "jest",
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@bangjelkoski/store2": "^2.14.3",
|
|
80
|
-
"@injectivelabs/exceptions": "1.16.1-alpha.
|
|
81
|
-
"@injectivelabs/networks": "1.16.1-alpha.
|
|
82
|
-
"@injectivelabs/ts-types": "1.16.1-alpha.
|
|
80
|
+
"@injectivelabs/exceptions": "^1.16.1-alpha.3",
|
|
81
|
+
"@injectivelabs/networks": "^1.16.1-alpha.3",
|
|
82
|
+
"@injectivelabs/ts-types": "^1.16.1-alpha.3",
|
|
83
83
|
"axios": "^1.8.1",
|
|
84
84
|
"bignumber.js": "^9.1.2",
|
|
85
85
|
"http-status-codes": "^2.3.0"
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"shx": "^0.3.4"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "8a8a9a67e0cc82f0971704a05028e517e5e147cc"
|
|
91
91
|
}
|