@taquito/rpc 17.3.2 → 17.4.0

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.
@@ -43,5 +43,4 @@ var OpKind;
43
43
  OpKind["SMART_ROLLUP_RECOVER_BOND"] = "smart_rollup_recover_bond";
44
44
  OpKind["SMART_ROLLUP_REFUTE"] = "smart_rollup_refute";
45
45
  OpKind["SMART_ROLLUP_TIMEOUT"] = "smart_rollup_timeout";
46
- })(OpKind = exports.OpKind || (exports.OpKind = {}));
47
- //# sourceMappingURL=opkind.js.map
46
+ })(OpKind || (exports.OpKind = OpKind = {}));
@@ -46,5 +46,4 @@ var RPCMethodName;
46
46
  RPCMethodName["GET_ALL_TICKET_BALANCES"] = "getAllTicketBalances";
47
47
  RPCMethodName["GET_PENDING_OPERATIONS"] = "getPendingOperations";
48
48
  RPCMethodName["GET_ORIGINATION_PROOF"] = "getOriginationProof";
49
- })(RPCMethodName = exports.RPCMethodName || (exports.RPCMethodName = {}));
50
- //# sourceMappingURL=rpc-client-interface.js.map
49
+ })(RPCMethodName || (exports.RPCMethodName = RPCMethodName = {}));
@@ -84,15 +84,15 @@ class RpcClientCache {
84
84
  }
85
85
  }
86
86
  validateAddress(address) {
87
- const addressValidation = utils_1.validateAddress(address);
87
+ const addressValidation = (0, utils_1.validateAddress)(address);
88
88
  if (addressValidation !== utils_1.ValidationResult.VALID) {
89
- throw new core_1.InvalidAddressError(address, utils_1.invalidDetail(addressValidation));
89
+ throw new core_1.InvalidAddressError(address, (0, utils_1.invalidDetail)(addressValidation));
90
90
  }
91
91
  }
92
92
  validateContract(address) {
93
- const addressValidation = utils_1.validateContractAddress(address);
93
+ const addressValidation = (0, utils_1.validateContractAddress)(address);
94
94
  if (addressValidation !== utils_1.ValidationResult.VALID) {
95
- throw new core_1.InvalidContractAddressError(address, utils_1.invalidDetail(addressValidation));
95
+ throw new core_1.InvalidContractAddressError(address, (0, utils_1.invalidDetail)(addressValidation));
96
96
  }
97
97
  }
98
98
  /**
@@ -811,8 +811,9 @@ class RpcClientCache {
811
811
  * @description Simulate a call to a michelson view
812
812
  *
813
813
  */
