@taquito/michelson-encoder 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.
Files changed (156) hide show
  1. package/dist/lib/errors.js +0 -1
  2. package/dist/lib/michelson-map.js +7 -8
  3. package/dist/lib/schema/errors.js +0 -1
  4. package/dist/lib/schema/event-schema.js +1 -2
  5. package/dist/lib/schema/model.js +0 -1
  6. package/dist/lib/schema/parameter.js +7 -8
  7. package/dist/lib/schema/storage.js +14 -15
  8. package/dist/lib/schema/types.js +0 -1
  9. package/dist/lib/schema/view-schema.js +20 -21
  10. package/dist/lib/taquito-michelson-encoder.js +5 -2
  11. package/dist/lib/tokens/bigmap.js +0 -1
  12. package/dist/lib/tokens/bls12-381-fr.js +0 -1
  13. package/dist/lib/tokens/bls12-381-g1.js +0 -1
  14. package/dist/lib/tokens/bls12-381-g2.js +0 -1
  15. package/dist/lib/tokens/chain-id.js +1 -2
  16. package/dist/lib/tokens/chest-key.js +0 -1
  17. package/dist/lib/tokens/chest.js +0 -1
  18. package/dist/lib/tokens/comparable/address.js +4 -5
  19. package/dist/lib/tokens/comparable/bool.js +0 -1
  20. package/dist/lib/tokens/comparable/bytes.js +2 -3
  21. package/dist/lib/tokens/comparable/int.js +0 -1
  22. package/dist/lib/tokens/comparable/key_hash.js +3 -4
  23. package/dist/lib/tokens/comparable/mutez.js +0 -1
  24. package/dist/lib/tokens/comparable/nat.js +0 -1
  25. package/dist/lib/tokens/comparable/string.js +0 -1
  26. package/dist/lib/tokens/comparable/timestamp.js +0 -1
  27. package/dist/lib/tokens/comparable/tx_rollup_l2_address.js +4 -5
  28. package/dist/lib/tokens/constant.js +0 -1
  29. package/dist/lib/tokens/contract.js +2 -3
  30. package/dist/lib/tokens/createToken.js +0 -1
  31. package/dist/lib/tokens/key.js +3 -4
  32. package/dist/lib/tokens/lambda.js +0 -1
  33. package/dist/lib/tokens/list.js +0 -1
  34. package/dist/lib/tokens/map.js +0 -1
  35. package/dist/lib/tokens/never.js +0 -1
  36. package/dist/lib/tokens/operation.js +0 -1
  37. package/dist/lib/tokens/option.js +0 -1
  38. package/dist/lib/tokens/or.js +0 -1
  39. package/dist/lib/tokens/pair.js +0 -1
  40. package/dist/lib/tokens/sapling-state.js +0 -1
  41. package/dist/lib/tokens/sapling-transaction-deprecated.js +0 -1
  42. package/dist/lib/tokens/sapling-transaction.js +0 -1
  43. package/dist/lib/tokens/set.js +0 -1
  44. package/dist/lib/tokens/signature.js +1 -2
  45. package/dist/lib/tokens/ticket-deprecated.js +0 -1
  46. package/dist/lib/tokens/ticket.js +0 -1
  47. package/dist/lib/tokens/token.js +0 -1
  48. package/dist/lib/tokens/tokens.js +0 -1
  49. package/dist/lib/tokens/unit.js +0 -1
  50. package/dist/lib/version.js +2 -3
  51. package/dist/taquito-michelson-encoder.es6.js +4217 -4217
  52. package/dist/taquito-michelson-encoder.es6.js.map +1 -1
  53. package/dist/taquito-michelson-encoder.umd.js +4217 -4224
  54. package/dist/taquito-michelson-encoder.umd.js.map +1 -1
  55. package/dist/types/errors.d.ts +17 -17
  56. package/dist/types/michelson-map.d.ts +82 -82
  57. package/dist/types/schema/errors.d.ts +83 -83
  58. package/dist/types/schema/event-schema.d.ts +12 -12
  59. package/dist/types/schema/model.d.ts +62 -62
  60. package/dist/types/schema/parameter.d.ts +59 -59
  61. package/dist/types/schema/storage.d.ts +101 -101
  62. package/dist/types/schema/types.d.ts +105 -105
  63. package/dist/types/schema/view-schema.d.ts +53 -53
  64. package/dist/types/taquito-michelson-encoder.d.ts +17 -17
  65. package/dist/types/tokens/bigmap.d.ts +61 -61
  66. package/dist/types/tokens/bls12-381-fr.d.ts +56 -56
  67. package/dist/types/tokens/bls12-381-g1.d.ts +52 -52
  68. package/dist/types/tokens/bls12-381-g2.d.ts +52 -52
  69. package/dist/types/tokens/chain-id.d.ts +56 -56
  70. package/dist/types/tokens/chest-key.d.ts +52 -52
  71. package/dist/types/tokens/chest.d.ts +52 -52
  72. package/dist/types/tokens/comparable/address.d.ts +66 -66
  73. package/dist/types/tokens/comparable/bool.d.ts +37 -37
  74. package/dist/types/tokens/comparable/bytes.d.ts +57 -57
  75. package/dist/types/tokens/comparable/int.d.ts +61 -61
  76. package/dist/types/tokens/comparable/key_hash.d.ts +59 -59
  77. package/dist/types/tokens/comparable/mutez.d.ts +58 -58
  78. package/dist/types/tokens/comparable/nat.d.ts +60 -60
  79. package/dist/types/tokens/comparable/string.d.ts +36 -36
  80. package/dist/types/tokens/comparable/timestamp.d.ts +39 -39
  81. package/dist/types/tokens/comparable/tx_rollup_l2_address.d.ts +64 -64
  82. package/dist/types/tokens/constant.d.ts +56 -56
  83. package/dist/types/tokens/contract.d.ts +53 -53
  84. package/dist/types/tokens/createToken.d.ts +18 -18
  85. package/dist/types/tokens/key.d.ts +62 -62
  86. package/dist/types/tokens/lambda.d.ts +34 -34
  87. package/dist/types/tokens/list.d.ts +53 -53
  88. package/dist/types/tokens/map.d.ts +57 -57
  89. package/dist/types/tokens/never.d.ts +46 -46
  90. package/dist/types/tokens/operation.d.ts +29 -29
  91. package/dist/types/tokens/option.d.ts +44 -44
  92. package/dist/types/tokens/or.d.ts +56 -56
  93. package/dist/types/tokens/pair.d.ts +54 -54
  94. package/dist/types/tokens/sapling-state.d.ts +53 -53
  95. package/dist/types/tokens/sapling-transaction-deprecated.d.ts +49 -49
  96. package/dist/types/tokens/sapling-transaction.d.ts +49 -49
  97. package/dist/types/tokens/set.d.ts +48 -48
  98. package/dist/types/tokens/signature.d.ts +58 -58
  99. package/dist/types/tokens/ticket-deprecated.d.ts +47 -47
  100. package/dist/types/tokens/ticket.d.ts +47 -47
  101. package/dist/types/tokens/token.d.ts +56 -56
  102. package/dist/types/tokens/tokens.d.ts +37 -37
  103. package/dist/types/tokens/unit.d.ts +39 -39
  104. package/dist/types/version.d.ts +4 -4
  105. package/package.json +27 -29
  106. package/signature.json +3 -5
  107. package/dist/lib/errors.js.map +0 -1
  108. package/dist/lib/michelson-map.js.map +0 -1
  109. package/dist/lib/schema/errors.js.map +0 -1
  110. package/dist/lib/schema/event-schema.js.map +0 -1
  111. package/dist/lib/schema/model.js.map +0 -1
  112. package/dist/lib/schema/parameter.js.map +0 -1
  113. package/dist/lib/schema/storage.js.map +0 -1
  114. package/dist/lib/schema/types.js.map +0 -1
  115. package/dist/lib/schema/view-schema.js.map +0 -1
  116. package/dist/lib/taquito-michelson-encoder.js.map +0 -1
  117. package/dist/lib/tokens/bigmap.js.map +0 -1
  118. package/dist/lib/tokens/bls12-381-fr.js.map +0 -1
  119. package/dist/lib/tokens/bls12-381-g1.js.map +0 -1
  120. package/dist/lib/tokens/bls12-381-g2.js.map +0 -1
  121. package/dist/lib/tokens/chain-id.js.map +0 -1
  122. package/dist/lib/tokens/chest-key.js.map +0 -1
  123. package/dist/lib/tokens/chest.js.map +0 -1
  124. package/dist/lib/tokens/comparable/address.js.map +0 -1
  125. package/dist/lib/tokens/comparable/bool.js.map +0 -1
  126. package/dist/lib/tokens/comparable/bytes.js.map +0 -1
  127. package/dist/lib/tokens/comparable/int.js.map +0 -1
  128. package/dist/lib/tokens/comparable/key_hash.js.map +0 -1
  129. package/dist/lib/tokens/comparable/mutez.js.map +0 -1
  130. package/dist/lib/tokens/comparable/nat.js.map +0 -1
  131. package/dist/lib/tokens/comparable/string.js.map +0 -1
  132. package/dist/lib/tokens/comparable/timestamp.js.map +0 -1
  133. package/dist/lib/tokens/comparable/tx_rollup_l2_address.js.map +0 -1
  134. package/dist/lib/tokens/constant.js.map +0 -1
  135. package/dist/lib/tokens/contract.js.map +0 -1
  136. package/dist/lib/tokens/createToken.js.map +0 -1
  137. package/dist/lib/tokens/key.js.map +0 -1
  138. package/dist/lib/tokens/lambda.js.map +0 -1
  139. package/dist/lib/tokens/list.js.map +0 -1
  140. package/dist/lib/tokens/map.js.map +0 -1
  141. package/dist/lib/tokens/never.js.map +0 -1
  142. package/dist/lib/tokens/operation.js.map +0 -1
  143. package/dist/lib/tokens/option.js.map +0 -1
  144. package/dist/lib/tokens/or.js.map +0 -1
  145. package/dist/lib/tokens/pair.js.map +0 -1
  146. package/dist/lib/tokens/sapling-state.js.map +0 -1
  147. package/dist/lib/tokens/sapling-transaction-deprecated.js.map +0 -1
  148. package/dist/lib/tokens/sapling-transaction.js.map +0 -1
  149. package/dist/lib/tokens/set.js.map +0 -1
  150. package/dist/lib/tokens/signature.js.map +0 -1
  151. package/dist/lib/tokens/ticket-deprecated.js.map +0 -1
  152. package/dist/lib/tokens/ticket.js.map +0 -1
  153. package/dist/lib/tokens/token.js.map +0 -1
  154. package/dist/lib/tokens/tokens.js.map +0 -1
  155. package/dist/lib/tokens/unit.js.map +0 -1
  156. package/dist/lib/version.js.map +0 -1
