@taquito/michel-codec 17.1.1 → 17.2.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 +2 -2
- package/dist/lib/base58.js.map +1 -1
- package/dist/lib/binary.js +35 -35
- package/dist/lib/binary.js.map +1 -1
- package/dist/lib/errors.js +14 -13
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/macros.js +6 -4
- package/dist/lib/macros.js.map +1 -1
- package/dist/lib/micheline-parser.js +11 -8
- package/dist/lib/micheline-parser.js.map +1 -1
- package/dist/lib/michelson-contract.js +2 -1
- package/dist/lib/michelson-contract.js.map +1 -1
- package/dist/lib/michelson-typecheck.js +36 -34
- package/dist/lib/michelson-typecheck.js.map +1 -1
- package/dist/lib/michelson-validator.js +2 -1
- package/dist/lib/michelson-validator.js.map +1 -1
- package/dist/lib/scan.js +5 -3
- package/dist/lib/scan.js.map +1 -1
- package/dist/lib/utils.js +10 -6
- package/dist/lib/utils.js.map +1 -1
- package/dist/lib/version.js +2 -2
- package/dist/taquito-michel-codec.es6.js +118 -107
- package/dist/taquito-michel-codec.es6.js.map +1 -1
- package/dist/taquito-michel-codec.umd.js +117 -106
- package/dist/taquito-michel-codec.umd.js.map +1 -1
- package/dist/types/base58.d.ts +3 -3
- package/dist/types/errors.d.ts +9 -13
- package/dist/types/macros.d.ts +6 -4
- package/dist/types/micheline-parser.d.ts +11 -8
- package/dist/types/michelson-typecheck.d.ts +4 -2
- package/dist/types/michelson-validator.d.ts +3 -2
- package/dist/types/scan.d.ts +6 -4
- package/dist/types/utils.d.ts +8 -4
- package/package.json +3 -3
package/dist/types/base58.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { TaquitoError } from '@taquito/core';
|
|
1
2
|
/**
|
|
2
3
|
* @category Error
|
|
3
4
|
* @description Error that indicates a failure when decoding a base58 encoding
|
|
4
5
|
*/
|
|
5
|
-
export declare class Base58DecodingError extends
|
|
6
|
-
message: string;
|
|
7
|
-
name: string;
|
|
6
|
+
export declare class Base58DecodingError extends TaquitoError {
|
|
7
|
+
readonly message: string;
|
|
8
8
|
constructor(message: string);
|
|
9
9
|
}
|
|
10
10
|
export declare function decodeBase58(src: string): number[];
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,35 +1,33 @@
|
|
|
1
|
+
import { ParameterValidationError, TaquitoError } from '@taquito/core';
|
|
1
2
|
/**
|
|
2
3
|
* @category Error
|
|
3
|
-
* @description Error that indicates an invalid
|
|
4
|
+
* @description Error that indicates an invalid Michelson being passed or used
|
|
4
5
|
*/
|
|
5
|
-
export declare class
|
|
6
|
+
export declare class InvalidMichelsonError extends ParameterValidationError {
|
|
6
7
|
readonly message: string;
|
|
7
|
-
name: string;
|
|
8
8
|
constructor(message: string);
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* @category Error
|
|
12
12
|
* @description Error that indicates an invalid type expression being passed or used
|
|
13
13
|
*/
|
|
14
|
-
export declare class InvalidTypeExpressionError extends
|
|
14
|
+
export declare class InvalidTypeExpressionError extends ParameterValidationError {
|
|
15
15
|
readonly message: string;
|
|
16
|
-
name: string;
|
|
17
16
|
constructor(message: string);
|
|
18
17
|
}
|
|
19
18
|
/**
|
|
20
19
|
* @category Error
|
|
21
20
|
* @description Error that indicates an invalid data expression being passed or used
|
|
22
21
|
*/
|
|
23
|
-
export declare class InvalidDataExpressionError extends
|
|
22
|
+
export declare class InvalidDataExpressionError extends ParameterValidationError {
|
|
24
23
|
readonly message: string;
|
|
25
|
-
name: string;
|
|
26
24
|
constructor(message: string);
|
|
27
25
|
}
|
|
28
26
|
/**
|
|
29
27
|
* @category Error
|
|
30
28
|
* @description Error that indicates an invalid contract entrypoint being referenced or passed
|
|
31
29
|
*/
|
|
32
|
-
export declare class InvalidEntrypointError extends
|
|
30
|
+
export declare class InvalidEntrypointError extends ParameterValidationError {
|
|
33
31
|
readonly entrypoint?: string | undefined;
|
|
34
32
|
constructor(entrypoint?: string | undefined);
|
|
35
33
|
}
|
|
@@ -37,25 +35,23 @@ export declare class InvalidEntrypointError extends Error {
|
|
|
37
35
|
* @category Error
|
|
38
36
|
* @description Error that indicates a failure happening when trying to encode Tezos ID
|
|
39
37
|
*/
|
|
40
|
-
export declare class TezosIdEncodeError extends
|
|
38
|
+
export declare class TezosIdEncodeError extends ParameterValidationError {
|
|
41
39
|
readonly message: string;
|
|
42
|
-
name: string;
|
|
43
40
|
constructor(message: string);
|
|
44
41
|
}
|
|
45
42
|
/**
|
|
46
43
|
* @category Error
|
|
47
44
|
* @description Error that indicates a general error happening when trying to create a LongInteger
|
|
48
45
|
*/
|
|
49
|
-
export declare class LongIntegerError extends
|
|
46
|
+
export declare class LongIntegerError extends TaquitoError {
|
|
50
47
|
readonly message: string;
|
|
51
|
-
name: string;
|
|
52
48
|
constructor(message: string);
|
|
53
49
|
}
|
|
54
50
|
/**
|
|
55
51
|
* @category Error
|
|
56
52
|
* @description Error that indicates a failure occurring when trying to parse a hex byte
|
|
57
53
|
*/
|
|
58
|
-
export declare class HexParseError extends
|
|
54
|
+
export declare class HexParseError extends TaquitoError {
|
|
59
55
|
readonly hexByte: string;
|
|
60
56
|
constructor(hexByte: string);
|
|
61
57
|
}
|
package/dist/types/macros.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { TaquitoError } from '@taquito/core';
|
|
1
2
|
import { Prim, Expr } from './micheline';
|
|
2
3
|
import { ProtocolOptions } from './michelson-types';
|
|
3
4
|
/**
|
|
4
5
|
* @category Error
|
|
5
|
-
* @description
|
|
6
|
+
* @description Error that indicates macros failed to be expanded
|
|
6
7
|
*/
|
|
7
|
-
export declare class MacroError extends
|
|
8
|
-
prim: Prim;
|
|
9
|
-
|
|
8
|
+
export declare class MacroError extends TaquitoError {
|
|
9
|
+
readonly prim: Prim;
|
|
10
|
+
readonly message: string;
|
|
11
|
+
constructor(prim: Prim, message: string);
|
|
10
12
|
}
|
|
11
13
|
export declare function expandMacros(ex: Prim, opt?: ProtocolOptions): Expr;
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import { Token } from './scan';
|
|
2
2
|
import { Expr } from './micheline';
|
|
3
3
|
import { ProtocolOptions } from './michelson-types';
|
|
4
|
+
import { TaquitoError } from '@taquito/core';
|
|
4
5
|
/**
|
|
5
6
|
* @category Error
|
|
6
|
-
* @description Error
|
|
7
|
+
* @description Error that indicates a failure when parsing Micheline expressions
|
|
7
8
|
*/
|
|
8
|
-
export declare class MichelineParseError extends
|
|
9
|
-
token: Token | null;
|
|
9
|
+
export declare class MichelineParseError extends TaquitoError {
|
|
10
|
+
readonly token: Token | null;
|
|
11
|
+
readonly message: string;
|
|
10
12
|
/**
|
|
11
13
|
* @param token A token caused the error
|
|
12
14
|
* @param message An error message
|
|
13
15
|
*/
|
|
14
|
-
constructor(token: Token | null, message
|
|
16
|
+
constructor(token: Token | null, message: string);
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
19
|
* @category Error
|
|
18
|
-
* @description Error
|
|
20
|
+
* @description Error inidicates a failure when parsing Micheline JSON
|
|
19
21
|
*/
|
|
20
|
-
export declare class JSONParseError extends
|
|
21
|
-
node: unknown;
|
|
22
|
+
export declare class JSONParseError extends TaquitoError {
|
|
23
|
+
readonly node: unknown;
|
|
24
|
+
readonly message: string;
|
|
22
25
|
/**
|
|
23
26
|
* @param node A node caused the error
|
|
24
27
|
* @param message An error message
|
|
25
28
|
*/
|
|
26
|
-
constructor(node: unknown, message
|
|
29
|
+
constructor(node: unknown, message: string);
|
|
27
30
|
}
|
|
28
31
|
export interface GlobalConstantHashAndValue {
|
|
29
32
|
[globalConstantHash: string]: Expr;
|
|
@@ -6,13 +6,15 @@ export interface Context extends ParserOptions {
|
|
|
6
6
|
traceCallback?: (t: InstructionTrace) => void;
|
|
7
7
|
}
|
|
8
8
|
export declare class MichelsonInstructionError extends MichelsonError<MichelsonCode> {
|
|
9
|
-
|
|
9
|
+
readonly val: MichelsonCode;
|
|
10
|
+
readonly stackState: MichelsonReturnType;
|
|
11
|
+
readonly message: string;
|
|
10
12
|
/**
|
|
11
13
|
* @param val Value of a type node caused the error
|
|
12
14
|
* @param stackState Current stack state
|
|
13
15
|
* @param message An error message
|
|
14
16
|
*/
|
|
15
|
-
constructor(val: MichelsonCode, stackState: MichelsonReturnType, message
|
|
17
|
+
constructor(val: MichelsonCode, stackState: MichelsonReturnType, message: string);
|
|
16
18
|
}
|
|
17
19
|
export declare function assertTypeAnnotationsValid(t: MichelsonType, field?: boolean): void;
|
|
18
20
|
export interface InstructionTrace {
|
|
@@ -3,12 +3,13 @@ import { MichelsonError } from './utils';
|
|
|
3
3
|
import { MichelsonCode, MichelsonType, MichelsonData, MichelsonContract, MichelsonInstruction, InstructionList } from './michelson-types';
|
|
4
4
|
export declare const instructionIDs: Record<MichelsonInstruction['prim'], true>;
|
|
5
5
|
export declare class MichelsonValidationError extends MichelsonError {
|
|
6
|
-
val: Expr;
|
|
6
|
+
readonly val: Expr;
|
|
7
|
+
readonly message: string;
|
|
7
8
|
/**
|
|
8
9
|
* @param val Value of a node caused the error
|
|
9
10
|
* @param message An error message
|
|
10
11
|
*/
|
|
11
|
-
constructor(val: Expr, message
|
|
12
|
+
constructor(val: Expr, message: string);
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Checks if the node is a valid Michelson code (sequence of instructions).
|
package/dist/types/scan.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { TaquitoError } from '@taquito/core';
|
|
1
2
|
/**
|
|
2
3
|
* @category Error
|
|
3
4
|
* @description Error that indicates a failure when performing the scan step when parsing Michelson
|
|
4
5
|
*/
|
|
5
|
-
export declare class ScanError extends
|
|
6
|
-
src: string;
|
|
7
|
-
idx: number;
|
|
8
|
-
|
|
6
|
+
export declare class ScanError extends TaquitoError {
|
|
7
|
+
readonly src: string;
|
|
8
|
+
readonly idx: number;
|
|
9
|
+
readonly message: string;
|
|
10
|
+
constructor(src: string, idx: number, message: string);
|
|
9
11
|
}
|
|
10
12
|
export declare enum Literal {
|
|
11
13
|
Comment = 0,
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Prim, Expr, StringLiteral, IntLiteral } from './micheline';
|
|
2
2
|
import { MichelsonData, MichelsonDataPair, MichelsonType, MichelsonTypePair } from './michelson-types';
|
|
3
|
+
import { TaquitoError } from '@taquito/core';
|
|
3
4
|
export declare type Tuple<N extends number, T> = N extends 1 ? [T] : N extends 2 ? [T, T] : N extends 3 ? [T, T, T] : N extends 4 ? [T, T, T, T] : N extends 5 ? [T, T, T, T, T] : N extends 6 ? [T, T, T, T, T, T] : N extends 7 ? [T, T, T, T, T, T, T] : N extends 8 ? [T, T, T, T, T, T, T, T] : T[];
|
|
4
5
|
declare type RequiredProp<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
5
6
|
declare type OmitProp<T, K extends keyof T> = Omit<T, K> & {
|
|
@@ -15,24 +16,27 @@ export declare type Nullable<T> = {
|
|
|
15
16
|
* @category Error
|
|
16
17
|
* @description Error that indicates a Michelson failure occurring
|
|
17
18
|
*/
|
|
18
|
-
export declare class MichelsonError<T extends Expr = Expr> extends
|
|
19
|
-
val: T;
|
|
19
|
+
export declare class MichelsonError<T extends Expr = Expr> extends TaquitoError {
|
|
20
|
+
readonly val: T;
|
|
21
|
+
readonly message: string;
|
|
20
22
|
/**
|
|
21
23
|
* @param val Value of a AST node caused the error
|
|
22
24
|
* @param path Path to a node caused the error
|
|
23
25
|
* @param message An error message
|
|
24
26
|
*/
|
|
25
|
-
constructor(val: T, message
|
|
27
|
+
constructor(val: T, message: string);
|
|
26
28
|
}
|
|
27
29
|
export declare function isMichelsonError<T extends Expr = Expr>(err: unknown): err is MichelsonError<T>;
|
|
28
30
|
export declare class MichelsonTypeError extends MichelsonError<MichelsonType | MichelsonType[]> {
|
|
31
|
+
readonly val: MichelsonType | MichelsonType[];
|
|
32
|
+
readonly message: string;
|
|
29
33
|
data?: Expr;
|
|
30
34
|
/**
|
|
31
35
|
* @param val Value of a type node caused the error
|
|
32
36
|
* @param data Value of a data node caused the error
|
|
33
37
|
* @param message An error message
|
|
34
38
|
*/
|
|
35
|
-
constructor(val: MichelsonType | MichelsonType[],
|
|
39
|
+
constructor(val: MichelsonType | MichelsonType[], message: string, data?: Expr);
|
|
36
40
|
}
|
|
37
41
|
export declare class LongInteger {
|
|
38
42
|
private neg;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taquito/michel-codec",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.2.0",
|
|
4
4
|
"description": "Michelson parser/validator/formatter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tezos",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@taquito/core": "^17.
|
|
70
|
+
"@taquito/core": "^17.2.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@types/bluebird": "^3.5.36",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"ts-toolbelt": "^9.6.0",
|
|
93
93
|
"typescript": "~4.1.5"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "8fe3376401f12f5a97556479620c0414a6e5c7c3"
|
|
96
96
|
}
|