@taquito/michelson-encoder 12.0.2 → 12.1.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 +6 -1
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/michelson-map.js +18 -2
- package/dist/lib/michelson-map.js.map +1 -1
- package/dist/lib/schema/error.js +100 -1
- package/dist/lib/schema/error.js.map +1 -1
- package/dist/lib/schema/parameter.js +4 -3
- package/dist/lib/schema/parameter.js.map +1 -1
- package/dist/lib/schema/storage.js +10 -9
- package/dist/lib/schema/storage.js.map +1 -1
- package/dist/lib/tokens/bigmap.js +5 -2
- package/dist/lib/tokens/bigmap.js.map +1 -1
- package/dist/lib/tokens/createToken.js +4 -0
- package/dist/lib/tokens/createToken.js.map +1 -1
- package/dist/lib/tokens/or.js +14 -2
- package/dist/lib/tokens/or.js.map +1 -1
- package/dist/lib/tokens/pair.js +28 -3
- package/dist/lib/tokens/pair.js.map +1 -1
- package/dist/lib/tokens/sapling-state.js +1 -2
- package/dist/lib/tokens/sapling-state.js.map +1 -1
- package/dist/lib/tokens/sapling-transaction.js +1 -1
- package/dist/lib/tokens/sapling-transaction.js.map +1 -1
- package/dist/lib/tokens/ticket.js +4 -0
- package/dist/lib/tokens/ticket.js.map +1 -1
- package/dist/lib/tokens/token.js +4 -0
- package/dist/lib/tokens/token.js.map +1 -1
- package/dist/lib/version.js +2 -2
- package/dist/taquito-michelson-encoder.es6.js +195 -40
- package/dist/taquito-michelson-encoder.es6.js.map +1 -1
- package/dist/taquito-michelson-encoder.umd.js +205 -39
- package/dist/taquito-michelson-encoder.umd.js.map +1 -1
- package/dist/types/errors.d.ts +2 -0
- package/dist/types/michelson-map.d.ts +13 -0
- package/dist/types/schema/error.d.ts +75 -0
- package/dist/types/tokens/bigmap.d.ts +4 -0
- package/dist/types/tokens/createToken.d.ts +4 -0
- package/dist/types/tokens/or.d.ts +9 -0
- package/dist/types/tokens/pair.d.ts +19 -0
- package/dist/types/tokens/ticket.d.ts +4 -0
- package/dist/types/tokens/token.d.ts +4 -0
- package/package.json +4 -4
package/dist/types/errors.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export { ListValidationError } from './tokens/list';
|
|
|
2
2
|
export { MapValidationError } from './tokens/map';
|
|
3
3
|
export { SetValidationError } from './tokens/set';
|
|
4
4
|
export { BigMapValidationError } from './tokens/bigmap';
|
|
5
|
+
export { TokenArgumentValidationError, TokenComparisonError } from './tokens/pair';
|
|
6
|
+
export { OrTokenDecodingError } from './tokens/or';
|
|
5
7
|
export { ChainIDValidationError } from './tokens/chain-id';
|
|
6
8
|
export { KeyValidationError } from './tokens/key';
|
|
7
9
|
export { ContractValidationError } from './tokens/contract';
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { MichelsonV1Expression } from '@taquito/rpc';
|
|
2
|
+
/**
|
|
3
|
+
* @category Error
|
|
4
|
+
* @description Error that indicates an invalid map type being passed or used
|
|
5
|
+
*/
|
|
6
|
+
export declare class InvalidMapTypeError extends Error {
|
|
7
|
+
mapType: string;
|
|
8
|
+
name: string;
|
|
9
|
+
constructor(mapType: string);
|
|
10
|
+
}
|
|
2
11
|
declare const michelsonMapTypeSymbol: unique symbol;
|
|
3
12
|
export declare type MichelsonMapKey = Array<any> | object | string | boolean | number;
|
|
13
|
+
/**
|
|
14
|
+
* @category Error
|
|
15
|
+
* @description 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
|
|
16
|
+
*/
|
|
4
17
|
export declare class MapTypecheckError extends Error {
|
|
5
18
|
readonly value: any;
|
|
6
19
|
readonly type: any;
|
|
@@ -1,11 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category Error
|
|
3
|
+
* @description Error that indicates a failure when encoding (transforming JS parameter into JSON Michelson)the parameter of the view
|
|
4
|
+
*/
|
|
1
5
|
export declare class ViewEncodingError extends Error {
|
|
2
6
|
smartContractViewName: string;
|
|
3
7
|
originalError: any;
|
|
4
8
|
name: string;
|
|
5
9
|
constructor(smartContractViewName: string, originalError: any);
|
|
6
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @category Error
|
|
13
|
+
* @description Error that indicates an invalid on-chain view found on the script
|
|
14
|
+
*/
|
|
7
15
|
export declare class InvalidScriptError extends Error {
|
|
8
16
|
message: string;
|
|
9
17
|
name: string;
|
|
10
18
|
constructor(message: string);
|
|
11
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* @category Error
|
|
22
|
+
* @description Error that indicates an invalid RPC response being passed or used
|
|
23
|
+
*/
|
|
24
|
+
export declare class InvalidRpcResponseError extends Error {
|
|
25
|
+
script: any;
|
|
26
|
+
name: string;
|
|
27
|
+
constructor(script: any);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @category Error
|
|
31
|
+
* @description Error that indicates a failure that occurred during encoding
|
|
32
|
+
*/
|
|
33
|
+
export declare class ParameterEncodingError extends Error {
|
|
34
|
+
message: string;
|
|
35
|
+
args: any;
|
|
36
|
+
originalError: any;
|
|
37
|
+
name: string;
|
|
38
|
+
constructor(message: string, args: any, originalError: any);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @category Error
|
|
42
|
+
* @description Error that indicates an invalid big map schema being passed or used
|
|
43
|
+
*/
|
|
44
|
+
export declare class InvalidBigMapSchema extends Error {
|
|
45
|
+
message: string;
|
|
46
|
+
name: string;
|
|
47
|
+
constructor(message: string);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @category Error
|
|
51
|
+
* @description Error that indicates an invalid big map diff being passed or used
|
|
52
|
+
*/
|
|
53
|
+
export declare class InvalidBigMapDiff extends Error {
|
|
54
|
+
message: string;
|
|
55
|
+
name: string;
|
|
56
|
+
constructor(message: string);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @category Error
|
|
60
|
+
* @description Error that indicates a failure when trying to encode big maps
|
|
61
|
+
*/
|
|
62
|
+
export declare class BigMapEncodingError extends Error {
|
|
63
|
+
private obj;
|
|
64
|
+
details: any;
|
|
65
|
+
name: string;
|
|
66
|
+
constructor(obj: string, details: any);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @category Error
|
|
70
|
+
* @description Error that indicates a failure when trying to encode storage
|
|
71
|
+
*/
|
|
72
|
+
export declare class StorageEncodingError extends Error {
|
|
73
|
+
private obj;
|
|
74
|
+
details: any;
|
|
75
|
+
name: string;
|
|
76
|
+
constructor(obj: string, details: any);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @category Error
|
|
80
|
+
* @description General error that indicates a function not being passed a necessary argument
|
|
81
|
+
*/
|
|
82
|
+
export declare class MissingArgumentError extends Error {
|
|
83
|
+
message: string;
|
|
84
|
+
name: string;
|
|
85
|
+
constructor(message: string);
|
|
86
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { BigMapTokenSchema } from '../schema/types';
|
|
2
2
|
import { ComparableToken, Semantic, Token, TokenFactory, TokenValidationError } from './token';
|
|
3
|
+
/**
|
|
4
|
+
* @category Error
|
|
5
|
+
* @description Error that indicates a failure happening when parsing encoding/executing Big Map types
|
|
6
|
+
*/
|
|
3
7
|
export declare class BigMapValidationError extends TokenValidationError {
|
|
4
8
|
value: any;
|
|
5
9
|
token: BigMapToken;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Token } from './token';
|
|
2
|
+
/**
|
|
3
|
+
* @category Error
|
|
4
|
+
* @description 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.
|
|
5
|
+
*/
|
|
2
6
|
export declare class InvalidTokenError extends Error {
|
|
3
7
|
message: string;
|
|
4
8
|
data: any;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { OrTokenSchema } from '../schema/types';
|
|
2
2
|
import { Token, TokenFactory, Semantic, ComparableToken } from './token';
|
|
3
|
+
/**
|
|
4
|
+
* @category Error
|
|
5
|
+
* @description Error that indicates a failure when decoding OR Token methods
|
|
6
|
+
*/
|
|
7
|
+
export declare class OrTokenDecodingError extends Error {
|
|
8
|
+
message: string;
|
|
9
|
+
name: string;
|
|
10
|
+
constructor(message: string);
|
|
11
|
+
}
|
|
3
12
|
export declare class OrToken extends ComparableToken {
|
|
4
13
|
protected val: {
|
|
5
14
|
prim: string;
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { Token, TokenFactory, Semantic, ComparableToken } from './token';
|
|
2
2
|
import { PairTokenSchema } from '../schema/types';
|
|
3
|
+
/**
|
|
4
|
+
* @category Error
|
|
5
|
+
* @description Error that indicates in invalid token argument being passed
|
|
6
|
+
*/
|
|
7
|
+
export declare class TokenArgumentValidationError extends Error {
|
|
8
|
+
message: string;
|
|
9
|
+
name: string;
|
|
10
|
+
constructor(message: string);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @category Error
|
|
14
|
+
* @description Error that indicates a failure occurring when doing a comparison of tokens
|
|
15
|
+
*/
|
|
16
|
+
export declare class TokenComparisonError extends Error {
|
|
17
|
+
val1: string;
|
|
18
|
+
val2: string;
|
|
19
|
+
name: string;
|
|
20
|
+
constructor(val1: string, val2: string);
|
|
21
|
+
}
|
|
3
22
|
export declare class PairToken extends ComparableToken {
|
|
4
23
|
static prim: 'pair';
|
|
5
24
|
constructor(val: {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { TicketTokenSchema } from '../schema/types';
|
|
2
2
|
import { Token, TokenFactory, Semantic } from './token';
|
|
3
|
+
/**
|
|
4
|
+
* @category Error
|
|
5
|
+
* @description Error that indicates a failure when encoding and sending a ticket to the blockchain
|
|
6
|
+
*/
|
|
3
7
|
export declare class EncodeTicketError extends Error {
|
|
4
8
|
name: string;
|
|
5
9
|
constructor();
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { MichelsonV1Expression } from '@taquito/rpc';
|
|
2
2
|
import { TokenSchema } from '../schema/types';
|
|
3
|
+
/**
|
|
4
|
+
* @category Error
|
|
5
|
+
* @description Error that indicates a failure when encoding invalid or incorrect data (e.g. if an address is expected but a number is received)
|
|
6
|
+
*/
|
|
3
7
|
export declare abstract class TokenValidationError extends Error {
|
|
4
8
|
value: any;
|
|
5
9
|
token: Token;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taquito/michelson-encoder",
|
|
3
|
-
"version": "12.0
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "converts michelson data and types into convenient JS/TS objects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tezos",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
]
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@taquito/rpc": "^12.0
|
|
72
|
-
"@taquito/utils": "^12.0
|
|
71
|
+
"@taquito/rpc": "^12.1.0",
|
|
72
|
+
"@taquito/utils": "^12.1.0",
|
|
73
73
|
"bignumber.js": "^9.0.2",
|
|
74
74
|
"fast-json-stable-stringify": "^2.1.0"
|
|
75
75
|
},
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"typedoc": "^0.20.36",
|
|
104
104
|
"typescript": "~4.1.5"
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "8e044472d87e92bfa748e8193ba84a7ee57d659f"
|
|
107
107
|
}
|