@gnolang/tm2-js-client 1.1.5 → 1.1.7

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.
@@ -129,7 +129,7 @@ export declare const Any: {
129
129
  } & {
130
130
  typeUrl?: string | undefined;
131
131
  value?: Uint8Array | undefined;
132
- } & { [K in Exclude<keyof I, keyof Any>]: never; }>(base?: I | undefined): Any;
132
+ } & { [K in Exclude<keyof I, keyof Any>]: never; }>(base?: I): Any;
133
133
  fromPartial<I_1 extends {
134
134
  typeUrl?: string | undefined;
135
135
  value?: Uint8Array | undefined;
@@ -170,7 +170,7 @@ export declare const Tx: {
170
170
  signature?: Uint8Array | undefined;
171
171
  }[]>]: never; }) | undefined;
172
172
  memo?: string | undefined;
173
- } & { [K_7 in Exclude<keyof I, keyof Tx>]: never; }>(base?: I | undefined): Tx;
173
+ } & { [K_7 in Exclude<keyof I, keyof Tx>]: never; }>(base?: I): Tx;
174
174
  fromPartial<I_1 extends {
175
175
  messages?: {
176
176
  typeUrl?: string | undefined;
@@ -393,7 +393,7 @@ export declare const TxFee: {
393
393
  xor: (other: string | number | Long) => Long;
394
394
  } & { [K in Exclude<keyof I["gasWanted"], keyof Long>]: never; }) | undefined;
395
395
  gasFee?: string | undefined;
396
- } & { [K_1 in Exclude<keyof I, keyof TxFee>]: never; }>(base?: I | undefined): TxFee;
396
+ } & { [K_1 in Exclude<keyof I, keyof TxFee>]: never; }>(base?: I): TxFee;
397
397
  fromPartial<I_1 extends {
398
398
  gasWanted?: string | number | Long | undefined;
399
399
  gasFee?: string | undefined;
@@ -493,7 +493,7 @@ export declare const TxSignature: {
493
493
  value?: Uint8Array | undefined;
494
494
  } & { [K in Exclude<keyof I["pubKey"], keyof Any>]: never; }) | undefined;
495
495
  signature?: Uint8Array | undefined;
496
- } & { [K_1 in Exclude<keyof I, keyof TxSignature>]: never; }>(base?: I | undefined): TxSignature;
496
+ } & { [K_1 in Exclude<keyof I, keyof TxSignature>]: never; }>(base?: I): TxSignature;
497
497
  fromPartial<I_1 extends {
498
498
  pubKey?: {
499
499
  typeUrl?: string | undefined;
@@ -520,7 +520,7 @@ export declare const PubKeySecp256k1: {
520
520
  key?: Uint8Array | undefined;
521
521
  } & {
522
522
  key?: Uint8Array | undefined;
523
- } & { [K in Exclude<keyof I, "key">]: never; }>(base?: I | undefined): PubKeySecp256k1;
523
+ } & { [K in Exclude<keyof I, "key">]: never; }>(base?: I): PubKeySecp256k1;
524
524
  fromPartial<I_1 extends {
525
525
  key?: Uint8Array | undefined;
526
526
  } & {
@@ -10,7 +10,7 @@ export declare const newRequest: (method: string, params?: any[]) => RPCRequest;
10
10
  * @param {Result} result the response result, if any
11
11
  * @param {RPCError} error the response error, if any
12
12
  */
13
- export declare const newResponse: <Result>(result?: Result | undefined, error?: RPCError) => RPCResponse<Result>;
13
+ export declare const newResponse: <Result>(result?: Result, error?: RPCError) => RPCResponse<Result>;
14
14
  /**
15
15
  * Parses the base64 encoded ABCI JSON into a concrete type
16
16
  * @param {string} data the base64-encoded JSON
@@ -1,5 +1,6 @@
1
1
  export * from './key';
2
2
  export * from './ledger';
3
+ export * from './signer';
3
4
  export * from './types';
4
5
  export * from './utility';
5
6
  export * from './wallet';
@@ -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;
@@ -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.5",
3
+ "version": "1.1.7",
4
4
  "description": "Tendermint2 JS / TS Client",
5
5
  "main": "./bin/index.js",
6
6
  "repository": {
@@ -26,22 +26,22 @@
26
26
  "registry": "https://registry.npmjs.org/"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/jest": "^29.5.1",
29
+ "@types/jest": "^29.5.12",
30
30
  "@types/long": "^5.0.0",
31
- "@types/node": "^20.1.4",
32
- "@types/ws": "^8.5.4",
31
+ "@types/node": "^20.12.5",
32
+ "@types/ws": "^8.5.10",
33
33
  "@typescript-eslint/eslint-plugin": "^5.59.5",
34
34
  "@typescript-eslint/parser": "^5.59.5",
35
- "eslint": "^8.40.0",
35
+ "eslint": "^8.56.0",
36
36
  "eslint-config-prettier": "^9.0.0",
37
- "eslint-plugin-prettier": "5.0.0",
38
- "jest": "^29.5.0",
37
+ "eslint-plugin-prettier": "5.1.2",
38
+ "jest": "^29.7.0",
39
39
  "jest-mock-extended": "^3.0.4",
40
40
  "jest-websocket-mock": "^2.4.0",
41
- "prettier": "^3.1.0",
41
+ "prettier": "^3.2.2",
42
42
  "ts-jest": "^29.1.0",
43
- "ts-proto": "^1.147.2",
44
- "typescript": "^5.0.4"
43
+ "ts-proto": "^1.171.0",
44
+ "typescript": "^5.4.4"
45
45
  },
46
46
  "dependencies": {
47
47
  "@cosmjs/amino": "^0.32.0",
@@ -52,7 +52,7 @@
52
52
  "long": "^5.2.3",
53
53
  "protobufjs": "^7.2.3",
54
54
  "uuid": "^9.0.1",
55
- "ws": "^8.13.0"
55
+ "ws": "^8.16.0"
56
56
  },
57
57
  "scripts": {
58
58
  "tsc": "tsc",