@injectivelabs/utils 1.20.11 → 1.20.12
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.
|
@@ -108,7 +108,7 @@ const mockFactory = {
|
|
|
108
108
|
|
|
109
109
|
//#endregion
|
|
110
110
|
//#region src/test-utils/msgs.ts
|
|
111
|
-
const prepareEip712 = ({ messages,
|
|
111
|
+
const prepareEip712 = ({ messages, memo = "", granter = "", payer = "", sequence = 1, accountNumber = 1, endpoints = {}, gas = require_constants.DEFAULT_GAS_LIMIT, network = __injectivelabs_networks.Network.Mainnet, timeoutHeight = 999999999, ethereumAddress: ethereumAddress$1 = mockFactory.ethereumAddress }) => {
|
|
112
112
|
const chainInfo = (0, __injectivelabs_networks.getNetworkInfo)(network);
|
|
113
113
|
const actualEndpoints = {
|
|
114
114
|
...(0, __injectivelabs_networks.getNetworkEndpoints)(network),
|
|
@@ -133,7 +133,8 @@ const prepareEip712 = ({ messages, gas = require_constants.DEFAULT_GAS_LIMIT, ne
|
|
|
133
133
|
amount: new require_constants.BigNumber_default(gas.toString()).times(require_constants.DEFAULT_GAS_PRICE).toFixed()
|
|
134
134
|
}],
|
|
135
135
|
gas: gas.toString(),
|
|
136
|
-
|
|
136
|
+
...granter && { granter },
|
|
137
|
+
...payer && { payer }
|
|
137
138
|
},
|
|
138
139
|
tx: {
|
|
139
140
|
...tx,
|
|
@@ -145,6 +146,7 @@ const prepareEip712 = ({ messages, gas = require_constants.DEFAULT_GAS_LIMIT, ne
|
|
|
145
146
|
},
|
|
146
147
|
prepareEip712Request: {
|
|
147
148
|
...eip712,
|
|
149
|
+
granter,
|
|
148
150
|
chainId: eip712.evmChainId,
|
|
149
151
|
message: web3Msgs,
|
|
150
152
|
gasLimit: gas,
|
|
@@ -4,26 +4,28 @@ import { Network, NetworkEndpoints } from "@injectivelabs/networks";
|
|
|
4
4
|
//#region src/test-utils/msgs.d.ts
|
|
5
5
|
declare const prepareEip712: <T>({
|
|
6
6
|
messages,
|
|
7
|
+
memo,
|
|
8
|
+
granter,
|
|
9
|
+
payer,
|
|
10
|
+
sequence,
|
|
11
|
+
accountNumber,
|
|
12
|
+
endpoints,
|
|
7
13
|
gas,
|
|
8
14
|
network,
|
|
9
|
-
injectiveAddress,
|
|
10
|
-
ethereumAddress,
|
|
11
|
-
endpoints,
|
|
12
|
-
accountNumber,
|
|
13
|
-
sequence,
|
|
14
15
|
timeoutHeight,
|
|
15
|
-
|
|
16
|
+
ethereumAddress
|
|
16
17
|
}: {
|
|
17
|
-
ethereumAddress?: string;
|
|
18
18
|
messages: T;
|
|
19
|
+
memo?: string;
|
|
20
|
+
payer?: string;
|
|
21
|
+
granter?: string;
|
|
19
22
|
network?: Network;
|
|
20
|
-
gas?: number | string;
|
|
21
|
-
accountNumber?: number;
|
|
22
23
|
sequence?: number;
|
|
24
|
+
accountNumber?: number;
|
|
23
25
|
timeoutHeight?: number;
|
|
24
|
-
|
|
26
|
+
gas?: number | string;
|
|
27
|
+
ethereumAddress?: string;
|
|
25
28
|
endpoints?: Partial<NetworkEndpoints>;
|
|
26
|
-
injectiveAddress?: string;
|
|
27
29
|
}) => {
|
|
28
30
|
endpoints: NetworkEndpoints;
|
|
29
31
|
eip712Args: {
|
|
@@ -40,7 +42,8 @@ declare const prepareEip712: <T>({
|
|
|
40
42
|
fee: {
|
|
41
43
|
amount: Coin[];
|
|
42
44
|
gas: string;
|
|
43
|
-
payer
|
|
45
|
+
payer?: string;
|
|
46
|
+
granter?: string;
|
|
44
47
|
};
|
|
45
48
|
};
|
|
46
49
|
prepareEip712Request: {
|
|
@@ -4,26 +4,28 @@ import { ChainId, Coin, EvmChainId } from "@injectivelabs/ts-types";
|
|
|
4
4
|
//#region src/test-utils/msgs.d.ts
|
|
5
5
|
declare const prepareEip712: <T>({
|
|
6
6
|
messages,
|
|
7
|
+
memo,
|
|
8
|
+
granter,
|
|
9
|
+
payer,
|
|
10
|
+
sequence,
|
|
11
|
+
accountNumber,
|
|
12
|
+
endpoints,
|
|
7
13
|
gas,
|
|
8
14
|
network,
|
|
9
|
-
injectiveAddress,
|
|
10
|
-
ethereumAddress,
|
|
11
|
-
endpoints,
|
|
12
|
-
accountNumber,
|
|
13
|
-
sequence,
|
|
14
15
|
timeoutHeight,
|
|
15
|
-
|
|
16
|
+
ethereumAddress
|
|
16
17
|
}: {
|
|
17
|
-
ethereumAddress?: string;
|
|
18
18
|
messages: T;
|
|
19
|
+
memo?: string;
|
|
20
|
+
payer?: string;
|
|
21
|
+
granter?: string;
|
|
19
22
|
network?: Network;
|
|
20
|
-
gas?: number | string;
|
|
21
|
-
accountNumber?: number;
|
|
22
23
|
sequence?: number;
|
|
24
|
+
accountNumber?: number;
|
|
23
25
|
timeoutHeight?: number;
|
|
24
|
-
|
|
26
|
+
gas?: number | string;
|
|
27
|
+
ethereumAddress?: string;
|
|
25
28
|
endpoints?: Partial<NetworkEndpoints>;
|
|
26
|
-
injectiveAddress?: string;
|
|
27
29
|
}) => {
|
|
28
30
|
endpoints: NetworkEndpoints;
|
|
29
31
|
eip712Args: {
|
|
@@ -40,7 +42,8 @@ declare const prepareEip712: <T>({
|
|
|
40
42
|
fee: {
|
|
41
43
|
amount: Coin[];
|
|
42
44
|
gas: string;
|
|
43
|
-
payer
|
|
45
|
+
payer?: string;
|
|
46
|
+
granter?: string;
|
|
44
47
|
};
|
|
45
48
|
};
|
|
46
49
|
prepareEip712Request: {
|
|
@@ -108,7 +108,7 @@ const mockFactory = {
|
|
|
108
108
|
|
|
109
109
|
//#endregion
|
|
110
110
|
//#region src/test-utils/msgs.ts
|
|
111
|
-
const prepareEip712 = ({ messages,
|
|
111
|
+
const prepareEip712 = ({ messages, memo = "", granter = "", payer = "", sequence = 1, accountNumber = 1, endpoints = {}, gas = DEFAULT_GAS_LIMIT, network = Network.Mainnet, timeoutHeight = 999999999, ethereumAddress: ethereumAddress$1 = mockFactory.ethereumAddress }) => {
|
|
112
112
|
const chainInfo = getNetworkInfo(network);
|
|
113
113
|
const actualEndpoints = {
|
|
114
114
|
...getNetworkEndpoints(network),
|
|
@@ -133,7 +133,8 @@ const prepareEip712 = ({ messages, gas = DEFAULT_GAS_LIMIT, network = Network.Ma
|
|
|
133
133
|
amount: new BigNumber_default(gas.toString()).times(DEFAULT_GAS_PRICE).toFixed()
|
|
134
134
|
}],
|
|
135
135
|
gas: gas.toString(),
|
|
136
|
-
|
|
136
|
+
...granter && { granter },
|
|
137
|
+
...payer && { payer }
|
|
137
138
|
},
|
|
138
139
|
tx: {
|
|
139
140
|
...tx,
|
|
@@ -145,6 +146,7 @@ const prepareEip712 = ({ messages, gas = DEFAULT_GAS_LIMIT, network = Network.Ma
|
|
|
145
146
|
},
|
|
146
147
|
prepareEip712Request: {
|
|
147
148
|
...eip712,
|
|
149
|
+
granter,
|
|
148
150
|
chainId: eip712.evmChainId,
|
|
149
151
|
message: web3Msgs,
|
|
150
152
|
gasLimit: gas,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/utils",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.12",
|
|
4
4
|
"description": "List of utils and helper functions that can be reused throughout Injective's projects.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"bignumber.js": "^9.3.1",
|
|
67
67
|
"http-status-codes": "^2.3.0",
|
|
68
68
|
"store2": "^2.14.4",
|
|
69
|
-
"@injectivelabs/
|
|
70
|
-
"@injectivelabs/
|
|
71
|
-
"@injectivelabs/ts-types": "1.20.
|
|
69
|
+
"@injectivelabs/exceptions": "1.20.12",
|
|
70
|
+
"@injectivelabs/networks": "1.20.12",
|
|
71
|
+
"@injectivelabs/ts-types": "1.20.12"
|
|
72
72
|
},
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|