@gnolang/tm2-js-client 1.1.0 → 1.1.2

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.
@@ -37,6 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.JSONRPCProvider = void 0;
40
+ var types_1 = require("../types");
40
41
  var services_1 = require("../../services");
41
42
  var utility_1 = require("../utility");
42
43
  var endpoints_1 = require("../endpoints");
@@ -224,7 +225,7 @@ var JSONRPCProvider = /** @class */ (function () {
224
225
  // Check if there is an immediate tx-broadcast error
225
226
  // (originating from basic transaction checks like CheckTx)
226
227
  if (response.error) {
227
- errType = response.error.ABCIErrorKey;
228
+ errType = response.error[types_1.ABCIErrorKey];
228
229
  log = response.Log;
229
230
  throw (0, errors_utility_1.constructRequestError)(errType, log);
230
231
  }
@@ -246,13 +247,13 @@ var JSONRPCProvider = /** @class */ (function () {
246
247
  check_tx = response.check_tx, deliver_tx = response.deliver_tx;
247
248
  // Check if there is an immediate tx-broadcast error (in CheckTx)
248
249
  if (check_tx.ResponseBase.Error) {
249
- errType = check_tx.ResponseBase.Error.ABCIErrorKey;
250
+ errType = check_tx.ResponseBase.Error[types_1.ABCIErrorKey];
250
251
  log = check_tx.ResponseBase.Log;
251
252
  throw (0, errors_utility_1.constructRequestError)(errType, log);
252
253
  }
253
254
  // Check if there is a parsing error with the transaction (in DeliverTx)
254
255
  if (deliver_tx.ResponseBase.Error) {
255
- errType = deliver_tx.ResponseBase.Error.ABCIErrorKey;
256
+ errType = deliver_tx.ResponseBase.Error[types_1.ABCIErrorKey];
256
257
  log = deliver_tx.ResponseBase.Log;
257
258
  throw (0, errors_utility_1.constructRequestError)(errType, log);
258
259
  }
@@ -39,6 +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
+ var types_1 = require("../types");
42
43
  var axios_1 = __importDefault(require("axios"));
43
44
  var jsonrpc_1 = require("./jsonrpc");
44
45
  var utility_1 = require("../utility");
@@ -110,6 +111,7 @@ describe('JSON-RPC Provider', function () {
110
111
  });
111
112
  }); });
112
113
  describe('sendTransaction', function () {
114
+ var _a;
113
115
  var validResult = {
114
116
  error: null,
115
117
  data: null,
@@ -119,9 +121,9 @@ describe('JSON-RPC Provider', function () {
119
121
  var mockError = '/std.UnauthorizedError';
120
122
  var mockLog = 'random error message';
121
123
  var invalidResult = {
122
- error: {
123
- ABCIErrorKey: mockError,
124
- },
124
+ error: (_a = {},
125
+ _a[types_1.ABCIErrorKey] = mockError,
126
+ _a),
125
127
  data: null,
126
128
  Log: mockLog,
127
129
  hash: '',
@@ -37,6 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.WSProvider = void 0;
40
+ var types_1 = require("../types");
40
41
  var utility_1 = require("../utility");
41
42
  var endpoints_1 = require("../endpoints");
42
43
  var errors_utility_1 = require("../utility/errors.utility");
@@ -313,7 +314,7 @@ var WSProvider = /** @class */ (function () {
313
314
  // Check if there is an immediate tx-broadcast error
314
315
  // (originating from basic transaction checks like CheckTx)
315
316
  if (broadcastResponse.error) {
316
- errType = broadcastResponse.error.ABCIErrorKey;
317
+ errType = broadcastResponse.error[types_1.ABCIErrorKey];
317
318
  log = broadcastResponse.Log;
318
319
  throw (0, errors_utility_1.constructRequestError)(errType, log);
319
320
  }
@@ -334,13 +335,13 @@ var WSProvider = /** @class */ (function () {
334
335
  check_tx = broadcastResponse.check_tx, deliver_tx = broadcastResponse.deliver_tx;
335
336
  // Check if there is an immediate tx-broadcast error (in CheckTx)
336
337
  if (check_tx.ResponseBase.Error) {
337
- errType = check_tx.ResponseBase.Error.ABCIErrorKey;
338
+ errType = check_tx.ResponseBase.Error[types_1.ABCIErrorKey];
338
339
  log = check_tx.ResponseBase.Log;
339
340
  throw (0, errors_utility_1.constructRequestError)(errType, log);
340
341
  }
341
342
  // Check if there is a parsing error with the transaction (in DeliverTx)
342
343
  if (deliver_tx.ResponseBase.Error) {
343
- errType = deliver_tx.ResponseBase.Error.ABCIErrorKey;
344
+ errType = deliver_tx.ResponseBase.Error[types_1.ABCIErrorKey];
344
345
  log = deliver_tx.ResponseBase.Log;
345
346
  throw (0, errors_utility_1.constructRequestError)(errType, log);
346
347
  }
@@ -39,6 +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
+ var types_1 = require("../types");
42
43
  var utility_1 = require("../utility");
43
44
  var ws_1 = require("./ws");
44
45
  var jest_websocket_mock_1 = __importDefault(require("jest-websocket-mock"));
@@ -338,6 +339,7 @@ describe('WS Provider', function () {
338
339
  });
339
340
  }); });
340
341
  describe('sendTransaction', function () {
342
+ var _a;
341
343
  var validResult = {
342
344
  error: null,
343
345
  data: null,
@@ -347,9 +349,9 @@ describe('WS Provider', function () {
347
349
  var mockError = '/std.UnauthorizedError';
348
350
  var mockLog = 'random error message';
349
351
  var invalidResult = {
350
- error: {
351
- ABCIErrorKey: mockError,
352
- },
352
+ error: (_a = {},
353
+ _a[types_1.ABCIErrorKey] = mockError,
354
+ _a),
353
355
  data: null,
354
356
  Log: mockLog,
355
357
  hash: '',
@@ -8,8 +8,8 @@ import { AccountWalletOption, CreateWalletOptions } from './types';
8
8
  * that can interact with the blockchain
9
9
  */
10
10
  export declare class Wallet {
11
- private provider;
12
- private signer;
11
+ protected provider: Provider;
12
+ protected signer: Signer;
13
13
  /**
14
14
  * Connects the wallet to the specified {@link Provider}
15
15
  * @param {Provider} provider the active {@link Provider}, if any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gnolang/tm2-js-client",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Tendermint2 JS / TS Client",
5
5
  "main": "./bin/index.js",
6
6
  "repository": {