@taquito/michelson-encoder 23.0.3 → 24.0.0-RC.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 (88) hide show
  1. package/dist/lib/constants.js +11 -0
  2. package/dist/lib/schema/parameter.js +1 -8
  3. package/dist/lib/schema/storage.js +0 -20
  4. package/dist/lib/schema/view-schema.js +2 -2
  5. package/dist/lib/taquito-michelson-encoder.js +3 -2
  6. package/dist/lib/tokens/bigmap.js +0 -12
  7. package/dist/lib/tokens/bls12-381-fr.js +0 -7
  8. package/dist/lib/tokens/bls12-381-g1.js +0 -7
  9. package/dist/lib/tokens/bls12-381-g2.js +0 -7
  10. package/dist/lib/tokens/chain-id.js +0 -7
  11. package/dist/lib/tokens/chest-key.js +0 -7
  12. package/dist/lib/tokens/chest.js +0 -7
  13. package/dist/lib/tokens/comparable/address.js +0 -7
  14. package/dist/lib/tokens/comparable/bool.js +0 -7
  15. package/dist/lib/tokens/comparable/bytes.js +0 -7
  16. package/dist/lib/tokens/comparable/int.js +0 -7
  17. package/dist/lib/tokens/comparable/key_hash.js +0 -7
  18. package/dist/lib/tokens/comparable/mutez.js +0 -7
  19. package/dist/lib/tokens/comparable/nat.js +0 -7
  20. package/dist/lib/tokens/comparable/string.js +0 -7
  21. package/dist/lib/tokens/comparable/timestamp.js +0 -7
  22. package/dist/lib/tokens/constant.js +0 -7
  23. package/dist/lib/tokens/contract.js +0 -7
  24. package/dist/lib/tokens/key.js +10 -29
  25. package/dist/lib/tokens/lambda.js +0 -12
  26. package/dist/lib/tokens/list.js +0 -9
  27. package/dist/lib/tokens/map.js +0 -12
  28. package/dist/lib/tokens/never.js +0 -7
  29. package/dist/lib/tokens/operation.js +0 -7
  30. package/dist/lib/tokens/option.js +0 -7
  31. package/dist/lib/tokens/or.js +7 -13
  32. package/dist/lib/tokens/pair.js +3 -10
  33. package/dist/lib/tokens/sapling-state.js +0 -11
  34. package/dist/lib/tokens/sapling-transaction-deprecated.js +0 -11
  35. package/dist/lib/tokens/sapling-transaction.js +0 -11
  36. package/dist/lib/tokens/set.js +0 -7
  37. package/dist/lib/tokens/signature.js +0 -7
  38. package/dist/lib/tokens/ticket-deprecated.js +0 -11
  39. package/dist/lib/tokens/ticket.js +0 -11
  40. package/dist/lib/tokens/token.js +1 -1
  41. package/dist/lib/tokens/unit.js +3 -10
  42. package/dist/lib/version.js +2 -2
  43. package/dist/taquito-michelson-encoder.es6.js +37 -355
  44. package/dist/taquito-michelson-encoder.es6.js.map +1 -1
  45. package/dist/taquito-michelson-encoder.umd.js +39 -357
  46. package/dist/taquito-michelson-encoder.umd.js.map +1 -1
  47. package/dist/types/constants.d.ts +8 -0
  48. package/dist/types/schema/parameter.d.ts +1 -6
  49. package/dist/types/schema/storage.d.ts +0 -11
  50. package/dist/types/schema/view-schema.d.ts +2 -2
  51. package/dist/types/taquito-michelson-encoder.d.ts +1 -2
  52. package/dist/types/tokens/bigmap.d.ts +0 -10
  53. package/dist/types/tokens/bls12-381-fr.d.ts +0 -5
  54. package/dist/types/tokens/bls12-381-g1.d.ts +0 -5
  55. package/dist/types/tokens/bls12-381-g2.d.ts +0 -5
  56. package/dist/types/tokens/chain-id.d.ts +0 -5
  57. package/dist/types/tokens/chest-key.d.ts +0 -5
  58. package/dist/types/tokens/chest.d.ts +0 -5
  59. package/dist/types/tokens/comparable/address.d.ts +0 -5
  60. package/dist/types/tokens/comparable/bool.d.ts +0 -5
  61. package/dist/types/tokens/comparable/bytes.d.ts +0 -5
  62. package/dist/types/tokens/comparable/int.d.ts +0 -5
  63. package/dist/types/tokens/comparable/key_hash.d.ts +0 -5
  64. package/dist/types/tokens/comparable/mutez.d.ts +0 -5
  65. package/dist/types/tokens/comparable/nat.d.ts +0 -5
  66. package/dist/types/tokens/comparable/string.d.ts +0 -5
  67. package/dist/types/tokens/comparable/timestamp.d.ts +0 -5
  68. package/dist/types/tokens/constant.d.ts +0 -5
  69. package/dist/types/tokens/contract.d.ts +0 -5
  70. package/dist/types/tokens/key.d.ts +0 -6
  71. package/dist/types/tokens/lambda.d.ts +0 -10
  72. package/dist/types/tokens/list.d.ts +0 -7
  73. package/dist/types/tokens/map.d.ts +0 -10
  74. package/dist/types/tokens/never.d.ts +0 -5
  75. package/dist/types/tokens/operation.d.ts +0 -5
  76. package/dist/types/tokens/option.d.ts +1 -8
  77. package/dist/types/tokens/or.d.ts +0 -5
  78. package/dist/types/tokens/pair.d.ts +0 -5
  79. package/dist/types/tokens/sapling-state.d.ts +0 -9
  80. package/dist/types/tokens/sapling-transaction-deprecated.d.ts +0 -9
  81. package/dist/types/tokens/sapling-transaction.d.ts +0 -9
  82. package/dist/types/tokens/set.d.ts +0 -5
  83. package/dist/types/tokens/signature.d.ts +0 -5
  84. package/dist/types/tokens/ticket-deprecated.d.ts +0 -9
  85. package/dist/types/tokens/ticket.d.ts +0 -9
  86. package/dist/types/tokens/token.d.ts +1 -6
  87. package/dist/types/tokens/unit.d.ts +0 -5
  88. package/package.json +9 -8
