@taquito/michelson-encoder 24.2.0-beta.1 → 24.3.0-beta.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.
Files changed (78) hide show
  1. package/dist/lib/michelson-map.js +5 -5
  2. package/dist/lib/schema/errors.js +8 -8
  3. package/dist/lib/schema/event-schema.js +1 -2
  4. package/dist/lib/schema/parameter.js +12 -12
  5. package/dist/lib/schema/storage.js +15 -13
  6. package/dist/lib/schema/view-schema.js +5 -5
  7. package/dist/lib/tokens/bigmap.js +1 -1
  8. package/dist/lib/tokens/bls12-381-fr.js +1 -1
  9. package/dist/lib/tokens/bls12-381-g1.js +1 -1
  10. package/dist/lib/tokens/bls12-381-g2.js +1 -1
  11. package/dist/lib/tokens/chain-id.js +1 -1
  12. package/dist/lib/tokens/chest-key.js +1 -1
  13. package/dist/lib/tokens/chest.js +1 -1
  14. package/dist/lib/tokens/comparable/address.js +1 -1
  15. package/dist/lib/tokens/comparable/bytes.js +1 -1
  16. package/dist/lib/tokens/comparable/int.js +1 -1
  17. package/dist/lib/tokens/comparable/key_hash.js +1 -1
  18. package/dist/lib/tokens/comparable/mutez.js +1 -1
  19. package/dist/lib/tokens/comparable/nat.js +1 -1
  20. package/dist/lib/tokens/constant.js +2 -2
  21. package/dist/lib/tokens/contract.js +1 -1
  22. package/dist/lib/tokens/createToken.js +2 -2
  23. package/dist/lib/tokens/key.js +1 -1
  24. package/dist/lib/tokens/list.js +1 -1
  25. package/dist/lib/tokens/map.js +1 -1
  26. package/dist/lib/tokens/never.js +1 -1
  27. package/dist/lib/tokens/or.js +9 -3
  28. package/dist/lib/tokens/pair.js +6 -3
  29. package/dist/lib/tokens/sapling-state.js +1 -1
  30. package/dist/lib/tokens/sapling-transaction-deprecated.js +1 -1
  31. package/dist/lib/tokens/sapling-transaction.js +1 -1
  32. package/dist/lib/tokens/set.js +1 -1
  33. package/dist/lib/tokens/signature.js +1 -1
  34. package/dist/lib/tokens/ticket-deprecated.js +1 -1
  35. package/dist/lib/tokens/ticket.js +1 -1
  36. package/dist/lib/tokens/token.js +3 -3
  37. package/dist/lib/version.js +2 -2
  38. package/dist/taquito-michelson-encoder.es6.js +95 -85
  39. package/dist/taquito-michelson-encoder.es6.js.map +1 -1
  40. package/dist/taquito-michelson-encoder.umd.js +95 -85
  41. package/dist/taquito-michelson-encoder.umd.js.map +1 -1
  42. package/dist/types/michelson-map.d.ts +5 -5
  43. package/dist/types/schema/errors.d.ts +12 -12
  44. package/dist/types/schema/parameter.d.ts +12 -12
  45. package/dist/types/schema/storage.d.ts +6 -6
  46. package/dist/types/schema/view-schema.d.ts +5 -5
  47. package/dist/types/tokens/bigmap.d.ts +1 -1
  48. package/dist/types/tokens/bls12-381-fr.d.ts +2 -2
  49. package/dist/types/tokens/bls12-381-g1.d.ts +2 -2
  50. package/dist/types/tokens/bls12-381-g2.d.ts +2 -2
  51. package/dist/types/tokens/chain-id.d.ts +1 -1
  52. package/dist/types/tokens/chest-key.d.ts +2 -2
  53. package/dist/types/tokens/chest.d.ts +2 -2
  54. package/dist/types/tokens/comparable/address.d.ts +1 -1
  55. package/dist/types/tokens/comparable/bytes.d.ts +1 -1
  56. package/dist/types/tokens/comparable/int.d.ts +1 -1
  57. package/dist/types/tokens/comparable/key_hash.d.ts +1 -1
  58. package/dist/types/tokens/comparable/mutez.d.ts +1 -1
  59. package/dist/types/tokens/comparable/nat.d.ts +1 -1
  60. package/dist/types/tokens/constant.d.ts +2 -2
  61. package/dist/types/tokens/contract.d.ts +1 -1
  62. package/dist/types/tokens/createToken.d.ts +2 -2
  63. package/dist/types/tokens/key.d.ts +1 -1
  64. package/dist/types/tokens/list.d.ts +1 -1
  65. package/dist/types/tokens/map.d.ts +1 -1
  66. package/dist/types/tokens/never.d.ts +1 -1
  67. package/dist/types/tokens/or.d.ts +1 -1
  68. package/dist/types/tokens/pair.d.ts +2 -2
  69. package/dist/types/tokens/sapling-state.d.ts +1 -1
  70. package/dist/types/tokens/sapling-transaction-deprecated.d.ts +1 -1
  71. package/dist/types/tokens/sapling-transaction.d.ts +1 -1
  72. package/dist/types/tokens/set.d.ts +1 -1
  73. package/dist/types/tokens/signature.d.ts +1 -1
  74. package/dist/types/tokens/ticket-deprecated.d.ts +1 -1
  75. package/dist/types/tokens/ticket.d.ts +1 -1
  76. package/dist/types/tokens/token.d.ts +6 -6
  77. package/package.json +24 -12
  78. package/LICENSE +0 -202
