@taquito/michel-codec 18.0.0-RC.0 → 19.0.0-beta-RC.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 +5 -8
- 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 +5657 -5657
- package/dist/taquito-michel-codec.es6.js.map +1 -1
- package/dist/taquito-michel-codec.umd.js +5657 -5659
- 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 +135 -137
- 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
|
@@ -1,137 +1,135 @@
|
|
|
1
|
-
import { Prim, Expr, IntLiteral, StringLiteral, BytesLiteral, List, Node } from './micheline';
|
|
2
|
-
interface Prim0<PT extends string = string> extends Prim<PT> {
|
|
3
|
-
args?: never;
|
|
4
|
-
}
|
|
5
|
-
interface PrimX<PT extends string = string, AT extends Expr[] = Expr[]> extends Prim<PT, AT> {
|
|
6
|
-
args: AT;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
export interface InstructionList extends List<MichelsonCode> {
|
|
16
|
-
}
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export declare const refContract: unique symbol;
|
|
24
|
-
export interface MichelsonTypeAddress extends Type0<'address'> {
|
|
25
|
-
[refContract]?: MichelsonTypeContract<MichelsonType>;
|
|
26
|
-
}
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export
|
|
39
|
-
export
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
export
|
|
48
|
-
export interface MichelsonTypeOption<T extends MichelsonType> extends TypeX<'option', [T]> {
|
|
49
|
-
}
|
|
50
|
-
export interface MichelsonTypeList<T extends MichelsonType> extends TypeX<'list', [T]> {
|
|
51
|
-
}
|
|
52
|
-
export interface MichelsonTypeContract<T extends MichelsonType> extends TypeX<'contract', [T]> {
|
|
53
|
-
}
|
|
54
|
-
export interface MichelsonTypeOr<T extends [MichelsonType, MichelsonType]> extends TypeX<'or', T> {
|
|
55
|
-
}
|
|
56
|
-
export interface MichelsonTypeLambda<Arg extends MichelsonType, Ret extends MichelsonType> extends TypeX<'lambda', [Arg, Ret]> {
|
|
57
|
-
}
|
|
58
|
-
export interface MichelsonTypeSet<T extends MichelsonType> extends TypeX<'set', [T]> {
|
|
59
|
-
}
|
|
60
|
-
export interface MichelsonTypeMap<K extends MichelsonType, V extends MichelsonType> extends TypeX<'map', [K, V]> {
|
|
61
|
-
}
|
|
62
|
-
export interface MichelsonTypeBigMap<K extends MichelsonType, V extends MichelsonType> extends TypeX<'big_map', [K, V]> {
|
|
63
|
-
}
|
|
64
|
-
export interface MichelsonTypeSaplingState<S extends string = string> extends TypeX<'sapling_state', [IntLiteral<S>]> {
|
|
65
|
-
}
|
|
66
|
-
export interface MichelsonTypeSaplingTransaction<S extends string = string> extends TypeX<'sapling_transaction', [IntLiteral<S>]> {
|
|
67
|
-
}
|
|
68
|
-
export interface MichelsonTypeTicket<T extends MichelsonType> extends TypeX<'ticket', [T]> {
|
|
69
|
-
}
|
|
70
|
-
export
|
|
71
|
-
export
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export
|
|
75
|
-
export
|
|
76
|
-
|
|
77
|
-
export
|
|
78
|
-
export
|
|
79
|
-
export
|
|
80
|
-
export
|
|
81
|
-
export
|
|
82
|
-
export
|
|
83
|
-
|
|
84
|
-
export
|
|
85
|
-
export
|
|
86
|
-
export
|
|
87
|
-
export
|
|
88
|
-
StringLiteral,
|
|
89
|
-
MichelsonType,
|
|
90
|
-
MichelsonType,
|
|
91
|
-
InstructionList
|
|
92
|
-
]>;
|
|
93
|
-
export
|
|
94
|
-
export
|
|
95
|
-
export interface MichelsonTypeFailed {
|
|
96
|
-
failed: MichelsonType;
|
|
97
|
-
level: number;
|
|
98
|
-
}
|
|
99
|
-
export
|
|
100
|
-
export declare enum Protocol {
|
|
101
|
-
Ps9mPmXa = "Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P",
|
|
102
|
-
PtCJ7pwo = "PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY",
|
|
103
|
-
PsYLVpVv = "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
|
|
104
|
-
PsddFKi3 = "PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",
|
|
105
|
-
Pt24m4xi = "Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",
|
|
106
|
-
PsBABY5H = "PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",
|
|
107
|
-
PsBabyM1 = "PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",
|
|
108
|
-
PsCARTHA = "PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",
|
|
109
|
-
PsDELPH1 = "PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",
|
|
110
|
-
PtEdoTez = "PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq",
|
|
111
|
-
PtEdo2Zk = "PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
export declare
|
|
131
|
-
export declare
|
|
132
|
-
export
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
export {};
|
|
1
|
+
import { Prim, Expr, IntLiteral, StringLiteral, BytesLiteral, List, Node } from './micheline';
|
|
2
|
+
interface Prim0<PT extends string = string> extends Prim<PT> {
|
|
3
|
+
args?: never;
|
|
4
|
+
}
|
|
5
|
+
interface PrimX<PT extends string = string, AT extends Expr[] = Expr[]> extends Prim<PT, AT> {
|
|
6
|
+
args: AT;
|
|
7
|
+
}
|
|
8
|
+
type MichelsonNoArgInstructionID = 'ABS' | 'ADD' | 'ADDRESS' | 'AMOUNT' | 'AND' | 'APPLY' | 'BALANCE' | 'BLAKE2B' | 'CAR' | 'CDR' | 'CHAIN_ID' | 'CHECK_SIGNATURE' | 'COMPARE' | 'CONCAT' | 'CONS' | 'EDIV' | 'EQ' | 'EXEC' | 'FAILWITH' | 'GE' | 'GET_AND_UPDATE' | 'GT' | 'HASH_KEY' | 'IMPLICIT_ACCOUNT' | 'INT' | 'ISNAT' | 'JOIN_TICKETS' | 'KECCAK' | 'LE' | 'LEVEL' | 'LSL' | 'LSR' | 'LT' | 'MEM' | 'MUL' | 'NEG' | 'NEQ' | 'NEVER' | 'NOT' | 'NOW' | 'OR' | 'PACK' | 'PAIRING_CHECK' | 'READ_TICKET' | 'SAPLING_VERIFY_UPDATE' | 'SELF' | 'SELF_ADDRESS' | 'SENDER' | 'SET_DELEGATE' | 'SHA256' | 'SHA3' | 'SHA512' | 'SIZE' | 'SLICE' | 'SOME' | 'SOURCE' | 'SPLIT_TICKET' | 'SUB' | 'SUB_MUTEZ' | 'SWAP' | 'TICKET' | 'TICKET_DEPRECATED' | 'TOTAL_VOTING_POWER' | 'TRANSFER_TOKENS' | 'UNIT' | 'VOTING_POWER' | 'XOR' | 'RENAME' | 'OPEN_CHEST' | 'MIN_BLOCK_TIME' | 'BYTES' | 'NAT';
|
|
9
|
+
type MichelsonRegularInstructionID = 'CONTRACT' | 'CREATE_CONTRACT' | 'DIG' | 'DIP' | 'DROP' | 'DUG' | 'DUP' | 'EMPTY_BIG_MAP' | 'EMPTY_MAP' | 'EMPTY_SET' | 'GET' | 'IF' | 'IF_CONS' | 'IF_LEFT' | 'IF_NONE' | 'ITER' | 'LAMBDA' | 'LAMBDA_REC' | 'LEFT' | 'LOOP' | 'LOOP_LEFT' | 'MAP' | 'NIL' | 'NONE' | 'PAIR' | 'PUSH' | 'RIGHT' | 'SAPLING_EMPTY_STATE' | 'UNPACK' | 'UNPAIR' | 'UPDATE' | 'CAST' | 'VIEW' | 'EMIT' | 'CREATE_ACCOUNT' | 'STEPS_TO_QUOTA';
|
|
10
|
+
export type MichelsonInstructionID = MichelsonNoArgInstructionID | MichelsonRegularInstructionID;
|
|
11
|
+
type InstrPrim<PT extends MichelsonInstructionID, AT extends Expr[]> = Prim<PT, AT>;
|
|
12
|
+
type Instr0<PT extends MichelsonNoArgInstructionID> = Prim0<PT>;
|
|
13
|
+
type InstrX<PT extends MichelsonRegularInstructionID, AT extends Expr[]> = PrimX<PT, AT>;
|
|
14
|
+
export type MichelsonCode = InstructionList | MichelsonInstruction;
|
|
15
|
+
export interface InstructionList extends List<MichelsonCode> {
|
|
16
|
+
}
|
|
17
|
+
export type MichelsonNoArgInstruction = Instr0<MichelsonNoArgInstructionID>;
|
|
18
|
+
export type MichelsonInstruction = MichelsonNoArgInstruction | InstrX<'DIG' | 'DUG' | 'SAPLING_EMPTY_STATE', [IntLiteral]> | InstrX<'NONE' | 'LEFT' | 'RIGHT' | 'NIL' | 'CAST', [MichelsonType]> | InstrX<'IF_NONE' | 'IF_LEFT' | 'IF_CONS' | 'IF', [InstructionList, InstructionList]> | InstrX<'MAP' | 'ITER' | 'LOOP' | 'LOOP_LEFT' | 'DIP', [InstructionList]> | InstrX<'UNPACK', [MichelsonType]> | InstrX<'CONTRACT', [MichelsonType]> | InstrX<'CREATE_CONTRACT', [MichelsonContract]> | InstrX<'PUSH', [MichelsonType, MichelsonData]> | InstrX<'EMPTY_SET', [MichelsonType]> | InstrX<'EMPTY_MAP', [MichelsonType, MichelsonType]> | InstrX<'EMPTY_BIG_MAP', [MichelsonType, MichelsonType]> | InstrX<'LAMBDA' | 'LAMBDA_REC', [MichelsonType, MichelsonType, InstructionList]> | InstrX<'DIP', [IntLiteral, InstructionList] | [InstructionList]> | InstrX<'VIEW', [StringLiteral, MichelsonType]> | InstrX<'EMIT', [MichelsonType]> | InstrPrim<'DROP' | 'PAIR' | 'UNPAIR' | 'DUP' | 'GET' | 'UPDATE', [IntLiteral]>;
|
|
19
|
+
export type MichelsonSimpleComparableTypeID = 'string' | 'nat' | 'int' | 'bytes' | 'bool' | 'mutez' | 'key_hash' | 'address' | 'timestamp' | 'never' | 'key' | 'unit' | 'signature' | 'chain_id' | 'tx_rollup_l2_address';
|
|
20
|
+
export type MichelsonTypeID = MichelsonSimpleComparableTypeID | 'option' | 'list' | 'set' | 'contract' | 'operation' | 'pair' | 'or' | 'lambda' | 'map' | 'big_map' | 'sapling_transaction' | 'sapling_transaction_deprecated' | 'sapling_state' | 'ticket' | 'bls12_381_g1' | 'bls12_381_g2' | 'bls12_381_fr' | 'chest_key' | 'chest';
|
|
21
|
+
type Type0<PT extends MichelsonTypeID> = Prim0<PT>;
|
|
22
|
+
type TypeX<PT extends MichelsonTypeID, AT extends Expr[]> = PrimX<PT, AT>;
|
|
23
|
+
export declare const refContract: unique symbol;
|
|
24
|
+
export interface MichelsonTypeAddress extends Type0<'address'> {
|
|
25
|
+
[refContract]?: MichelsonTypeContract<MichelsonType>;
|
|
26
|
+
}
|
|
27
|
+
export type MichelsonTypeInt = Type0<'int'>;
|
|
28
|
+
export type MichelsonTypeNat = Type0<'nat'>;
|
|
29
|
+
export type MichelsonTypeString = Type0<'string'>;
|
|
30
|
+
export type MichelsonTypeBytes = Type0<'bytes'>;
|
|
31
|
+
export type MichelsonTypeMutez = Type0<'mutez'>;
|
|
32
|
+
export type MichelsonTypeBool = Type0<'bool'>;
|
|
33
|
+
export type MichelsonTypeKeyHash = Type0<'key_hash'>;
|
|
34
|
+
export type MichelsonTypeTimestamp = Type0<'timestamp'>;
|
|
35
|
+
export type MichelsonTypeKey = Type0<'key'>;
|
|
36
|
+
export type MichelsonTypeUnit = Type0<'unit'>;
|
|
37
|
+
export type MichelsonTypeSignature = Type0<'signature'>;
|
|
38
|
+
export type MichelsonTypeOperation = Type0<'operation'>;
|
|
39
|
+
export type MichelsonTypeChainID = Type0<'chain_id'>;
|
|
40
|
+
export type MichelsonTypeNever = Type0<'never'>;
|
|
41
|
+
export type MichelsonTypeBLS12_381_G1 = Type0<'bls12_381_g1'>;
|
|
42
|
+
export type MichelsonTypeBLS12_381_G2 = Type0<'bls12_381_g2'>;
|
|
43
|
+
export type MichelsonTypeBLS12_381_FR = Type0<'bls12_381_fr'>;
|
|
44
|
+
export type MichelsonTypeChestKey = Type0<'chest_key'>;
|
|
45
|
+
export type MichelsonTypeChest = Type0<'chest'>;
|
|
46
|
+
type TypeList<T extends MichelsonType[]> = T & Node;
|
|
47
|
+
export type MichelsonTypePair<T extends MichelsonType[]> = TypeX<'pair', T> | TypeList<T>;
|
|
48
|
+
export interface MichelsonTypeOption<T extends MichelsonType> extends TypeX<'option', [T]> {
|
|
49
|
+
}
|
|
50
|
+
export interface MichelsonTypeList<T extends MichelsonType> extends TypeX<'list', [T]> {
|
|
51
|
+
}
|
|
52
|
+
export interface MichelsonTypeContract<T extends MichelsonType> extends TypeX<'contract', [T]> {
|
|
53
|
+
}
|
|
54
|
+
export interface MichelsonTypeOr<T extends [MichelsonType, MichelsonType]> extends TypeX<'or', T> {
|
|
55
|
+
}
|
|
56
|
+
export interface MichelsonTypeLambda<Arg extends MichelsonType, Ret extends MichelsonType> extends TypeX<'lambda', [Arg, Ret]> {
|
|
57
|
+
}
|
|
58
|
+
export interface MichelsonTypeSet<T extends MichelsonType> extends TypeX<'set', [T]> {
|
|
59
|
+
}
|
|
60
|
+
export interface MichelsonTypeMap<K extends MichelsonType, V extends MichelsonType> extends TypeX<'map', [K, V]> {
|
|
61
|
+
}
|
|
62
|
+
export interface MichelsonTypeBigMap<K extends MichelsonType, V extends MichelsonType> extends TypeX<'big_map', [K, V]> {
|
|
63
|
+
}
|
|
64
|
+
export interface MichelsonTypeSaplingState<S extends string = string> extends TypeX<'sapling_state', [IntLiteral<S>]> {
|
|
65
|
+
}
|
|
66
|
+
export interface MichelsonTypeSaplingTransaction<S extends string = string> extends TypeX<'sapling_transaction', [IntLiteral<S>]> {
|
|
67
|
+
}
|
|
68
|
+
export interface MichelsonTypeTicket<T extends MichelsonType> extends TypeX<'ticket', [T]> {
|
|
69
|
+
}
|
|
70
|
+
export type MichelsonType<T extends MichelsonTypeID = MichelsonTypeID> = T extends 'int' ? MichelsonTypeInt : T extends 'nat' ? MichelsonTypeNat : T extends 'string' ? MichelsonTypeString : T extends 'bytes' ? MichelsonTypeBytes : T extends 'mutez' ? MichelsonTypeMutez : T extends 'bool' ? MichelsonTypeBool : T extends 'key_hash' ? MichelsonTypeKeyHash : T extends 'timestamp' ? MichelsonTypeTimestamp : T extends 'address' ? MichelsonTypeAddress : T extends 'key' ? MichelsonTypeKey : T extends 'unit' ? MichelsonTypeUnit : T extends 'signature' ? MichelsonTypeSignature : T extends 'operation' ? MichelsonTypeOperation : T extends 'chain_id' ? MichelsonTypeChainID : T extends 'option' ? MichelsonTypeOption<MichelsonType> : T extends 'list' ? MichelsonTypeList<MichelsonType> : T extends 'contract' ? MichelsonTypeContract<MichelsonType> : T extends 'ticket' ? MichelsonTypeTicket<MichelsonType> : T extends 'pair' ? MichelsonTypePair<MichelsonType[]> : T extends 'or' ? MichelsonTypeOr<[MichelsonType, MichelsonType]> : T extends 'lambda' ? MichelsonTypeLambda<MichelsonType, MichelsonType> : T extends 'set' ? MichelsonTypeSet<MichelsonType> : T extends 'map' ? MichelsonTypeMap<MichelsonType, MichelsonType> : T extends 'big_map' ? MichelsonTypeBigMap<MichelsonType, MichelsonType> : T extends 'never' ? MichelsonTypeNever : T extends 'bls12_381_g1' ? MichelsonTypeBLS12_381_G1 : T extends 'bls12_381_g2' ? MichelsonTypeBLS12_381_G2 : T extends 'bls12_381_fr' ? MichelsonTypeBLS12_381_FR : T extends 'sapling_transaction' ? MichelsonTypeSaplingTransaction : T extends 'sapling_state' ? MichelsonTypeSaplingState : T extends 'chest_key' ? MichelsonTypeChestKey : MichelsonTypeChest;
|
|
71
|
+
export type MichelsonDataID = 'Unit' | 'True' | 'False' | 'None' | 'Pair' | 'Left' | 'Right' | 'Some' | 'Lambda_rec';
|
|
72
|
+
type Data0<PT extends MichelsonDataID> = Prim0<PT>;
|
|
73
|
+
type DataX<PT extends MichelsonDataID, AT extends MichelsonData[]> = PrimX<PT, AT>;
|
|
74
|
+
export type MichelsonDataOption = DataX<'Some', [MichelsonData]> | Data0<'None'>;
|
|
75
|
+
export type MichelsonDataOr = DataX<'Left' | 'Right', [MichelsonData]>;
|
|
76
|
+
type DataList<T extends MichelsonData[]> = T & Node;
|
|
77
|
+
export type MichelsonDataPair<T extends MichelsonData[]> = DataX<'Pair', T> | DataList<T>;
|
|
78
|
+
export type MichelsonMapElt = PrimX<'Elt', [MichelsonData, MichelsonData]>;
|
|
79
|
+
export type MichelsonMapEltList = List<MichelsonMapElt>;
|
|
80
|
+
export type MichelsonLambdaRec = DataX<'Lambda_rec', [InstructionList]>;
|
|
81
|
+
export type MichelsonData = IntLiteral | StringLiteral | BytesLiteral | Data0<'Unit' | 'True' | 'False'> | MichelsonDataOption | MichelsonDataOr | DataList<MichelsonData[]> | MichelsonDataPair<MichelsonData[]> | InstructionList | MichelsonMapEltList | MichelsonLambdaRec;
|
|
82
|
+
export type MichelsonSectionID = 'parameter' | 'storage' | 'code' | 'view';
|
|
83
|
+
type SectionPrim<PT extends MichelsonSectionID, AT extends Expr[]> = PrimX<PT, AT>;
|
|
84
|
+
export type MichelsonContractParameter = SectionPrim<'parameter', [MichelsonType]>;
|
|
85
|
+
export type MichelsonContractStorage = SectionPrim<'storage', [MichelsonType]>;
|
|
86
|
+
export type MichelsonContractCode = SectionPrim<'code', [InstructionList]>;
|
|
87
|
+
export type MichelsonContractView = SectionPrim<'view', [
|
|
88
|
+
StringLiteral,
|
|
89
|
+
MichelsonType,
|
|
90
|
+
MichelsonType,
|
|
91
|
+
InstructionList
|
|
92
|
+
]>;
|
|
93
|
+
export type MichelsonContract = MichelsonContractSection[];
|
|
94
|
+
export type MichelsonContractSection<T extends MichelsonSectionID = MichelsonSectionID> = T extends 'parameter' ? MichelsonContractParameter : T extends 'storage' ? MichelsonContractStorage : T extends 'view' ? MichelsonContractView : MichelsonContractCode;
|
|
95
|
+
export interface MichelsonTypeFailed {
|
|
96
|
+
failed: MichelsonType;
|
|
97
|
+
level: number;
|
|
98
|
+
}
|
|
99
|
+
export type MichelsonReturnType = MichelsonType[] | MichelsonTypeFailed;
|
|
100
|
+
export declare enum Protocol {
|
|
101
|
+
Ps9mPmXa = "Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P",
|
|
102
|
+
PtCJ7pwo = "PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY",
|
|
103
|
+
PsYLVpVv = "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
|
|
104
|
+
PsddFKi3 = "PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",
|
|
105
|
+
Pt24m4xi = "Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",
|
|
106
|
+
PsBABY5H = "PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",
|
|
107
|
+
PsBabyM1 = "PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",
|
|
108
|
+
PsCARTHA = "PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",
|
|
109
|
+
PsDELPH1 = "PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",
|
|
110
|
+
PtEdoTez = "PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq",
|
|
111
|
+
PtEdo2Zk = "PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",
|
|
112
|
+
PsFLorena = "PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",
|
|
113
|
+
PtGRANADs = "PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",
|
|
114
|
+
PtHangzH = "PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r",
|
|
115
|
+
PtHangz2 = "PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",
|
|
116
|
+
PsiThaCa = "PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",
|
|
117
|
+
Psithaca2 = "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",
|
|
118
|
+
PtJakarta = "PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw",
|
|
119
|
+
PtJakart2 = "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",
|
|
120
|
+
PtKathman = "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",
|
|
121
|
+
PtLimaPtL = "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",
|
|
122
|
+
PtMumbaii = "PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",
|
|
123
|
+
PtMumbai2 = "PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",
|
|
124
|
+
PtNairobi = "PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",
|
|
125
|
+
ProxfordY = "ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH",
|
|
126
|
+
ProtoALpha = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"
|
|
127
|
+
}
|
|
128
|
+
export declare const DefaultProtocol = Protocol.Psithaca2;
|
|
129
|
+
export type ProtocolID = `${Protocol}`;
|
|
130
|
+
export declare function ProtoGreaterOrEqual(a: ProtocolID, b: ProtocolID): boolean;
|
|
131
|
+
export declare function ProtoInferiorTo(a: ProtocolID, b: ProtocolID): boolean;
|
|
132
|
+
export interface ProtocolOptions {
|
|
133
|
+
protocol?: ProtocolID;
|
|
134
|
+
}
|
|
135
|
+
export {};
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { Prim, Expr, StringLiteral } from './micheline';
|
|
2
|
-
import { MichelsonError } from './utils';
|
|
3
|
-
import { MichelsonCode, MichelsonType, MichelsonData, MichelsonContract, MichelsonInstruction, InstructionList } from './michelson-types';
|
|
4
|
-
export declare const instructionIDs: Record<MichelsonInstruction['prim'], true>;
|
|
5
|
-
export declare class MichelsonValidationError extends MichelsonError {
|
|
6
|
-
readonly val: Expr;
|
|
7
|
-
readonly message: string;
|
|
8
|
-
/**
|
|
9
|
-
* @param val Value of a node caused the error
|
|
10
|
-
* @param message An error message
|
|
11
|
-
*/
|
|
12
|
-
constructor(val: Expr, message: string);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Checks if the node is a valid Michelson code (sequence of instructions).
|
|
16
|
-
* This is a type guard function which either returns true of throws an exception.
|
|
17
|
-
* @param ex An AST node
|
|
18
|
-
*/
|
|
19
|
-
export declare function assertMichelsonInstruction(ex: Expr): ex is MichelsonCode;
|
|
20
|
-
export declare function assertMichelsonComparableType(ex: Expr): ex is MichelsonType;
|
|
21
|
-
export declare function assertMichelsonPackableType(ex: Expr): ex is MichelsonType;
|
|
22
|
-
export declare function assertMichelsonPushableType(ex: Expr): ex is MichelsonType;
|
|
23
|
-
export declare function assertMichelsonStorableType(ex: Expr): ex is MichelsonType;
|
|
24
|
-
export declare function assertMichelsonPassableType(ex: Expr): ex is MichelsonType;
|
|
25
|
-
export declare function assertMichelsonBigMapStorableType(ex: Expr): ex is MichelsonType;
|
|
26
|
-
export declare function assertViewNameValid(name: StringLiteral): void;
|
|
27
|
-
/**
|
|
28
|
-
* Checks if the node is a valid Michelson type expression.
|
|
29
|
-
* This is a type guard function which either returns true of throws an exception.
|
|
30
|
-
* @param ex An AST node
|
|
31
|
-
*/
|
|
32
|
-
export declare function assertMichelsonType(ex: Expr): ex is MichelsonType;
|
|
33
|
-
/**
|
|
34
|
-
* Checks if the node is a valid Michelson data literal such as `(Pair {Elt "0" 0} 0)`.
|
|
35
|
-
* This is a type guard function which either returns true of throws an exception.
|
|
36
|
-
* @param ex An AST node
|
|
37
|
-
*/
|
|
38
|
-
export declare function assertMichelsonData(ex: Expr): ex is MichelsonData;
|
|
39
|
-
/**
|
|
40
|
-
* Checks if the node is a valid Michelson smart contract source containing all required and valid properties such as `parameter`, `storage` and `code`.
|
|
41
|
-
* This is a type guard function which either returns true of throws an exception.
|
|
42
|
-
* @param ex An AST node
|
|
43
|
-
*/
|
|
44
|
-
export declare function assertMichelsonContract(ex: Expr): ex is MichelsonContract;
|
|
45
|
-
/**
|
|
46
|
-
* Checks if the node is a valid Michelson smart contract source containing all required and valid properties such as `parameter`, `storage` and `code`.
|
|
47
|
-
* @param ex An AST node
|
|
48
|
-
*/
|
|
49
|
-
export declare function isMichelsonScript(ex: Expr): ex is MichelsonContract;
|
|
50
|
-
/**
|
|
51
|
-
* Checks if the node is a valid Michelson data literal such as `(Pair {Elt "0" 0} 0)`.
|
|
52
|
-
* @param ex An AST node
|
|
53
|
-
*/
|
|
54
|
-
export declare function isMichelsonData(ex: Expr): ex is MichelsonData;
|
|
55
|
-
/**
|
|
56
|
-
* Checks if the node is a valid Michelson code (sequence of instructions).
|
|
57
|
-
* @param ex An AST node
|
|
58
|
-
*/
|
|
59
|
-
export declare function isMichelsonCode(ex: Expr): ex is InstructionList;
|
|
60
|
-
/**
|
|
61
|
-
* Checks if the node is a valid Michelson type expression.
|
|
62
|
-
* @param ex An AST node
|
|
63
|
-
*/
|
|
64
|
-
export declare function isMichelsonType(ex: Expr): ex is MichelsonType;
|
|
65
|
-
export declare function isInstruction(p: Prim): p is MichelsonInstruction;
|
|
66
|
-
export declare function assertDataListIfAny(d: MichelsonData): d is MichelsonData[];
|
|
1
|
+
import { Prim, Expr, StringLiteral } from './micheline';
|
|
2
|
+
import { MichelsonError } from './utils';
|
|
3
|
+
import { MichelsonCode, MichelsonType, MichelsonData, MichelsonContract, MichelsonInstruction, InstructionList } from './michelson-types';
|
|
4
|
+
export declare const instructionIDs: Record<MichelsonInstruction['prim'], true>;
|
|
5
|
+
export declare class MichelsonValidationError extends MichelsonError {
|
|
6
|
+
readonly val: Expr;
|
|
7
|
+
readonly message: string;
|
|
8
|
+
/**
|
|
9
|
+
* @param val Value of a node caused the error
|
|
10
|
+
* @param message An error message
|
|
11
|
+
*/
|
|
12
|
+
constructor(val: Expr, message: string);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Checks if the node is a valid Michelson code (sequence of instructions).
|
|
16
|
+
* This is a type guard function which either returns true of throws an exception.
|
|
17
|
+
* @param ex An AST node
|
|
18
|
+
*/
|
|
19
|
+
export declare function assertMichelsonInstruction(ex: Expr): ex is MichelsonCode;
|
|
20
|
+
export declare function assertMichelsonComparableType(ex: Expr): ex is MichelsonType;
|
|
21
|
+
export declare function assertMichelsonPackableType(ex: Expr): ex is MichelsonType;
|
|
22
|
+
export declare function assertMichelsonPushableType(ex: Expr): ex is MichelsonType;
|
|
23
|
+
export declare function assertMichelsonStorableType(ex: Expr): ex is MichelsonType;
|
|
24
|
+
export declare function assertMichelsonPassableType(ex: Expr): ex is MichelsonType;
|
|
25
|
+
export declare function assertMichelsonBigMapStorableType(ex: Expr): ex is MichelsonType;
|
|
26
|
+
export declare function assertViewNameValid(name: StringLiteral): void;
|
|
27
|
+
/**
|
|
28
|
+
* Checks if the node is a valid Michelson type expression.
|
|
29
|
+
* This is a type guard function which either returns true of throws an exception.
|
|
30
|
+
* @param ex An AST node
|
|
31
|
+
*/
|
|
32
|
+
export declare function assertMichelsonType(ex: Expr): ex is MichelsonType;
|
|
33
|
+
/**
|
|
34
|
+
* Checks if the node is a valid Michelson data literal such as `(Pair {Elt "0" 0} 0)`.
|
|
35
|
+
* This is a type guard function which either returns true of throws an exception.
|
|
36
|
+
* @param ex An AST node
|
|
37
|
+
*/
|
|
38
|
+
export declare function assertMichelsonData(ex: Expr): ex is MichelsonData;
|
|
39
|
+
/**
|
|
40
|
+
* Checks if the node is a valid Michelson smart contract source containing all required and valid properties such as `parameter`, `storage` and `code`.
|
|
41
|
+
* This is a type guard function which either returns true of throws an exception.
|
|
42
|
+
* @param ex An AST node
|
|
43
|
+
*/
|
|
44
|
+
export declare function assertMichelsonContract(ex: Expr): ex is MichelsonContract;
|
|
45
|
+
/**
|
|
46
|
+
* Checks if the node is a valid Michelson smart contract source containing all required and valid properties such as `parameter`, `storage` and `code`.
|
|
47
|
+
* @param ex An AST node
|
|
48
|
+
*/
|
|
49
|
+
export declare function isMichelsonScript(ex: Expr): ex is MichelsonContract;
|
|
50
|
+
/**
|
|
51
|
+
* Checks if the node is a valid Michelson data literal such as `(Pair {Elt "0" 0} 0)`.
|
|
52
|
+
* @param ex An AST node
|
|
53
|
+
*/
|
|
54
|
+
export declare function isMichelsonData(ex: Expr): ex is MichelsonData;
|
|
55
|
+
/**
|
|
56
|
+
* Checks if the node is a valid Michelson code (sequence of instructions).
|
|
57
|
+
* @param ex An AST node
|
|
58
|
+
*/
|
|
59
|
+
export declare function isMichelsonCode(ex: Expr): ex is InstructionList;
|
|
60
|
+
/**
|
|
61
|
+
* Checks if the node is a valid Michelson type expression.
|
|
62
|
+
* @param ex An AST node
|
|
63
|
+
*/
|
|
64
|
+
export declare function isMichelsonType(ex: Expr): ex is MichelsonType;
|
|
65
|
+
export declare function isInstruction(p: Prim): p is MichelsonInstruction;
|
|
66
|
+
export declare function assertDataListIfAny(d: MichelsonData): d is MichelsonData[];
|
package/dist/types/scan.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { TaquitoError } from '@taquito/core';
|
|
2
|
-
/**
|
|
3
|
-
* @category Error
|
|
4
|
-
* @description Error that indicates a failure when performing the scan step when parsing Michelson
|
|
5
|
-
*/
|
|
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);
|
|
11
|
-
}
|
|
12
|
-
export declare enum Literal {
|
|
13
|
-
Comment = 0,
|
|
14
|
-
Number = 1,
|
|
15
|
-
String = 2,
|
|
16
|
-
Bytes = 3,
|
|
17
|
-
Ident = 4
|
|
18
|
-
}
|
|
19
|
-
export
|
|
20
|
-
export interface Token {
|
|
21
|
-
t: TokenType;
|
|
22
|
-
v: string;
|
|
23
|
-
first: number;
|
|
24
|
-
last: number;
|
|
25
|
-
}
|
|
26
|
-
export declare function scan(src: string, scanComments?: boolean): Generator<Token, void>;
|
|
1
|
+
import { TaquitoError } from '@taquito/core';
|
|
2
|
+
/**
|
|
3
|
+
* @category Error
|
|
4
|
+
* @description Error that indicates a failure when performing the scan step when parsing Michelson
|
|
5
|
+
*/
|
|
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);
|
|
11
|
+
}
|
|
12
|
+
export declare enum Literal {
|
|
13
|
+
Comment = 0,
|
|
14
|
+
Number = 1,
|
|
15
|
+
String = 2,
|
|
16
|
+
Bytes = 3,
|
|
17
|
+
Ident = 4
|
|
18
|
+
}
|
|
19
|
+
export type TokenType = '(' | ')' | '{' | '}' | ';' | Literal;
|
|
20
|
+
export interface Token {
|
|
21
|
+
t: TokenType;
|
|
22
|
+
v: string;
|
|
23
|
+
first: number;
|
|
24
|
+
last: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function scan(src: string, scanComments?: boolean): Generator<Token, void>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* @module @taquito/michel-codec
|
|
4
|
-
*/
|
|
5
|
-
export * from './micheline';
|
|
6
|
-
export * from './micheline-parser';
|
|
7
|
-
export * from './micheline-emitter';
|
|
8
|
-
export * from './michelson-validator';
|
|
9
|
-
export * from './michelson-types';
|
|
10
|
-
export * from './michelson-typecheck';
|
|
11
|
-
export * from './michelson-contract';
|
|
12
|
-
export * from './formatters';
|
|
13
|
-
export * from './binary';
|
|
14
|
-
export { MichelsonError, isMichelsonError, MichelsonTypeError } from './utils';
|
|
15
|
-
export { MacroError } from './macros';
|
|
16
|
-
export { VERSION } from './version';
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @module @taquito/michel-codec
|
|
4
|
+
*/
|
|
5
|
+
export * from './micheline';
|
|
6
|
+
export * from './micheline-parser';
|
|
7
|
+
export * from './micheline-emitter';
|
|
8
|
+
export * from './michelson-validator';
|
|
9
|
+
export * from './michelson-types';
|
|
10
|
+
export * from './michelson-typecheck';
|
|
11
|
+
export * from './michelson-contract';
|
|
12
|
+
export * from './formatters';
|
|
13
|
+
export * from './binary';
|
|
14
|
+
export { MichelsonError, isMichelsonError, MichelsonTypeError } from './utils';
|
|
15
|
+
export { MacroError } from './macros';
|
|
16
|
+
export { VERSION } from './version';
|