@gnolang/tm2-js-client 1.1.5 → 1.1.6
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/bin/wallet/index.d.ts
CHANGED
package/bin/wallet/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./key"), exports);
|
|
18
18
|
__exportStar(require("./ledger"), exports);
|
|
19
|
+
__exportStar(require("./signer"), exports);
|
|
19
20
|
__exportStar(require("./types"), exports);
|
|
20
21
|
__exportStar(require("./utility"), exports);
|
|
21
22
|
__exportStar(require("./wallet"), exports);
|
|
@@ -27,4 +27,10 @@ export declare const defaultAddressPrefix = "g";
|
|
|
27
27
|
* @param {string} str the string to be encoded
|
|
28
28
|
*/
|
|
29
29
|
export declare const stringToUTF8: (str: string) => Uint8Array;
|
|
30
|
+
/**
|
|
31
|
+
* Escapes <,>,& in string.
|
|
32
|
+
* Golang's json marshaller escapes <,>,& by default.
|
|
33
|
+
* https://cs.opensource.google/go/go/+/refs/tags/go1.20.6:src/encoding/json/encode.go;l=46-53
|
|
34
|
+
*/
|
|
35
|
+
export declare function encodeCharacterSet(data: string): string;
|
|
30
36
|
export {};
|
|
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.stringToUTF8 = exports.defaultAddressPrefix = exports.generateKeyPair = exports.generateEntropy = exports.generateHDPath = void 0;
|
|
42
|
+
exports.encodeCharacterSet = exports.stringToUTF8 = exports.defaultAddressPrefix = exports.generateKeyPair = exports.generateEntropy = exports.generateHDPath = void 0;
|
|
43
43
|
var crypto_1 = require("@cosmjs/crypto");
|
|
44
44
|
var crypto_2 = __importDefault(require("crypto"));
|
|
45
45
|
/**
|
|
@@ -103,3 +103,15 @@ var stringToUTF8 = function (str) {
|
|
|
103
103
|
return new TextEncoder().encode(str);
|
|
104
104
|
};
|
|
105
105
|
exports.stringToUTF8 = stringToUTF8;
|
|
106
|
+
/**
|
|
107
|
+
* Escapes <,>,& in string.
|
|
108
|
+
* Golang's json marshaller escapes <,>,& by default.
|
|
109
|
+
* https://cs.opensource.google/go/go/+/refs/tags/go1.20.6:src/encoding/json/encode.go;l=46-53
|
|
110
|
+
*/
|
|
111
|
+
function encodeCharacterSet(data) {
|
|
112
|
+
return data
|
|
113
|
+
.replace(/</g, '\\u003c')
|
|
114
|
+
.replace(/>/g, '\\u003e')
|
|
115
|
+
.replace(/&/g, '\\u0026');
|
|
116
|
+
}
|
|
117
|
+
exports.encodeCharacterSet = encodeCharacterSet;
|
package/bin/wallet/wallet.js
CHANGED
|
@@ -224,7 +224,7 @@ var Wallet = /** @class */ (function () {
|
|
|
224
224
|
memo: tx.memo,
|
|
225
225
|
time: defaultSigTimestamp,
|
|
226
226
|
};
|
|
227
|
-
signBytes = (0, utility_1.stringToUTF8)((0, signdoc_1.sortedJsonStringify)(signPayload));
|
|
227
|
+
signBytes = (0, utility_1.stringToUTF8)((0, utility_1.encodeCharacterSet)((0, signdoc_1.sortedJsonStringify)(signPayload)));
|
|
228
228
|
wrappedKey = {
|
|
229
229
|
key: publicKey,
|
|
230
230
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gnolang/tm2-js-client",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Tendermint2 JS / TS Client",
|
|
5
5
|
"main": "./bin/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/jest": "^29.5.1",
|
|
30
30
|
"@types/long": "^5.0.0",
|
|
31
|
-
"@types/node": "^20.1
|
|
31
|
+
"@types/node": "^20.11.1",
|
|
32
32
|
"@types/ws": "^8.5.4",
|
|
33
33
|
"@typescript-eslint/eslint-plugin": "^5.59.5",
|
|
34
34
|
"@typescript-eslint/parser": "^5.59.5",
|
|
35
|
-
"eslint": "^8.
|
|
35
|
+
"eslint": "^8.56.0",
|
|
36
36
|
"eslint-config-prettier": "^9.0.0",
|
|
37
|
-
"eslint-plugin-prettier": "5.
|
|
37
|
+
"eslint-plugin-prettier": "5.1.2",
|
|
38
38
|
"jest": "^29.5.0",
|
|
39
39
|
"jest-mock-extended": "^3.0.4",
|
|
40
40
|
"jest-websocket-mock": "^2.4.0",
|
|
41
|
-
"prettier": "^3.
|
|
41
|
+
"prettier": "^3.2.2",
|
|
42
42
|
"ts-jest": "^29.1.0",
|
|
43
|
-
"ts-proto": "^1.
|
|
43
|
+
"ts-proto": "^1.167.2",
|
|
44
44
|
"typescript": "^5.0.4"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|