814
- runScriptView(_a, { block } = rpc_client_interface_2.defaultRPCOptions) {
814
+ runScriptView(_a, _b) {
815
815
  var { unparsing_mode = 'Readable' } = _a, rest = __rest(_a, ["unparsing_mode"]);
816
+ var _c = _b === void 0 ? rpc_client_interface_2.defaultRPCOptions : _b, block = _c.block;
816
817
  return __awaiter(this, void 0, void 0, function* () {
817
818
  return this.rpcClient.runScriptView(Object.assign({ unparsing_mode }, rest), { block });
818
819
  });
@@ -824,8 +825,9 @@ class RpcClientCache {
824
825
  * @description Simulate a call to a view following the TZIP-4 standard. See https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-4/tzip-4.md#view-entrypoints.
825
826
  *
826
827
  */
827
- runView(_a, { block } = rpc_client_interface_2.defaultRPCOptions) {
828
+ runView(_a, _b) {
828
829
  var { unparsing_mode = 'Readable' } = _a, rest = __rest(_a, ["unparsing_mode"]);
830
+ var _c = _b === void 0 ? rpc_client_interface_2.defaultRPCOptions : _b, block = _c.block;
829
831
  return __awaiter(this, void 0, void 0, function* () {
830
832
  return this.rpcClient.runView(Object.assign({ unparsing_mode }, rest), { block });
831
833
  });
@@ -1140,4 +1142,3 @@ class RpcClientCache {
1140
1142
  }
1141
1143
  }
1142
1144
  exports.RpcClientCache = RpcClientCache;
1143
- //# sourceMappingURL=rpc-cache.js.map
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -73,18 +77,24 @@ class RpcClient {
73
77
  }
74
78
  createURL(path) {
75
79
  // Trim trailing slashes because it is assumed to be included in path
76
- return `${this.url.replace(/\/+$/g, '')}${path}`;
80
+ // the regex solution is prone to ReDoS. Please see: https://stackoverflow.com/questions/6680825/return-string-without-trailing-slash#comment124306698_6680877
81
+ // We also got a CodeQL error for the regex based solution
82
+ let rootUrl = this.url;
83
+ while (rootUrl.endsWith('/')) {
84
+ rootUrl = rootUrl.slice(0, -1);
85
+ }
86
+ return `${rootUrl}${path}`;
77
87
  }
78
88
  validateAddress(address) {
79
- const addressValidation = utils_2.validateAddress(address);
89
+ const addressValidation = (0, utils_2.validateAddress)(address);
80
90
  if (addressValidation !== utils_2.ValidationResult.VALID) {
81
- throw new core_1.InvalidAddressError(address, utils_2.invalidDetail(addressValidation));
91
+ throw new core_1.InvalidAddressError(address, (0, utils_2.invalidDetail)(addressValidation));
82
92
  }
83
93
  }
84
94
  validateContract(address) {
85
- const addressValidation = utils_2.validateContractAddress(address);
95
+ const addressValidation = (0, utils_2.validateContractAddress)(address);
86
96
  if (addressValidation !== utils_2.ValidationResult.VALID) {
87
- throw new core_1.InvalidContractAddressError(address, utils_2.invalidDetail(addressValidation));
97
+ throw new core_1.InvalidContractAddressError(address, (0, utils_2.invalidDetail)(addressValidation));
88
98
  }
89
99
  }
90
100
  /**
@@ -315,7 +325,7 @@ class RpcClient {
315
325
  url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/delegates/${address}`),
316
326
  method: 'GET',
317
327
  });
318
- const castedResponse = utils_1.castToBigNumber(response, [
328
+ const castedResponse = (0, utils_1.castToBigNumber)(response, [
319
329
  'balance',
320
330
  'full_balance',
321
331
  'current_frozen_deposits',
@@ -329,7 +339,7 @@ class RpcClient {
329
339
  return Object.assign(Object.assign(Object.assign({}, response), castedResponse), { frozen_balance_by_cycle: response.frozen_balance_by_cycle
330
340
  ? response.frozen_balance_by_cycle.map((_a) => {
331
341
  var { deposit, deposits, fees, rewards } = _a, rest = __rest(_a, ["deposit", "deposits", "fees", "rewards"]);
332
- const castedToBigNumber = utils_1.castToBigNumber({ deposit, deposits, fees, rewards }, [
342
+ const castedToBigNumber = (0, utils_1.castToBigNumber)({ deposit, deposits, fees, rewards }, [
333
343
  'deposit',
334
344
  'deposits',
335
345
  'fees',
@@ -372,7 +382,7 @@ class RpcClient {
372
382
  url: this.createURL(`/chains/${this.chain}/blocks/${block}/context/constants`),
373
383
  method: 'GET',
374
384
  });
375
- const castedResponse = utils_1.castToBigNumber(response, [
385
+ const castedResponse = (0, utils_1.castToBigNumber)(response, [
376
386
  'time_between_blocks',
377
387
  'hard_gas_limit_per_operation',
378
388
  'hard_gas_limit_per_block',
@@ -406,7 +416,7 @@ class RpcClient {
406
416
  }
407
417
  /**
408
418
  *
409
- * @param options contains generic configuration for rpc calls. See examples for various available sytaxes.
419
+ * @param options contains generic configuration for rpc calls. See examples for various available syntaxes.
410
420
  *
411
421
  * @description All the information about a block
412
422
  *
@@ -526,7 +536,7 @@ class RpcClient {
526
536
  url: this.createURL(`/chains/${this.chain}/blocks/${block}/votes/ballots`),
527
537
  method: 'GET',
528
538
  });
529
- const casted = utils_1.castToBigNumber(response, ['yay', 'nay', 'pass']);
539
+ const casted = (0, utils_1.castToBigNumber)(response, ['yay', 'nay', 'pass']);
530
540
  return casted;
531
541
  });
532
542
  }
@@ -736,8 +746,9 @@ class RpcClient {
736
746
  * @description Simulate a call to a michelson view
737
747
  *
738
748
  */
739
- runScriptView(_a, { block } = rpc_client_interface_1.defaultRPCOptions) {
749
+ runScriptView(_a, _b) {
740
750
  var { unparsing_mode = 'Readable' } = _a, rest = __rest(_a, ["unparsing_mode"]);
751
+ var _c = _b === void 0 ? rpc_client_interface_1.defaultRPCOptions : _b, block = _c.block;
741
752
  return __awaiter(this, void 0, void 0, function* () {
742
753
  return this.httpBackend.createRequest({
743
754
  url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/scripts/run_script_view`),
@@ -752,8 +763,9 @@ class RpcClient {
752
763
  * @description Simulate a call to a view following the TZIP-4 standard. See https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-4/tzip-4.md#view-entrypoints.
753
764
  *
754
765
  */
755
- runView(_a, { block } = rpc_client_interface_1.defaultRPCOptions) {
766
+ runView(_a, _b) {
756
767
  var { unparsing_mode = 'Readable' } = _a, rest = __rest(_a, ["unparsing_mode"]);
768
+ var _c = _b === void 0 ? rpc_client_interface_1.defaultRPCOptions : _b, block = _c.block;
757
769
  return __awaiter(this, void 0, void 0, function* () {
758
770
  return this.httpBackend.createRequest({
759
771
  url: this.createURL(`/chains/${this.chain}/blocks/${block}/helpers/scripts/run_view`),
@@ -1018,4 +1030,3 @@ class RpcClient {
1018
1030
  }
1019
1031
  }
1020
1032
  exports.RpcClient = RpcClient;
1021
- //# sourceMappingURL=taquito-rpc.js.map
package/dist/lib/types.js CHANGED
@@ -4,7 +4,7 @@ exports.SmartRollupRefuteGameEndedReason = exports.SmartRollupRefuteGameEndedPla
4
4
  var OPERATION_METADATA;
5
5
  (function (OPERATION_METADATA) {
6
6
  OPERATION_METADATA["TOO_LARGE"] = "too large";
7
- })(OPERATION_METADATA = exports.OPERATION_METADATA || (exports.OPERATION_METADATA = {}));
7
+ })(OPERATION_METADATA || (exports.OPERATION_METADATA = OPERATION_METADATA = {}));
8
8
  var METADATA_BALANCE_UPDATES_CATEGORY;
9
9
  (function (METADATA_BALANCE_UPDATES_CATEGORY) {
10
10
  METADATA_BALANCE_UPDATES_CATEGORY["BAKING_REWARDS"] = "baking rewards";
@@ -31,42 +31,41 @@ var METADATA_BALANCE_UPDATES_CATEGORY;
31
31
  METADATA_BALANCE_UPDATES_CATEGORY["TX_ROLLUP_REJECTION_REWARDS"] = "tx_rollup_rejection_rewards";
32
32
  METADATA_BALANCE_UPDATES_CATEGORY["TX_ROLLUP_REJECTION_PUNISHMENTS"] = "tx_rollup_rejection_punishments";
33
33
  METADATA_BALANCE_UPDATES_CATEGORY["BONDS"] = "bonds";
34
- })(METADATA_BALANCE_UPDATES_CATEGORY = exports.METADATA_BALANCE_UPDATES_CATEGORY || (exports.METADATA_BALANCE_UPDATES_CATEGORY = {}));
34
+ })(METADATA_BALANCE_UPDATES_CATEGORY || (exports.METADATA_BALANCE_UPDATES_CATEGORY = METADATA_BALANCE_UPDATES_CATEGORY = {}));
35
35
  var PvmKind;
36
36
  (function (PvmKind) {
37
37
  PvmKind["WASM2"] = "wasm_2_0_0";
38
38
  PvmKind["ARITH"] = "arith";
39
- })(PvmKind = exports.PvmKind || (exports.PvmKind = {}));
39
+ })(PvmKind || (exports.PvmKind = PvmKind = {}));
40
40
  var SmartRollupRefutationOptions;
41
41
  (function (SmartRollupRefutationOptions) {
42
42
  SmartRollupRefutationOptions["START"] = "start";
43
43
  SmartRollupRefutationOptions["MOVE"] = "move";
44
- })(SmartRollupRefutationOptions = exports.SmartRollupRefutationOptions || (exports.SmartRollupRefutationOptions = {}));
44
+ })(SmartRollupRefutationOptions || (exports.SmartRollupRefutationOptions = SmartRollupRefutationOptions = {}));
45
45
  var SmartRollupInputProofKind;
46
46
  (function (SmartRollupInputProofKind) {
47
47
  SmartRollupInputProofKind["INBOX_PROOF"] = "inbox_proof";
48
48
  SmartRollupInputProofKind["REVEAL_PROOF"] = "reveal_proof";
49
49
  SmartRollupInputProofKind["FIRST_INPUT"] = "first_input";
50
- })(SmartRollupInputProofKind = exports.SmartRollupInputProofKind || (exports.SmartRollupInputProofKind = {}));
50
+ })(SmartRollupInputProofKind || (exports.SmartRollupInputProofKind = SmartRollupInputProofKind = {}));
51
51
  var SmartRollupRefuteRevealProofKind;
52
52
  (function (SmartRollupRefuteRevealProofKind) {
53
53
  SmartRollupRefuteRevealProofKind["RAW_DATA_PROOF"] = "raw_data_proof";
54
54
  SmartRollupRefuteRevealProofKind["METADATA_PROOF"] = "metadata_proof";
55
55
  SmartRollupRefuteRevealProofKind["DAL_PAGE_PROOF"] = "dal_page_proof";
56
- })(SmartRollupRefuteRevealProofKind = exports.SmartRollupRefuteRevealProofKind || (exports.SmartRollupRefuteRevealProofKind = {}));
56
+ })(SmartRollupRefuteRevealProofKind || (exports.SmartRollupRefuteRevealProofKind = SmartRollupRefuteRevealProofKind = {}));
57
57
  var SmartRollupRefuteGameStatusOptions;
58
58
  (function (SmartRollupRefuteGameStatusOptions) {
59
59
  SmartRollupRefuteGameStatusOptions["ONGOING"] = "ongoing";
60
60
  SmartRollupRefuteGameStatusOptions["ENDED"] = "ended";
61
- })(SmartRollupRefuteGameStatusOptions = exports.SmartRollupRefuteGameStatusOptions || (exports.SmartRollupRefuteGameStatusOptions = {}));
61
+ })(SmartRollupRefuteGameStatusOptions || (exports.SmartRollupRefuteGameStatusOptions = SmartRollupRefuteGameStatusOptions = {}));
62
62
  var SmartRollupRefuteGameEndedPlayerOutcomes;
63
63
  (function (SmartRollupRefuteGameEndedPlayerOutcomes) {
64
64
  SmartRollupRefuteGameEndedPlayerOutcomes["LOSER"] = "loser";
65
65
  SmartRollupRefuteGameEndedPlayerOutcomes["DRAW"] = "draw";
66
- })(SmartRollupRefuteGameEndedPlayerOutcomes = exports.SmartRollupRefuteGameEndedPlayerOutcomes || (exports.SmartRollupRefuteGameEndedPlayerOutcomes = {}));
66
+ })(SmartRollupRefuteGameEndedPlayerOutcomes || (exports.SmartRollupRefuteGameEndedPlayerOutcomes = SmartRollupRefuteGameEndedPlayerOutcomes = {}));
67
67
  var SmartRollupRefuteGameEndedReason;
68
68
  (function (SmartRollupRefuteGameEndedReason) {
69
69
  SmartRollupRefuteGameEndedReason["CONFLICT_RESOLVED"] = "conflict_resolved";
70
70
  SmartRollupRefuteGameEndedReason["TIMEOUT"] = "timeout";
71
- })(SmartRollupRefuteGameEndedReason = exports.SmartRollupRefuteGameEndedReason || (exports.SmartRollupRefuteGameEndedReason = {}));
72
- //# sourceMappingURL=types.js.map
71
+ })(SmartRollupRefuteGameEndedReason || (exports.SmartRollupRefuteGameEndedReason = SmartRollupRefuteGameEndedReason = {}));
@@ -61,4 +61,3 @@ function castToString(data, keys) {
61
61
  return response;
62
62
  }
63
63
  exports.castToString = castToString;
64
- //# sourceMappingURL=utils.js.map
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
5
5
  exports.VERSION = {
6
- "commitHash": "a97e506efd61b86e39ae30db588401b8fda46553",
7
- "version": "17.3.2"
6
+ "commitHash": "a908ab176a8c52c025fd43e7acd452415396f54e",
7
+ "version": "17.4.0"
8
8
  };
9
- //# sourceMappingURL=version.js.map