@taquito/michelson-encoder 24.2.0 → 24.3.0-beta.1
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.
- package/dist/lib/michelson-map.js +5 -5
- package/dist/lib/schema/errors.js +8 -8
- package/dist/lib/schema/event-schema.js +1 -2
- package/dist/lib/schema/parameter.js +12 -12
- package/dist/lib/schema/storage.js +15 -13
- package/dist/lib/schema/view-schema.js +5 -5
- package/dist/lib/tokens/bigmap.js +1 -1
- package/dist/lib/tokens/bls12-381-fr.js +1 -1
- package/dist/lib/tokens/bls12-381-g1.js +1 -1
- package/dist/lib/tokens/bls12-381-g2.js +1 -1
- package/dist/lib/tokens/chain-id.js +1 -1
- package/dist/lib/tokens/chest-key.js +1 -1
- package/dist/lib/tokens/chest.js +1 -1
- package/dist/lib/tokens/comparable/address.js +1 -1
- package/dist/lib/tokens/comparable/bytes.js +1 -1
- package/dist/lib/tokens/comparable/int.js +1 -1
- package/dist/lib/tokens/comparable/key_hash.js +1 -1
- package/dist/lib/tokens/comparable/mutez.js +1 -1
- package/dist/lib/tokens/comparable/nat.js +1 -1
- package/dist/lib/tokens/constant.js +2 -2
- package/dist/lib/tokens/contract.js +1 -1
- package/dist/lib/tokens/createToken.js +2 -2
- package/dist/lib/tokens/key.js +1 -1
- package/dist/lib/tokens/list.js +1 -1
- package/dist/lib/tokens/map.js +1 -1
- package/dist/lib/tokens/never.js +1 -1
- package/dist/lib/tokens/or.js +9 -3
- package/dist/lib/tokens/pair.js +6 -3
- package/dist/lib/tokens/sapling-state.js +1 -1
- package/dist/lib/tokens/sapling-transaction-deprecated.js +1 -1
- package/dist/lib/tokens/sapling-transaction.js +1 -1
- package/dist/lib/tokens/set.js +1 -1
- package/dist/lib/tokens/signature.js +1 -1
- package/dist/lib/tokens/ticket-deprecated.js +1 -1
- package/dist/lib/tokens/ticket.js +1 -1
- package/dist/lib/tokens/token.js +3 -3
- package/dist/lib/version.js +2 -2
- package/dist/taquito-michelson-encoder.es6.js +95 -85
- package/dist/taquito-michelson-encoder.es6.js.map +1 -1
- package/dist/taquito-michelson-encoder.umd.js +95 -85
- package/dist/taquito-michelson-encoder.umd.js.map +1 -1
- package/dist/types/michelson-map.d.ts +5 -5
- package/dist/types/schema/errors.d.ts +12 -12
- package/dist/types/schema/parameter.d.ts +12 -12
- package/dist/types/schema/storage.d.ts +6 -6
- package/dist/types/schema/view-schema.d.ts +5 -5
- package/dist/types/tokens/bigmap.d.ts +1 -1
- package/dist/types/tokens/bls12-381-fr.d.ts +2 -2
- package/dist/types/tokens/bls12-381-g1.d.ts +2 -2
- package/dist/types/tokens/bls12-381-g2.d.ts +2 -2
- package/dist/types/tokens/chain-id.d.ts +1 -1
- package/dist/types/tokens/chest-key.d.ts +2 -2
- package/dist/types/tokens/chest.d.ts +2 -2
- package/dist/types/tokens/comparable/address.d.ts +1 -1
- package/dist/types/tokens/comparable/bytes.d.ts +1 -1
- package/dist/types/tokens/comparable/int.d.ts +1 -1
- package/dist/types/tokens/comparable/key_hash.d.ts +1 -1
- package/dist/types/tokens/comparable/mutez.d.ts +1 -1
- package/dist/types/tokens/comparable/nat.d.ts +1 -1
- package/dist/types/tokens/constant.d.ts +2 -2
- package/dist/types/tokens/contract.d.ts +1 -1
- package/dist/types/tokens/createToken.d.ts +2 -2
- package/dist/types/tokens/key.d.ts +1 -1
- package/dist/types/tokens/list.d.ts +1 -1
- package/dist/types/tokens/map.d.ts +1 -1
- package/dist/types/tokens/never.d.ts +1 -1
- package/dist/types/tokens/or.d.ts +1 -1
- package/dist/types/tokens/pair.d.ts +2 -2
- package/dist/types/tokens/sapling-state.d.ts +1 -1
- package/dist/types/tokens/sapling-transaction-deprecated.d.ts +1 -1
- package/dist/types/tokens/sapling-transaction.d.ts +1 -1
- package/dist/types/tokens/set.d.ts +1 -1
- package/dist/types/tokens/signature.d.ts +1 -1
- package/dist/types/tokens/ticket-deprecated.d.ts +1 -1
- package/dist/types/tokens/ticket.d.ts +1 -1
- package/dist/types/tokens/token.d.ts +6 -6
- package/package.json +24 -12
- package/LICENSE +0 -202
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
var _a$1;
|
|
8
8
|
/**
|
|
9
9
|
* @category Error
|
|
10
|
-
*
|
|
10
|
+
* Error that indicates an invalid map type being passed or used
|
|
11
11
|
*/
|
|
12
12
|
class InvalidMapTypeError extends core.TaquitoError {
|
|
13
13
|
constructor(mapType, reason) {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* @category Error
|
|
47
|
-
*
|
|
47
|
+
* 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
48
|
*/
|
|
49
49
|
class MapTypecheckError extends core.TaquitoError {
|
|
50
50
|
constructor(value, type, objectType, reason) {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* Michelson Map is an abstraction over the michelson native map. It supports complex Pair as key
|
|
62
62
|
*/
|
|
63
63
|
class MichelsonMap {
|
|
64
64
|
// Used to check if an object is a michelson map.
|
|
@@ -150,13 +150,13 @@
|
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
152
|
*
|
|
153
|
-
*
|
|
153
|
+
* Set a key and a value in the MichelsonMap. If the key already exists, override the current value.
|
|
154
154
|
*
|
|
155
155
|
* @example map.set("myKey", "myValue") // Using a string as key
|
|
156
156
|
*
|
|
157
157
|
* @example map.set({0: "test", 1: "test1"}, "myValue") // Using a pair as key
|
|
158
158
|
*
|
|
159
|
-
* @
|
|
159
|
+
* @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.
|
|
160
160
|
*
|
|
161
161
|
* 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").
|
|
162
162
|
*
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
198
|
* @category Error
|
|
199
|
-
*
|
|
199
|
+
* Error that indicates a failure when encoding invalid or incorrect data (e.g. if an address is expected but a number is received)
|
|
200
200
|
*/
|
|
201
201
|
class TokenValidationError extends core.TaquitoError {
|
|
202
202
|
constructor(value, token, baseMessage) {
|
|
@@ -211,13 +211,13 @@
|
|
|
211
211
|
}
|
|
212
212
|
class Token {
|
|
213
213
|
/**
|
|
214
|
-
*
|
|
214
|
+
* Gets the strategy used for field numbering in Token execute/encode/decode to convert Michelson values to/from javascript objects, returns a value of type {@link FieldNumberingStrategy} that controls how field numbers are calculated
|
|
215
215
|
*/
|
|
216
216
|
static get fieldNumberingStrategy() {
|
|
217
217
|
return Token._fieldNumberingStrategy;
|
|
218
218
|
}
|
|
219
219
|
/**
|
|
220
|
-
*
|
|
220
|
+
* Sets the strategy used for field numbering in Token execute/encode/decode to convert Michelson values to/from javascript objects, accepts a value of type {@link FieldNumberingStrategy} that controls how field numbers are calculated
|
|
221
221
|
*/
|
|
222
222
|
static set fieldNumberingStrategy(value) {
|
|
223
223
|
Token._fieldNumberingStrategy = value;
|
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
|
|
291
291
|
/**
|
|
292
292
|
* @category Error
|
|
293
|
-
*
|
|
293
|
+
* Error that indicates a failure happening when parsing encoding/executing Big Map types
|
|
294
294
|
*/
|
|
295
295
|
class BigMapValidationError extends TokenValidationError {
|
|
296
296
|
constructor(value, token, message) {
|
|
@@ -414,7 +414,7 @@
|
|
|
414
414
|
|
|
415
415
|
/**
|
|
416
416
|
* @category Error
|
|
417
|
-
*
|
|
417
|
+
* Error that indicates a failure happening when parsing encoding/executing an OrToken
|
|
418
418
|
*/
|
|
419
419
|
class OrValidationError extends TokenValidationError {
|
|
420
420
|
constructor(value, token, message) {
|
|
@@ -606,7 +606,10 @@
|
|
|
606
606
|
else {
|
|
607
607
|
return rightToken.generateSchema();
|
|
608
608
|
}
|
|
609
|
-
}, (leftValue, rightValue) => (
|
|
609
|
+
}, (leftValue, rightValue) => ({
|
|
610
|
+
...leftValue,
|
|
611
|
+
...rightValue,
|
|
612
|
+
})),
|
|
610
613
|
};
|
|
611
614
|
}
|
|
612
615
|
findToken(label) {
|
|
@@ -671,7 +674,10 @@
|
|
|
671
674
|
if (OrToken.prim === tokenToFind) {
|
|
672
675
|
tokens.push(this);
|
|
673
676
|
}
|
|
674
|
-
this.traversal((leftToken) => leftToken.findAndReturnTokens(tokenToFind, tokens), (rightToken) => rightToken.findAndReturnTokens(tokenToFind, tokens), (leftValue, rightValue) => (
|
|
677
|
+
this.traversal((leftToken) => leftToken.findAndReturnTokens(tokenToFind, tokens), (rightToken) => rightToken.findAndReturnTokens(tokenToFind, tokens), (leftValue, rightValue) => ({
|
|
678
|
+
...leftValue,
|
|
679
|
+
...rightValue,
|
|
680
|
+
}));
|
|
675
681
|
return tokens;
|
|
676
682
|
}
|
|
677
683
|
getIdxForChildren() {
|
|
@@ -685,7 +691,7 @@
|
|
|
685
691
|
|
|
686
692
|
/**
|
|
687
693
|
* @category Error
|
|
688
|
-
*
|
|
694
|
+
* Error that indicates in invalid token argument being passed
|
|
689
695
|
*/
|
|
690
696
|
class TokenArgumentValidationError extends core.TaquitoError {
|
|
691
697
|
constructor(message) {
|
|
@@ -696,7 +702,7 @@
|
|
|
696
702
|
}
|
|
697
703
|
/**
|
|
698
704
|
* @category Error
|
|
699
|
-
*
|
|
705
|
+
* Error that indicates a failure occurring when doing a comparison of tokens
|
|
700
706
|
*/
|
|
701
707
|
class TokenComparisonError extends core.TaquitoError {
|
|
702
708
|
constructor(val1, val2) {
|
|
@@ -840,7 +846,10 @@
|
|
|
840
846
|
else {
|
|
841
847
|
rightValue = { [rightToken.annot()]: getRightValue(rightToken) };
|
|
842
848
|
}
|
|
843
|
-
const res =
|
|
849
|
+
const res = {
|
|
850
|
+
...leftValue,
|
|
851
|
+
...rightValue,
|
|
852
|
+
};
|
|
844
853
|
return res;
|
|
845
854
|
}
|
|
846
855
|
Execute(val, semantics) {
|
|
@@ -907,7 +916,7 @@
|
|
|
907
916
|
|
|
908
917
|
/**
|
|
909
918
|
* @category Error
|
|
910
|
-
*
|
|
919
|
+
* Error that indicates a failure happening when parsing encoding/executing Nat
|
|
911
920
|
*/
|
|
912
921
|
class NatValidationError extends TokenValidationError {
|
|
913
922
|
constructor(value, token, message) {
|
|
@@ -1035,7 +1044,7 @@
|
|
|
1035
1044
|
|
|
1036
1045
|
/**
|
|
1037
1046
|
* @category Error
|
|
1038
|
-
*
|
|
1047
|
+
* Error that indicates a failure happening when parsing encoding/executing an Address
|
|
1039
1048
|
*/
|
|
1040
1049
|
class AddressValidationError extends TokenValidationError {
|
|
1041
1050
|
constructor(value, token, message) {
|
|
@@ -1145,7 +1154,7 @@
|
|
|
1145
1154
|
|
|
1146
1155
|
/**
|
|
1147
1156
|
* @category Error
|
|
1148
|
-
*
|
|
1157
|
+
* Error that indicates a failure happening when parsing encoding/executing a Map
|
|
1149
1158
|
*/
|
|
1150
1159
|
class MapValidationError extends TokenValidationError {
|
|
1151
1160
|
constructor(value, token, message) {
|
|
@@ -1306,7 +1315,7 @@
|
|
|
1306
1315
|
|
|
1307
1316
|
/**
|
|
1308
1317
|
* @category Error
|
|
1309
|
-
*
|
|
1318
|
+
* Error that indicates a failure happening when parsing encoding/executing a Contract
|
|
1310
1319
|
*/
|
|
1311
1320
|
class ContractValidationError extends TokenValidationError {
|
|
1312
1321
|
constructor(value, token, message) {
|
|
@@ -1386,7 +1395,7 @@
|
|
|
1386
1395
|
|
|
1387
1396
|
/**
|
|
1388
1397
|
* @category Error
|
|
1389
|
-
*
|
|
1398
|
+
* Error that indicates a failure happening when parsing encoding/executing a List
|
|
1390
1399
|
*/
|
|
1391
1400
|
class ListValidationError extends TokenValidationError {
|
|
1392
1401
|
constructor(value, token, message) {
|
|
@@ -1466,7 +1475,7 @@
|
|
|
1466
1475
|
|
|
1467
1476
|
/**
|
|
1468
1477
|
* @category Error
|
|
1469
|
-
*
|
|
1478
|
+
* Error that indicates a failure happening when parsing encoding/executing Mutez
|
|
1470
1479
|
*/
|
|
1471
1480
|
class MutezValidationError extends TokenValidationError {
|
|
1472
1481
|
constructor(value, token, message) {
|
|
@@ -1547,7 +1556,7 @@
|
|
|
1547
1556
|
|
|
1548
1557
|
/**
|
|
1549
1558
|
* @category Error
|
|
1550
|
-
*
|
|
1559
|
+
* Error that indicates a failure happening when parsing encoding/executing Bytes
|
|
1551
1560
|
*/
|
|
1552
1561
|
class BytesValidationError extends TokenValidationError {
|
|
1553
1562
|
constructor(value, token, message) {
|
|
@@ -1777,7 +1786,7 @@
|
|
|
1777
1786
|
|
|
1778
1787
|
/**
|
|
1779
1788
|
* @category Error
|
|
1780
|
-
*
|
|
1789
|
+
* Error that indicates a failure happening when parsing encoding/executing Int
|
|
1781
1790
|
*/
|
|
1782
1791
|
class IntValidationError extends TokenValidationError {
|
|
1783
1792
|
constructor(value, token, message) {
|
|
@@ -1914,7 +1923,7 @@
|
|
|
1914
1923
|
|
|
1915
1924
|
/**
|
|
1916
1925
|
* @category Error
|
|
1917
|
-
*
|
|
1926
|
+
* Error that indicates a failure happening when parsing encoding/executing a Key
|
|
1918
1927
|
*/
|
|
1919
1928
|
class KeyValidationError extends TokenValidationError {
|
|
1920
1929
|
constructor(value, token, message) {
|
|
@@ -2004,7 +2013,7 @@
|
|
|
2004
2013
|
|
|
2005
2014
|
/**
|
|
2006
2015
|
* @category Error
|
|
2007
|
-
*
|
|
2016
|
+
* Error that indicates a failure happening when parsing encoding/executing Key Hash
|
|
2008
2017
|
*/
|
|
2009
2018
|
class KeyHashValidationError extends TokenValidationError {
|
|
2010
2019
|
constructor(value, token, message) {
|
|
@@ -2088,7 +2097,7 @@
|
|
|
2088
2097
|
|
|
2089
2098
|
/**
|
|
2090
2099
|
* @category Error
|
|
2091
|
-
*
|
|
2100
|
+
* Error that indicates a failure happening when parsing encoding/executing a Signature
|
|
2092
2101
|
*/
|
|
2093
2102
|
class SignatureValidationError extends TokenValidationError {
|
|
2094
2103
|
constructor(value, token, message) {
|
|
@@ -2250,7 +2259,7 @@
|
|
|
2250
2259
|
|
|
2251
2260
|
/**
|
|
2252
2261
|
* @category Error
|
|
2253
|
-
*
|
|
2262
|
+
* Error that indicates a failure happening when parsing encoding/executing a Set
|
|
2254
2263
|
*/
|
|
2255
2264
|
class SetValidationError extends TokenValidationError {
|
|
2256
2265
|
constructor(value, token, message) {
|
|
@@ -2327,7 +2336,7 @@
|
|
|
2327
2336
|
|
|
2328
2337
|
/**
|
|
2329
2338
|
* @category Error
|
|
2330
|
-
*
|
|
2339
|
+
* Error that indicates a failure happening when parsing encoding/executing a ChainID
|
|
2331
2340
|
*/
|
|
2332
2341
|
class ChainIDValidationError extends TokenValidationError {
|
|
2333
2342
|
constructor(value, token, message) {
|
|
@@ -2399,7 +2408,7 @@
|
|
|
2399
2408
|
|
|
2400
2409
|
/**
|
|
2401
2410
|
* @category Error
|
|
2402
|
-
*
|
|
2411
|
+
* Error that indicates a failure when encoding and sending a ticket to the blockchain
|
|
2403
2412
|
*/
|
|
2404
2413
|
class EncodeTicketError extends core.TaquitoError {
|
|
2405
2414
|
constructor() {
|
|
@@ -2483,7 +2492,7 @@
|
|
|
2483
2492
|
|
|
2484
2493
|
/**
|
|
2485
2494
|
* @category Error
|
|
2486
|
-
*
|
|
2495
|
+
* Error that indicates a failure when encoding and sending a ticket to the blockchain
|
|
2487
2496
|
*/
|
|
2488
2497
|
class EncodeTicketDeprecatedError extends core.TaquitoError {
|
|
2489
2498
|
constructor() {
|
|
@@ -2567,7 +2576,7 @@
|
|
|
2567
2576
|
|
|
2568
2577
|
/**
|
|
2569
2578
|
* @category Error
|
|
2570
|
-
*
|
|
2579
|
+
* Error that indicates a failure happening when parsing encoding/executing a Never Token
|
|
2571
2580
|
*/
|
|
2572
2581
|
class NeverTokenError extends TokenValidationError {
|
|
2573
2582
|
constructor(value, token, message) {
|
|
@@ -2623,7 +2632,7 @@
|
|
|
2623
2632
|
|
|
2624
2633
|
/**
|
|
2625
2634
|
* @category Error
|
|
2626
|
-
*
|
|
2635
|
+
* Error that indicates a failure happening when parsing encoding/executing a Sapling State
|
|
2627
2636
|
*/
|
|
2628
2637
|
class SaplingStateValidationError extends TokenValidationError {
|
|
2629
2638
|
constructor(value, token, message) {
|
|
@@ -2702,7 +2711,7 @@
|
|
|
2702
2711
|
|
|
2703
2712
|
/**
|
|
2704
2713
|
* @category Error
|
|
2705
|
-
*
|
|
2714
|
+
* Error that indicates a failure happening when parsing encoding/executing a Sapling Transaction
|
|
2706
2715
|
*/
|
|
2707
2716
|
class SaplingTransactionValidationError extends TokenValidationError {
|
|
2708
2717
|
constructor(value, token, message) {
|
|
@@ -2771,7 +2780,7 @@
|
|
|
2771
2780
|
|
|
2772
2781
|
/**
|
|
2773
2782
|
* @category Error
|
|
2774
|
-
*
|
|
2783
|
+
* Error that indicates a failure happening when parsing encoding/executing a Sapling Transaction Deprecated
|
|
2775
2784
|
*/
|
|
2776
2785
|
class SaplingTransactionDeprecatedValidationError extends TokenValidationError {
|
|
2777
2786
|
constructor(value, token, message) {
|
|
@@ -2840,7 +2849,7 @@
|
|
|
2840
2849
|
|
|
2841
2850
|
/**
|
|
2842
2851
|
* @category Error
|
|
2843
|
-
*
|
|
2852
|
+
* Error that indicates a failure happening when parsing encoding/executing a BLS12-381 scalar field Fr
|
|
2844
2853
|
*/
|
|
2845
2854
|
class Bls12381frValidationError extends TokenValidationError {
|
|
2846
2855
|
constructor(value, token, message) {
|
|
@@ -2921,7 +2930,7 @@
|
|
|
2921
2930
|
|
|
2922
2931
|
/**
|
|
2923
2932
|
* @category Error
|
|
2924
|
-
*
|
|
2933
|
+
* Error that indicates a failure happening when parsing encoding/executing a BLS12-381 curve G1
|
|
2925
2934
|
*/
|
|
2926
2935
|
class Bls12381g1ValidationError extends TokenValidationError {
|
|
2927
2936
|
constructor(value, token, message) {
|
|
@@ -2992,7 +3001,7 @@
|
|
|
2992
3001
|
|
|
2993
3002
|
/**
|
|
2994
3003
|
* @category Error
|
|
2995
|
-
*
|
|
3004
|
+
* Error that indicates a failure happening when parsing encoding/executing a BLS12-381 curve G2
|
|
2996
3005
|
*/
|
|
2997
3006
|
class Bls12381g2ValidationError extends TokenValidationError {
|
|
2998
3007
|
constructor(value, token, message) {
|
|
@@ -3063,7 +3072,7 @@
|
|
|
3063
3072
|
|
|
3064
3073
|
/**
|
|
3065
3074
|
* @category Error
|
|
3066
|
-
*
|
|
3075
|
+
* Error that indicates a failure happening when parsing encoding/executing a Chest
|
|
3067
3076
|
*/
|
|
3068
3077
|
class ChestValidationError extends TokenValidationError {
|
|
3069
3078
|
constructor(value, token, message) {
|
|
@@ -3132,7 +3141,7 @@
|
|
|
3132
3141
|
|
|
3133
3142
|
/**
|
|
3134
3143
|
* @category Error
|
|
3135
|
-
*
|
|
3144
|
+
* Error that indicates a failure happening when parsing encoding/executing a Chest Key
|
|
3136
3145
|
*/
|
|
3137
3146
|
class ChestKeyValidationError extends TokenValidationError {
|
|
3138
3147
|
constructor(value, token, message) {
|
|
@@ -3201,7 +3210,7 @@
|
|
|
3201
3210
|
|
|
3202
3211
|
/**
|
|
3203
3212
|
* @category Error
|
|
3204
|
-
*
|
|
3213
|
+
* Error that indicates a failure happening when parsing encoding a Global Constant
|
|
3205
3214
|
*/
|
|
3206
3215
|
class GlobalConstantEncodingError extends TokenValidationError {
|
|
3207
3216
|
constructor(value, token, message) {
|
|
@@ -3213,7 +3222,7 @@
|
|
|
3213
3222
|
}
|
|
3214
3223
|
/**
|
|
3215
3224
|
* @category Error
|
|
3216
|
-
*
|
|
3225
|
+
* Error that indicates a failure happening when parsing executing a Global Constant
|
|
3217
3226
|
*/
|
|
3218
3227
|
class GlobalConstantDecodingError extends TokenValidationError {
|
|
3219
3228
|
constructor(value, token, message) {
|
|
@@ -3313,7 +3322,7 @@
|
|
|
3313
3322
|
|
|
3314
3323
|
/**
|
|
3315
3324
|
* @category Error
|
|
3316
|
-
*
|
|
3325
|
+
* 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.
|
|
3317
3326
|
*/
|
|
3318
3327
|
class InvalidTokenError extends core.TaquitoError {
|
|
3319
3328
|
constructor(message, data) {
|
|
@@ -3325,7 +3334,7 @@
|
|
|
3325
3334
|
}
|
|
3326
3335
|
/**
|
|
3327
3336
|
*
|
|
3328
|
-
*
|
|
3337
|
+
* Create a token from a value
|
|
3329
3338
|
* @throws {@link InvalidTokenError} If the value passed is not supported by the Michelson Encoder
|
|
3330
3339
|
*/
|
|
3331
3340
|
function createToken(val, idx, parentTokenType) {
|
|
@@ -3342,7 +3351,7 @@
|
|
|
3342
3351
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3343
3352
|
/**
|
|
3344
3353
|
* @category Error
|
|
3345
|
-
*
|
|
3354
|
+
* Error that indicates a failure when encoding (transforming JS parameter into JSON Michelson) the parameter of the view
|
|
3346
3355
|
*/
|
|
3347
3356
|
class ParameterEncodingError extends core.InvalidViewParameterError {
|
|
3348
3357
|
constructor(viewName, sigs, args, cause) {
|
|
@@ -3357,7 +3366,7 @@
|
|
|
3357
3366
|
}
|
|
3358
3367
|
/**
|
|
3359
3368
|
* @category Error
|
|
3360
|
-
*
|
|
3369
|
+
* Error that indicates an invalid on-chain view found on the script
|
|
3361
3370
|
*/
|
|
3362
3371
|
class InvalidScriptError extends core.TaquitoError {
|
|
3363
3372
|
constructor(script, reason) {
|
|
@@ -3375,7 +3384,7 @@
|
|
|
3375
3384
|
}
|
|
3376
3385
|
/**
|
|
3377
3386
|
* @category Error
|
|
3378
|
-
*
|
|
3387
|
+
* Error that indicates an invalid RPC response being passed or used
|
|
3379
3388
|
*/
|
|
3380
3389
|
class InvalidRpcResponseError extends core.TaquitoError {
|
|
3381
3390
|
constructor(script, reason) {
|
|
@@ -3393,7 +3402,7 @@
|
|
|
3393
3402
|
}
|
|
3394
3403
|
/**
|
|
3395
3404
|
* @category Error
|
|
3396
|
-
*
|
|
3405
|
+
* Error that indicates an invalid big map schema being passed or used
|
|
3397
3406
|
*/
|
|
3398
3407
|
class InvalidBigMapSchemaError extends core.TaquitoError {
|
|
3399
3408
|
constructor(message) {
|
|
@@ -3404,7 +3413,7 @@
|
|
|
3404
3413
|
}
|
|
3405
3414
|
/**
|
|
3406
3415
|
* @category Error
|
|
3407
|
-
*
|
|
3416
|
+
* Error that indicates an invalid big map diff being passed or used
|
|
3408
3417
|
*/
|
|
3409
3418
|
class InvalidBigMapDiffError extends core.TaquitoError {
|
|
3410
3419
|
constructor(message, value) {
|
|
@@ -3416,7 +3425,7 @@
|
|
|
3416
3425
|
}
|
|
3417
3426
|
/**
|
|
3418
3427
|
* @category Error
|
|
3419
|
-
*
|
|
3428
|
+
* Error that indicates a failure when trying to encode big maps
|
|
3420
3429
|
*/
|
|
3421
3430
|
class BigMapEncodingError extends core.TaquitoError {
|
|
3422
3431
|
constructor(obj, details, schema, value) {
|
|
@@ -3430,7 +3439,7 @@
|
|
|
3430
3439
|
}
|
|
3431
3440
|
/**
|
|
3432
3441
|
* @category Error
|
|
3433
|
-
*
|
|
3442
|
+
* Error that indicates a failure when trying to encode storage
|
|
3434
3443
|
*/
|
|
3435
3444
|
class StorageEncodingError extends core.TaquitoError {
|
|
3436
3445
|
constructor(obj, details, schema, value, semantics) {
|
|
@@ -3445,7 +3454,7 @@
|
|
|
3445
3454
|
}
|
|
3446
3455
|
/**
|
|
3447
3456
|
* @category Error
|
|
3448
|
-
*
|
|
3457
|
+
* General error that indicates a function not being passed a necessary argument
|
|
3449
3458
|
*/
|
|
3450
3459
|
class MissingArgumentError extends core.TaquitoError {
|
|
3451
3460
|
constructor(message) {
|
|
@@ -3459,7 +3468,6 @@
|
|
|
3459
3468
|
const schemaTypeSymbol = Symbol.for('taquito-schema-type-symbol');
|
|
3460
3469
|
// collapse comb pair
|
|
3461
3470
|
function collapse(val, prim = PairToken.prim) {
|
|
3462
|
-
var _b, _c;
|
|
3463
3471
|
if (Array.isArray(val)) {
|
|
3464
3472
|
return collapse({
|
|
3465
3473
|
prim: prim,
|
|
@@ -3468,13 +3476,16 @@
|
|
|
3468
3476
|
}
|
|
3469
3477
|
const extended = val;
|
|
3470
3478
|
if (extended.prim === prim && extended.args && extended.args.length > 2) {
|
|
3471
|
-
return
|
|
3472
|
-
|
|
3479
|
+
return {
|
|
3480
|
+
...extended,
|
|
3481
|
+
args: [
|
|
3482
|
+
extended.args?.[0],
|
|
3473
3483
|
{
|
|
3474
3484
|
prim: prim,
|
|
3475
|
-
args:
|
|
3485
|
+
args: extended.args?.slice(1),
|
|
3476
3486
|
},
|
|
3477
|
-
]
|
|
3487
|
+
],
|
|
3488
|
+
};
|
|
3478
3489
|
}
|
|
3479
3490
|
return extended;
|
|
3480
3491
|
}
|
|
@@ -3489,15 +3500,15 @@
|
|
|
3489
3500
|
(ac.args !== undefined &&
|
|
3490
3501
|
bc.args !== undefined &&
|
|
3491
3502
|
ac.args.length === bc.args.length &&
|
|
3492
|
-
ac.args.every((v, i) =>
|
|
3503
|
+
ac.args.every((v, i) => deepEqual(v, bc.args?.[i] ?? {})))) &&
|
|
3493
3504
|
((ac.annots === undefined && bc.annots === undefined) ||
|
|
3494
3505
|
(ac.annots !== undefined &&
|
|
3495
3506
|
bc.annots !== undefined &&
|
|
3496
3507
|
ac.annots.length === bc.annots.length &&
|
|
3497
|
-
ac.annots.every((v, i) =>
|
|
3508
|
+
ac.annots.every((v, i) => v === bc.annots?.[i]))));
|
|
3498
3509
|
}
|
|
3499
3510
|
/**
|
|
3500
|
-
* @
|
|
3511
|
+
* @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.
|
|
3501
3512
|
*/
|
|
3502
3513
|
class Schema {
|
|
3503
3514
|
static isSchema(obj) {
|
|
@@ -3557,7 +3568,7 @@
|
|
|
3557
3568
|
return this.removeTopLevelAnnotation(storage);
|
|
3558
3569
|
}
|
|
3559
3570
|
/**
|
|
3560
|
-
*
|
|
3571
|
+
* Validates that a value matches the schema type.
|
|
3561
3572
|
* Performs type checking with special handling for BigMap, Ticket, and nested Map tokens.
|
|
3562
3573
|
*
|
|
3563
3574
|
* @param val - The value to validate against the schema
|
|
@@ -3623,7 +3634,7 @@
|
|
|
3623
3634
|
}
|
|
3624
3635
|
}
|
|
3625
3636
|
/**
|
|
3626
|
-
* @throws
|
|
3637
|
+
* @throws TokenValidationError
|
|
3627
3638
|
* @throws {@link StorageEncodingError}
|
|
3628
3639
|
*/
|
|
3629
3640
|
Encode(value, semantics) {
|
|
@@ -3638,14 +3649,14 @@
|
|
|
3638
3649
|
}
|
|
3639
3650
|
}
|
|
3640
3651
|
/**
|
|
3641
|
-
*
|
|
3652
|
+
* Produce a representation of the storage schema.
|
|
3642
3653
|
* Note: Provide guidance on how to write the storage object for the origination operation with Taquito.
|
|
3643
3654
|
*/
|
|
3644
3655
|
generateSchema() {
|
|
3645
3656
|
return this.removeTopLevelAnnotation(this.root.generateSchema());
|
|
3646
3657
|
}
|
|
3647
3658
|
/**
|
|
3648
|
-
*
|
|
3659
|
+
* Look up in top-level pairs of the storage to find a value matching the specified type
|
|
3649
3660
|
*
|
|
3650
3661
|
* @returns The first value found that match the type or `undefined` if no value is found
|
|
3651
3662
|
*
|
|
@@ -3678,7 +3689,7 @@
|
|
|
3678
3689
|
}
|
|
3679
3690
|
}
|
|
3680
3691
|
/**
|
|
3681
|
-
*
|
|
3692
|
+
* Look up the schema to find any occurrence of a particular token.
|
|
3682
3693
|
*
|
|
3683
3694
|
* @returns an array of tokens of the specified kind or an empty array if no token was found
|
|
3684
3695
|
*
|
|
@@ -3701,12 +3712,12 @@
|
|
|
3701
3712
|
_a = schemaTypeSymbol;
|
|
3702
3713
|
|
|
3703
3714
|
/**
|
|
3704
|
-
* @
|
|
3715
|
+
* @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.
|
|
3705
3716
|
*/
|
|
3706
3717
|
class ParameterSchema {
|
|
3707
3718
|
/**
|
|
3708
3719
|
*
|
|
3709
|
-
*
|
|
3720
|
+
* Create an instance of ParameterSchema from a contract script
|
|
3710
3721
|
*
|
|
3711
3722
|
* @param val contract script obtained from the RPC
|
|
3712
3723
|
* @returns ParameterSchema
|
|
@@ -3732,14 +3743,14 @@
|
|
|
3732
3743
|
return new ParameterSchema(parameter.args[0]);
|
|
3733
3744
|
}
|
|
3734
3745
|
/**
|
|
3735
|
-
*
|
|
3746
|
+
* Check if the Contract parameter is multiple entry point or not
|
|
3736
3747
|
*/
|
|
3737
3748
|
get isMultipleEntryPoint() {
|
|
3738
3749
|
return (this.root instanceof OrToken ||
|
|
3739
3750
|
(this.root instanceof OptionToken && this.root.subToken() instanceof OrToken));
|
|
3740
3751
|
}
|
|
3741
3752
|
/**
|
|
3742
|
-
*
|
|
3753
|
+
* Check if the Contract parameter has an annotation or not
|
|
3743
3754
|
*/
|
|
3744
3755
|
get hasAnnotation() {
|
|
3745
3756
|
if (this.isMultipleEntryPoint) {
|
|
@@ -3750,21 +3761,21 @@
|
|
|
3750
3761
|
}
|
|
3751
3762
|
}
|
|
3752
3763
|
/**
|
|
3753
|
-
*
|
|
3754
|
-
* @throws
|
|
3764
|
+
* Return the schema of the parameter of a specific entry point
|
|
3765
|
+
* @throws InvalidTokenError
|
|
3755
3766
|
*/
|
|
3756
3767
|
constructor(val) {
|
|
3757
3768
|
this.root = createToken(val, 0);
|
|
3758
3769
|
}
|
|
3759
3770
|
/**
|
|
3760
|
-
*
|
|
3771
|
+
* Returns the javascript object equivalent of the Micheline value provided
|
|
3761
3772
|
*/
|
|
3762
3773
|
Execute(val, semantics) {
|
|
3763
3774
|
return this.root.Execute(val, semantics);
|
|
3764
3775
|
}
|
|
3765
3776
|
/**
|
|
3766
|
-
*
|
|
3767
|
-
* @throws
|
|
3777
|
+
* Returns a micheline formatted object for the values provided
|
|
3778
|
+
* @throws TokenValidationError
|
|
3768
3779
|
* @throws {@link ParameterEncodingError}
|
|
3769
3780
|
*/
|
|
3770
3781
|
Encode(...args) {
|
|
@@ -3779,8 +3790,8 @@
|
|
|
3779
3790
|
}
|
|
3780
3791
|
}
|
|
3781
3792
|
/**
|
|
3782
|
-
*
|
|
3783
|
-
* @throws
|
|
3793
|
+
* Returns a micheline formatted object for the javascript object provided
|
|
3794
|
+
* @throws TokenValidationError
|
|
3784
3795
|
* @throws {@link ParameterEncodingError}
|
|
3785
3796
|
*/
|
|
3786
3797
|
EncodeObject(value, semantics) {
|
|
@@ -3795,7 +3806,7 @@
|
|
|
3795
3806
|
}
|
|
3796
3807
|
}
|
|
3797
3808
|
/**
|
|
3798
|
-
*
|
|
3809
|
+
* Produce a schema grouping together all the entry points of a contract.
|
|
3799
3810
|
*/
|
|
3800
3811
|
generateSchema() {
|
|
3801
3812
|
return this.root.generateSchema();
|
|
@@ -3808,7 +3819,7 @@
|
|
|
3808
3819
|
class ViewSchema {
|
|
3809
3820
|
/**
|
|
3810
3821
|
*
|
|
3811
|
-
*
|
|
3822
|
+
* Create an instance of ViewSchema for each view in a script
|
|
3812
3823
|
*
|
|
3813
3824
|
* @param val contract script obtained from the RPC
|
|
3814
3825
|
* @returns array of ViewSchema or empty array if there is no view in the contract
|
|
@@ -3849,7 +3860,7 @@
|
|
|
3849
3860
|
}
|
|
3850
3861
|
/**
|
|
3851
3862
|
*
|
|
3852
|
-
*
|
|
3863
|
+
* Transform the view parameter into Michelson
|
|
3853
3864
|
*
|
|
3854
3865
|
* @param args parameter of the view in js format
|
|
3855
3866
|
* @returns parameter of the view in Michelson
|
|
@@ -3865,7 +3876,7 @@
|
|
|
3865
3876
|
}
|
|
3866
3877
|
/**
|
|
3867
3878
|
*
|
|
3868
|
-
*
|
|
3879
|
+
* Transform the view result from Michelson to readable data
|
|
3869
3880
|
*
|
|
3870
3881
|
* @param val result of the view in JSON Michelson
|
|
3871
3882
|
* @param semantics optional semantics to override the default decoding behavior
|
|
@@ -3876,14 +3887,14 @@
|
|
|
3876
3887
|
}
|
|
3877
3888
|
/**
|
|
3878
3889
|
*
|
|
3879
|
-
*
|
|
3890
|
+
* Return the signature of the view parameter
|
|
3880
3891
|
*/
|
|
3881
3892
|
extractArgsSchema() {
|
|
3882
3893
|
return this.rootArgsType.generateSchema();
|
|
3883
3894
|
}
|
|
3884
3895
|
/**
|
|
3885
3896
|
*
|
|
3886
|
-
*
|
|
3897
|
+
* Return the format of the view result
|
|
3887
3898
|
*/
|
|
3888
3899
|
extractResultSchema() {
|
|
3889
3900
|
return this.rootReturnType.generateSchema();
|
|
@@ -3896,8 +3907,7 @@
|
|
|
3896
3907
|
this.type = type;
|
|
3897
3908
|
}
|
|
3898
3909
|
static fromMichelineValue(val) {
|
|
3899
|
-
|
|
3900
|
-
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]);
|
|
3910
|
+
return new EventSchema(val.annots?.[0], val.args?.[0]);
|
|
3901
3911
|
}
|
|
3902
3912
|
static fromRPCResponse(val) {
|
|
3903
3913
|
const allEventSchema = [];
|
|
@@ -3941,8 +3951,8 @@
|
|
|
3941
3951
|
|
|
3942
3952
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT!
|
|
3943
3953
|
const VERSION = {
|
|
3944
|
-
"commitHash": "
|
|
3945
|
-
"version": "24.
|
|
3954
|
+
"commitHash": "05df48fee92f846cba793920d6fa829afd6a1847",
|
|
3955
|
+
"version": "24.3.0-beta.1"
|
|
3946
3956
|
};
|
|
3947
3957
|
|
|
3948
3958
|
exports.AddressValidationError = AddressValidationError;
|