@@ -1,8 +1,8 @@
1
1
  import stringify from 'fast-json-stable-stringify';
2
2
  import { TaquitoError, InvalidViewParameterError } from '@taquito/core';
3
3
  import BigNumber from 'bignumber.js';
4
- import { b58DecodeAddress, validateAddress, ValidationResult, encodeAddress, splitAddress, compareArrays, stripHexPrefix, encodeKey, validatePublicKey, b58DecodePublicKey, encodeKeyHash, validateKeyHash, b58DecodePublicKeyHash, validateSignature, validateChain } from '@taquito/utils';
5
- import elliptic from 'elliptic';
4
+ import { b58DecodeAddress, validateAddress, ValidationResult, encodeAddress, splitAddress, compareArrays, stripHexPrefix, encodeKey, validatePublicKey, encodeKeyHash, validateKeyHash, b58DecodePublicKeyHash, validateSignature, validateChain } from '@taquito/utils';
5
+ import { publicKeyFromString } from '@taquito/signer';
6
6
 
7
7
  var _a$1;
8
8
  /**
@@ -278,7 +278,7 @@ class Token {
278
278
  return this.val;
279
279
  }
280
280
  ExtractSignature() {
281
- return [[this.ExtractSchema()]];
281
+ return [[this.generateSchema()]];
282
282
  }
283
283
  }
284
284
  Token._fieldNumberingStrategy = 'Latest';
@@ -313,18 +313,6 @@ class BigMapToken extends Token {
313
313
  get KeySchema() {
314
314
  return this.createToken(this.val.args[0], 0);
315
315
  }
316
- /**
317
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
318
- *
319
- */
320
- ExtractSchema() {
321
- return {
322
- big_map: {
323
- key: this.KeySchema.ExtractSchema(),
324
- value: this.ValueSchema.ExtractSchema(),
325
- },
326
- };
327
- }
328
316
  generateSchema() {
329
317
  return {
330
318
  __michelsonType: BigMapToken.prim,
@@ -449,7 +437,7 @@ class OrToken extends ComparableToken {
449
437
  const leftToken = this.createToken(this.val.args[0], this.getIdxForChildren(), 'Or');
450
438
  let keyCount = 1;
451
439
  if (leftToken instanceof OrToken) {
452
- keyCount = Object.keys(leftToken.ExtractSchema()).length;
440
+ keyCount = Object.keys(leftToken.generateSchema().schema).length;
453
441
  }
454
442
  const rightToken = this.createToken(this.val.args[1], this.getIdxForChildren() + keyCount, 'Or');
455
443
  if (String(leftToken.annot()) === String(label) && !(leftToken instanceof OrToken)) {
@@ -480,7 +468,7 @@ class OrToken extends ComparableToken {
480
468
  const leftToken = this.createToken(this.val.args[0], this.getIdxForChildren(), 'Or');
481
469
  let keyCount = 1;
482
470
  if (leftToken instanceof OrToken) {
483
- keyCount = Object.keys(leftToken.ExtractSchema()).length;
471
+ keyCount = Object.keys(leftToken.generateSchema().schema).length;
484
472
  }
485
473
  const rightToken = this.createToken(this.val.args[1], this.getIdxForChildren() + keyCount, 'Or');
486
474
  const newSig = [];
@@ -511,7 +499,7 @@ class OrToken extends ComparableToken {
511
499
  const leftToken = this.createToken(this.val.args[0], this.getIdxForChildren(), 'Or');
512
500
  let keyCount = 1;
513
501
  if (leftToken instanceof OrToken) {
514
- keyCount = Object.keys(leftToken.ExtractSchema()).length;
502
+ keyCount = Object.keys(leftToken.generateSchema().schema).length;
515
503
  }
516
504
  const rightToken = this.createToken(this.val.args[1], this.getIdxForChildren() + keyCount, 'Or');
517
505
  if (String(leftToken.annot()) === String(label) && !(leftToken instanceof OrToken)) {
@@ -554,7 +542,7 @@ class OrToken extends ComparableToken {
554
542
  const leftToken = this.createToken(this.val.args[0], this.getIdxForChildren(), 'Or');
555
543
  let keyCount = 1;
556
544
  if (leftToken instanceof OrToken) {
557
- keyCount = Object.keys(leftToken.ExtractSchema()).length;
545
+ keyCount = Object.keys(leftToken.generateSchema().schema).length;
558
546
  }
559
547
  const rightToken = this.createToken(this.val.args[1], this.getIdxForChildren() + keyCount, 'Or');
560
548
  if (val.prim === 'Right') {
@@ -585,7 +573,7 @@ class OrToken extends ComparableToken {
585
573
  let leftValue;
586
574
  if (leftToken instanceof OrToken) {
587
575
  leftValue = getLeftValue(leftToken);
588
- keyCount = Object.keys(leftToken.ExtractSchema()).length;
576
+ keyCount = Object.keys(leftToken.generateSchema().schema).length;
589
577
  }
590
578
  else {
591
579
  leftValue = { [leftToken.annot()]: getLeftValue(leftToken) };
@@ -601,13 +589,6 @@ class OrToken extends ComparableToken {
601
589
  const res = concat(leftValue, rightValue);
602
590
  return res;
603
591
  }
604
- /**
605
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
606
- *
607
- */
608
- ExtractSchema() {
609
- return this.traversal((leftToken) => leftToken.ExtractSchema(), (rightToken) => rightToken.ExtractSchema(), (leftValue, rightValue) => (Object.assign(Object.assign({}, leftValue), rightValue)));
610
- }
611
592
  generateSchema() {
612
593
  return {
613
594
  __michelsonType: OrToken.prim,
@@ -632,7 +613,8 @@ class OrToken extends ComparableToken {
632
613
  const leftToken = this.createToken(this.val.args[0], this.getIdxForChildren(), 'Or');
633
614
  let keyCount = 1;
634
615
  if (leftToken instanceof OrToken) {
635
- keyCount = Object.keys(leftToken.ExtractSchema()).length;
616
+ const schema = leftToken.generateSchema();
617
+ keyCount = Object.keys(schema.schema).length;
636
618
  }
637
619
  const rightToken = this.createToken(this.val.args[1], this.getIdxForChildren() + keyCount, 'Or');
638
620
  if (String(leftToken.annot()) === String(label) &&
@@ -773,7 +755,7 @@ class PairToken extends ComparableToken {
773
755
  return this.args().map((a) => {
774
756
  const tok = this.createToken(a, this.getIdxForChildren() + cnt, 'Pair');
775
757
  if (tok instanceof PairToken) {
776
- cnt += Object.keys(tok.ExtractSchema()).length;
758
+ cnt += Object.keys(tok.generateSchema()).length;
777
759
  }
778
760
  else {
779
761
  cnt++;
@@ -792,7 +774,7 @@ class PairToken extends ComparableToken {
792
774
  const leftToken = this.createToken(args[0], this.getIdxForChildren(), 'Pair');
793
775
  let keyCount = 1;
794
776
  if (leftToken instanceof OrToken) {
795
- keyCount = Object.keys(leftToken.ExtractSchema()).length;
777
+ keyCount = Object.keys(leftToken.generateSchema()).length;
796
778
  }
797
779
  const rightToken = this.createToken(args[1], this.getIdxForChildren() + keyCount, 'Pair');
798
780
  const newSig = [];
@@ -844,7 +826,7 @@ class PairToken extends ComparableToken {
844
826
  if (leftToken instanceof PairToken && !leftToken.hasAnnotations()) {
845
827
  leftValue = getLeftValue(leftToken);
846
828
  if (leftToken instanceof PairToken) {
847
- keyCount = Object.keys(leftToken.ExtractSchema()).length;
829
+ keyCount = Object.keys(leftToken.generateSchema()).length;
848
830
  }
849
831
  }
850
832
  else {
@@ -865,13 +847,6 @@ class PairToken extends ComparableToken {
865
847
  const args = collapse$1(val, 'Pair');
866
848
  return this.traversal((leftToken) => leftToken.Execute(args[0], semantics), (rightToken) => rightToken.Execute(args[1], semantics));
867
849
  }
868
- /**
869
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
870
- *
871
- */
872
- ExtractSchema() {
873
- return this.traversal((leftToken) => leftToken.ExtractSchema(), (rightToken) => rightToken.ExtractSchema());
874
- }
875
850
  generateSchema() {
876
851
  return {
877
852
  __michelsonType: PairToken.prim,
@@ -982,13 +957,6 @@ class NatToken extends ComparableToken {
982
957
  }
983
958
  return { int: new BigNumber(val).toFixed() };
984
959
  }
985
- /**
986
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
987
- *
988
- */
989
- ExtractSchema() {
990
- return NatToken.prim;
991
- }
992
960
  generateSchema() {
993
961
  return {
994
962
  __michelsonType: NatToken.prim,
@@ -1031,13 +999,6 @@ class StringToken extends ComparableToken {
1031
999
  Execute(val) {
1032
1000
  return val[Object.keys(val)[0]];
1033
1001
  }
1034
- /**
1035
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
1036
- *
1037
- */
1038
- ExtractSchema() {
1039
- return StringToken.prim;
1040
- }
1041
1002
  generateSchema() {
1042
1003
  return {
1043
1004
  __michelsonType: StringToken.prim,
@@ -1139,13 +1100,6 @@ class AddressToken extends ComparableToken {
1139
1100
  }
1140
1101
  return encodeAddress(val.bytes);
1141
1102
  }
1142
- /**
1143
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
1144
- *
1145
- */
1146
- ExtractSchema() {
1147
- return AddressToken.prim;
1148
- }
1149
1103
  generateSchema() {
1150
1104
  return {
1151
1105
  __michelsonType: AddressToken.prim,
@@ -1275,18 +1229,6 @@ class MapToken extends Token {
1275
1229
  };
1276
1230
  });
1277
1231
  }
1278
- /**
1279
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
1280
- *
1281
- */
1282
- ExtractSchema() {
1283
- return {
1284
- map: {
1285
- key: this.KeySchema.ExtractSchema(),
1286
- value: this.ValueSchema.ExtractSchema(),
1287
- },
1288
- };
1289
- }
1290
1232
  generateSchema() {
1291
1233
  return {
1292
1234
  __michelsonType: MapToken.prim,
@@ -1327,13 +1269,6 @@ class BoolToken extends ComparableToken {
1327
1269
  }
1328
1270
  return { prim: val ? 'True' : 'False' };
1329
1271
  }
1330
- /**
1331
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
1332
- *
1333
- */
1334
- ExtractSchema() {
1335
- return BoolToken.prim;
1336
- }
1337
1272
  generateSchema() {
1338
1273
  return {
1339
1274
  __michelsonType: BoolToken.prim,
@@ -1431,13 +1366,6 @@ class ContractToken extends Token {
1431
1366
  }
1432
1367
  return { string: val };
1433
1368
  }
1434
- /**
1435
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
1436
- *
1437
- */
1438
- ExtractSchema() {
1439
- return ContractToken.prim;
1440
- }
1441
1369
  generateSchema() {
1442
1370
  const valueSchema = this.createToken(this.val.args[0], 0);
1443
1371
  return {
@@ -1520,15 +1448,6 @@ class ListToken extends Token {
1520
1448
  return [...prev, schema.EncodeObject(current)];
1521
1449
  }, []);
1522
1450
  }
1523
- /**
1524
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
1525
- *
1526
- */
1527
- ExtractSchema() {
1528
- return {
1529
- [ListToken.prim]: this.valueSchema.ExtractSchema(),
1530
- };
1531
- }
1532
1451
  generateSchema() {
1533
1452
  return {
1534
1453
  __michelsonType: ListToken.prim,
@@ -1567,13 +1486,6 @@ class MutezToken extends ComparableToken {
1567
1486
  Execute(val) {
1568
1487
  return new BigNumber(val[Object.keys(val)[0]]);
1569
1488
  }
1570
- /**
1571
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
1572
- *
1573
- */
1574
- ExtractSchema() {
1575
- return MutezToken.prim;
1576
- }
1577
1489
  generateSchema() {
1578
1490
  return {
1579
1491
  __michelsonType: MutezToken.prim,
@@ -1696,13 +1608,6 @@ class BytesToken extends ComparableToken {
1696
1608
  Execute(val) {
1697
1609
  return val.bytes;
1698
1610
  }
1699
- /**
1700
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
1701
- *
1702
- */
1703
- ExtractSchema() {
1704
- return BytesToken.prim;
1705
- }
1706
1611
  generateSchema() {
1707
1612
  return {
1708
1613
  __michelsonType: BytesToken.prim,
@@ -1768,13 +1673,6 @@ class OptionToken extends ComparableToken {
1768
1673
  }
1769
1674
  return { Some: this.schema().Execute(val.args[0], semantics) };
1770
1675
  }
1771
- /**
1772
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
1773
- *
1774
- */
1775
- ExtractSchema() {
1776
- return { Some: this.schema().ExtractSchema() };
1777
- }
1778
1676
  generateSchema() {
1779
1677
  return {
1780
1678
  __michelsonType: OptionToken.prim,
@@ -1853,13 +1751,6 @@ class TimestampToken extends ComparableToken {
1853
1751
  return { string: val };
1854
1752
  }
1855
1753
  }
1856
- /**
1857
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
1858
- *
1859
- */
1860
- ExtractSchema() {
1861
- return TimestampToken.prim;
1862
- }
1863
1754
  generateSchema() {
1864
1755
  return {
1865
1756
  __michelsonType: TimestampToken.prim,
@@ -1906,13 +1797,6 @@ class IntToken extends ComparableToken {
1906
1797
  Execute(val) {
1907
1798
  return new BigNumber(val[Object.keys(val)[0]]);
1908
1799
  }
1909
- /**
1910
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
1911
- *
1912
- */
1913
- ExtractSchema() {
1914
- return IntToken.prim;
1915
- }
1916
1800
  generateSchema() {
1917
1801
  return {
1918
1802
  __michelsonType: IntToken.prim,
@@ -1972,6 +1856,15 @@ class IntToken extends ComparableToken {
1972
1856
  }
1973
1857
  IntToken.prim = 'int';
1974
1858
 
1859
+ /**
1860
+ * Symbol representing Unit value in Michelson
1861
+ */
1862
+ const UnitValue = Symbol();
1863
+ /**
1864
+ * Sapling state placeholder value
1865
+ */
1866
+ const SaplingStateValue = {};
1867
+
1975
1868
  class UnitToken extends ComparableToken {
1976
1869
  constructor(val, idx, fac) {
1977
1870
  super(val, idx, fac);
@@ -1992,13 +1885,6 @@ class UnitToken extends ComparableToken {
1992
1885
  Execute(_val) {
1993
1886
  return UnitValue;
1994
1887
  }
1995
- /**
1996
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
1997
- *
1998
- */
1999
- ExtractSchema() {
2000
- return UnitToken.prim;
2001
- }
2002
1888
  generateSchema() {
2003
1889
  return {
2004
1890
  __michelsonType: UnitToken.prim,
@@ -2026,7 +1912,6 @@ class UnitToken extends ComparableToken {
2026
1912
  }
2027
1913
  UnitToken.prim = 'unit';
2028
1914
 
2029
- const ec = new elliptic.ec('p256');
2030
1915
  /**
2031
1916
  * @category Error
2032
1917
  * @description Error that indicates a failure happening when parsing encoding/executing a Key
@@ -2078,13 +1963,6 @@ class KeyToken extends ComparableToken {
2078
1963
  }
2079
1964
  return { string: val };
2080
1965
  }
2081
- /**
2082
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
2083
- *
2084
- */
2085
- ExtractSchema() {
2086
- return KeyToken.prim;
2087
- }
2088
1966
  generateSchema() {
2089
1967
  return {
2090
1968
  __michelsonType: KeyToken.prim,
@@ -2100,31 +1978,20 @@ class KeyToken extends ComparableToken {
2100
1978
  type: { prim: KeyToken.prim },
2101
1979
  };
2102
1980
  }
2103
- decompressP256PublicKey(compressedKey) {
2104
- const compressedArray = Array.from(compressedKey);
2105
- const keyPair = ec.keyFromPublic(compressedArray);
2106
- const publicKey = keyPair.getPublic();
2107
- const uncompressedArray = publicKey.encode('array', false);
2108
- return Buffer.concat([new Uint8Array([0x02]), new Uint8Array(uncompressedArray)]); // add back prefix 0x02
2109
- }
2110
1981
  compare(key1, key2) {
2111
- const bytes1 = b58DecodePublicKey(key1, 'array');
2112
- const bytes2 = b58DecodePublicKey(key2, 'array');
2113
- let array1;
2114
- let array2;
2115
- if (bytes1[0] === 0x02) {
2116
- array1 = this.decompressP256PublicKey(bytes1.slice(1)); // remove prefix 0x02
2117
- }
2118
- else {
2119
- array1 = bytes1;
2120
- }
2121
- if (bytes2[0] === 0x02) {
2122
- array2 = this.decompressP256PublicKey(bytes2.slice(1)); // remove prefix 0x02
1982
+ const publicKey1 = publicKeyFromString(key1);
1983
+ const publicKey2 = publicKeyFromString(key2);
1984
+ const bytes1 = publicKey1.toProtocol();
1985
+ const bytes2 = publicKey2.toProtocol();
1986
+ if (bytes1[0] === bytes2[0]) {
1987
+ return publicKey1.compare(publicKey2);
1988
+ }
1989
+ else if (bytes1[0] > bytes2[0]) {
1990
+ return 1;
2123
1991
  }
2124
1992
  else {
2125
- array2 = bytes2;
1993
+ return -1;
2126
1994
  }
2127
- return compareArrays(array1, array2);
2128
1995
  }
2129
1996
  findAndReturnTokens(tokenToFind, tokens) {
2130
1997
  if (KeyToken.prim === tokenToFind) {
@@ -2186,13 +2053,6 @@ class KeyHashToken extends ComparableToken {
2186
2053
  }
2187
2054
  return { string: val };
2188
2055
  }
2189
- /**
2190
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
2191
- *
2192
- */
2193
- ExtractSchema() {
2194
- return KeyHashToken.prim;
2195
- }
2196
2056
  generateSchema() {
2197
2057
  return {
2198
2058
  __michelsonType: KeyHashToken.prim,
@@ -2278,13 +2138,6 @@ class SignatureToken extends ComparableToken {
2278
2138
  }
2279
2139
  return { string: val };
2280
2140
  }
2281
- /**
2282
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
2283
- *
2284
- */
2285
- ExtractSchema() {
2286
- return SignatureToken.prim;
2287
- }
2288
2141
  generateSchema() {
2289
2142
  return {
2290
2143
  __michelsonType: SignatureToken.prim,
@@ -2340,18 +2193,6 @@ class LambdaToken extends Token {
2340
2193
  }
2341
2194
  return val;
2342
2195
  }
2343
- /**
2344
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
2345
- *
2346
- */
2347
- ExtractSchema() {
2348
- return {
2349
- [LambdaToken.prim]: {
2350
- parameters: this.paramSchema.ExtractSchema(),
2351
- returns: this.returnSchema.ExtractSchema(),
2352
- },
2353
- };
2354
- }
2355
2196
  generateSchema() {
2356
2197
  return {
2357
2198
  __michelsonType: LambdaToken.prim,
@@ -2392,13 +2233,6 @@ class OperationToken extends Token {
2392
2233
  }
2393
2234
  return { string: val };
2394
2235
  }
2395
- /**
2396
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
2397
- *
2398
- */
2399
- ExtractSchema() {
2400
- return OperationToken.prim;
2401
- }
2402
2236
  generateSchema() {
2403
2237
  return {
2404
2238
  __michelsonType: OperationToken.prim,
@@ -2475,13 +2309,6 @@ class SetToken extends Token {
2475
2309
  return [...prev, this.KeySchema.EncodeObject(current)];
2476
2310
  }, []);
2477
2311
  }
2478
- /**
2479
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
2480
- *
2481
- */
2482
- ExtractSchema() {
2483
- return SetToken.prim;
2484
- }
2485
2312
  generateSchema() {
2486
2313
  return {
2487
2314
  __michelsonType: SetToken.prim,
@@ -2528,13 +2355,6 @@ class ChainIDToken extends ComparableToken {
2528
2355
  Execute(val) {
2529
2356
  return val[Object.keys(val)[0]];
2530
2357
  }
2531
- /**
2532
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
2533
- *
2534
- */
2535
- ExtractSchema() {
2536
- return ChainIDToken.prim;
2537
- }
2538
2358
  generateSchema() {
2539
2359
  return {
2540
2360
  __michelsonType: ChainIDToken.prim,
@@ -2635,17 +2455,6 @@ class TicketToken extends Token {
2635
2455
  amount: amount.Execute(val.args[2], semantics),
2636
2456
  };
2637
2457
  }
2638
- /**
2639
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
2640
- *
2641
- */
2642
- ExtractSchema() {
2643
- return {
2644
- ticketer: ContractToken.prim,
2645
- value: this.valueToken.ExtractSchema(),
2646
- amount: IntToken.prim,
2647
- };
2648
- }
2649
2458
  generateSchema() {
2650
2459
  return {
2651
2460
  __michelsonType: TicketToken.prim,
@@ -2730,17 +2539,6 @@ class TicketDeprecatedToken extends Token {
2730
2539
  amount: amount.Execute(val.args[2], semantics),
2731
2540
  };
2732
2541
  }
2733
- /**
2734
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
2735
- *
2736
- */
2737
- ExtractSchema() {
2738
- return {
2739
- ticketer: ContractToken.prim,
2740
- value: this.valueToken.ExtractSchema(),
2741
- amount: IntToken.prim,
2742
- };
2743
- }
2744
2542
  generateSchema() {
2745
2543
  return {
2746
2544
  __michelsonType: TicketDeprecatedToken.prim,
@@ -2808,13 +2606,6 @@ class NeverToken extends Token {
2808
2606
  Execute(val) {
2809
2607
  throw new NeverTokenError(val, this, `There is no literal value for the type never. Trying to execute ${JSON.stringify(val)}.`);
2810
2608
  }
2811
- /**
2812
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
2813
- *
2814
- */
2815
- ExtractSchema() {
2816
- return NeverToken.prim;
2817
- }
2818
2609
  generateSchema() {
2819
2610
  return {
2820
2611
  __michelsonType: NeverToken.prim,
@@ -2892,17 +2683,6 @@ class SaplingStateToken extends Token {
2892
2683
  throw new SaplingStateValidationError(val, this, `Invalid sapling_state. Received: ${JSON.stringify(val)} while expecting: {}`);
2893
2684
  }
2894
2685
  }
2895
- /**
2896
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
2897
- *
2898
- */
2899
- ExtractSchema() {
2900
- return {
2901
- [SaplingStateToken.prim]: {
2902
- 'memo-size': Number(this.val.args[0]['int']),
2903
- },
2904
- };
2905
- }
2906
2686
  generateSchema() {
2907
2687
  return {
2908
2688
  __michelsonType: SaplingStateToken.prim,
@@ -2972,17 +2752,6 @@ class SaplingTransactionToken extends Token {
2972
2752
  }
2973
2753
  return { bytes: String(val).toString() };
2974
2754
  }
2975
- /**
2976
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
2977
- *
2978
- */
2979
- ExtractSchema() {
2980
- return {
2981
- [SaplingTransactionToken.prim]: {
2982
- 'memo-size': Number(this.val.args[0]['int']),
2983
- },
2984
- };
2985
- }
2986
2755
  generateSchema() {
2987
2756
  return {
2988
2757
  __michelsonType: SaplingTransactionToken.prim,
@@ -3052,17 +2821,6 @@ class SaplingTransactionDeprecatedToken extends Token {
3052
2821
  }
3053
2822
  return { bytes: String(val).toString() };
3054
2823
  }
3055
- /**
3056
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
3057
- *
3058
- */
3059
- ExtractSchema() {
3060
- return {
3061
- [SaplingTransactionDeprecatedToken.prim]: {
3062
- 'memo-size': Number(this.val.args[0]['int']),
3063
- },
3064
- };
3065
- }
3066
2824
  generateSchema() {
3067
2825
  return {
3068
2826
  __michelsonType: SaplingTransactionDeprecatedToken.prim,
@@ -3144,13 +2902,6 @@ class Bls12381frToken extends Token {
3144
2902
  Execute(val) {
3145
2903
  return val.bytes;
3146
2904
  }
3147
- /**
3148
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
3149
- *
3150
- */
3151
- ExtractSchema() {
3152
- return Bls12381frToken.prim;
3153
- }
3154
2905
  generateSchema() {
3155
2906
  return {
3156
2907
  __michelsonType: Bls12381frToken.prim,
@@ -3222,13 +2973,6 @@ class Bls12381g1Token extends Token {
3222
2973
  Execute(val) {
3223
2974
  return val.bytes;
3224
2975
  }
3225
- /**
3226
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
3227
- *
3228
- */
3229
- ExtractSchema() {
3230
- return Bls12381g1Token.prim;
3231
- }
3232
2976
  generateSchema() {
3233
2977
  return {
3234
2978
  __michelsonType: Bls12381g1Token.prim,
@@ -3300,13 +3044,6 @@ class Bls12381g2Token extends Token {
3300
3044
  Execute(val) {
3301
3045
  return val.bytes;
3302
3046
  }
3303
- /**
3304
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
3305
- *
3306
- */
3307
- ExtractSchema() {
3308
- return Bls12381g2Token.prim;
3309
- }
3310
3047
  generateSchema() {
3311
3048
  return {
3312
3049
  __michelsonType: Bls12381g2Token.prim,
@@ -3378,13 +3115,6 @@ class ChestToken extends Token {
3378
3115
  Execute(val) {
3379
3116
  return val.bytes;
3380
3117
  }
3381
- /**
3382
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
3383
- *
3384
- */
3385
- ExtractSchema() {
3386
- return ChestToken.prim;
3387
- }
3388
3118
  generateSchema() {
3389
3119
  return {
3390
3120
  __michelsonType: ChestToken.prim,
@@ -3454,13 +3184,6 @@ class ChestKeyToken extends Token {
3454
3184
  Execute(val) {
3455
3185
  return val.bytes;
3456
3186
  }
3457
- /**
3458
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
3459
- *
3460
- */
3461
- ExtractSchema() {
3462
- return ChestKeyToken.prim;
3463
- }
3464
3187
  generateSchema() {
3465
3188
  return {
3466
3189
  __michelsonType: ChestKeyToken.prim,
@@ -3533,13 +3256,6 @@ class GlobalConstantToken extends Token {
3533
3256
  }
3534
3257
  throw new GlobalConstantEncodingError(val, this, `Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0]['string']}.`);
3535
3258
  }
3536
- /**
3537
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
3538
- *
3539
- */
3540
- ExtractSchema() {
3541
- return GlobalConstantToken.prim;
3542
- }
3543
3259
  generateSchema() {
3544
3260
  return {
3545
3261
  __michelsonType: GlobalConstantToken.prim,
@@ -3921,13 +3637,6 @@ class Schema {
3921
3637
  throw new StorageEncodingError('storage object', ex, this.root, value, semantics);
3922
3638
  }
3923
3639
  }
3924
- /**
3925
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
3926
- *
3927
- */
3928
- ExtractSchema() {
3929
- return this.removeTopLevelAnnotation(this.root.ExtractSchema());
3930
- }
3931
3640
  /**
3932
3641
  * @description Produce a representation of the storage schema.
3933
3642
  * Note: Provide guidance on how to write the storage object for the origination operation with Taquito.
@@ -3935,19 +3644,6 @@ class Schema {
3935
3644
  generateSchema() {
3936
3645
  return this.removeTopLevelAnnotation(this.root.generateSchema());
3937
3646
  }
3938
- /**
3939
- * @deprecated
3940
- * @throws {@link InvalidBigMapSchemaError}
3941
- */
3942
- ComputeState(tx, state) {
3943
- if (!this.bigMap) {
3944
- throw new InvalidBigMapSchemaError('Big map schema is undefined');
3945
- }
3946
- const bigMap = tx.reduce((prev, current) => {
3947
- return Object.assign(Object.assign({}, prev), this.ExecuteOnBigMapDiff(current.contents[0].metadata.operation_result.big_map_diff));
3948
- }, {});
3949
- return Object.assign(Object.assign({}, this.Execute(state)), { [this.bigMap.annot()]: bigMap });
3950
- }
3951
3647
  /**
3952
3648
  * @description Look up in top-level pairs of the storage to find a value matching the specified type
3953
3649
  *
@@ -4047,7 +3743,7 @@ class ParameterSchema {
4047
3743
  */
4048
3744
  get hasAnnotation() {
4049
3745
  if (this.isMultipleEntryPoint) {
4050
- return Object.keys(this.ExtractSchema())[0] !== '0';
3746
+ return Object.keys(this.generateSchema())[0] !== '0';
4051
3747
  }
4052
3748
  else {
4053
3749
  return true;
@@ -4098,13 +3794,6 @@ class ParameterSchema {
4098
3794
  throw new ParameterEncodingError('Unable to encode parameter object', this.root, value, ex);
4099
3795
  }
4100
3796
  }
4101
- /**
4102
- * @deprecated ExtractSchema has been deprecated in favor of generateSchema
4103
- *
4104
- */
4105
- ExtractSchema() {
4106
- return this.root.ExtractSchema();
4107
- }
4108
3797
  /**
4109
3798
  * @description Produce a schema grouping together all the entry points of a contract.
4110
3799
  */
@@ -4190,14 +3879,14 @@ class ViewSchema {
4190
3879
  * @description Return the signature of the view parameter
4191
3880
  */
4192
3881
  extractArgsSchema() {
4193
- return this.rootArgsType.ExtractSchema();
3882
+ return this.rootArgsType.generateSchema();
4194
3883
  }
4195
3884
  /**
4196
3885
  *
4197
3886
  * @description Return the format of the view result
4198
3887
  */
4199
3888
  extractResultSchema() {
4200
- return this.rootReturnType.ExtractSchema();
3889
+ return this.rootReturnType.generateSchema();
4201
3890
  }
4202
3891
  }
4203
3892
 
@@ -4252,16 +3941,9 @@ class EventSchema {
4252
3941
 
4253
3942
  // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
4254
3943
  const VERSION = {
4255
- "commitHash": "42048d039f6d4345fc59d04b03650bcb8e27bb62",
4256
- "version": "23.0.3"
3944
+ "commitHash": "0e66f21b0164a7add990b5c0d60698086daece99",
3945
+ "version": "24.0.0-RC.0"
4257
3946
  };
4258
3947
 
4259
- /**
4260
- * @packageDocumentation
4261
- * @module @taquito/michelson-encoder
4262
- */
4263
- const UnitValue = Symbol();
4264
- const SaplingStateValue = {};
4265
-
4266
3948
  export { AddressValidationError, BigMapEncodingError, BigMapValidationError, BytesValidationError, ChainIDValidationError, ContractValidationError, EncodeTicketError, EventSchema, IntValidationError, InvalidBigMapDiffError, InvalidBigMapSchemaError, InvalidMapTypeError, InvalidRpcResponseError, InvalidScriptError, KeyHashValidationError, KeyValidationError, ListValidationError, MapTypecheckError, MapValidationError, MichelsonMap, MissingArgumentError, MutezValidationError, NatValidationError, OrValidationError, ParameterEncodingError, ParameterSchema, SaplingStateValue, Schema, SetValidationError, SignatureValidationError, StorageEncodingError, Token, TokenArgumentValidationError, TokenComparisonError, UnitValue, VERSION, ViewSchema, deepEqual };
4267
3949
  //# sourceMappingURL=taquito-michelson-encoder.es6.js.map