@@ -36,4 +36,3 @@ var nat_1 = require("./tokens/comparable/nat");
36
36
  Object.defineProperty(exports, "NatValidationError", { enumerable: true, get: function () { return nat_1.NatValidationError; } });
37
37
  var ticket_1 = require("./tokens/ticket");
38
38
  Object.defineProperty(exports, "EncodeTicketError", { enumerable: true, get: function () { return ticket_1.EncodeTicketError; } });
39
- //# sourceMappingURL=errors.js.map
@@ -63,6 +63,12 @@ exports.MapTypecheckError = MapTypecheckError;
63
63
  * @description Michelson Map is an abstraction over the michelson native map. It supports complex Pair as key
64
64
  */
65
65
  class MichelsonMap {
66
+ // Used to check if an object is a michelson map.
67
+ // Using instanceof was not working for project that had multiple instance of taquito dependencies
68
+ // as the class constructor is different
69
+ static isMichelsonMap(obj) {
70
+ return obj && obj[michelsonMapTypeSymbol] === true;
71
+ }
66
72
  /**
67
73
  * @param mapType If specified key and value will be type-checked before being added to the map
68
74
  *
@@ -76,12 +82,6 @@ class MichelsonMap {
76
82
  this.setType(mapType);
77
83
  }
78
84
  }
79
- // Used to check if an object is a michelson map.
80
- // Using instanceof was not working for project that had multiple instance of taquito dependencies
81
- // as the class constructor is different
82
- static isMichelsonMap(obj) {
83
- return obj && obj[michelsonMapTypeSymbol] === true;
84
- }
85
85
  setType(mapType) {
86
86
  validateMapType(mapType);
87
87
  this.keySchema = new storage_1.Schema(mapType.args[0]);
@@ -133,7 +133,7 @@ class MichelsonMap {
133
133
  }
134
134
  }
135
135
  serializeDeterministically(key) {
136
- return fast_json_stable_stringify_1.default(key);
136
+ return (0, fast_json_stable_stringify_1.default)(key);
137
137
  }
138
138
  *keys() {
139
139
  for (const [key] of this.entries()) {
@@ -202,4 +202,3 @@ class MichelsonMap {
202
202
  }
203
203
  exports.MichelsonMap = MichelsonMap;
204
204
  _a = michelsonMapTypeSymbol;
205
- //# sourceMappingURL=michelson-map.js.map
@@ -125,4 +125,3 @@ class MissingArgumentError extends core_1.TaquitoError {
125
125
  }
126
126
  }
127
127
  exports.MissingArgumentError = MissingArgumentError;
128
- //# sourceMappingURL=errors.js.map
@@ -27,7 +27,7 @@ class EventSchema {
27
27
  static removeDuplicates(events) {
28
28
  const uniqueEvents = [];
29
29
  events.forEach((event) => {
30
- const idx = uniqueEvents.findIndex((e) => e.tag === event.tag && storage_1.deepEqual(e.type, event.type));
30
+ const idx = uniqueEvents.findIndex((e) => e.tag === event.tag && (0, storage_1.deepEqual)(e.type, event.type));
31
31
  if (idx === -1) {
32
32
  uniqueEvents.push(event);
33
33
  }
@@ -51,4 +51,3 @@ class EventSchema {
51
51
  }
52
52
  }
53
53
  exports.EventSchema = EventSchema;
54
- //# sourceMappingURL=event-schema.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=model.js.map
@@ -10,13 +10,6 @@ const errors_1 = require("./errors");
10
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.
11
11
  */
12
12
  class ParameterSchema {
13
- /**
14
- * @description Return the schema of the parameter of a specific entry point
15
- * @throws {@link InvalidTokenError}
16
- */
17
- constructor(val) {
18
- this.root = createToken_1.createToken(val, 0);
19
- }
20
13
  /**
21
14
  *
22
15
  * @description Create an instance of ParameterSchema from a contract script
@@ -62,6 +55,13 @@ class ParameterSchema {
62
55
  return true;
63
56
  }
64
57
  }
58
+ /**
59
+ * @description Return the schema of the parameter of a specific entry point
60
+ * @throws {@link InvalidTokenError}
61
+ */
62
+ constructor(val) {
63
+ this.root = (0, createToken_1.createToken)(val, 0);
64
+ }
65
65
  /**
66
66
  * @description Returns the javascript object equivalent of the Micheline value provided
67
67
  */
@@ -118,4 +118,3 @@ class ParameterSchema {
118
118
  }
119
119
  }
120
120
  exports.ParameterSchema = ParameterSchema;
121
- //# sourceMappingURL=parameter.js.map
@@ -56,20 +56,6 @@ exports.deepEqual = deepEqual;
56
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.
57
57
  */
58
58
  class Schema {
59
- constructor(val) {
60
- this.val = val;
61
- this[_a] = true;
62
- this.root = createToken_1.createToken(val, 0);
63
- if (this.root instanceof bigmap_1.BigMapToken) {
64
- this.bigMap = this.root;
65
- }
66
- else if (this.isExpressionExtended(val) && val.prim === 'pair') {
67
- const exp = val.args[0];
68
- if (this.isExpressionExtended(exp) && exp.prim === 'big_map') {
69
- this.bigMap = new bigmap_1.BigMapToken(exp, 0, createToken_1.createToken);
70
- }
71
- }
72
- }
73
59
  static isSchema(obj) {
74
60
  return obj && obj[schemaTypeSymbol] === true;
75
61
  }
@@ -99,6 +85,20 @@ class Schema {
99
85
  isExpressionExtended(val) {
100
86
  return 'prim' in val && Array.isArray(val.args);
101
87
  }
88
+ constructor(val) {
89
+ this.val = val;
90
+ this[_a] = true;
91
+ this.root = (0, createToken_1.createToken)(val, 0);
92
+ if (this.root instanceof bigmap_1.BigMapToken) {
93
+ this.bigMap = this.root;
94
+ }
95
+ else if (this.isExpressionExtended(val) && val.prim === 'pair') {
96
+ const exp = val.args[0];
97
+ if (this.isExpressionExtended(exp) && exp.prim === 'big_map') {
98
+ this.bigMap = new bigmap_1.BigMapToken(exp, 0, createToken_1.createToken);
99
+ }
100
+ }
101
+ }
102
102
  removeTopLevelAnnotation(obj) {
103
103
  // PairToken and OrToken can have redundant top level annotation in their storage
104
104
  if (this.root instanceof pair_1.PairToken || this.root instanceof or_1.OrToken) {
@@ -263,4 +263,3 @@ class Schema {
263
263
  }
264
264
  exports.Schema = Schema;
265
265
  _a = schemaTypeSymbol;
266
- //# sourceMappingURL=storage.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -4,26 +4,6 @@ exports.ViewSchema = void 0;
4
4
  const createToken_1 = require("../tokens/createToken");
5
5
  const errors_1 = require("./errors");
6
6
  class ViewSchema {
7
- /**
8
- * @throws {@link InvalidScriptError}
9
- */
10
- constructor(viewArgs) {
11
- if (!viewArgs) {
12
- throw new errors_1.InvalidScriptError(viewArgs, 'the args are not defined');
13
- }
14
- if (viewArgs.length !== 4) {
15
- throw new errors_1.InvalidScriptError(viewArgs, `there should be exactly 4 arguments`);
16
- }
17
- if (!('string' in viewArgs[0]) || !viewArgs[0]['string']) {
18
- throw new errors_1.InvalidScriptError(viewArgs, `The first argument should be a string, representing the view name. It should be in the form: { string: 'viewName' }`);
19
- }
20
- this.viewName = viewArgs[0]['string'];
21
- this.viewArgsType = viewArgs[1];
22
- this.viewReturnType = viewArgs[2];
23
- this.instructions = viewArgs[3];
24
- this.rootArgsType = createToken_1.createToken(this.viewArgsType, 0);
25
- this.rootReturnType = createToken_1.createToken(this.viewReturnType, 0);
26
- }
27
7
  /**
28
8
  *
29
9
  * @description Create an instance of ViewSchema for each view in a script
@@ -45,6 +25,26 @@ class ViewSchema {
45
25
  }
46
26
  return allViewSchema;
47
27
  }
28
+ /**
29
+ * @throws {@link InvalidScriptError}
30
+ */
31
+ constructor(viewArgs) {
32
+ if (!viewArgs) {
33
+ throw new errors_1.InvalidScriptError(viewArgs, 'the args are not defined');
34
+ }
35
+ if (viewArgs.length !== 4) {
36
+ throw new errors_1.InvalidScriptError(viewArgs, `there should be exactly 4 arguments`);
37
+ }
38
+ if (!('string' in viewArgs[0]) || !viewArgs[0]['string']) {
39
+ throw new errors_1.InvalidScriptError(viewArgs, `The first argument should be a string, representing the view name. It should be in the form: { string: 'viewName' }`);
40
+ }
41
+ this.viewName = viewArgs[0]['string'];
42
+ this.viewArgsType = viewArgs[1];
43
+ this.viewReturnType = viewArgs[2];
44
+ this.instructions = viewArgs[3];
45
+ this.rootArgsType = (0, createToken_1.createToken)(this.viewArgsType, 0);
46
+ this.rootReturnType = (0, createToken_1.createToken)(this.viewReturnType, 0);
47
+ }
48
48
  /**
49
49
  *
50
50
  * @description Transform the view parameter into Michelson
@@ -88,4 +88,3 @@ class ViewSchema {
88
88
  }
89
89
  }
90
90
  exports.ViewSchema = ViewSchema;
91
- //# sourceMappingURL=view-schema.js.map
@@ -5,7 +5,11 @@
5
5
  */
6
6
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
7
  if (k2 === undefined) k2 = k;
8
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
9
13
  }) : (function(o, m, k, k2) {
10
14
  if (k2 === undefined) k2 = k;
11
15
  o[k2] = m[k];
@@ -29,4 +33,3 @@ var version_1 = require("./version");
29
33
  Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
30
34
  var token_1 = require("./tokens/token");
31
35
  Object.defineProperty(exports, "Token", { enumerable: true, get: function () { return token_1.Token; } });
32
- //# sourceMappingURL=taquito-michelson-encoder.js.map
@@ -140,4 +140,3 @@ class BigMapToken extends token_1.Token {
140
140
  }
141
141
  exports.BigMapToken = BigMapToken;
142
142
  BigMapToken.prim = 'big_map';
143
- //# sourceMappingURL=bigmap.js.map
@@ -91,4 +91,3 @@ exports.Bls12381frToken = Bls12381frToken;
91
91
  // An element of the BLS12-381 scalar field Fr
92
92
  // see https://tezos.gitlab.io/michelson-reference/#type-bls12_381_fr
93
93
  Bls12381frToken.prim = 'bls12_381_fr';
94
- //# sourceMappingURL=bls12-381-fr.js.map
@@ -81,4 +81,3 @@ exports.Bls12381g1Token = Bls12381g1Token;
81
81
  // A point on the BLS12-381 curve G1
82
82
  // See https://tezos.gitlab.io/michelson-reference/#type-bls12_381_g1
83
83
  Bls12381g1Token.prim = 'bls12_381_g1';
84
- //# sourceMappingURL=bls12-381-g1.js.map
@@ -81,4 +81,3 @@ exports.Bls12381g2Token = Bls12381g2Token;
81
81
  // A point on the BLS12-381 curve G2
82
82
  // See https://tezos.gitlab.io/michelson-reference/#type-bls12_381_g2
83
83
  Bls12381g2Token.prim = 'bls12_381_g2';
84
- //# sourceMappingURL=bls12-381-g2.js.map
@@ -27,7 +27,7 @@ class ChainIDToken extends token_1.ComparableToken {
27
27
  * @throws {@link ChainIDValidationError}
28
28
  */
29
29
  validate(value) {
30
- if (utils_1.validateChain(value) !== utils_1.ValidationResult.VALID) {
30
+ if ((0, utils_1.validateChain)(value) !== utils_1.ValidationResult.VALID) {
31
31
  throw new ChainIDValidationError(value, this, `Value ${JSON.stringify(value)} is not a valid ChainID`);
32
32
  }
33
33
  }
@@ -83,4 +83,3 @@ class ChainIDToken extends token_1.ComparableToken {
83
83
  }
84
84
  exports.ChainIDToken = ChainIDToken;
85
85
  ChainIDToken.prim = 'chain_id';
86
- //# sourceMappingURL=chain-id.js.map
@@ -79,4 +79,3 @@ class ChestKeyToken extends token_1.Token {
79
79
  }
80
80
  exports.ChestKeyToken = ChestKeyToken;
81
81
  ChestKeyToken.prim = 'chest_key';
82
- //# sourceMappingURL=chest-key.js.map
@@ -79,4 +79,3 @@ class ChestToken extends token_1.Token {
79
79
  }
80
80
  exports.ChestToken = ChestToken;
81
81
  ChestToken.prim = 'chest';
82
- //# sourceMappingURL=chest.js.map
@@ -24,7 +24,7 @@ class AddressToken extends token_1.ComparableToken {
24
24
  this.fac = fac;
25
25
  }
26
26
  ToBigMapKey(val) {
27
- const decoded = utils_1.b58decode(val);
27
+ const decoded = (0, utils_1.b58decode)(val);
28
28
  return {
29
29
  key: { bytes: decoded },
30
30
  type: { prim: 'bytes' },
@@ -34,7 +34,7 @@ class AddressToken extends token_1.ComparableToken {
34
34
  * @throws {@link AddressValidationError}
35
35
  */
36
36
  validate(value) {
37
- if (utils_1.validateAddress(value) !== utils_1.ValidationResult.VALID) {
37
+ if ((0, utils_1.validateAddress)(value) !== utils_1.ValidationResult.VALID) {
38
38
  throw new AddressValidationError(value, this, `Address is not valid: ${JSON.stringify(value)}`);
39
39
  }
40
40
  }
@@ -66,7 +66,7 @@ class AddressToken extends token_1.ComparableToken {
66
66
  if (!val.bytes) {
67
67
  throw new AddressValidationError(val, this, `cannot be missing both string and bytes: ${JSON.stringify(val)}`);
68
68
  }
69
- return utils_1.encodePubKey(val.bytes);
69
+ return (0, utils_1.encodePubKey)(val.bytes);
70
70
  }
71
71
  /**
72
72
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
@@ -91,7 +91,7 @@ class AddressToken extends token_1.ComparableToken {
91
91
  if (!bytes) {
92
92
  throw new AddressValidationError({ bytes, string }, this, `cannot be missing both string and bytes ${JSON.stringify({ string, bytes })}`);
93
93
  }
94
- return utils_1.encodePubKey(bytes);
94
+ return (0, utils_1.encodePubKey)(bytes);
95
95
  }
96
96
  compare(address1, address2) {
97
97
  const isImplicit = (address) => {
@@ -116,4 +116,3 @@ class AddressToken extends token_1.ComparableToken {
116
116
  }
117
117
  exports.AddressToken = AddressToken;
118
118
  AddressToken.prim = 'address';
119
- //# sourceMappingURL=address.js.map
@@ -64,4 +64,3 @@ class BoolToken extends token_1.ComparableToken {
64
64
  }
65
65
  exports.BoolToken = BoolToken;
66
66
  BoolToken.prim = 'bool';
67
- //# sourceMappingURL=bool.js.map
@@ -46,7 +46,7 @@ class BytesToken extends token_1.ComparableToken {
46
46
  */
47
47
  Encode(args) {
48
48
  let val = args.pop();
49
- val = utils_1.stripHexPrefix(this.convertUint8ArrayToHexString(val));
49
+ val = (0, utils_1.stripHexPrefix)(this.convertUint8ArrayToHexString(val));
50
50
  this.validate(val);
51
51
  return { bytes: String(val).toString() };
52
52
  }
@@ -56,7 +56,7 @@ class BytesToken extends token_1.ComparableToken {
56
56
  EncodeObject(val, semantic) {
57
57
  val = this.convertUint8ArrayToHexString(val);
58
58
  if (typeof val === 'string') {
59
- val = utils_1.stripHexPrefix(val);
59
+ val = (0, utils_1.stripHexPrefix)(val);
60
60
  }
61
61
  this.validate(val);
62
62
  if (semantic && semantic[BytesToken.prim]) {
@@ -95,4 +95,3 @@ class BytesToken extends token_1.ComparableToken {
95
95
  }
96
96
  exports.BytesToken = BytesToken;
97
97
  BytesToken.prim = 'bytes';
98
- //# sourceMappingURL=bytes.js.map
@@ -92,4 +92,3 @@ class IntToken extends token_1.ComparableToken {
92
92
  }
93
93
  exports.IntToken = IntToken;
94
94
  IntToken.prim = 'int';
95
- //# sourceMappingURL=int.js.map
@@ -27,13 +27,13 @@ class KeyHashToken extends token_1.ComparableToken {
27
27
  if (val.string) {
28
28
  return val.string;
29
29
  }
30
- return utils_1.encodeKeyHash(val.bytes);
30
+ return (0, utils_1.encodeKeyHash)(val.bytes);
31
31
  }
32
32
  /**
33
33
  * @throws {@link KeyHashValidationError}
34
34
  */
35
35
  validate(value) {
36
- if (utils_1.validateKeyHash(value) !== utils_1.ValidationResult.VALID) {
36
+ if ((0, utils_1.validateKeyHash)(value) !== utils_1.ValidationResult.VALID) {
37
37
  throw new KeyHashValidationError(value, this, `KeyHash is not valid: ${JSON.stringify(value)}`);
38
38
  }
39
39
  }
@@ -72,7 +72,7 @@ class KeyHashToken extends token_1.ComparableToken {
72
72
  if (string) {
73
73
  return string;
74
74
  }
75
- return utils_1.encodeKeyHash(bytes);
75
+ return (0, utils_1.encodeKeyHash)(bytes);
76
76
  }
77
77
  ToBigMapKey(val) {
78
78
  return {
@@ -89,4 +89,3 @@ class KeyHashToken extends token_1.ComparableToken {
89
89
  }
90
90
  exports.KeyHashToken = KeyHashToken;
91
91
  KeyHashToken.prim = 'key_hash';
92
- //# sourceMappingURL=key_hash.js.map
@@ -92,4 +92,3 @@ class MutezToken extends token_1.ComparableToken {
92
92
  }
93
93
  exports.MutezToken = MutezToken;
94
94
  MutezToken.prim = 'mutez';
95
- //# sourceMappingURL=mutez.js.map
@@ -95,4 +95,3 @@ class NatToken extends token_1.ComparableToken {
95
95
  }
96
96
  exports.NatToken = NatToken;
97
97
  NatToken.prim = 'nat';
98
- //# sourceMappingURL=nat.js.map
@@ -53,4 +53,3 @@ class StringToken extends token_1.ComparableToken {
53
53
  }
54
54
  exports.StringToken = StringToken;
55
55
  StringToken.prim = 'string';
56
- //# sourceMappingURL=string.js.map
@@ -71,4 +71,3 @@ class TimestampToken extends token_1.ComparableToken {
71
71
  }
72
72
  exports.TimestampToken = TimestampToken;
73
73
  TimestampToken.prim = 'timestamp';
74
- //# sourceMappingURL=timestamp.js.map
@@ -24,7 +24,7 @@ class TxRollupL2AddressToken extends token_1.ComparableToken {
24
24
  this.fac = fac;
25
25
  }
26
26
  ToBigMapKey(val) {
27
- const decoded = utils_1.b58decodeL2Address(val);
27
+ const decoded = (0, utils_1.b58decodeL2Address)(val);
28
28
  return {
29
29
  key: { bytes: decoded },
30
30
  type: { prim: 'bytes' },
@@ -34,7 +34,7 @@ class TxRollupL2AddressToken extends token_1.ComparableToken {
34
34
  * @throws {@link TxRollupL2AddressValidationError}
35
35
  */
36
36
  validate(value) {
37
- if (utils_1.validateAddress(value) !== utils_1.ValidationResult.VALID) {
37
+ if ((0, utils_1.validateAddress)(value) !== utils_1.ValidationResult.VALID) {
38
38
  throw new TxRollupL2AddressValidationError(value, this, `tx_rollup_l2_address is not valid: ${JSON.stringify(value)}`);
39
39
  }
40
40
  }
@@ -69,7 +69,7 @@ class TxRollupL2AddressToken extends token_1.ComparableToken {
69
69
  if (!val.bytes) {
70
70
  throw new TxRollupL2AddressValidationError(val, this, `value cannot be missing string and byte value. must have one ${JSON.stringify(val)}`);
71
71
  }
72
- return utils_1.encodeL2Address(val.bytes);
72
+ return (0, utils_1.encodeL2Address)(val.bytes);
73
73
  }
74
74
  ExtractSchema() {
75
75
  return TxRollupL2AddressToken.prim;
@@ -90,7 +90,7 @@ class TxRollupL2AddressToken extends token_1.ComparableToken {
90
90
  if (!bytes) {
91
91
  throw new TxRollupL2AddressValidationError(bytes, this, `value cannot be missing string and byte value. must have one: bytes = ${JSON.stringify(bytes)}`);
92
92
  }
93
- return utils_1.encodeL2Address(bytes);
93
+ return (0, utils_1.encodeL2Address)(bytes);
94
94
  }
95
95
  findAndReturnTokens(tokenToFind, tokens) {
96
96
  if (TxRollupL2AddressToken.prim === tokenToFind) {
@@ -101,4 +101,3 @@ class TxRollupL2AddressToken extends token_1.ComparableToken {
101
101
  }
102
102
  exports.TxRollupL2AddressToken = TxRollupL2AddressToken;
103
103
  TxRollupL2AddressToken.prim = 'tx_rollup_l2_address';
104
- //# sourceMappingURL=tx_rollup_l2_address.js.map
@@ -85,4 +85,3 @@ class GlobalConstantToken extends token_1.Token {
85
85
  }
86
86
  exports.GlobalConstantToken = GlobalConstantToken;
87
87
  GlobalConstantToken.prim = 'constant';
88
- //# sourceMappingURL=constant.js.map
@@ -28,7 +28,7 @@ class ContractToken extends token_1.Token {
28
28
  */
29
29
  validate(value) {
30
30
  // tz1,tz2 and tz3 seems to be valid contract values (for Unit contract)
31
- if (utils_1.validateAddress(value) !== utils_1.ValidationResult.VALID) {
31
+ if ((0, utils_1.validateAddress)(value) !== utils_1.ValidationResult.VALID) {
32
32
  throw new ContractValidationError(value, this, `Value ${JSON.stringify(value)} is not a valid contract address.`);
33
33
  }
34
34
  return null;
@@ -43,7 +43,7 @@ class ContractToken extends token_1.Token {
43
43
  if (!val.bytes) {
44
44
  throw new ContractValidationError(val, this, `Value ${JSON.stringify(val)} is not a valid contract address. must contain bytes or string.`);
45
45
  }
46
- return utils_1.encodePubKey(val.bytes);
46
+ return (0, utils_1.encodePubKey)(val.bytes);
47
47
  }
48
48
  /**
49
49
  * @throws {@link ContractValidationError}
@@ -88,4 +88,3 @@ class ContractToken extends token_1.Token {
88
88
  }
89
89
  exports.ContractToken = ContractToken;
90
90
  ContractToken.prim = 'contract';
91
- //# sourceMappingURL=contract.js.map
@@ -33,4 +33,3 @@ function createToken(val, idx) {
33
33
  return new t(val, idx, createToken);
34
34
  }
35
35
  exports.createToken = createToken;
36
- //# sourceMappingURL=createToken.js.map
@@ -28,13 +28,13 @@ class KeyToken extends token_1.ComparableToken {
28
28
  if (val.string) {
29
29
  return val.string;
30
30
  }
31
- return utils_1.encodeKey(val.bytes);
31
+ return (0, utils_1.encodeKey)(val.bytes);
32
32
  }
33
33
  /**
34
34
  * @throws {@link KeyValidationError}
35
35
  */
36
36
  validate(value) {
37
- if (utils_1.validatePublicKey(value) !== utils_1.ValidationResult.VALID) {
37
+ if ((0, utils_1.validatePublicKey)(value) !== utils_1.ValidationResult.VALID) {
38
38
  throw new KeyValidationError(value, this, 'Key is not valid');
39
39
  }
40
40
  }
@@ -101,7 +101,7 @@ class KeyToken extends token_1.ComparableToken {
101
101
  return val.substring(0, publicKeyPrefixLength);
102
102
  }
103
103
  getP256PublicKeyComparableBytes(p2pk) {
104
- return utils_1.b58cdecode(p2pk, utils_1.prefix[utils_1.Prefix.P2PK]).slice(1);
104
+ return (0, utils_1.b58cdecode)(p2pk, utils_1.prefix[utils_1.Prefix.P2PK]).slice(1);
105
105
  }
106
106
  findAndReturnTokens(tokenToFind, tokens) {
107
107
  if (KeyToken.prim === tokenToFind) {
@@ -112,4 +112,3 @@ class KeyToken extends token_1.ComparableToken {
112
112
  }
113
113
  exports.KeyToken = KeyToken;
114
114
  KeyToken.prim = 'key';
115
- //# sourceMappingURL=key.js.map
@@ -65,4 +65,3 @@ class LambdaToken extends token_1.Token {
65
65
  }
66
66
  exports.LambdaToken = LambdaToken;
67
67
  LambdaToken.prim = 'lambda';
68
- //# sourceMappingURL=lambda.js.map
@@ -92,4 +92,3 @@ class ListToken extends token_1.Token {
92
92
  }
93
93
  exports.ListToken = ListToken;
94
94
  ListToken.prim = 'list';
95
- //# sourceMappingURL=list.js.map
@@ -122,4 +122,3 @@ class MapToken extends token_1.Token {
122
122
  }
123
123
  exports.MapToken = MapToken;
124
124
  MapToken.prim = 'map';
125
- //# sourceMappingURL=map.js.map
@@ -66,4 +66,3 @@ class NeverToken extends token_1.Token {
66
66
  }
67
67
  exports.NeverToken = NeverToken;
68
68
  NeverToken.prim = 'never';
69
- //# sourceMappingURL=never.js.map
@@ -44,4 +44,3 @@ class OperationToken extends token_1.Token {
44
44
  }
45
45
  exports.OperationToken = OperationToken;
46
46
  OperationToken.prim = 'operation';
47
- //# sourceMappingURL=operation.js.map
@@ -93,4 +93,3 @@ class OptionToken extends token_1.ComparableToken {
93
93
  }
94
94
  exports.OptionToken = OptionToken;
95
95
  OptionToken.prim = 'option';
96
- //# sourceMappingURL=option.js.map
@@ -273,4 +273,3 @@ class OrToken extends token_1.ComparableToken {
273
273
  }
274
274
  exports.OrToken = OrToken;
275
275
  OrToken.prim = 'or';
276
- //# sourceMappingURL=or.js.map
@@ -229,4 +229,3 @@ class PairToken extends token_1.ComparableToken {
229
229
  }
230
230
  exports.PairToken = PairToken;
231
231
  PairToken.prim = 'pair';
232
- //# sourceMappingURL=pair.js.map
@@ -93,4 +93,3 @@ class SaplingStateToken extends token_1.Token {
93
93
  }
94
94
  exports.SaplingStateToken = SaplingStateToken;
95
95
  SaplingStateToken.prim = 'sapling_state';
96
- //# sourceMappingURL=sapling-state.js.map
@@ -83,4 +83,3 @@ class SaplingTransactionDeprecatedToken extends token_1.Token {
83
83
  }
84
84
  exports.SaplingTransactionDeprecatedToken = SaplingTransactionDeprecatedToken;
85
85
  SaplingTransactionDeprecatedToken.prim = 'sapling_transaction_deprecated';
86
- //# sourceMappingURL=sapling-transaction-deprecated.js.map
@@ -83,4 +83,3 @@ class SaplingTransactionToken extends token_1.Token {
83
83
  }
84
84
  exports.SaplingTransactionToken = SaplingTransactionToken;
85
85
  SaplingTransactionToken.prim = 'sapling_transaction';
86
- //# sourceMappingURL=sapling-transaction.js.map
@@ -87,4 +87,3 @@ class SetToken extends token_1.Token {
87
87
  }
88
88
  exports.SetToken = SetToken;
89
89
  SetToken.prim = 'set';
90
- //# sourceMappingURL=set.js.map
@@ -34,7 +34,7 @@ class SignatureToken extends token_1.ComparableToken {
34
34
  * @throws {@link SignatureValidationError}
35
35
  */
36
36
  validate(value) {
37
- if (utils_1.validateSignature(value) !== utils_1.ValidationResult.VALID) {
37
+ if ((0, utils_1.validateSignature)(value) !== utils_1.ValidationResult.VALID) {
38
38
  throw new SignatureValidationError(value, this, 'Signature is not valid');
39
39
  }
40
40
  }
@@ -87,4 +87,3 @@ class SignatureToken extends token_1.ComparableToken {
87
87
  }
88
88
  exports.SignatureToken = SignatureToken;
89
89
  SignatureToken.prim = 'signature';
90
- //# sourceMappingURL=signature.js.map
@@ -101,4 +101,3 @@ class TicketDeprecatedToken extends token_1.Token {
101
101
  }
102
102
  exports.TicketDeprecatedToken = TicketDeprecatedToken;
103
103
  TicketDeprecatedToken.prim = 'ticket_deprecated';
104
- //# sourceMappingURL=ticket-deprecated.js.map
@@ -101,4 +101,3 @@ class TicketToken extends token_1.Token {
101
101
  }
102
102
  exports.TicketToken = TicketToken;
103
103
  TicketToken.prim = 'ticket';
104
- //# sourceMappingURL=ticket.js.map
@@ -87,4 +87,3 @@ class ComparableToken extends Token {
87
87
  }
88
88
  }
89
89
  exports.ComparableToken = ComparableToken;
90
- //# sourceMappingURL=token.js.map
@@ -75,4 +75,3 @@ exports.tokens = [
75
75
  chest_key_1.ChestKeyToken,
76
76
  constant_1.GlobalConstantToken,
77
77
  ];
78
- //# sourceMappingURL=tokens.js.map
@@ -57,4 +57,3 @@ class UnitToken extends token_1.ComparableToken {
57
57
  }
58
58
  exports.UnitToken = UnitToken;
59
59
  UnitToken.prim = 'unit';
60
- //# sourceMappingURL=unit.js.map