@taquito/michel-codec 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.
- package/dist/lib/base58.js +0 -1
- package/dist/lib/binary.js +39 -40
- package/dist/lib/errors.js +0 -1
- package/dist/lib/formatters.js +9 -10
- package/dist/lib/global-constants.js +0 -1
- package/dist/lib/macros.js +2 -3
- package/dist/lib/micheline-emitter.js +0 -1
- package/dist/lib/micheline-parser.js +7 -8
- package/dist/lib/micheline.js +0 -1
- package/dist/lib/michelson-contract.js +11 -12
- package/dist/lib/michelson-typecheck.js +57 -58
- package/dist/lib/michelson-types.js +1 -4
- package/dist/lib/michelson-validator.js +0 -1
- package/dist/lib/scan.js +1 -2
- package/dist/lib/taquito-michel-codec.js +5 -2
- package/dist/lib/utils.js +10 -11
- package/dist/lib/version.js +2 -3
- package/dist/taquito-michel-codec.es6.js +5656 -5656
- package/dist/taquito-michel-codec.es6.js.map +1 -1
- package/dist/taquito-michel-codec.umd.js +5656 -5658
- package/dist/taquito-michel-codec.umd.js.map +1 -1
- package/dist/types/base58.d.ts +13 -13
- package/dist/types/binary.d.ts +127 -127
- package/dist/types/errors.d.ts +57 -57
- package/dist/types/formatters.d.ts +6 -6
- package/dist/types/global-constants.d.ts +3 -3
- package/dist/types/macros.d.ts +13 -13
- package/dist/types/micheline-emitter.d.ts +17 -17
- package/dist/types/micheline-parser.d.ts +130 -130
- package/dist/types/micheline.d.ts +44 -44
- package/dist/types/michelson-contract.d.ts +24 -24
- package/dist/types/michelson-typecheck.d.ts +38 -38
- package/dist/types/michelson-types.d.ts +134 -136
- package/dist/types/michelson-validator.d.ts +66 -66
- package/dist/types/scan.d.ts +26 -26
- package/dist/types/taquito-michel-codec.d.ts +16 -16
- package/dist/types/utils.d.ts +77 -77
- package/dist/types/version.d.ts +4 -4
- package/package.json +24 -26
- package/signature.json +28 -10
- package/dist/lib/base58.js.map +0 -1
- package/dist/lib/binary.js.map +0 -1
- package/dist/lib/errors.js.map +0 -1
- package/dist/lib/formatters.js.map +0 -1
- package/dist/lib/global-constants.js.map +0 -1
- package/dist/lib/macros.js.map +0 -1
- package/dist/lib/micheline-emitter.js.map +0 -1
- package/dist/lib/micheline-parser.js.map +0 -1
- package/dist/lib/micheline.js.map +0 -1
- package/dist/lib/michelson-contract.js.map +0 -1
- package/dist/lib/michelson-typecheck.js.map +0 -1
- package/dist/lib/michelson-types.js.map +0 -1
- package/dist/lib/michelson-validator.js.map +0 -1
- package/dist/lib/scan.js.map +0 -1
- package/dist/lib/taquito-michel-codec.js.map +0 -1
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/version.js.map +0 -1
|
@@ -43,16 +43,16 @@ function assertScalarTypesEqual(a, b, field = false) {
|
|
|
43
43
|
if (typeID(a) !== typeID(b)) {
|
|
44
44
|
throw new utils_1.MichelsonTypeError(a, `types mismatch: ${typeID(a)} != ${typeID(b)}`, undefined);
|
|
45
45
|
}
|
|
46
|
-
const ann = [utils_1.unpackAnnotations(a), utils_1.unpackAnnotations(b)];
|
|
46
|
+
const ann = [(0, utils_1.unpackAnnotations)(a), (0, utils_1.unpackAnnotations)(b)];
|
|
47
47
|
if (ann[0].t && ann[1].t && ann[0].t[0] !== ann[1].t[0]) {
|
|
48
48
|
throw new utils_1.MichelsonTypeError(a, `${typeID(a)}: type names mismatch: ${ann[0].t[0]} != ${ann[1].t[0]}`, undefined);
|
|
49
49
|
}
|
|
50
50
|
if (field && ann[0].f && ann[1].f && ann[0].f[0] !== ann[1].f[0]) {
|
|
51
51
|
throw new utils_1.MichelsonTypeError(a, `${typeID(a)}: field names mismatch: ${ann[0].f[0]} != ${ann[1].f}`, undefined);
|
|
52
52
|
}
|
|
53
|
-
if (utils_1.isPairType(a)) {
|
|
54
|
-
const aArgs = utils_1.unpackComb('pair', a);
|
|
55
|
-
const bArgs = utils_1.unpackComb('pair', b);
|
|
53
|
+
if ((0, utils_1.isPairType)(a)) {
|
|
54
|
+
const aArgs = (0, utils_1.unpackComb)('pair', a);
|
|
55
|
+
const bArgs = (0, utils_1.unpackComb)('pair', b);
|
|
56
56
|
assertScalarTypesEqual(aArgs.args[0], bArgs.args[0], true);
|
|
57
57
|
assertScalarTypesEqual(aArgs.args[1], bArgs.args[1], true);
|
|
58
58
|
return;
|
|
@@ -93,7 +93,7 @@ function assertStacksEqual(a, b) {
|
|
|
93
93
|
function assertTypeAnnotationsValid(t, field = false) {
|
|
94
94
|
var _a, _b, _c;
|
|
95
95
|
if (!Array.isArray(t)) {
|
|
96
|
-
const ann = utils_1.unpackAnnotations(t);
|
|
96
|
+
const ann = (0, utils_1.unpackAnnotations)(t);
|
|
97
97
|
if ((((_a = ann.t) === null || _a === void 0 ? void 0 : _a.length) || 0) > 1) {
|
|
98
98
|
throw new utils_1.MichelsonTypeError(t, `${t.prim}: at most one type annotation allowed: ${t.annots}`, undefined);
|
|
99
99
|
}
|
|
@@ -108,7 +108,7 @@ function assertTypeAnnotationsValid(t, field = false) {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
if (utils_1.isPairType(t)) {
|
|
111
|
+
if ((0, utils_1.isPairType)(t)) {
|
|
112
112
|
const args = typeArgs(t);
|
|
113
113
|
for (const a of args) {
|
|
114
114
|
assertTypeAnnotationsValid(a, true);
|
|
@@ -137,13 +137,13 @@ function assertTypeAnnotationsValid(t, field = false) {
|
|
|
137
137
|
exports.assertTypeAnnotationsValid = assertTypeAnnotationsValid;
|
|
138
138
|
// Data integrity check
|
|
139
139
|
function _compareMichelsonData(t, a, b) {
|
|
140
|
-
if (utils_1.isPairType(t)) {
|
|
141
|
-
if (utils_1.isPairData(a) && utils_1.isPairData(b)) {
|
|
142
|
-
michelson_validator_1.assertDataListIfAny(a);
|
|
143
|
-
michelson_validator_1.assertDataListIfAny(b);
|
|
144
|
-
const tComb = utils_1.unpackComb('pair', t);
|
|
145
|
-
const aComb = utils_1.unpackComb('Pair', a);
|
|
146
|
-
const bComb = utils_1.unpackComb('Pair', b);
|
|
140
|
+
if ((0, utils_1.isPairType)(t)) {
|
|
141
|
+
if ((0, utils_1.isPairData)(a) && (0, utils_1.isPairData)(b)) {
|
|
142
|
+
(0, michelson_validator_1.assertDataListIfAny)(a);
|
|
143
|
+
(0, michelson_validator_1.assertDataListIfAny)(b);
|
|
144
|
+
const tComb = (0, utils_1.unpackComb)('pair', t);
|
|
145
|
+
const aComb = (0, utils_1.unpackComb)('Pair', a);
|
|
146
|
+
const bComb = (0, utils_1.unpackComb)('Pair', b);
|
|
147
147
|
const x = _compareMichelsonData(tComb.args[0], aComb.args[0], bComb.args[0]);
|
|
148
148
|
if (x !== 0) {
|
|
149
149
|
return x;
|
|
@@ -168,10 +168,10 @@ function _compareMichelsonData(t, a, b) {
|
|
|
168
168
|
break;
|
|
169
169
|
case 'bytes':
|
|
170
170
|
if ('bytes' in a && 'bytes' in b) {
|
|
171
|
-
const aa = utils_1.parseBytes(a.bytes);
|
|
172
|
-
const bb = utils_1.parseBytes(b.bytes);
|
|
171
|
+
const aa = (0, utils_1.parseBytes)(a.bytes);
|
|
172
|
+
const bb = (0, utils_1.parseBytes)(b.bytes);
|
|
173
173
|
if (aa !== null && bb !== null) {
|
|
174
|
-
return utils_1.compareBytes(aa, bb);
|
|
174
|
+
return (0, utils_1.compareBytes)(aa, bb);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
break;
|
|
@@ -189,13 +189,13 @@ function _compareMichelsonData(t, a, b) {
|
|
|
189
189
|
case 'signature':
|
|
190
190
|
case 'chain_id':
|
|
191
191
|
if (('string' in a || 'bytes' in a) && ('string' in b || 'bytes' in b)) {
|
|
192
|
-
return utils_1.compareBytes('string' in a ? base58_1.decodeBase58Check(a.string) : utils_1.parseBytes(a.bytes) || [], 'string' in b ? base58_1.decodeBase58Check(b.string) : utils_1.parseBytes(b.bytes) || []);
|
|
192
|
+
return (0, utils_1.compareBytes)('string' in a ? (0, base58_1.decodeBase58Check)(a.string) : (0, utils_1.parseBytes)(a.bytes) || [], 'string' in b ? (0, base58_1.decodeBase58Check)(b.string) : (0, utils_1.parseBytes)(b.bytes) || []);
|
|
193
193
|
}
|
|
194
194
|
break;
|
|
195
195
|
case 'timestamp':
|
|
196
196
|
if (('string' in a || 'int' in a) && ('string' in b || 'int' in b)) {
|
|
197
|
-
const aa = utils_1.parseDate(a);
|
|
198
|
-
const bb = utils_1.parseDate(b);
|
|
197
|
+
const aa = (0, utils_1.parseDate)(a);
|
|
198
|
+
const bb = (0, utils_1.parseDate)(b);
|
|
199
199
|
if (aa !== null && bb !== null) {
|
|
200
200
|
const x = aa.valueOf() - bb.valueOf();
|
|
201
201
|
return x < 0 ? -1 : x > 0 ? 1 : 0;
|
|
@@ -217,18 +217,18 @@ function isFunction(d) {
|
|
|
217
217
|
return false;
|
|
218
218
|
}
|
|
219
219
|
for (const v of d) {
|
|
220
|
-
if (!((Array.isArray(v) && isFunction(v)) || ('prim' in v && michelson_validator_1.isInstruction(v)))) {
|
|
220
|
+
if (!((Array.isArray(v) && isFunction(v)) || ('prim' in v && (0, michelson_validator_1.isInstruction)(v)))) {
|
|
221
221
|
return false;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
return true;
|
|
225
225
|
}
|
|
226
226
|
function assertDataValidInternal(d, t, ctx) {
|
|
227
|
-
if (utils_1.isPairType(t)) {
|
|
228
|
-
if (utils_1.isPairData(d)) {
|
|
229
|
-
michelson_validator_1.assertDataListIfAny(d);
|
|
230
|
-
const dc = utils_1.unpackComb('Pair', d);
|
|
231
|
-
const tc = utils_1.unpackComb('pair', t);
|
|
227
|
+
if ((0, utils_1.isPairType)(t)) {
|
|
228
|
+
if ((0, utils_1.isPairData)(d)) {
|
|
229
|
+
(0, michelson_validator_1.assertDataListIfAny)(d);
|
|
230
|
+
const dc = (0, utils_1.unpackComb)('Pair', d);
|
|
231
|
+
const tc = (0, utils_1.unpackComb)('pair', t);
|
|
232
232
|
assertDataValidInternal(dc.args[0], tc.args[0], ctx);
|
|
233
233
|
assertDataValidInternal(dc.args[1], tc.args[1], ctx);
|
|
234
234
|
return;
|
|
@@ -238,13 +238,13 @@ function assertDataValidInternal(d, t, ctx) {
|
|
|
238
238
|
switch (t.prim) {
|
|
239
239
|
// Atomic literals
|
|
240
240
|
case 'int':
|
|
241
|
-
if ('int' in d && utils_1.isDecimal(d.int)) {
|
|
241
|
+
if ('int' in d && (0, utils_1.isDecimal)(d.int)) {
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
244
|
throw new utils_1.MichelsonTypeError(t, `integer value expected: ${JSON.stringify(d)}`, d);
|
|
245
245
|
case 'nat':
|
|
246
246
|
case 'mutez':
|
|
247
|
-
if ('int' in d && utils_1.isNatural(d.int)) {
|
|
247
|
+
if ('int' in d && (0, utils_1.isNatural)(d.int)) {
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
250
250
|
throw new utils_1.MichelsonTypeError(t, `natural value expected: ${JSON.stringify(d)}`, d);
|
|
@@ -256,7 +256,7 @@ function assertDataValidInternal(d, t, ctx) {
|
|
|
256
256
|
case 'bytes':
|
|
257
257
|
case 'bls12_381_g1':
|
|
258
258
|
case 'bls12_381_g2':
|
|
259
|
-
if ('bytes' in d && utils_1.parseBytes(d.bytes) !== null) {
|
|
259
|
+
if ('bytes' in d && (0, utils_1.parseBytes)(d.bytes) !== null) {
|
|
260
260
|
return;
|
|
261
261
|
}
|
|
262
262
|
throw new utils_1.MichelsonTypeError(t, `bytes value expected: ${JSON.stringify(d)}`, d);
|
|
@@ -267,12 +267,12 @@ function assertDataValidInternal(d, t, ctx) {
|
|
|
267
267
|
throw new utils_1.MichelsonTypeError(t, `boolean value expected: ${JSON.stringify(d)}`, d);
|
|
268
268
|
case 'key_hash':
|
|
269
269
|
if ('string' in d &&
|
|
270
|
-
utils_1.checkDecodeTezosID(d.string, 'ED25519PublicKeyHash', 'SECP256K1PublicKeyHash', 'P256PublicKeyHash') !== null) {
|
|
270
|
+
(0, utils_1.checkDecodeTezosID)(d.string, 'ED25519PublicKeyHash', 'SECP256K1PublicKeyHash', 'P256PublicKeyHash') !== null) {
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
273
|
else if ('bytes' in d) {
|
|
274
274
|
try {
|
|
275
|
-
binary_1.decodePublicKeyHashBytes(d);
|
|
275
|
+
(0, binary_1.decodePublicKeyHashBytes)(d);
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
278
|
catch (err) {
|
|
@@ -281,7 +281,7 @@ function assertDataValidInternal(d, t, ctx) {
|
|
|
281
281
|
}
|
|
282
282
|
throw new utils_1.MichelsonTypeError(t, `key hash expected: ${JSON.stringify(d)}`, d);
|
|
283
283
|
case 'timestamp':
|
|
284
|
-
if (('string' in d || 'int' in d) && utils_1.parseDate(d) !== null) {
|
|
284
|
+
if (('string' in d || 'int' in d) && (0, utils_1.parseDate)(d) !== null) {
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
287
|
throw new utils_1.MichelsonTypeError(t, `timestamp expected: ${JSON.stringify(d)}`, d);
|
|
@@ -293,13 +293,13 @@ function assertDataValidInternal(d, t, ctx) {
|
|
|
293
293
|
// trim entry point
|
|
294
294
|
address = d.string.slice(0, ep);
|
|
295
295
|
}
|
|
296
|
-
if (utils_1.checkDecodeTezosID(address, 'ED25519PublicKeyHash', 'SECP256K1PublicKeyHash', 'P256PublicKeyHash', 'ContractHash', 'TxRollupL2Address', 'RollupAddress') !== null) {
|
|
296
|
+
if ((0, utils_1.checkDecodeTezosID)(address, 'ED25519PublicKeyHash', 'SECP256K1PublicKeyHash', 'P256PublicKeyHash', 'ContractHash', 'TxRollupL2Address', 'RollupAddress') !== null) {
|
|
297
297
|
return;
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
else if ('bytes' in d) {
|
|
301
301
|
try {
|
|
302
|
-
binary_1.decodeAddressBytes(d);
|
|
302
|
+
(0, binary_1.decodeAddressBytes)(d);
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
305
|
catch (err) {
|
|
@@ -309,13 +309,13 @@ function assertDataValidInternal(d, t, ctx) {
|
|
|
309
309
|
throw new utils_1.MichelsonTypeError(t, `address expected: ${JSON.stringify(d)}`, d);
|
|
310
310
|
case 'key':
|
|
311
311
|
if ('string' in d &&
|
|
312
|
-
utils_1.checkDecodeTezosID(d.string, 'ED25519PublicKey', 'SECP256K1PublicKey', 'P256PublicKey') !==
|
|
312
|
+
(0, utils_1.checkDecodeTezosID)(d.string, 'ED25519PublicKey', 'SECP256K1PublicKey', 'P256PublicKey') !==
|
|
313
313
|
null) {
|
|
314
314
|
return;
|
|
315
315
|
}
|
|
316
316
|
else if ('bytes' in d) {
|
|
317
317
|
try {
|
|
318
|
-
binary_1.decodePublicKeyBytes(d);
|
|
318
|
+
(0, binary_1.decodePublicKeyBytes)(d);
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
321
|
catch (err) {
|
|
@@ -331,13 +331,13 @@ function assertDataValidInternal(d, t, ctx) {
|
|
|
331
331
|
case 'signature':
|
|
332
332
|
if ('bytes' in d ||
|
|
333
333
|
('string' in d &&
|
|
334
|
-
utils_1.checkDecodeTezosID(d.string, 'ED25519Signature', 'SECP256K1Signature', 'P256Signature', 'GenericSignature') !== null)) {
|
|
334
|
+
(0, utils_1.checkDecodeTezosID)(d.string, 'ED25519Signature', 'SECP256K1Signature', 'P256Signature', 'GenericSignature') !== null)) {
|
|
335
335
|
return;
|
|
336
336
|
}
|
|
337
337
|
throw new utils_1.MichelsonTypeError(t, `signature expected: ${JSON.stringify(d)}`, d);
|
|
338
338
|
case 'chain_id':
|
|
339
339
|
if ('bytes' in d || 'string' in d) {
|
|
340
|
-
const x = 'string' in d ? base58_1.decodeBase58Check(d.string) : utils_1.parseBytes(d.bytes);
|
|
340
|
+
const x = 'string' in d ? (0, base58_1.decodeBase58Check)(d.string) : (0, utils_1.parseBytes)(d.bytes);
|
|
341
341
|
if (x !== null) {
|
|
342
342
|
return;
|
|
343
343
|
}
|
|
@@ -357,7 +357,7 @@ function assertDataValidInternal(d, t, ctx) {
|
|
|
357
357
|
throw new utils_1.MichelsonTypeError(t, `option expected: ${JSON.stringify(d)}`, d);
|
|
358
358
|
case 'list':
|
|
359
359
|
case 'set':
|
|
360
|
-
if (michelson_validator_1.assertDataListIfAny(d)) {
|
|
360
|
+
if ((0, michelson_validator_1.assertDataListIfAny)(d)) {
|
|
361
361
|
//let prev: MichelsonData | undefined;
|
|
362
362
|
for (const v of d) {
|
|
363
363
|
assertDataValidInternal(v, t.args[0], ctx);
|
|
@@ -405,7 +405,7 @@ function assertDataValidInternal(d, t, ctx) {
|
|
|
405
405
|
}
|
|
406
406
|
throw new utils_1.MichelsonTypeError(t, `${t.prim} expected: ${JSON.stringify(d)}`, d);
|
|
407
407
|
case 'bls12_381_fr':
|
|
408
|
-
if (('int' in d && utils_1.isDecimal(d.int)) || ('bytes' in d && utils_1.parseBytes(d.bytes) !== null)) {
|
|
408
|
+
if (('int' in d && (0, utils_1.isDecimal)(d.int)) || ('bytes' in d && (0, utils_1.parseBytes)(d.bytes) !== null)) {
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
411
|
throw new utils_1.MichelsonTypeError(t, `BLS12-381 element expected: ${JSON.stringify(d)}`, d);
|
|
@@ -585,7 +585,7 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
585
585
|
}
|
|
586
586
|
// comb helper functions
|
|
587
587
|
function getN(src, n, i = n) {
|
|
588
|
-
const p = utils_1.unpackComb('pair', src);
|
|
588
|
+
const p = (0, utils_1.unpackComb)('pair', src);
|
|
589
589
|
if (i === 1) {
|
|
590
590
|
return [p.args[0]];
|
|
591
591
|
}
|
|
@@ -593,7 +593,7 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
593
593
|
return p.args;
|
|
594
594
|
}
|
|
595
595
|
const right = p.args[1];
|
|
596
|
-
if (utils_1.isPairType(right)) {
|
|
596
|
+
if ((0, utils_1.isPairType)(right)) {
|
|
597
597
|
return [p.args[0], ...getN(right, n, i - 1)];
|
|
598
598
|
}
|
|
599
599
|
else {
|
|
@@ -604,12 +604,12 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
604
604
|
if (i === 0) {
|
|
605
605
|
return src;
|
|
606
606
|
}
|
|
607
|
-
const p = utils_1.unpackComb('pair', src);
|
|
607
|
+
const p = (0, utils_1.unpackComb)('pair', src);
|
|
608
608
|
if (i === 1) {
|
|
609
609
|
return p.args[0];
|
|
610
610
|
}
|
|
611
611
|
const right = p.args[1];
|
|
612
|
-
if (utils_1.isPairType(right)) {
|
|
612
|
+
if ((0, utils_1.isPairType)(right)) {
|
|
613
613
|
return getNth(right, n, i - 2);
|
|
614
614
|
}
|
|
615
615
|
else if (i === 2) {
|
|
@@ -621,12 +621,12 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
621
621
|
if (i === 0) {
|
|
622
622
|
return x;
|
|
623
623
|
}
|
|
624
|
-
const p = utils_1.unpackComb('pair', src);
|
|
624
|
+
const p = (0, utils_1.unpackComb)('pair', src);
|
|
625
625
|
if (i === 1) {
|
|
626
626
|
return Object.assign(Object.assign({}, p), { args: [x, p.args[1]] });
|
|
627
627
|
}
|
|
628
628
|
const right = p.args[1];
|
|
629
|
-
if (utils_1.isPairType(right)) {
|
|
629
|
+
if ((0, utils_1.isPairType)(right)) {
|
|
630
630
|
return Object.assign(Object.assign({}, p), { args: [p.args[0], updateNth(right, x, n, i - 2)] });
|
|
631
631
|
}
|
|
632
632
|
else if (i === 2) {
|
|
@@ -718,7 +718,7 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
718
718
|
}
|
|
719
719
|
case 'CAR':
|
|
720
720
|
case 'CDR': {
|
|
721
|
-
const s = utils_1.unpackComb('pair', args(0, ['pair'])[0]);
|
|
721
|
+
const s = (0, utils_1.unpackComb)('pair', args(0, ['pair'])[0]);
|
|
722
722
|
const field = s.args[instruction.prim === 'CAR' ? 0 : 1];
|
|
723
723
|
const ia = instructionAnn({ f: 1, v: 1 }, { specialVar: true });
|
|
724
724
|
return [
|
|
@@ -832,7 +832,7 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
832
832
|
const s = args(0, null, ['lambda']);
|
|
833
833
|
ensureStorableType(s[0]);
|
|
834
834
|
ensurePushableType(s[0]);
|
|
835
|
-
if (!utils_1.isPairType(s[1].args[0])) {
|
|
835
|
+
if (!(0, utils_1.isPairType)(s[1].args[0])) {
|
|
836
836
|
throw new MichelsonInstructionError(instruction, stack, `${instruction.prim}: function's argument must be a pair: ${typeID(s[1].args[0])}`);
|
|
837
837
|
}
|
|
838
838
|
const pt = s[1].args[0];
|
|
@@ -844,7 +844,7 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
844
844
|
}
|
|
845
845
|
case 'FAILWITH': {
|
|
846
846
|
const s = args(0, null)[0];
|
|
847
|
-
if (!michelson_types_1.ProtoInferiorTo(proto, michelson_types_1.Protocol.PtEdo2Zk)) {
|
|
847
|
+
if (!(0, michelson_types_1.ProtoInferiorTo)(proto, michelson_types_1.Protocol.PtEdo2Zk)) {
|
|
848
848
|
ensurePackableType(s);
|
|
849
849
|
}
|
|
850
850
|
return { failed: s, level: 0 };
|
|
@@ -900,7 +900,7 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
900
900
|
throw new MichelsonInstructionError(instruction, stack, `${instruction.prim}: can't add ${s[0].prim} to ${s[1].prim}`);
|
|
901
901
|
}
|
|
902
902
|
case 'SUB': {
|
|
903
|
-
const s = michelson_types_1.ProtoInferiorTo(proto, michelson_types_1.Protocol.PsiThaCa)
|
|
903
|
+
const s = (0, michelson_types_1.ProtoInferiorTo)(proto, michelson_types_1.Protocol.PsiThaCa)
|
|
904
904
|
? args(0, ['nat', 'int', 'timestamp', 'mutez'], ['nat', 'int', 'timestamp', 'mutez'])
|
|
905
905
|
: args(0, ['nat', 'int', 'timestamp'], ['nat', 'int', 'timestamp']);
|
|
906
906
|
if (((s[0].prim === 'nat' || s[0].prim === 'int') &&
|
|
@@ -1391,7 +1391,7 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
1391
1391
|
case 'TICKET': {
|
|
1392
1392
|
const s = args(0, null, ['nat'])[0];
|
|
1393
1393
|
ensureComparableType(s);
|
|
1394
|
-
if (michelson_types_1.ProtoInferiorTo(proto, michelson_types_1.Protocol.PtLimaPtL)) {
|
|
1394
|
+
if ((0, michelson_types_1.ProtoInferiorTo)(proto, michelson_types_1.Protocol.PtLimaPtL)) {
|
|
1395
1395
|
return [
|
|
1396
1396
|
annotate({ prim: 'ticket', args: [s] }, instructionAnn({ t: 1, v: 1 })),
|
|
1397
1397
|
...stack.slice(2),
|
|
@@ -1408,7 +1408,7 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
}
|
|
1410
1410
|
case 'JOIN_TICKETS': {
|
|
1411
|
-
const s = utils_1.unpackComb('pair', args(0, ['pair'])[0]);
|
|
1411
|
+
const s = (0, utils_1.unpackComb)('pair', args(0, ['pair'])[0]);
|
|
1412
1412
|
if (typeID(s.args[0]) !== 'ticket') {
|
|
1413
1413
|
throw new MichelsonInstructionError(instruction, stack, `${instruction.prim}: ticket expected: ${typeID(s.args[0])}`);
|
|
1414
1414
|
}
|
|
@@ -1423,7 +1423,7 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
1423
1423
|
}
|
|
1424
1424
|
case 'SPLIT_TICKET': {
|
|
1425
1425
|
const s = args(0, ['ticket'], ['pair']);
|
|
1426
|
-
const p = utils_1.unpackComb('pair', s[1]);
|
|
1426
|
+
const p = (0, utils_1.unpackComb)('pair', s[1]);
|
|
1427
1427
|
if (typeID(p.args[0]) !== 'nat') {
|
|
1428
1428
|
throw new MichelsonInstructionError(instruction, stack, `${instruction.prim}: nat expected: ${typeID(p.args[0])}`);
|
|
1429
1429
|
}
|
|
@@ -1456,10 +1456,10 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
1456
1456
|
}
|
|
1457
1457
|
case 'PAIRING_CHECK': {
|
|
1458
1458
|
const p = args(0, ['list'])[0].args[0];
|
|
1459
|
-
if (!utils_1.isPairType(p)) {
|
|
1459
|
+
if (!(0, utils_1.isPairType)(p)) {
|
|
1460
1460
|
throw new MichelsonInstructionError(instruction, stack, `${instruction.prim}: pair expected: ${typeID(p)}`);
|
|
1461
1461
|
}
|
|
1462
|
-
const c = utils_1.unpackComb('pair', p);
|
|
1462
|
+
const c = (0, utils_1.unpackComb)('pair', p);
|
|
1463
1463
|
if (typeID(c.args[0]) !== 'bls12_381_g1') {
|
|
1464
1464
|
throw new MichelsonInstructionError(instruction, stack, `${instruction.prim}: bls12_381_g1 expected: ${typeID(c.args[0])}`);
|
|
1465
1465
|
}
|
|
@@ -1478,7 +1478,7 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
1478
1478
|
if (parseInt(s[0].args[0].int, 10) !== parseInt(s[1].args[0].int, 10)) {
|
|
1479
1479
|
throw new MichelsonInstructionError(instruction, stack, `${instruction.prim}: sapling memo size mismatch: ${s[0].args[0].int} != ${s[1].args[0].int}`);
|
|
1480
1480
|
}
|
|
1481
|
-
return michelson_types_1.ProtoInferiorTo(proto, michelson_types_1.Protocol.PtJakarta)
|
|
1481
|
+
return (0, michelson_types_1.ProtoInferiorTo)(proto, michelson_types_1.Protocol.PtJakarta)
|
|
1482
1482
|
? [
|
|
1483
1483
|
annotateVar({
|
|
1484
1484
|
prim: 'option',
|
|
@@ -1594,13 +1594,13 @@ function contractEntryPoints(src) {
|
|
|
1594
1594
|
if (isContract(src)) {
|
|
1595
1595
|
const param = contractSection(src, 'parameter');
|
|
1596
1596
|
const ch = contractEntryPoints(param.args[0]);
|
|
1597
|
-
const a = utils_1.unpackAnnotations(param);
|
|
1597
|
+
const a = (0, utils_1.unpackAnnotations)(param);
|
|
1598
1598
|
return a.f ? [[a.f[0], param.args[0]], ...ch] : ch;
|
|
1599
1599
|
}
|
|
1600
1600
|
if (isOrType(src)) {
|
|
1601
1601
|
const args = typeArgs(src);
|
|
1602
1602
|
const getArg = (n) => {
|
|
1603
|
-
const a = utils_1.unpackAnnotations(args[n]);
|
|
1603
|
+
const a = (0, utils_1.unpackAnnotations)(args[n]);
|
|
1604
1604
|
if (typeID(args[n]) === 'or') {
|
|
1605
1605
|
const ch = contractEntryPoints(args[n]);
|
|
1606
1606
|
return a.f ? [[a.f[0], args[n]], ...ch] : ch;
|
|
@@ -1730,4 +1730,3 @@ function isTypeEqual(a, b, field = false) {
|
|
|
1730
1730
|
}
|
|
1731
1731
|
}
|
|
1732
1732
|
exports.isTypeEqual = isTypeEqual;
|
|
1733
|
-
//# sourceMappingURL=michelson-typecheck.js.map
|
|
@@ -16,9 +16,7 @@ var Protocol;
|
|
|
16
16
|
Protocol["PsDELPH1"] = "PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo";
|
|
17
17
|
Protocol["PtEdoTez"] = "PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq";
|
|
18
18
|
Protocol["PtEdo2Zk"] = "PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA";
|
|
19
|
-
Protocol["PsFLoren"] = "PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i";
|
|
20
19
|
Protocol["PsFLorena"] = "PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i";
|
|
21
|
-
Protocol["PtGRANAD"] = "PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV";
|
|
22
20
|
Protocol["PtGRANADs"] = "PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV";
|
|
23
21
|
Protocol["PtHangzH"] = "PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r";
|
|
24
22
|
Protocol["PtHangz2"] = "PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx";
|
|
@@ -32,7 +30,7 @@ var Protocol;
|
|
|
32
30
|
Protocol["PtMumbai2"] = "PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1";
|
|
33
31
|
Protocol["PtNairobi"] = "PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf";
|
|
34
32
|
Protocol["ProtoALpha"] = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK";
|
|
35
|
-
})(Protocol
|
|
33
|
+
})(Protocol || (exports.Protocol = Protocol = {}));
|
|
36
34
|
exports.DefaultProtocol = Protocol.Psithaca2;
|
|
37
35
|
const protoLevel = {
|
|
38
36
|
Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P: 0,
|
|
@@ -69,4 +67,3 @@ function ProtoInferiorTo(a, b) {
|
|
|
69
67
|
return protoLevel[a] < protoLevel[b];
|
|
70
68
|
}
|
|
71
69
|
exports.ProtoInferiorTo = ProtoInferiorTo;
|
|
72
|
-
//# sourceMappingURL=michelson-types.js.map
|
package/dist/lib/scan.js
CHANGED
|
@@ -23,7 +23,7 @@ var Literal;
|
|
|
23
23
|
Literal[Literal["String"] = 2] = "String";
|
|
24
24
|
Literal[Literal["Bytes"] = 3] = "Bytes";
|
|
25
25
|
Literal[Literal["Ident"] = 4] = "Ident";
|
|
26
|
-
})(Literal
|
|
26
|
+
})(Literal || (exports.Literal = Literal = {}));
|
|
27
27
|
const isSpace = new RegExp('\\s');
|
|
28
28
|
const isIdentStart = new RegExp('[:@%_A-Za-z]');
|
|
29
29
|
const isIdent = new RegExp('[@%_\\.A-Za-z0-9]');
|
|
@@ -126,4 +126,3 @@ function* scan(src, scanComments = false) {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
exports.scan = scan;
|
|
129
|
-
//# sourceMappingURL=scan.js.map
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -32,4 +36,3 @@ var macros_1 = require("./macros");
|
|
|
32
36
|
Object.defineProperty(exports, "MacroError", { enumerable: true, get: function () { return macros_1.MacroError; } });
|
|
33
37
|
var version_1 = require("./version");
|
|
34
38
|
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
|
|
35
|
-
//# sourceMappingURL=taquito-michel-codec.js.map
|
package/dist/lib/utils.js
CHANGED
|
@@ -45,6 +45,14 @@ class MichelsonTypeError extends MichelsonError {
|
|
|
45
45
|
exports.MichelsonTypeError = MichelsonTypeError;
|
|
46
46
|
// Ad hoc big integer parser
|
|
47
47
|
class LongInteger {
|
|
48
|
+
append(c) {
|
|
49
|
+
let i = 0;
|
|
50
|
+
while (c !== 0 || i < this.buf.length) {
|
|
51
|
+
const m = (this.buf[i] || 0) * 10 + c;
|
|
52
|
+
this.buf[i++] = m % 256;
|
|
53
|
+
c = Math.floor(m / 256);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
48
56
|
constructor(arg) {
|
|
49
57
|
this.neg = false;
|
|
50
58
|
this.buf = [];
|
|
@@ -73,14 +81,6 @@ class LongInteger {
|
|
|
73
81
|
this.append(arg);
|
|
74
82
|
}
|
|
75
83
|
}
|
|
76
|
-
append(c) {
|
|
77
|
-
let i = 0;
|
|
78
|
-
while (c !== 0 || i < this.buf.length) {
|
|
79
|
-
const m = (this.buf[i] || 0) * 10 + c;
|
|
80
|
-
this.buf[i++] = m % 256;
|
|
81
|
-
c = Math.floor(m / 256);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
84
|
cmp(arg) {
|
|
85
85
|
if (this.neg !== arg.neg) {
|
|
86
86
|
return (arg.neg ? 1 : 0) - (this.neg ? 1 : 0);
|
|
@@ -227,7 +227,7 @@ exports.tezosPrefix = {
|
|
|
227
227
|
TxRollupL2Address: [20, [6, 161, 166]],
|
|
228
228
|
};
|
|
229
229
|
function checkDecodeTezosID(id, ...types) {
|
|
230
|
-
const buf = base58_1.decodeBase58Check(id);
|
|
230
|
+
const buf = (0, base58_1.decodeBase58Check)(id);
|
|
231
231
|
for (const t of types) {
|
|
232
232
|
const [plen, p] = exports.tezosPrefix[t];
|
|
233
233
|
if (buf.length === plen + p.length) {
|
|
@@ -248,7 +248,7 @@ function encodeTezosID(id, data) {
|
|
|
248
248
|
if (data.length !== plen) {
|
|
249
249
|
throw new errors_1.TezosIdEncodeError(`Incorrect data length for ${id}: ${data.length}`);
|
|
250
250
|
}
|
|
251
|
-
return base58_1.encodeBase58Check([...p, ...data]);
|
|
251
|
+
return (0, base58_1.encodeBase58Check)([...p, ...data]);
|
|
252
252
|
}
|
|
253
253
|
exports.encodeTezosID = encodeTezosID;
|
|
254
254
|
function unpackComb(id, v) {
|
|
@@ -320,4 +320,3 @@ function hexBytes(bytes) {
|
|
|
320
320
|
return bytes.map((x) => ((x >> 4) & 0xf).toString(16) + (x & 0xf).toString(16)).join('');
|
|
321
321
|
}
|
|
322
322
|
exports.hexBytes = hexBytes;
|
|
323
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/lib/version.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
4
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
5
5
|
exports.VERSION = {
|
|
6
|
-
"commitHash": "
|
|
7
|
-
"version": "17.
|
|
6
|
+
"commitHash": "a908ab176a8c52c025fd43e7acd452415396f54e",
|
|
7
|
+
"version": "17.4.0"
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=version.js.map
|