@taquito/michelson-encoder 17.3.2 → 17.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/errors.js +0 -1
- package/dist/lib/michelson-map.js +7 -8
- package/dist/lib/schema/errors.js +0 -1
- package/dist/lib/schema/event-schema.js +1 -2
- package/dist/lib/schema/model.js +0 -1
- package/dist/lib/schema/parameter.js +7 -8
- package/dist/lib/schema/storage.js +14 -15
- package/dist/lib/schema/types.js +0 -1
- package/dist/lib/schema/view-schema.js +20 -21
- package/dist/lib/taquito-michelson-encoder.js +5 -2
- package/dist/lib/tokens/bigmap.js +0 -1
- package/dist/lib/tokens/bls12-381-fr.js +0 -1
- package/dist/lib/tokens/bls12-381-g1.js +0 -1
- package/dist/lib/tokens/bls12-381-g2.js +0 -1
- package/dist/lib/tokens/chain-id.js +1 -2
- package/dist/lib/tokens/chest-key.js +0 -1
- package/dist/lib/tokens/chest.js +0 -1
- package/dist/lib/tokens/comparable/address.js +4 -5
- package/dist/lib/tokens/comparable/bool.js +0 -1
- package/dist/lib/tokens/comparable/bytes.js +2 -3
- package/dist/lib/tokens/comparable/int.js +0 -1
- package/dist/lib/tokens/comparable/key_hash.js +3 -4
- package/dist/lib/tokens/comparable/mutez.js +0 -1
- package/dist/lib/tokens/comparable/nat.js +0 -1
- package/dist/lib/tokens/comparable/string.js +0 -1
- package/dist/lib/tokens/comparable/timestamp.js +0 -1
- package/dist/lib/tokens/comparable/tx_rollup_l2_address.js +4 -5
- package/dist/lib/tokens/constant.js +0 -1
- package/dist/lib/tokens/contract.js +2 -3
- package/dist/lib/tokens/createToken.js +0 -1
- package/dist/lib/tokens/key.js +3 -4
- package/dist/lib/tokens/lambda.js +0 -1
- package/dist/lib/tokens/list.js +0 -1
- package/dist/lib/tokens/map.js +0 -1
- package/dist/lib/tokens/never.js +0 -1
- package/dist/lib/tokens/operation.js +0 -1
- package/dist/lib/tokens/option.js +0 -1
- package/dist/lib/tokens/or.js +0 -1
- package/dist/lib/tokens/pair.js +0 -1
- package/dist/lib/tokens/sapling-state.js +0 -1
- package/dist/lib/tokens/sapling-transaction-deprecated.js +0 -1
- package/dist/lib/tokens/sapling-transaction.js +0 -1
- package/dist/lib/tokens/set.js +0 -1
- package/dist/lib/tokens/signature.js +1 -2
- package/dist/lib/tokens/ticket-deprecated.js +0 -1
- package/dist/lib/tokens/ticket.js +0 -1
- package/dist/lib/tokens/token.js +0 -1
- package/dist/lib/tokens/tokens.js +0 -1
- package/dist/lib/tokens/unit.js +0 -1
- package/dist/lib/version.js +2 -3
- package/dist/taquito-michelson-encoder.es6.js +4217 -4217
- package/dist/taquito-michelson-encoder.es6.js.map +1 -1
- package/dist/taquito-michelson-encoder.umd.js +4217 -4224
- package/dist/taquito-michelson-encoder.umd.js.map +1 -1
- package/dist/types/errors.d.ts +17 -17
- package/dist/types/michelson-map.d.ts +82 -82
- package/dist/types/schema/errors.d.ts +83 -83
- package/dist/types/schema/event-schema.d.ts +12 -12
- package/dist/types/schema/model.d.ts +62 -62
- package/dist/types/schema/parameter.d.ts +59 -59
- package/dist/types/schema/storage.d.ts +101 -101
- package/dist/types/schema/types.d.ts +105 -105
- package/dist/types/schema/view-schema.d.ts +53 -53
- package/dist/types/taquito-michelson-encoder.d.ts +17 -17
- package/dist/types/tokens/bigmap.d.ts +61 -61
- package/dist/types/tokens/bls12-381-fr.d.ts +56 -56
- package/dist/types/tokens/bls12-381-g1.d.ts +52 -52
- package/dist/types/tokens/bls12-381-g2.d.ts +52 -52
- package/dist/types/tokens/chain-id.d.ts +56 -56
- package/dist/types/tokens/chest-key.d.ts +52 -52
- package/dist/types/tokens/chest.d.ts +52 -52
- package/dist/types/tokens/comparable/address.d.ts +66 -66
- package/dist/types/tokens/comparable/bool.d.ts +37 -37
- package/dist/types/tokens/comparable/bytes.d.ts +57 -57
- package/dist/types/tokens/comparable/int.d.ts +61 -61
- package/dist/types/tokens/comparable/key_hash.d.ts +59 -59
- package/dist/types/tokens/comparable/mutez.d.ts +58 -58
- package/dist/types/tokens/comparable/nat.d.ts +60 -60
- package/dist/types/tokens/comparable/string.d.ts +36 -36
- package/dist/types/tokens/comparable/timestamp.d.ts +39 -39
- package/dist/types/tokens/comparable/tx_rollup_l2_address.d.ts +64 -64
- package/dist/types/tokens/constant.d.ts +56 -56
- package/dist/types/tokens/contract.d.ts +53 -53
- package/dist/types/tokens/createToken.d.ts +18 -18
- package/dist/types/tokens/key.d.ts +62 -62
- package/dist/types/tokens/lambda.d.ts +34 -34
- package/dist/types/tokens/list.d.ts +53 -53
- package/dist/types/tokens/map.d.ts +57 -57
- package/dist/types/tokens/never.d.ts +46 -46
- package/dist/types/tokens/operation.d.ts +29 -29
- package/dist/types/tokens/option.d.ts +44 -44
- package/dist/types/tokens/or.d.ts +56 -56
- package/dist/types/tokens/pair.d.ts +54 -54
- package/dist/types/tokens/sapling-state.d.ts +53 -53
- package/dist/types/tokens/sapling-transaction-deprecated.d.ts +49 -49
- package/dist/types/tokens/sapling-transaction.d.ts +49 -49
- package/dist/types/tokens/set.d.ts +48 -48
- package/dist/types/tokens/signature.d.ts +58 -58
- package/dist/types/tokens/ticket-deprecated.d.ts +47 -47
- package/dist/types/tokens/ticket.d.ts +47 -47
- package/dist/types/tokens/token.d.ts +56 -56
- package/dist/types/tokens/tokens.d.ts +37 -37
- package/dist/types/tokens/unit.d.ts +39 -39
- package/dist/types/version.d.ts +4 -4
- package/package.json +27 -29
- package/signature.json +3 -5
- package/dist/lib/errors.js.map +0 -1
- package/dist/lib/michelson-map.js.map +0 -1
- package/dist/lib/schema/errors.js.map +0 -1
- package/dist/lib/schema/event-schema.js.map +0 -1
- package/dist/lib/schema/model.js.map +0 -1
- package/dist/lib/schema/parameter.js.map +0 -1
- package/dist/lib/schema/storage.js.map +0 -1
- package/dist/lib/schema/types.js.map +0 -1
- package/dist/lib/schema/view-schema.js.map +0 -1
- package/dist/lib/taquito-michelson-encoder.js.map +0 -1
- package/dist/lib/tokens/bigmap.js.map +0 -1
- package/dist/lib/tokens/bls12-381-fr.js.map +0 -1
- package/dist/lib/tokens/bls12-381-g1.js.map +0 -1
- package/dist/lib/tokens/bls12-381-g2.js.map +0 -1
- package/dist/lib/tokens/chain-id.js.map +0 -1
- package/dist/lib/tokens/chest-key.js.map +0 -1
- package/dist/lib/tokens/chest.js.map +0 -1
- package/dist/lib/tokens/comparable/address.js.map +0 -1
- package/dist/lib/tokens/comparable/bool.js.map +0 -1
- package/dist/lib/tokens/comparable/bytes.js.map +0 -1
- package/dist/lib/tokens/comparable/int.js.map +0 -1
- package/dist/lib/tokens/comparable/key_hash.js.map +0 -1
- package/dist/lib/tokens/comparable/mutez.js.map +0 -1
- package/dist/lib/tokens/comparable/nat.js.map +0 -1
- package/dist/lib/tokens/comparable/string.js.map +0 -1
- package/dist/lib/tokens/comparable/timestamp.js.map +0 -1
- package/dist/lib/tokens/comparable/tx_rollup_l2_address.js.map +0 -1
- package/dist/lib/tokens/constant.js.map +0 -1
- package/dist/lib/tokens/contract.js.map +0 -1
- package/dist/lib/tokens/createToken.js.map +0 -1
- package/dist/lib/tokens/key.js.map +0 -1
- package/dist/lib/tokens/lambda.js.map +0 -1
- package/dist/lib/tokens/list.js.map +0 -1
- package/dist/lib/tokens/map.js.map +0 -1
- package/dist/lib/tokens/never.js.map +0 -1
- package/dist/lib/tokens/operation.js.map +0 -1
- package/dist/lib/tokens/option.js.map +0 -1
- package/dist/lib/tokens/or.js.map +0 -1
- package/dist/lib/tokens/pair.js.map +0 -1
- package/dist/lib/tokens/sapling-state.js.map +0 -1
- package/dist/lib/tokens/sapling-transaction-deprecated.js.map +0 -1
- package/dist/lib/tokens/sapling-transaction.js.map +0 -1
- package/dist/lib/tokens/set.js.map +0 -1
- package/dist/lib/tokens/signature.js.map +0 -1
- package/dist/lib/tokens/ticket-deprecated.js.map +0 -1
- package/dist/lib/tokens/ticket.js.map +0 -1
- package/dist/lib/tokens/token.js.map +0 -1
- package/dist/lib/tokens/tokens.js.map +0 -1
- package/dist/lib/tokens/unit.js.map +0 -1
- package/dist/lib/version.js.map +0 -1
package/dist/lib/errors.js
CHANGED
|
@@ -36,4 +36,3 @@ var nat_1 = require("./tokens/comparable/nat");
|
|
|
36
36
|
Object.defineProperty(exports, "NatValidationError", { enumerable: true, get: function () { return nat_1.NatValidationError; } });
|
|
37
37
|
var ticket_1 = require("./tokens/ticket");
|
|
38
38
|
Object.defineProperty(exports, "EncodeTicketError", { enumerable: true, get: function () { return ticket_1.EncodeTicketError; } });
|
|
39
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -63,6 +63,12 @@ exports.MapTypecheckError = MapTypecheckError;
|
|
|
63
63
|
* @description Michelson Map is an abstraction over the michelson native map. It supports complex Pair as key
|
|
64
64
|
*/
|
|
65
65
|
class MichelsonMap {
|
|
66
|
+
// Used to check if an object is a michelson map.
|
|
67
|
+
// Using instanceof was not working for project that had multiple instance of taquito dependencies
|
|
68
|
+
// as the class constructor is different
|
|
69
|
+
static isMichelsonMap(obj) {
|
|
70
|
+
return obj && obj[michelsonMapTypeSymbol] === true;
|
|
71
|
+
}
|
|
66
72
|
/**
|
|
67
73
|
* @param mapType If specified key and value will be type-checked before being added to the map
|
|
68
74
|
*
|
|
@@ -76,12 +82,6 @@ class MichelsonMap {
|
|
|
76
82
|
this.setType(mapType);
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
|
-
// Used to check if an object is a michelson map.
|
|
80
|
-
// Using instanceof was not working for project that had multiple instance of taquito dependencies
|
|
81
|
-
// as the class constructor is different
|
|
82
|
-
static isMichelsonMap(obj) {
|
|
83
|
-
return obj && obj[michelsonMapTypeSymbol] === true;
|
|
84
|
-
}
|
|
85
85
|
setType(mapType) {
|
|
86
86
|
validateMapType(mapType);
|
|
87
87
|
this.keySchema = new storage_1.Schema(mapType.args[0]);
|
|
@@ -133,7 +133,7 @@ class MichelsonMap {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
serializeDeterministically(key) {
|
|
136
|
-
return fast_json_stable_stringify_1.default(key);
|
|
136
|
+
return (0, fast_json_stable_stringify_1.default)(key);
|
|
137
137
|
}
|
|
138
138
|
*keys() {
|
|
139
139
|
for (const [key] of this.entries()) {
|
|
@@ -202,4 +202,3 @@ class MichelsonMap {
|
|
|
202
202
|
}
|
|
203
203
|
exports.MichelsonMap = MichelsonMap;
|
|
204
204
|
_a = michelsonMapTypeSymbol;
|
|
205
|
-
//# sourceMappingURL=michelson-map.js.map
|
|
@@ -27,7 +27,7 @@ class EventSchema {
|
|
|
27
27
|
static removeDuplicates(events) {
|
|
28
28
|
const uniqueEvents = [];
|
|
29
29
|
events.forEach((event) => {
|
|
30
|
-
const idx = uniqueEvents.findIndex((e) => e.tag === event.tag && storage_1.deepEqual(e.type, event.type));
|
|
30
|
+
const idx = uniqueEvents.findIndex((e) => e.tag === event.tag && (0, storage_1.deepEqual)(e.type, event.type));
|
|
31
31
|
if (idx === -1) {
|
|
32
32
|
uniqueEvents.push(event);
|
|
33
33
|
}
|
|
@@ -51,4 +51,3 @@ class EventSchema {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
exports.EventSchema = EventSchema;
|
|
54
|
-
//# sourceMappingURL=event-schema.js.map
|
package/dist/lib/schema/model.js
CHANGED
|
@@ -10,13 +10,6 @@ const errors_1 = require("./errors");
|
|
|
10
10
|
* @warn Our current smart contract abstraction feature is currently in preview. It's API is not final, and it may not cover every use case (yet). We will greatly appreciate any feedback on this feature.
|
|
11
11
|
*/
|
|
12
12
|
class ParameterSchema {
|
|
13
|
-
/**
|
|
14
|
-
* @description Return the schema of the parameter of a specific entry point
|
|
15
|
-
* @throws {@link InvalidTokenError}
|
|
16
|
-
*/
|
|
17
|
-
constructor(val) {
|
|
18
|
-
this.root = createToken_1.createToken(val, 0);
|
|
19
|
-
}
|
|
20
13
|
/**
|
|
21
14
|
*
|
|
22
15
|
* @description Create an instance of ParameterSchema from a contract script
|
|
@@ -62,6 +55,13 @@ class ParameterSchema {
|
|
|
62
55
|
return true;
|
|
63
56
|
}
|
|
64
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @description Return the schema of the parameter of a specific entry point
|
|
60
|
+
* @throws {@link InvalidTokenError}
|
|
61
|
+
*/
|
|
62
|
+
constructor(val) {
|
|
63
|
+
this.root = (0, createToken_1.createToken)(val, 0);
|
|
64
|
+
}
|
|
65
65
|
/**
|
|
66
66
|
* @description Returns the javascript object equivalent of the Micheline value provided
|
|
67
67
|
*/
|
|
@@ -118,4 +118,3 @@ class ParameterSchema {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
exports.ParameterSchema = ParameterSchema;
|
|
121
|
-
//# sourceMappingURL=parameter.js.map
|
|
@@ -56,20 +56,6 @@ exports.deepEqual = deepEqual;
|
|
|
56
56
|
* @warn Our current smart contract abstraction feature is currently in preview. Its API is not final, and it may not cover every use case (yet). We will greatly appreciate any feedback on this feature.
|
|
57
57
|
*/
|
|
58
58
|
class Schema {
|
|
59
|
-
constructor(val) {
|
|
60
|
-
this.val = val;
|
|
61
|
-
this[_a] = true;
|
|
62
|
-
this.root = createToken_1.createToken(val, 0);
|
|
63
|
-
if (this.root instanceof bigmap_1.BigMapToken) {
|
|
64
|
-
this.bigMap = this.root;
|
|
65
|
-
}
|
|
66
|
-
else if (this.isExpressionExtended(val) && val.prim === 'pair') {
|
|
67
|
-
const exp = val.args[0];
|
|
68
|
-
if (this.isExpressionExtended(exp) && exp.prim === 'big_map') {
|
|
69
|
-
this.bigMap = new bigmap_1.BigMapToken(exp, 0, createToken_1.createToken);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
59
|
static isSchema(obj) {
|
|
74
60
|
return obj && obj[schemaTypeSymbol] === true;
|
|
75
61
|
}
|
|
@@ -99,6 +85,20 @@ class Schema {
|
|
|
99
85
|
isExpressionExtended(val) {
|
|
100
86
|
return 'prim' in val && Array.isArray(val.args);
|
|
101
87
|
}
|
|
88
|
+
constructor(val) {
|
|
89
|
+
this.val = val;
|
|
90
|
+
this[_a] = true;
|
|
91
|
+
this.root = (0, createToken_1.createToken)(val, 0);
|
|
92
|
+
if (this.root instanceof bigmap_1.BigMapToken) {
|
|
93
|
+
this.bigMap = this.root;
|
|
94
|
+
}
|
|
95
|
+
else if (this.isExpressionExtended(val) && val.prim === 'pair') {
|
|
96
|
+
const exp = val.args[0];
|
|
97
|
+
if (this.isExpressionExtended(exp) && exp.prim === 'big_map') {
|
|
98
|
+
this.bigMap = new bigmap_1.BigMapToken(exp, 0, createToken_1.createToken);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
102
|
removeTopLevelAnnotation(obj) {
|
|
103
103
|
// PairToken and OrToken can have redundant top level annotation in their storage
|
|
104
104
|
if (this.root instanceof pair_1.PairToken || this.root instanceof or_1.OrToken) {
|
|
@@ -263,4 +263,3 @@ class Schema {
|
|
|
263
263
|
}
|
|
264
264
|
exports.Schema = Schema;
|
|
265
265
|
_a = schemaTypeSymbol;
|
|
266
|
-
//# sourceMappingURL=storage.js.map
|
package/dist/lib/schema/types.js
CHANGED
|
@@ -4,26 +4,6 @@ exports.ViewSchema = void 0;
|
|
|
4
4
|
const createToken_1 = require("../tokens/createToken");
|
|
5
5
|
const errors_1 = require("./errors");
|
|
6
6
|
class ViewSchema {
|
|
7
|
-
/**
|
|
8
|
-
* @throws {@link InvalidScriptError}
|
|
9
|
-
*/
|
|
10
|
-
constructor(viewArgs) {
|
|
11
|
-
if (!viewArgs) {
|
|
12
|
-
throw new errors_1.InvalidScriptError(viewArgs, 'the args are not defined');
|
|
13
|
-
}
|
|
14
|
-
if (viewArgs.length !== 4) {
|
|
15
|
-
throw new errors_1.InvalidScriptError(viewArgs, `there should be exactly 4 arguments`);
|
|
16
|
-
}
|
|
17
|
-
if (!('string' in viewArgs[0]) || !viewArgs[0]['string']) {
|
|
18
|
-
throw new errors_1.InvalidScriptError(viewArgs, `The first argument should be a string, representing the view name. It should be in the form: { string: 'viewName' }`);
|
|
19
|
-
}
|
|
20
|
-
this.viewName = viewArgs[0]['string'];
|
|
21
|
-
this.viewArgsType = viewArgs[1];
|
|
22
|
-
this.viewReturnType = viewArgs[2];
|
|
23
|
-
this.instructions = viewArgs[3];
|
|
24
|
-
this.rootArgsType = createToken_1.createToken(this.viewArgsType, 0);
|
|
25
|
-
this.rootReturnType = createToken_1.createToken(this.viewReturnType, 0);
|
|
26
|
-
}
|
|
27
7
|
/**
|
|
28
8
|
*
|
|
29
9
|
* @description Create an instance of ViewSchema for each view in a script
|
|
@@ -45,6 +25,26 @@ class ViewSchema {
|
|
|
45
25
|
}
|
|
46
26
|
return allViewSchema;
|
|
47
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @throws {@link InvalidScriptError}
|
|
30
|
+
*/
|
|
31
|
+
constructor(viewArgs) {
|
|
32
|
+
if (!viewArgs) {
|
|
33
|
+
throw new errors_1.InvalidScriptError(viewArgs, 'the args are not defined');
|
|
34
|
+
}
|
|
35
|
+
if (viewArgs.length !== 4) {
|
|
36
|
+
throw new errors_1.InvalidScriptError(viewArgs, `there should be exactly 4 arguments`);
|
|
37
|
+
}
|
|
38
|
+
if (!('string' in viewArgs[0]) || !viewArgs[0]['string']) {
|
|
39
|
+
throw new errors_1.InvalidScriptError(viewArgs, `The first argument should be a string, representing the view name. It should be in the form: { string: 'viewName' }`);
|
|
40
|
+
}
|
|
41
|
+
this.viewName = viewArgs[0]['string'];
|
|
42
|
+
this.viewArgsType = viewArgs[1];
|
|
43
|
+
this.viewReturnType = viewArgs[2];
|
|
44
|
+
this.instructions = viewArgs[3];
|
|
45
|
+
this.rootArgsType = (0, createToken_1.createToken)(this.viewArgsType, 0);
|
|
46
|
+
this.rootReturnType = (0, createToken_1.createToken)(this.viewReturnType, 0);
|
|
47
|
+
}
|
|
48
48
|
/**
|
|
49
49
|
*
|
|
50
50
|
* @description Transform the view parameter into Michelson
|
|
@@ -88,4 +88,3 @@ class ViewSchema {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
exports.ViewSchema = ViewSchema;
|
|
91
|
-
//# sourceMappingURL=view-schema.js.map
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
7
|
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
9
13
|
}) : (function(o, m, k, k2) {
|
|
10
14
|
if (k2 === undefined) k2 = k;
|
|
11
15
|
o[k2] = m[k];
|
|
@@ -29,4 +33,3 @@ var version_1 = require("./version");
|
|
|
29
33
|
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
|
|
30
34
|
var token_1 = require("./tokens/token");
|
|
31
35
|
Object.defineProperty(exports, "Token", { enumerable: true, get: function () { return token_1.Token; } });
|
|
32
|
-
//# sourceMappingURL=taquito-michelson-encoder.js.map
|
|
@@ -27,7 +27,7 @@ class ChainIDToken extends token_1.ComparableToken {
|
|
|
27
27
|
* @throws {@link ChainIDValidationError}
|
|
28
28
|
*/
|
|
29
29
|
validate(value) {
|
|
30
|
-
if (utils_1.validateChain(value) !== utils_1.ValidationResult.VALID) {
|
|
30
|
+
if ((0, utils_1.validateChain)(value) !== utils_1.ValidationResult.VALID) {
|
|
31
31
|
throw new ChainIDValidationError(value, this, `Value ${JSON.stringify(value)} is not a valid ChainID`);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -83,4 +83,3 @@ class ChainIDToken extends token_1.ComparableToken {
|
|
|
83
83
|
}
|
|
84
84
|
exports.ChainIDToken = ChainIDToken;
|
|
85
85
|
ChainIDToken.prim = 'chain_id';
|
|
86
|
-
//# sourceMappingURL=chain-id.js.map
|
package/dist/lib/tokens/chest.js
CHANGED
|
@@ -24,7 +24,7 @@ class AddressToken extends token_1.ComparableToken {
|
|
|
24
24
|
this.fac = fac;
|
|
25
25
|
}
|
|
26
26
|
ToBigMapKey(val) {
|
|
27
|
-
const decoded = utils_1.b58decode(val);
|
|
27
|
+
const decoded = (0, utils_1.b58decode)(val);
|
|
28
28
|
return {
|
|
29
29
|
key: { bytes: decoded },
|
|
30
30
|
type: { prim: 'bytes' },
|
|
@@ -34,7 +34,7 @@ class AddressToken extends token_1.ComparableToken {
|
|
|
34
34
|
* @throws {@link AddressValidationError}
|
|
35
35
|
*/
|
|
36
36
|
validate(value) {
|
|
37
|
-
if (utils_1.validateAddress(value) !== utils_1.ValidationResult.VALID) {
|
|
37
|
+
if ((0, utils_1.validateAddress)(value) !== utils_1.ValidationResult.VALID) {
|
|
38
38
|
throw new AddressValidationError(value, this, `Address is not valid: ${JSON.stringify(value)}`);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -66,7 +66,7 @@ class AddressToken extends token_1.ComparableToken {
|
|
|
66
66
|
if (!val.bytes) {
|
|
67
67
|
throw new AddressValidationError(val, this, `cannot be missing both string and bytes: ${JSON.stringify(val)}`);
|
|
68
68
|
}
|
|
69
|
-
return utils_1.encodePubKey(val.bytes);
|
|
69
|
+
return (0, utils_1.encodePubKey)(val.bytes);
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* @deprecated ExtractSchema has been deprecated in favor of generateSchema
|
|
@@ -91,7 +91,7 @@ class AddressToken extends token_1.ComparableToken {
|
|
|
91
91
|
if (!bytes) {
|
|
92
92
|
throw new AddressValidationError({ bytes, string }, this, `cannot be missing both string and bytes ${JSON.stringify({ string, bytes })}`);
|
|
93
93
|
}
|
|
94
|
-
return utils_1.encodePubKey(bytes);
|
|
94
|
+
return (0, utils_1.encodePubKey)(bytes);
|
|
95
95
|
}
|
|
96
96
|
compare(address1, address2) {
|
|
97
97
|
const isImplicit = (address) => {
|
|
@@ -116,4 +116,3 @@ class AddressToken extends token_1.ComparableToken {
|
|
|
116
116
|
}
|
|
117
117
|
exports.AddressToken = AddressToken;
|
|
118
118
|
AddressToken.prim = 'address';
|
|
119
|
-
//# sourceMappingURL=address.js.map
|
|
@@ -46,7 +46,7 @@ class BytesToken extends token_1.ComparableToken {
|
|
|
46
46
|
*/
|
|
47
47
|
Encode(args) {
|
|
48
48
|
let val = args.pop();
|
|
49
|
-
val = utils_1.stripHexPrefix(this.convertUint8ArrayToHexString(val));
|
|
49
|
+
val = (0, utils_1.stripHexPrefix)(this.convertUint8ArrayToHexString(val));
|
|
50
50
|
this.validate(val);
|
|
51
51
|
return { bytes: String(val).toString() };
|
|
52
52
|
}
|
|
@@ -56,7 +56,7 @@ class BytesToken extends token_1.ComparableToken {
|
|
|
56
56
|
EncodeObject(val, semantic) {
|
|
57
57
|
val = this.convertUint8ArrayToHexString(val);
|
|
58
58
|
if (typeof val === 'string') {
|
|
59
|
-
val = utils_1.stripHexPrefix(val);
|
|
59
|
+
val = (0, utils_1.stripHexPrefix)(val);
|
|
60
60
|
}
|
|
61
61
|
this.validate(val);
|
|
62
62
|
if (semantic && semantic[BytesToken.prim]) {
|
|
@@ -95,4 +95,3 @@ class BytesToken extends token_1.ComparableToken {
|
|
|
95
95
|
}
|
|
96
96
|
exports.BytesToken = BytesToken;
|
|
97
97
|
BytesToken.prim = 'bytes';
|
|
98
|
-
//# sourceMappingURL=bytes.js.map
|
|
@@ -27,13 +27,13 @@ class KeyHashToken extends token_1.ComparableToken {
|
|
|
27
27
|
if (val.string) {
|
|
28
28
|
return val.string;
|
|
29
29
|
}
|
|
30
|
-
return utils_1.encodeKeyHash(val.bytes);
|
|
30
|
+
return (0, utils_1.encodeKeyHash)(val.bytes);
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* @throws {@link KeyHashValidationError}
|
|
34
34
|
*/
|
|
35
35
|
validate(value) {
|
|
36
|
-
if (utils_1.validateKeyHash(value) !== utils_1.ValidationResult.VALID) {
|
|
36
|
+
if ((0, utils_1.validateKeyHash)(value) !== utils_1.ValidationResult.VALID) {
|
|
37
37
|
throw new KeyHashValidationError(value, this, `KeyHash is not valid: ${JSON.stringify(value)}`);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -72,7 +72,7 @@ class KeyHashToken extends token_1.ComparableToken {
|
|
|
72
72
|
if (string) {
|
|
73
73
|
return string;
|
|
74
74
|
}
|
|
75
|
-
return utils_1.encodeKeyHash(bytes);
|
|
75
|
+
return (0, utils_1.encodeKeyHash)(bytes);
|
|
76
76
|
}
|
|
77
77
|
ToBigMapKey(val) {
|
|
78
78
|
return {
|
|
@@ -89,4 +89,3 @@ class KeyHashToken extends token_1.ComparableToken {
|
|
|
89
89
|
}
|
|
90
90
|
exports.KeyHashToken = KeyHashToken;
|
|
91
91
|
KeyHashToken.prim = 'key_hash';
|
|
92
|
-
//# sourceMappingURL=key_hash.js.map
|
|
@@ -24,7 +24,7 @@ class TxRollupL2AddressToken extends token_1.ComparableToken {
|
|
|
24
24
|
this.fac = fac;
|
|
25
25
|
}
|
|
26
26
|
ToBigMapKey(val) {
|
|
27
|
-
const decoded = utils_1.b58decodeL2Address(val);
|
|
27
|
+
const decoded = (0, utils_1.b58decodeL2Address)(val);
|
|
28
28
|
return {
|
|
29
29
|
key: { bytes: decoded },
|
|
30
30
|
type: { prim: 'bytes' },
|
|
@@ -34,7 +34,7 @@ class TxRollupL2AddressToken extends token_1.ComparableToken {
|
|
|
34
34
|
* @throws {@link TxRollupL2AddressValidationError}
|
|
35
35
|
*/
|
|
36
36
|
validate(value) {
|
|
37
|
-
if (utils_1.validateAddress(value) !== utils_1.ValidationResult.VALID) {
|
|
37
|
+
if ((0, utils_1.validateAddress)(value) !== utils_1.ValidationResult.VALID) {
|
|
38
38
|
throw new TxRollupL2AddressValidationError(value, this, `tx_rollup_l2_address is not valid: ${JSON.stringify(value)}`);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -69,7 +69,7 @@ class TxRollupL2AddressToken extends token_1.ComparableToken {
|
|
|
69
69
|
if (!val.bytes) {
|
|
70
70
|
throw new TxRollupL2AddressValidationError(val, this, `value cannot be missing string and byte value. must have one ${JSON.stringify(val)}`);
|
|
71
71
|
}
|
|
72
|
-
return utils_1.encodeL2Address(val.bytes);
|
|
72
|
+
return (0, utils_1.encodeL2Address)(val.bytes);
|
|
73
73
|
}
|
|
74
74
|
ExtractSchema() {
|
|
75
75
|
return TxRollupL2AddressToken.prim;
|
|
@@ -90,7 +90,7 @@ class TxRollupL2AddressToken extends token_1.ComparableToken {
|
|
|
90
90
|
if (!bytes) {
|
|
91
91
|
throw new TxRollupL2AddressValidationError(bytes, this, `value cannot be missing string and byte value. must have one: bytes = ${JSON.stringify(bytes)}`);
|
|
92
92
|
}
|
|
93
|
-
return utils_1.encodeL2Address(bytes);
|
|
93
|
+
return (0, utils_1.encodeL2Address)(bytes);
|
|
94
94
|
}
|
|
95
95
|
findAndReturnTokens(tokenToFind, tokens) {
|
|
96
96
|
if (TxRollupL2AddressToken.prim === tokenToFind) {
|
|
@@ -101,4 +101,3 @@ class TxRollupL2AddressToken extends token_1.ComparableToken {
|
|
|
101
101
|
}
|
|
102
102
|
exports.TxRollupL2AddressToken = TxRollupL2AddressToken;
|
|
103
103
|
TxRollupL2AddressToken.prim = 'tx_rollup_l2_address';
|
|
104
|
-
//# sourceMappingURL=tx_rollup_l2_address.js.map
|
|
@@ -28,7 +28,7 @@ class ContractToken extends token_1.Token {
|
|
|
28
28
|
*/
|
|
29
29
|
validate(value) {
|
|
30
30
|
// tz1,tz2 and tz3 seems to be valid contract values (for Unit contract)
|
|
31
|
-
if (utils_1.validateAddress(value) !== utils_1.ValidationResult.VALID) {
|
|
31
|
+
if ((0, utils_1.validateAddress)(value) !== utils_1.ValidationResult.VALID) {
|
|
32
32
|
throw new ContractValidationError(value, this, `Value ${JSON.stringify(value)} is not a valid contract address.`);
|
|
33
33
|
}
|
|
34
34
|
return null;
|
|
@@ -43,7 +43,7 @@ class ContractToken extends token_1.Token {
|
|
|
43
43
|
if (!val.bytes) {
|
|
44
44
|
throw new ContractValidationError(val, this, `Value ${JSON.stringify(val)} is not a valid contract address. must contain bytes or string.`);
|
|
45
45
|
}
|
|
46
|
-
return utils_1.encodePubKey(val.bytes);
|
|
46
|
+
return (0, utils_1.encodePubKey)(val.bytes);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* @throws {@link ContractValidationError}
|
|
@@ -88,4 +88,3 @@ class ContractToken extends token_1.Token {
|
|
|
88
88
|
}
|
|
89
89
|
exports.ContractToken = ContractToken;
|
|
90
90
|
ContractToken.prim = 'contract';
|
|
91
|
-
//# sourceMappingURL=contract.js.map
|
package/dist/lib/tokens/key.js
CHANGED
|
@@ -28,13 +28,13 @@ class KeyToken extends token_1.ComparableToken {
|
|
|
28
28
|
if (val.string) {
|
|
29
29
|
return val.string;
|
|
30
30
|
}
|
|
31
|
-
return utils_1.encodeKey(val.bytes);
|
|
31
|
+
return (0, utils_1.encodeKey)(val.bytes);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* @throws {@link KeyValidationError}
|
|
35
35
|
*/
|
|
36
36
|
validate(value) {
|
|
37
|
-
if (utils_1.validatePublicKey(value) !== utils_1.ValidationResult.VALID) {
|
|
37
|
+
if ((0, utils_1.validatePublicKey)(value) !== utils_1.ValidationResult.VALID) {
|
|
38
38
|
throw new KeyValidationError(value, this, 'Key is not valid');
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -101,7 +101,7 @@ class KeyToken extends token_1.ComparableToken {
|
|
|
101
101
|
return val.substring(0, publicKeyPrefixLength);
|
|
102
102
|
}
|
|
103
103
|
getP256PublicKeyComparableBytes(p2pk) {
|
|
104
|
-
return utils_1.b58cdecode(p2pk, utils_1.prefix[utils_1.Prefix.P2PK]).slice(1);
|
|
104
|
+
return (0, utils_1.b58cdecode)(p2pk, utils_1.prefix[utils_1.Prefix.P2PK]).slice(1);
|
|
105
105
|
}
|
|
106
106
|
findAndReturnTokens(tokenToFind, tokens) {
|
|
107
107
|
if (KeyToken.prim === tokenToFind) {
|
|
@@ -112,4 +112,3 @@ class KeyToken extends token_1.ComparableToken {
|
|
|
112
112
|
}
|
|
113
113
|
exports.KeyToken = KeyToken;
|
|
114
114
|
KeyToken.prim = 'key';
|
|
115
|
-
//# sourceMappingURL=key.js.map
|
package/dist/lib/tokens/list.js
CHANGED
package/dist/lib/tokens/map.js
CHANGED
package/dist/lib/tokens/never.js
CHANGED
package/dist/lib/tokens/or.js
CHANGED
package/dist/lib/tokens/pair.js
CHANGED
|
@@ -83,4 +83,3 @@ class SaplingTransactionDeprecatedToken extends token_1.Token {
|
|
|
83
83
|
}
|
|
84
84
|
exports.SaplingTransactionDeprecatedToken = SaplingTransactionDeprecatedToken;
|
|
85
85
|
SaplingTransactionDeprecatedToken.prim = 'sapling_transaction_deprecated';
|
|
86
|
-
//# sourceMappingURL=sapling-transaction-deprecated.js.map
|
package/dist/lib/tokens/set.js
CHANGED
|
@@ -34,7 +34,7 @@ class SignatureToken extends token_1.ComparableToken {
|
|
|
34
34
|
* @throws {@link SignatureValidationError}
|
|
35
35
|
*/
|
|
36
36
|
validate(value) {
|
|
37
|
-
if (utils_1.validateSignature(value) !== utils_1.ValidationResult.VALID) {
|
|
37
|
+
if ((0, utils_1.validateSignature)(value) !== utils_1.ValidationResult.VALID) {
|
|
38
38
|
throw new SignatureValidationError(value, this, 'Signature is not valid');
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -87,4 +87,3 @@ class SignatureToken extends token_1.ComparableToken {
|
|
|
87
87
|
}
|
|
88
88
|
exports.SignatureToken = SignatureToken;
|
|
89
89
|
SignatureToken.prim = 'signature';
|
|
90
|
-
//# sourceMappingURL=signature.js.map
|
package/dist/lib/tokens/token.js
CHANGED
package/dist/lib/tokens/unit.js
CHANGED