@injectivelabs/sdk-ts 1.0.134 → 1.0.135
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/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/time.d.ts +11 -0
- package/dist/utils/time.d.ts.map +1 -0
- package/dist/utils/time.js +22 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/utils/transaction.d.ts +0 -10
- package/dist/utils/transaction.d.ts.map +1 -1
- package/dist/utils/transaction.js +1 -19
- package/dist/utils/transaction.js.map +1 -1
- package/package.json +2 -2
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA"}
|
package/dist/utils/index.js
CHANGED
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,4CAAyB;AACzB,4CAAyB;AACzB,+CAA4B;AAC5B,4CAAyB;AACzB,yCAAsB;AACtB,2CAAwB;AACxB,yCAAsB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,4CAAyB;AACzB,4CAAyB;AACzB,+CAA4B;AAC5B,4CAAyB;AACzB,yCAAsB;AACtB,2CAAwB;AACxB,yCAAsB;AACtB,yCAAsB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a timeout timestamp in milliseconds so its compatible
|
|
3
|
+
* with the way Cosmos handles transactions
|
|
4
|
+
*/
|
|
5
|
+
export declare const makeTimeoutTimestamp: (timeoutInMs?: number) => number;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a timeout timestamp in nanoseconds so its compatible
|
|
8
|
+
* with the way Cosmos handles transactions
|
|
9
|
+
*/
|
|
10
|
+
export declare const makeTimeoutTimestampInNs: (timeoutInMs?: number) => number;
|
|
11
|
+
//# sourceMappingURL=time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,iBAClB,MAAM,WAOpB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,iBACtB,MAAM,WACuB,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeTimeoutTimestampInNs = exports.makeTimeoutTimestamp = void 0;
|
|
4
|
+
const utils_1 = require("@injectivelabs/utils");
|
|
5
|
+
/**
|
|
6
|
+
* Returns a timeout timestamp in milliseconds so its compatible
|
|
7
|
+
* with the way Cosmos handles transactions
|
|
8
|
+
*/
|
|
9
|
+
const makeTimeoutTimestamp = (timeoutInMs = utils_1.DEFAULT_TIMESTAMP_TIMEOUT_MS) => {
|
|
10
|
+
const now = new Date();
|
|
11
|
+
const timestamp = new Date(now.getTime() + timeoutInMs);
|
|
12
|
+
const actualTimestamp = timestamp.getTime();
|
|
13
|
+
return actualTimestamp;
|
|
14
|
+
};
|
|
15
|
+
exports.makeTimeoutTimestamp = makeTimeoutTimestamp;
|
|
16
|
+
/**
|
|
17
|
+
* Returns a timeout timestamp in nanoseconds so its compatible
|
|
18
|
+
* with the way Cosmos handles transactions
|
|
19
|
+
*/
|
|
20
|
+
const makeTimeoutTimestampInNs = (timeoutInMs = utils_1.DEFAULT_TIMESTAMP_TIMEOUT_MS) => (0, exports.makeTimeoutTimestamp)(timeoutInMs) * 1e6;
|
|
21
|
+
exports.makeTimeoutTimestampInNs = makeTimeoutTimestampInNs;
|
|
22
|
+
//# sourceMappingURL=time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":";;;AAAA,gDAAmE;AAEnE;;;GAGG;AACI,MAAM,oBAAoB,GAAG,CAClC,cAAsB,oCAA4B,EAClD,EAAE;IACF,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;IACtB,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,CAAA;IACvD,MAAM,eAAe,GAAG,SAAS,CAAC,OAAO,EAAE,CAAA;IAE3C,OAAO,eAAe,CAAA;AACxB,CAAC,CAAA;AARY,QAAA,oBAAoB,wBAQhC;AAED;;;GAGG;AACI,MAAM,wBAAwB,GAAG,CACtC,cAAsB,oCAA4B,EAClD,EAAE,CAAC,IAAA,4BAAoB,EAAC,WAAW,CAAC,GAAG,GAAG,CAAA;AAF/B,QAAA,wBAAwB,4BAEO"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
1
|
export declare const recoverTypedSignaturePubKey: (data: any, signature: string) => string;
|
|
2
|
-
/**
|
|
3
|
-
* Returns a timeout timestamp in milliseconds so its compatible
|
|
4
|
-
* with the way Cosmos handles transactions
|
|
5
|
-
*/
|
|
6
|
-
export declare const makeTimeoutTimestamp: (timeoutInMs?: number) => number;
|
|
7
|
-
/**
|
|
8
|
-
* Returns a timeout timestamp in nanoseconds so its compatible
|
|
9
|
-
* with the way Cosmos handles transactions
|
|
10
|
-
*/
|
|
11
|
-
export declare const makeTimeoutTimestampInNs: (timeoutInMs?: number) => number;
|
|
12
2
|
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/utils/transaction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/utils/transaction.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,2BAA2B,SAChC,GAAG,aACE,MAAM,KAChB,MASF,CAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.recoverTypedSignaturePubKey = void 0;
|
|
4
4
|
const ethereumjs_util_1 = require("ethereumjs-util");
|
|
5
5
|
const secp256k1_1 = require("secp256k1");
|
|
6
6
|
const eth_sig_util_1 = require("@metamask/eth-sig-util");
|
|
7
|
-
const utils_1 = require("@injectivelabs/utils");
|
|
8
7
|
const recoverTypedSignaturePubKey = (data, signature) => {
|
|
9
8
|
const compressedPubKeyPrefix = Buffer.from('04', 'hex');
|
|
10
9
|
const message = eth_sig_util_1.TypedDataUtils.eip712Hash(data, eth_sig_util_1.SignTypedDataVersion.V4);
|
|
@@ -15,21 +14,4 @@ const recoverTypedSignaturePubKey = (data, signature) => {
|
|
|
15
14
|
return `0x${compressedKey.toString('hex')}`;
|
|
16
15
|
};
|
|
17
16
|
exports.recoverTypedSignaturePubKey = recoverTypedSignaturePubKey;
|
|
18
|
-
/**
|
|
19
|
-
* Returns a timeout timestamp in milliseconds so its compatible
|
|
20
|
-
* with the way Cosmos handles transactions
|
|
21
|
-
*/
|
|
22
|
-
const makeTimeoutTimestamp = (timeoutInMs = utils_1.DEFAULT_TIMESTAMP_TIMEOUT_MS) => {
|
|
23
|
-
const now = new Date();
|
|
24
|
-
const timestamp = new Date(now.getTime() + timeoutInMs);
|
|
25
|
-
const actualTimestamp = timestamp.getTime();
|
|
26
|
-
return actualTimestamp;
|
|
27
|
-
};
|
|
28
|
-
exports.makeTimeoutTimestamp = makeTimeoutTimestamp;
|
|
29
|
-
/**
|
|
30
|
-
* Returns a timeout timestamp in nanoseconds so its compatible
|
|
31
|
-
* with the way Cosmos handles transactions
|
|
32
|
-
*/
|
|
33
|
-
const makeTimeoutTimestampInNs = (timeoutInMs = utils_1.DEFAULT_TIMESTAMP_TIMEOUT_MS) => (0, exports.makeTimeoutTimestamp)(timeoutInMs) * 1e6;
|
|
34
|
-
exports.makeTimeoutTimestampInNs = makeTimeoutTimestampInNs;
|
|
35
17
|
//# sourceMappingURL=transaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src/utils/transaction.ts"],"names":[],"mappings":";;;AAAA,qDAAuD;AACvD,yCAA4C;AAC5C,yDAA6E;
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src/utils/transaction.ts"],"names":[],"mappings":";;;AAAA,qDAAuD;AACvD,yCAA4C;AAC5C,yDAA6E;AAEtE,MAAM,2BAA2B,GAAG,CACzC,IAAS,EACT,SAAiB,EACT,EAAE;IACV,MAAM,sBAAsB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACvD,MAAM,OAAO,GAAG,6BAAc,CAAC,UAAU,CAAC,IAAI,EAAE,mCAAoB,CAAC,EAAE,CAAC,CAAA;IACxE,MAAM,SAAS,GAAG,IAAA,4BAAU,EAAC,SAAS,CAAC,CAAA;IACvC,MAAM,SAAS,GAAG,IAAA,2BAAS,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;IAC3E,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC,CAAA;IACtE,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,IAAA,4BAAgB,EAAC,WAAW,CAAC,CAAC,CAAA;IAEhE,OAAO,KAAK,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAA;AAC7C,CAAC,CAAA;AAZY,QAAA,2BAA2B,+BAYvC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/sdk-ts",
|
|
3
3
|
"description": "SDK in TypeScript for building Injective applications in a Node environment.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.135",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Bojan Angjelkoski",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"shx": "^0.3.2",
|
|
63
63
|
"snakecase-keys": "^5.4.1"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "899f2b54a52ad05bc8e34dcab894717a62d81caa",
|
|
66
66
|
"typedoc": {
|
|
67
67
|
"entryPoint": "./src/index.ts",
|
|
68
68
|
"readmeFile": "./README.md",
|