@@ -7,7 +7,7 @@ const fast_json_stable_stringify_1 = require("fast-json-stable-stringify");
7
7
  const core_1 = require("@taquito/core");
8
8
  /**
9
9
  * @category Error
10
- * @description Error that indicates an invalid map type being passed or used
10
+ * Error that indicates an invalid map type being passed or used
11
11
  */
12
12
  class InvalidMapTypeError extends core_1.TaquitoError {
13
13
  constructor(mapType, reason) {
@@ -45,7 +45,7 @@ function validateMapType(value) {
45
45
  }
46
46
  /**
47
47
  * @category Error
48
- * @description Error that indicates a map type mismatch, where an attempt to set a key or value in a Map doesn't match the defined type of the Map
48
+ * Error that indicates a map type mismatch, where an attempt to set a key or value in a Map doesn't match the defined type of the Map
49
49
  */
50
50
  class MapTypecheckError extends core_1.TaquitoError {
51
51
  constructor(value, type, objectType, reason) {
@@ -60,7 +60,7 @@ class MapTypecheckError extends core_1.TaquitoError {
60
60
  }
61
61
  exports.MapTypecheckError = MapTypecheckError;
62
62
  /**
63
- * @description Michelson Map is an abstraction over the michelson native map. It supports complex Pair as key
63
+ * Michelson Map is an abstraction over the michelson native map. It supports complex Pair as key
64
64
  */
65
65
  class MichelsonMap {
66
66
  // Used to check if an object is a michelson map.
@@ -152,13 +152,13 @@ class MichelsonMap {
152
152
  }
153
153
  /**
154
154
  *
155
- * @description Set a key and a value in the MichelsonMap. If the key already exists, override the current value.
155
+ * Set a key and a value in the MichelsonMap. If the key already exists, override the current value.
156
156
  *
157
157
  * @example map.set("myKey", "myValue") // Using a string as key
158
158
  *
159
159
  * @example map.set({0: "test", 1: "test1"}, "myValue") // Using a pair as key
160
160
  *
161
- * @warn The same key can be represented in multiple ways, depending on the type of the key. This duplicate key situation will cause a runtime error (duplicate key) when sending the map data to the Tezos RPC node.
161
+ * @remarks The same key can be represented in multiple ways, depending on the type of the key. This duplicate key situation will cause a runtime error (duplicate key) when sending the map data to the Tezos RPC node.
162
162
  *
163
163
  * For example, consider a contract with a map whose key is of type boolean. If you set the following values in MichelsonMap: map.set(false, "myValue") and map.set(null, "myValue").
164
164
  *
@@ -5,7 +5,7 @@ exports.MissingArgumentError = exports.StorageEncodingError = exports.BigMapEnco
5
5
  const core_1 = require("@taquito/core");
6
6
  /**
7
7
  * @category Error
8
- * @description Error that indicates a failure when encoding (transforming JS parameter into JSON Michelson) the parameter of the view
8
+ * Error that indicates a failure when encoding (transforming JS parameter into JSON Michelson) the parameter of the view
9
9
  */
10
10
  class ParameterEncodingError extends core_1.InvalidViewParameterError {
11
11
  constructor(viewName, sigs, args, cause) {
@@ -21,7 +21,7 @@ class ParameterEncodingError extends core_1.InvalidViewParameterError {
21
21
  exports.ParameterEncodingError = ParameterEncodingError;
22
22
  /**
23
23
  * @category Error
24
- * @description Error that indicates an invalid on-chain view found on the script
24
+ * Error that indicates an invalid on-chain view found on the script
25
25
  */
26
26
  class InvalidScriptError extends core_1.TaquitoError {
27
27
  constructor(script, reason) {
@@ -40,7 +40,7 @@ class InvalidScriptError extends core_1.TaquitoError {
40
40
  exports.InvalidScriptError = InvalidScriptError;
41
41
  /**
42
42
  * @category Error
43
- * @description Error that indicates an invalid RPC response being passed or used
43
+ * Error that indicates an invalid RPC response being passed or used
44
44
  */
45
45
  class InvalidRpcResponseError extends core_1.TaquitoError {
46
46
  constructor(script, reason) {
@@ -59,7 +59,7 @@ class InvalidRpcResponseError extends core_1.TaquitoError {
59
59
  exports.InvalidRpcResponseError = InvalidRpcResponseError;
60
60
  /**
61
61
  * @category Error
62
- * @description Error that indicates an invalid big map schema being passed or used
62
+ * Error that indicates an invalid big map schema being passed or used
63
63
  */
64
64
  class InvalidBigMapSchemaError extends core_1.TaquitoError {
65
65
  constructor(message) {
@@ -71,7 +71,7 @@ class InvalidBigMapSchemaError extends core_1.TaquitoError {
71
71
  exports.InvalidBigMapSchemaError = InvalidBigMapSchemaError;
72
72
  /**
73
73
  * @category Error
74
- * @description Error that indicates an invalid big map diff being passed or used
74
+ * Error that indicates an invalid big map diff being passed or used
75
75
  */
76
76
  class InvalidBigMapDiffError extends core_1.TaquitoError {
77
77
  constructor(message, value) {
@@ -84,7 +84,7 @@ class InvalidBigMapDiffError extends core_1.TaquitoError {
84
84
  exports.InvalidBigMapDiffError = InvalidBigMapDiffError;
85
85
  /**
86
86
  * @category Error
87
- * @description Error that indicates a failure when trying to encode big maps
87
+ * Error that indicates a failure when trying to encode big maps
88
88
  */
89
89
  class BigMapEncodingError extends core_1.TaquitoError {
90
90
  constructor(obj, details, schema, value) {
@@ -99,7 +99,7 @@ class BigMapEncodingError extends core_1.TaquitoError {
99
99
  exports.BigMapEncodingError = BigMapEncodingError;
100
100
  /**
101
101
  * @category Error
102
- * @description Error that indicates a failure when trying to encode storage
102
+ * Error that indicates a failure when trying to encode storage
103
103
  */
104
104
  class StorageEncodingError extends core_1.TaquitoError {
105
105
  constructor(obj, details, schema, value, semantics) {
@@ -115,7 +115,7 @@ class StorageEncodingError extends core_1.TaquitoError {
115
115
  exports.StorageEncodingError = StorageEncodingError;
116
116
  /**
117
117
  * @category Error
118
- * @description General error that indicates a function not being passed a necessary argument
118
+ * General error that indicates a function not being passed a necessary argument
119
119
  */
120
120
  class MissingArgumentError extends core_1.TaquitoError {
121
121
  constructor(message) {
@@ -8,8 +8,7 @@ class EventSchema {
8
8
  this.type = type;
9
9
  }
10
10
  static fromMichelineValue(val) {
11
- var _a, _b;
12
- return new EventSchema((_a = val.annots) === null || _a === void 0 ? void 0 : _a[0], (_b = val.args) === null || _b === void 0 ? void 0 : _b[0]);
11
+ return new EventSchema(val.annots?.[0], val.args?.[0]);
13
12
  }
14
13
  static fromRPCResponse(val) {
15
14
  const allEventSchema = [];
@@ -7,12 +7,12 @@ const or_1 = require("../tokens/or");
7
7
  const option_1 = require("../tokens/option");
8
8
  const errors_1 = require("./errors");
9
9
  /**
10
- * @warn Our current smart contract abstraction feature is currently in preview. It's API is not final, and it may not cover every use case (yet). We will greatly appreciate any feedback on this feature.
10
+ * @remarks Our current smart contract abstraction feature is currently in preview. It's API is not final, and it may not cover every use case (yet). We will greatly appreciate any feedback on this feature.
11
11
  */
12
12
  class ParameterSchema {
13
13
  /**
14
14
  *
15
- * @description Create an instance of ParameterSchema from a contract script
15
+ * Create an instance of ParameterSchema from a contract script
16
16
  *
17
17
  * @param val contract script obtained from the RPC
18
18
  * @returns ParameterSchema
@@ -38,14 +38,14 @@ class ParameterSchema {
38
38
  return new ParameterSchema(parameter.args[0]);
39
39
  }
40
40
  /**
41
- * @description Check if the Contract parameter is multiple entry point or not
41
+ * Check if the Contract parameter is multiple entry point or not
42
42
  */
43
43
  get isMultipleEntryPoint() {
44
44
  return (this.root instanceof or_1.OrToken ||
45
45
  (this.root instanceof option_1.OptionToken && this.root.subToken() instanceof or_1.OrToken));
46
46
  }
47
47
  /**
48
- * @description Check if the Contract parameter has an annotation or not
48
+ * Check if the Contract parameter has an annotation or not
49
49
  */
50
50
  get hasAnnotation() {
51
51
  if (this.isMultipleEntryPoint) {
@@ -56,21 +56,21 @@ class ParameterSchema {
56
56
  }
57
57
  }
58
58
  /**
59
- * @description Return the schema of the parameter of a specific entry point
60
- * @throws {@link InvalidTokenError}
59
+ * Return the schema of the parameter of a specific entry point
60
+ * @throws InvalidTokenError
61
61
  */
62
62
  constructor(val) {
63
63
  this.root = (0, createToken_1.createToken)(val, 0);
64
64
  }
65
65
  /**
66
- * @description Returns the javascript object equivalent of the Micheline value provided
66
+ * Returns the javascript object equivalent of the Micheline value provided
67
67
  */
68
68
  Execute(val, semantics) {
69
69
  return this.root.Execute(val, semantics);
70
70
  }
71
71
  /**
72
- * @description Returns a micheline formatted object for the values provided
73
- * @throws {@link TokenValidationError}
72
+ * Returns a micheline formatted object for the values provided
73
+ * @throws TokenValidationError
74
74
  * @throws {@link ParameterEncodingError}
75
75
  */
76
76
  Encode(...args) {
@@ -85,8 +85,8 @@ class ParameterSchema {
85
85
  }
86
86
  }
87
87
  /**
88
- * @description Returns a micheline formatted object for the javascript object provided
89
- * @throws {@link TokenValidationError}
88
+ * Returns a micheline formatted object for the javascript object provided
89
+ * @throws TokenValidationError
90
90
  * @throws {@link ParameterEncodingError}
91
91
  */
92
92
  EncodeObject(value, semantics) {
@@ -101,7 +101,7 @@ class ParameterSchema {
101
101
  }
102
102
  }
103
103
  /**
104
- * @description Produce a schema grouping together all the entry points of a contract.
104
+ * Produce a schema grouping together all the entry points of a contract.
105
105
  */
106
106
  generateSchema() {
107
107
  return this.root.generateSchema();
@@ -15,7 +15,6 @@ const errors_1 = require("./errors");
15
15
  const schemaTypeSymbol = Symbol.for('taquito-schema-type-symbol');
16
16
  // collapse comb pair
17
17
  function collapse(val, prim = pair_1.PairToken.prim) {
18
- var _b, _c;
19
18
  if (Array.isArray(val)) {
20
19
  return collapse({
21
20
  prim: prim,
@@ -24,13 +23,16 @@ function collapse(val, prim = pair_1.PairToken.prim) {
24
23
  }
25
24
  const extended = val;
26
25
  if (extended.prim === prim && extended.args && extended.args.length > 2) {
27
- return Object.assign(Object.assign({}, extended), { args: [
28
- (_b = extended.args) === null || _b === void 0 ? void 0 : _b[0],
26
+ return {
27
+ ...extended,
28
+ args: [
29
+ extended.args?.[0],
29
30
  {
30
31
  prim: prim,
31
- args: (_c = extended.args) === null || _c === void 0 ? void 0 : _c.slice(1),
32
+ args: extended.args?.slice(1),
32
33
  },
33
- ] });
34
+ ],
35
+ };
34
36
  }
35
37
  return extended;
36
38
  }
@@ -45,15 +47,15 @@ function deepEqual(a, b) {
45
47
  (ac.args !== undefined &&
46
48
  bc.args !== undefined &&
47
49
  ac.args.length === bc.args.length &&
48
- ac.args.every((v, i) => { var _b, _c; return deepEqual(v, (_c = (_b = bc.args) === null || _b === void 0 ? void 0 : _b[i]) !== null && _c !== void 0 ? _c : {}); }))) &&
50
+ ac.args.every((v, i) => deepEqual(v, bc.args?.[i] ?? {})))) &&
49
51
  ((ac.annots === undefined && bc.annots === undefined) ||
50
52
  (ac.annots !== undefined &&
51
53
  bc.annots !== undefined &&
52
54
  ac.annots.length === bc.annots.length &&
53
- ac.annots.every((v, i) => { var _b; return v === ((_b = bc.annots) === null || _b === void 0 ? void 0 : _b[i]); }))));
55
+ ac.annots.every((v, i) => v === bc.annots?.[i]))));
54
56
  }
55
57
  /**
56
- * @warn Our current smart contract abstraction feature is currently in preview. Its API is not final, and it may not cover every use case (yet). We will greatly appreciate any feedback on this feature.
58
+ * @remarks Our current smart contract abstraction feature is currently in preview. Its API is not final, and it may not cover every use case (yet). We will greatly appreciate any feedback on this feature.
57
59
  */
58
60
  class Schema {
59
61
  static isSchema(obj) {
@@ -113,7 +115,7 @@ class Schema {
113
115
  return this.removeTopLevelAnnotation(storage);
114
116
  }
115
117
  /**
116
- * @description Validates that a value matches the schema type.
118
+ * Validates that a value matches the schema type.
117
119
  * Performs type checking with special handling for BigMap, Ticket, and nested Map tokens.
118
120
  *
119
121
  * @param val - The value to validate against the schema
@@ -179,7 +181,7 @@ class Schema {
179
181
  }
180
182
  }
181
183
  /**
182
- * @throws {@link TokenValidationError}
184
+ * @throws TokenValidationError
183
185
  * @throws {@link StorageEncodingError}
184
186
  */
185
187
  Encode(value, semantics) {
@@ -194,14 +196,14 @@ class Schema {
194
196
  }
195
197
  }
196
198
  /**
197
- * @description Produce a representation of the storage schema.
199
+ * Produce a representation of the storage schema.
198
200
  * Note: Provide guidance on how to write the storage object for the origination operation with Taquito.
199
201
  */
200
202
  generateSchema() {
201
203
  return this.removeTopLevelAnnotation(this.root.generateSchema());
202
204
  }
203
205
  /**
204
- * @description Look up in top-level pairs of the storage to find a value matching the specified type
206
+ * Look up in top-level pairs of the storage to find a value matching the specified type
205
207
  *
206
208
  * @returns The first value found that match the type or `undefined` if no value is found
207
209
  *
@@ -234,7 +236,7 @@ class Schema {
234
236
  }
235
237
  }
236
238
  /**
237
- * @description Look up the schema to find any occurrence of a particular token.
239
+ * Look up the schema to find any occurrence of a particular token.
238
240
  *
239
241
  * @returns an array of tokens of the specified kind or an empty array if no token was found
240
242
  *
@@ -6,7 +6,7 @@ const errors_1 = require("./errors");
6
6
  class ViewSchema {
7
7
  /**
8
8
  *
9
- * @description Create an instance of ViewSchema for each view in a script
9
+ * Create an instance of ViewSchema for each view in a script
10
10
  *
11
11
  * @param val contract script obtained from the RPC
12
12
  * @returns array of ViewSchema or empty array if there is no view in the contract
@@ -47,7 +47,7 @@ class ViewSchema {
47
47
  }
48
48
  /**
49
49
  *
50
- * @description Transform the view parameter into Michelson
50
+ * Transform the view parameter into Michelson
51
51
  *
52
52
  * @param args parameter of the view in js format
53
53
  * @returns parameter of the view in Michelson
@@ -63,7 +63,7 @@ class ViewSchema {
63
63
  }
64
64
  /**
65
65
  *
66
- * @description Transform the view result from Michelson to readable data
66
+ * Transform the view result from Michelson to readable data
67
67
  *
68
68
  * @param val result of the view in JSON Michelson
69
69
  * @param semantics optional semantics to override the default decoding behavior
@@ -74,14 +74,14 @@ class ViewSchema {
74
74
  }
75
75
  /**
76
76
  *
77
- * @description Return the signature of the view parameter
77
+ * Return the signature of the view parameter
78
78
  */
79
79
  extractArgsSchema() {
80
80
  return this.rootArgsType.generateSchema();
81
81
  }
82
82
  /**
83
83
  *
84
- * @description Return the format of the view result
84
+ * Return the format of the view result
85
85
  */
86
86
  extractResultSchema() {
87
87
  return this.rootReturnType.generateSchema();
@@ -5,7 +5,7 @@ const michelson_map_1 = require("../michelson-map");
5
5
  const token_1 = require("./token");
6
6
  /**
7
7
  * @category Error
8
- * @description Error that indicates a failure happening when parsing encoding/executing Big Map types
8
+ * Error that indicates a failure happening when parsing encoding/executing Big Map types
9
9
  */
10
10
  class BigMapValidationError extends token_1.TokenValidationError {
11
11
  constructor(value, token, message) {
@@ -4,7 +4,7 @@ exports.Bls12381frToken = exports.Bls12381frValidationError = void 0;
4
4
  const token_1 = require("./token");
5
5
  /**
6
6
  * @category Error
7
- * @description Error that indicates a failure happening when parsing encoding/executing a BLS12-381 scalar field Fr
7
+ * Error that indicates a failure happening when parsing encoding/executing a BLS12-381 scalar field Fr
8
8
  */
9
9
  class Bls12381frValidationError extends token_1.TokenValidationError {
10
10
  constructor(value, token, message) {
@@ -4,7 +4,7 @@ exports.Bls12381g1Token = exports.Bls12381g1ValidationError = void 0;
4
4
  const token_1 = require("./token");
5
5
  /**
6
6
  * @category Error
7
- * @description Error that indicates a failure happening when parsing encoding/executing a BLS12-381 curve G1
7
+ * Error that indicates a failure happening when parsing encoding/executing a BLS12-381 curve G1
8
8
  */
9
9
  class Bls12381g1ValidationError extends token_1.TokenValidationError {
10
10
  constructor(value, token, message) {
@@ -4,7 +4,7 @@ exports.Bls12381g2Token = exports.Bls12381g2ValidationError = void 0;
4
4
  const token_1 = require("./token");
5
5
  /**
6
6
  * @category Error
7
- * @description Error that indicates a failure happening when parsing encoding/executing a BLS12-381 curve G2
7
+ * Error that indicates a failure happening when parsing encoding/executing a BLS12-381 curve G2
8
8
  */
9
9
  class Bls12381g2ValidationError extends token_1.TokenValidationError {
10
10
  constructor(value, token, message) {
@@ -5,7 +5,7 @@ const token_1 = require("./token");
5
5
  const utils_1 = require("@taquito/utils");
6
6
  /**
7
7
  * @category Error
8
- * @description Error that indicates a failure happening when parsing encoding/executing a ChainID
8
+ * Error that indicates a failure happening when parsing encoding/executing a ChainID
9
9
  */
10
10
  class ChainIDValidationError extends token_1.TokenValidationError {
11
11
  constructor(value, token, message) {
@@ -4,7 +4,7 @@ exports.ChestKeyToken = exports.ChestKeyValidationError = void 0;
4
4
  const token_1 = require("./token");
5
5
  /**
6
6
  * @category Error
7
- * @description Error that indicates a failure happening when parsing encoding/executing a Chest Key
7
+ * Error that indicates a failure happening when parsing encoding/executing a Chest Key
8
8
  */
9
9
  class ChestKeyValidationError extends token_1.TokenValidationError {
10
10
  constructor(value, token, message) {
@@ -4,7 +4,7 @@ exports.ChestToken = exports.ChestValidationError = void 0;
4
4
  const token_1 = require("./token");
5
5
  /**
6
6
  * @category Error
7
- * @description Error that indicates a failure happening when parsing encoding/executing a Chest
7
+ * Error that indicates a failure happening when parsing encoding/executing a Chest
8
8
  */
9
9
  class ChestValidationError extends token_1.TokenValidationError {
10
10
  constructor(value, token, message) {
@@ -5,7 +5,7 @@ const token_1 = require("../token");
5
5
  const utils_1 = require("@taquito/utils");
6
6
  /**
7
7
  * @category Error
8
- * @description Error that indicates a failure happening when parsing encoding/executing an Address
8
+ * Error that indicates a failure happening when parsing encoding/executing an Address
9
9
  */
10
10
  class AddressValidationError extends token_1.TokenValidationError {
11
11
  constructor(value, token, message) {
@@ -5,7 +5,7 @@ const token_1 = require("../token");
5
5
  const utils_1 = require("@taquito/utils");
6
6
  /**
7
7
  * @category Error
8
- * @description Error that indicates a failure happening when parsing encoding/executing Bytes
8
+ * Error that indicates a failure happening when parsing encoding/executing Bytes
9
9
  */
10
10
  class BytesValidationError extends token_1.TokenValidationError {
11
11
  constructor(value, token, message) {
@@ -5,7 +5,7 @@ const token_1 = require("../token");
5
5
  const bignumber_js_1 = require("bignumber.js");
6
6
  /**
7
7
  * @category Error
8
- * @description Error that indicates a failure happening when parsing encoding/executing Int
8
+ * Error that indicates a failure happening when parsing encoding/executing Int
9
9
  */
10
10
  class IntValidationError extends token_1.TokenValidationError {
11
11
  constructor(value, token, message) {
@@ -5,7 +5,7 @@ const token_1 = require("../token");
5
5
  const utils_1 = require("@taquito/utils");
6
6
  /**
7
7
  * @category Error
8
- * @description Error that indicates a failure happening when parsing encoding/executing Key Hash
8
+ * Error that indicates a failure happening when parsing encoding/executing Key Hash
9
9
  */
10
10
  class KeyHashValidationError extends token_1.TokenValidationError {
11
11
  constructor(value, token, message) {
@@ -5,7 +5,7 @@ const token_1 = require("../token");
5
5
  const bignumber_js_1 = require("bignumber.js");
6
6
  /**
7
7
  * @category Error
8
- * @description Error that indicates a failure happening when parsing encoding/executing Mutez
8
+ * Error that indicates a failure happening when parsing encoding/executing Mutez
9
9
  */
10
10
  class MutezValidationError extends token_1.TokenValidationError {
11
11
  constructor(value, token, message) {
@@ -5,7 +5,7 @@ const token_1 = require("../token");
5
5
  const bignumber_js_1 = require("bignumber.js");
6
6
  /**
7
7
  * @category Error
8
- * @description Error that indicates a failure happening when parsing encoding/executing Nat
8
+ * Error that indicates a failure happening when parsing encoding/executing Nat
9
9
  */
10
10
  class NatValidationError extends token_1.TokenValidationError {
11
11
  constructor(value, token, message) {
@@ -4,7 +4,7 @@ exports.GlobalConstantToken = exports.GlobalConstantDecodingError = exports.Glob
4
4
  const token_1 = require("./token");
5
5
  /**
6
6
  * @category Error
7
- * @description Error that indicates a failure happening when parsing encoding a Global Constant
7
+ * Error that indicates a failure happening when parsing encoding a Global Constant
8
8
  */
9
9
  class GlobalConstantEncodingError extends token_1.TokenValidationError {
10
10
  constructor(value, token, message) {
@@ -17,7 +17,7 @@ class GlobalConstantEncodingError extends token_1.TokenValidationError {
17
17
  exports.GlobalConstantEncodingError = GlobalConstantEncodingError;
18
18
  /**
19
19
  * @category Error
20
- * @description Error that indicates a failure happening when parsing executing a Global Constant
20
+ * Error that indicates a failure happening when parsing executing a Global Constant
21
21
  */
22
22
  class GlobalConstantDecodingError extends token_1.TokenValidationError {
23
23
  constructor(value, token, message) {
@@ -5,7 +5,7 @@ const utils_1 = require("@taquito/utils");
5
5
  const token_1 = require("./token");
6
6
  /**
7
7
  * @category Error
8
- * @description Error that indicates a failure happening when parsing encoding/executing a Contract
8
+ * Error that indicates a failure happening when parsing encoding/executing a Contract
9
9
  */
10
10
  class ContractValidationError extends token_1.TokenValidationError {
11
11
  constructor(value, token, message) {
@@ -7,7 +7,7 @@ const pair_1 = require("./pair");
7
7
  const core_1 = require("@taquito/core");
8
8
  /**
9
9
  * @category Error
10
- * @description Error that indicates a script having an invalid type or it being unsupported by the Michelson Encoder. Note some protocol changes might affect this, we encourage users to open an issue so we can look into implementing support for said types.
10
+ * Error that indicates a script having an invalid type or it being unsupported by the Michelson Encoder. Note some protocol changes might affect this, we encourage users to open an issue so we can look into implementing support for said types.
11
11
  */
12
12
  class InvalidTokenError extends core_1.TaquitoError {
13
13
  constructor(message, data) {
@@ -20,7 +20,7 @@ class InvalidTokenError extends core_1.TaquitoError {
20
20
  exports.InvalidTokenError = InvalidTokenError;
21
21
  /**
22
22
  *
23
- * @description Create a token from a value
23
+ * Create a token from a value
24
24
  * @throws {@link InvalidTokenError} If the value passed is not supported by the Michelson Encoder
25
25
  */
26
26
  function createToken(val, idx, parentTokenType) {
@@ -6,7 +6,7 @@ const utils_1 = require("@taquito/utils");
6
6
  const signer_1 = require("@taquito/signer");
7
7
  /**
8
8
  * @category Error
9
- * @description Error that indicates a failure happening when parsing encoding/executing a Key
9
+ * Error that indicates a failure happening when parsing encoding/executing a Key
10
10
  */
11
11
  class KeyValidationError extends token_1.TokenValidationError {
12
12
  constructor(value, token, message) {
@@ -4,7 +4,7 @@ exports.ListToken = exports.ListValidationError = void 0;
4
4
  const token_1 = require("./token");
5
5
  /**
6
6
  * @category Error
7
- * @description Error that indicates a failure happening when parsing encoding/executing a List
7
+ * Error that indicates a failure happening when parsing encoding/executing a List
8
8
  */
9
9
  class ListValidationError extends token_1.TokenValidationError {
10
10
  constructor(value, token, message) {
@@ -5,7 +5,7 @@ const michelson_map_1 = require("../michelson-map");
5
5
  const token_1 = require("./token");
6
6
  /**
7
7
  * @category Error
8
- * @description Error that indicates a failure happening when parsing encoding/executing a Map
8
+ * Error that indicates a failure happening when parsing encoding/executing a Map
9
9
  */
10
10
  class MapValidationError extends token_1.TokenValidationError {
11
11
  constructor(value, token, message) {
@@ -4,7 +4,7 @@ exports.NeverToken = exports.NeverTokenError = void 0;
4
4
  const token_1 = require("./token");
5
5
  /**
6
6
  * @category Error
7
- * @description Error that indicates a failure happening when parsing encoding/executing a Never Token
7
+ * Error that indicates a failure happening when parsing encoding/executing a Never Token
8
8
  */
9
9
  class NeverTokenError extends token_1.TokenValidationError {
10
10
  constructor(value, token, message) {
@@ -4,7 +4,7 @@ exports.OrToken = exports.OrValidationError = void 0;
4
4
  const token_1 = require("./token");
5
5
  /**
6
6
  * @category Error
7
- * @description Error that indicates a failure happening when parsing encoding/executing an OrToken
7
+ * Error that indicates a failure happening when parsing encoding/executing an OrToken
8
8
  */
9
9
  class OrValidationError extends token_1.TokenValidationError {
10
10
  constructor(value, token, message) {
@@ -197,7 +197,10 @@ class OrToken extends token_1.ComparableToken {
197
197
  else {
198
198
  return rightToken.generateSchema();
199
199
  }
200
- }, (leftValue, rightValue) => (Object.assign(Object.assign({}, leftValue), rightValue))),
200
+ }, (leftValue, rightValue) => ({
201
+ ...leftValue,
202
+ ...rightValue,
203
+ })),
201
204
  };
202
205
  }
203
206
  findToken(label) {
@@ -262,7 +265,10 @@ class OrToken extends token_1.ComparableToken {
262
265
  if (OrToken.prim === tokenToFind) {
263
266
  tokens.push(this);
264
267
  }
265
- this.traversal((leftToken) => leftToken.findAndReturnTokens(tokenToFind, tokens), (rightToken) => rightToken.findAndReturnTokens(tokenToFind, tokens), (leftValue, rightValue) => (Object.assign(Object.assign({}, leftValue), rightValue)));
268
+ this.traversal((leftToken) => leftToken.findAndReturnTokens(tokenToFind, tokens), (rightToken) => rightToken.findAndReturnTokens(tokenToFind, tokens), (leftValue, rightValue) => ({
269
+ ...leftValue,
270
+ ...rightValue,
271
+ }));
266
272
  return tokens;
267
273
  }
268
274
  getIdxForChildren() {
@@ -6,7 +6,7 @@ const or_1 = require("./or");
6
6
  const core_1 = require("@taquito/core");
7
7
  /**
8
8
  * @category Error
9
- * @description Error that indicates in invalid token argument being passed
9
+ * Error that indicates in invalid token argument being passed
10
10
  */
11
11
  class TokenArgumentValidationError extends core_1.TaquitoError {
12
12
  constructor(message) {
@@ -18,7 +18,7 @@ class TokenArgumentValidationError extends core_1.TaquitoError {
18
18
  exports.TokenArgumentValidationError = TokenArgumentValidationError;
19
19
  /**
20
20
  * @category Error
21
- * @description Error that indicates a failure occurring when doing a comparison of tokens
21
+ * Error that indicates a failure occurring when doing a comparison of tokens
22
22
  */
23
23
  class TokenComparisonError extends core_1.TaquitoError {
24
24
  constructor(val1, val2) {
@@ -163,7 +163,10 @@ class PairToken extends token_1.ComparableToken {
163
163
  else {
164
164
  rightValue = { [rightToken.annot()]: getRightValue(rightToken) };
165
165
  }
166
- const res = Object.assign(Object.assign({}, leftValue), rightValue);
166
+ const res = {
167
+ ...leftValue,
168
+ ...rightValue,
169
+ };
167
170
  return res;
168
171
  }
169
172
  Execute(val, semantics) {
@@ -4,7 +4,7 @@ exports.SaplingStateToken = exports.SaplingStateValidationError = void 0;
4
4
  const token_1 = require("./token");
5
5
  /**
6
6
  * @category Error
7
- * @description Error that indicates a failure happening when parsing encoding/executing a Sapling State
7
+ * Error that indicates a failure happening when parsing encoding/executing a Sapling State
8
8
  */
9
9
  class SaplingStateValidationError extends token_1.TokenValidationError {
10
10
  constructor(value, token, message) {
@@ -4,7 +4,7 @@ exports.SaplingTransactionDeprecatedToken = exports.SaplingTransactionDeprecated
4
4
  const token_1 = require("./token");
5
5
  /**
6
6
  * @category Error
7
- * @description Error that indicates a failure happening when parsing encoding/executing a Sapling Transaction Deprecated
7
+ * Error that indicates a failure happening when parsing encoding/executing a Sapling Transaction Deprecated
8
8
  */
9
9
  class SaplingTransactionDeprecatedValidationError extends token_1.TokenValidationError {
10
10
  constructor(value, token, message) {