@helios-lang/contract-utils 0.3.21 → 0.3.22
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/README.md +46 -0
- package/package.json +9 -4
- package/src/artifacts/ChildArtifactWriter.js +18 -0
- package/src/artifacts/RootArtifact.js +8 -0
- package/src/cli/compile.js +211 -0
- package/src/cli/config.mjs +158 -0
- package/src/cli/login.mjs +117 -0
- package/src/cli/project.mjs +67 -0
- package/src/codegen/LoadedScriptsWriter.js +20 -3
- package/src/context/ContractContextBuilder.js +34 -1
- package/src/context/debugger.js +46 -0
- package/src/helios.mjs +47 -0
- package/src/hl2ts.js +5 -185
- package/src/index.js +10 -1
- package/types/artifacts/ChildArtifactWriter.d.ts.map +1 -1
- package/types/artifacts/RootArtifact.d.ts.map +1 -1
- package/types/cli/compile.d.ts +9 -0
- package/types/cli/compile.d.ts.map +1 -0
- package/types/cli/config.d.mts +4 -0
- package/types/cli/config.d.mts.map +1 -0
- package/types/cli/project.d.mts +11 -0
- package/types/cli/project.d.mts.map +1 -0
- package/types/codegen/LoadedScriptsWriter.d.ts +2 -1
- package/types/codegen/LoadedScriptsWriter.d.ts.map +1 -1
- package/types/context/ContractContextBuilder.d.ts.map +1 -1
- package/types/context/debugger.d.ts +9 -0
- package/types/context/debugger.d.ts.map +1 -0
- package/types/hl2ts.d.ts +1 -6
- package/types/hl2ts.d.ts.map +1 -1
- package/types/index.d.ts +18 -1
- package/types/index.d.ts.map +1 -1
- package/types/cast/PermissiveType.d.ts +0 -4
- package/types/cast/PermissiveType.d.ts.map +0 -1
- package/types/cast/StrictType.d.ts +0 -4
- package/types/cast/StrictType.d.ts.map +0 -1
- package/types/codegen/LoadedModule.d.ts +0 -17
- package/types/codegen/LoadedModule.d.ts.map +0 -1
- package/types/codegen/LoadedValidator.d.ts +0 -38
- package/types/codegen/LoadedValidator.d.ts.map +0 -1
- package/types/codegen/Module.d.ts +0 -24
- package/types/codegen/Module.d.ts.map +0 -1
- package/types/codegen/TypeCheckedModule.d.ts +0 -24
- package/types/codegen/TypeCheckedModule.d.ts.map +0 -1
- package/types/codegen/TypeCheckedValidator.d.ts +0 -9
- package/types/codegen/TypeCheckedValidator.d.ts.map +0 -1
- package/types/codegen/TypescriptWriter.d.ts +0 -50
- package/types/codegen/TypescriptWriter.d.ts.map +0 -1
- package/types/codegen/Validator.d.ts +0 -22
- package/types/codegen/Validator.d.ts.map +0 -1
- package/types/codegen/Writer.d.ts +0 -23
- package/types/codegen/Writer.d.ts.map +0 -1
- package/types/context/ContractContext.d.ts +0 -53
- package/types/context/ContractContext.d.ts.map +0 -1
- package/types/context/writeContractContextArtifacts.d.ts +0 -30
- package/types/context/writeContractContextArtifacts.d.ts.map +0 -1
- package/types/lib/Lib.d.ts +0 -41
- package/types/lib/Lib.d.ts.map +0 -1
- package/types/lib/Libg_v0_16.d.ts +0 -256
- package/types/lib/Libg_v0_16.d.ts.map +0 -1
- package/types/lib/index.d.ts +0 -3
- package/types/lib/index.d.ts.map +0 -1
- package/types/lib/load.d.ts +0 -6
- package/types/lib/load.d.ts.map +0 -1
- package/types/runtime/Cast.d.ts +0 -32
- package/types/runtime/Cast.d.ts.map +0 -1
- package/types/runtime/ContractContext.d.ts +0 -23
- package/types/runtime/ContractContext.d.ts.map +0 -1
- package/types/runtime/ContractContextBuilder.d.ts +0 -53
- package/types/runtime/ContractContextBuilder.d.ts.map +0 -1
- package/types/runtime/DagCompiler.d.ts +0 -64
- package/types/runtime/DagCompiler.d.ts.map +0 -1
- package/types/runtime/PermissiveType.d.ts +0 -3
- package/types/runtime/PermissiveType.d.ts.map +0 -1
- package/types/runtime/StrictType.d.ts +0 -3
- package/types/runtime/StrictType.d.ts.map +0 -1
- package/types/runtime/index.d.ts +0 -2
- package/types/runtime/index.d.ts.map +0 -1
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import("../codegen/index.js").TypeCheckedModule} ModuleDetails
|
|
3
|
-
* @typedef {import("../codegen/index.js").TypeCheckedValidator} ValidatorDetails
|
|
4
|
-
* @typedef {import("../codegen/index.js").TypeSchema} InternalTypeDetails
|
|
5
|
-
* @typedef {import("./Lib.js").CompileOptions} CompileOptions
|
|
6
|
-
* @typedef {import("./Lib.js").CompileOutput} CompileOutput
|
|
7
|
-
* @typedef {import("./Lib.js").Lib} Lib
|
|
8
|
-
* @typedef {import("./Lib.js").SourceDetails} SourceDetails
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* @typedef {{
|
|
12
|
-
* [name: string]: string[]
|
|
13
|
-
* }} DagDependencies
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* @typedef {{
|
|
17
|
-
* }} ScriptHashType
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* @typedef {{
|
|
21
|
-
* includes: (m: string) => boolean
|
|
22
|
-
* }} IR
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* @typedef {{
|
|
26
|
-
* name: string
|
|
27
|
-
* }} EnumStatement
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* @typedef {{
|
|
31
|
-
* name: string
|
|
32
|
-
* }} StructStatement
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* @typedef {StructStatement | EnumStatement | any} Statement
|
|
36
|
-
*/
|
|
37
|
-
/**
|
|
38
|
-
* @typedef {{
|
|
39
|
-
* name: {value: string}
|
|
40
|
-
* filterDependencies: (all: Module[]) => Module[]
|
|
41
|
-
* statements: Statement[]
|
|
42
|
-
* }} Module
|
|
43
|
-
*/
|
|
44
|
-
/**
|
|
45
|
-
* @typedef {{
|
|
46
|
-
* name: string
|
|
47
|
-
* toIR: (ctx: any, extra: Map<string, IR>) => IR
|
|
48
|
-
* types: UserTypes
|
|
49
|
-
* mainImportedModules: Module[]
|
|
50
|
-
* mainModule: Module
|
|
51
|
-
* mainArgTypes: DataType[]
|
|
52
|
-
* }} Program
|
|
53
|
-
*/
|
|
54
|
-
/**
|
|
55
|
-
* @typedef {{
|
|
56
|
-
* typeDetails?: TypeDetails
|
|
57
|
-
* }} DataType
|
|
58
|
-
*/
|
|
59
|
-
/**
|
|
60
|
-
* @typedef {{
|
|
61
|
-
* type: string
|
|
62
|
-
* } | {
|
|
63
|
-
* type: "List"
|
|
64
|
-
* itemType: TypeSchema
|
|
65
|
-
* } | {
|
|
66
|
-
* type: "Map"
|
|
67
|
-
* keyType: TypeSchema
|
|
68
|
-
* valueType: TypeSchema
|
|
69
|
-
* } | {
|
|
70
|
-
* type: "Option"
|
|
71
|
-
* someType: TypeSchema
|
|
72
|
-
* } | {
|
|
73
|
-
* type: "Struct"
|
|
74
|
-
* fieldTypes: NamedTypeSchema[]
|
|
75
|
-
* } | {
|
|
76
|
-
* type: "Enum"
|
|
77
|
-
* variantTypes: {name: string, fieldTypes: NamedTypeSchema[]}[]
|
|
78
|
-
* }} TypeSchema
|
|
79
|
-
*/
|
|
80
|
-
/**
|
|
81
|
-
* @typedef {{
|
|
82
|
-
* name: string
|
|
83
|
-
* } & TypeSchema} NamedTypeSchema
|
|
84
|
-
*/
|
|
85
|
-
/**
|
|
86
|
-
* @typedef {{
|
|
87
|
-
* inputType: string
|
|
88
|
-
* outputType: string
|
|
89
|
-
* internalType: TypeSchema
|
|
90
|
-
* }} TypeDetails
|
|
91
|
-
*/
|
|
92
|
-
/**
|
|
93
|
-
* @typedef {{
|
|
94
|
-
* }} UserTypes
|
|
95
|
-
*/
|
|
96
|
-
/**
|
|
97
|
-
* @implements {Lib}
|
|
98
|
-
*/
|
|
99
|
-
export class Lib_v0_16 implements Lib {
|
|
100
|
-
/**
|
|
101
|
-
* @param {any} lib
|
|
102
|
-
*/
|
|
103
|
-
constructor(lib: any);
|
|
104
|
-
lib: any;
|
|
105
|
-
/**
|
|
106
|
-
* @type {string}
|
|
107
|
-
*/
|
|
108
|
-
get version(): string;
|
|
109
|
-
/**
|
|
110
|
-
* @param {string} purpose
|
|
111
|
-
* @returns {ScriptHashType}
|
|
112
|
-
*/
|
|
113
|
-
getScriptHashType(purpose: string): ScriptHashType;
|
|
114
|
-
/**
|
|
115
|
-
* @param {{[name: string]: SourceDetails}} validators
|
|
116
|
-
* @param {{[name: string]: SourceDetails}} modules
|
|
117
|
-
* @returns {{modules: {[name: string]: ModuleDetails}, validators: {[name: string]: ValidatorDetails}}}
|
|
118
|
-
*/
|
|
119
|
-
typeCheck(validators: {
|
|
120
|
-
[name: string]: import("./Lib.js").SourceDetails;
|
|
121
|
-
}, modules: {
|
|
122
|
-
[name: string]: import("./Lib.js").SourceDetails;
|
|
123
|
-
}): {
|
|
124
|
-
modules: {
|
|
125
|
-
[name: string]: import("./Lib.js").TypeCheckedModule;
|
|
126
|
-
};
|
|
127
|
-
validators: {
|
|
128
|
-
[name: string]: import("./Lib.js").TypeCheckedValidator;
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
/**
|
|
132
|
-
* Generate additional IR definitions
|
|
133
|
-
* * dependency on own precalculated hash (eg. unoptimized program should use hash of optimized program)
|
|
134
|
-
* * dependency on own hash through methods defined on the ScriptContext
|
|
135
|
-
* * dependency on hashes of other validators
|
|
136
|
-
* @private
|
|
137
|
-
* @param {string} name - name of the validator being compiled
|
|
138
|
-
* @param {string} purpose - purpose the validator being compiled
|
|
139
|
-
* @param {number} nPosParams
|
|
140
|
-
* @param {CompileOptions} options
|
|
141
|
-
* @returns {Map<string, IR>}
|
|
142
|
-
*/
|
|
143
|
-
private generateExtraIRDefinitions;
|
|
144
|
-
/**
|
|
145
|
-
* @param {string} main
|
|
146
|
-
* @param {string[]} modules
|
|
147
|
-
* @param {CompileOptions} options
|
|
148
|
-
* @returns {CompileOutput}
|
|
149
|
-
*/
|
|
150
|
-
compile(main: string, modules: string[], options: CompileOptions): CompileOutput;
|
|
151
|
-
/**
|
|
152
|
-
* @private
|
|
153
|
-
* @param {SourceDetails[]} validators
|
|
154
|
-
* @param {SourceDetails[]} modules
|
|
155
|
-
* @param {{[name: string]: ScriptHashType}} validatorTypes
|
|
156
|
-
* @returns {Program[]}
|
|
157
|
-
*/
|
|
158
|
-
private createPrograms;
|
|
159
|
-
/**
|
|
160
|
-
* @private
|
|
161
|
-
* @param {Program} program
|
|
162
|
-
* @param {{[name: string]: ScriptHashType}} validatorTypes
|
|
163
|
-
* @returns {IR}
|
|
164
|
-
*/
|
|
165
|
-
private toTestIR;
|
|
166
|
-
/**
|
|
167
|
-
* @private
|
|
168
|
-
* @param {Program[]} validators
|
|
169
|
-
* @param {{[name: string]: ScriptHashType}} validatorTypes
|
|
170
|
-
* @returns {DagDependencies}
|
|
171
|
-
*/
|
|
172
|
-
private buildDagDependencies;
|
|
173
|
-
/**
|
|
174
|
-
* @private
|
|
175
|
-
* @param {TypeSchema} it
|
|
176
|
-
* @returns {InternalTypeDetails}
|
|
177
|
-
*/
|
|
178
|
-
private convertInternalType;
|
|
179
|
-
/**
|
|
180
|
-
* @private
|
|
181
|
-
* @param {DataType} dt
|
|
182
|
-
* @returns {InternalTypeDetails}
|
|
183
|
-
*/
|
|
184
|
-
private getInternalTypeDetails;
|
|
185
|
-
}
|
|
186
|
-
export type ModuleDetails = import("../codegen/index.js").TypeCheckedModule;
|
|
187
|
-
export type ValidatorDetails = import("../codegen/index.js").TypeCheckedValidator;
|
|
188
|
-
export type InternalTypeDetails = import("../codegen/index.js").TypeSchema;
|
|
189
|
-
export type CompileOptions = import("./Lib.js").CompileOptions;
|
|
190
|
-
export type CompileOutput = import("./Lib.js").CompileOutput;
|
|
191
|
-
export type Lib = import("./Lib.js").Lib;
|
|
192
|
-
export type SourceDetails = import("./Lib.js").SourceDetails;
|
|
193
|
-
export type DagDependencies = {
|
|
194
|
-
[name: string]: string[];
|
|
195
|
-
};
|
|
196
|
-
export type ScriptHashType = {};
|
|
197
|
-
export type IR = {
|
|
198
|
-
includes: (m: string) => boolean;
|
|
199
|
-
};
|
|
200
|
-
export type EnumStatement = {
|
|
201
|
-
name: string;
|
|
202
|
-
};
|
|
203
|
-
export type StructStatement = {
|
|
204
|
-
name: string;
|
|
205
|
-
};
|
|
206
|
-
export type Statement = StructStatement | EnumStatement | any;
|
|
207
|
-
export type Module = {
|
|
208
|
-
name: {
|
|
209
|
-
value: string;
|
|
210
|
-
};
|
|
211
|
-
filterDependencies: (all: Module[]) => Module[];
|
|
212
|
-
statements: Statement[];
|
|
213
|
-
};
|
|
214
|
-
export type Program = {
|
|
215
|
-
name: string;
|
|
216
|
-
toIR: (ctx: any, extra: Map<string, IR>) => IR;
|
|
217
|
-
types: UserTypes;
|
|
218
|
-
mainImportedModules: Module[];
|
|
219
|
-
mainModule: Module;
|
|
220
|
-
mainArgTypes: DataType[];
|
|
221
|
-
};
|
|
222
|
-
export type DataType = {
|
|
223
|
-
typeDetails?: TypeDetails;
|
|
224
|
-
};
|
|
225
|
-
export type TypeSchema = {
|
|
226
|
-
type: string;
|
|
227
|
-
} | {
|
|
228
|
-
type: "List";
|
|
229
|
-
itemType: TypeSchema;
|
|
230
|
-
} | {
|
|
231
|
-
type: "Map";
|
|
232
|
-
keyType: TypeSchema;
|
|
233
|
-
valueType: TypeSchema;
|
|
234
|
-
} | {
|
|
235
|
-
type: "Option";
|
|
236
|
-
someType: TypeSchema;
|
|
237
|
-
} | {
|
|
238
|
-
type: "Struct";
|
|
239
|
-
fieldTypes: NamedTypeSchema[];
|
|
240
|
-
} | {
|
|
241
|
-
type: "Enum";
|
|
242
|
-
variantTypes: {
|
|
243
|
-
name: string;
|
|
244
|
-
fieldTypes: NamedTypeSchema[];
|
|
245
|
-
}[];
|
|
246
|
-
};
|
|
247
|
-
export type NamedTypeSchema = {
|
|
248
|
-
name: string;
|
|
249
|
-
} & TypeSchema;
|
|
250
|
-
export type TypeDetails = {
|
|
251
|
-
inputType: string;
|
|
252
|
-
outputType: string;
|
|
253
|
-
internalType: TypeSchema;
|
|
254
|
-
};
|
|
255
|
-
export type UserTypes = {};
|
|
256
|
-
//# sourceMappingURL=Libg_v0_16.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Libg_v0_16.d.ts","sourceRoot":"","sources":["../../src/lib/Libg_v0_16.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;GAEG;AAEH;;;;;;GAMG;AACH;;;;;;;;;GASG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;GAIG;AAEH;;;;;;GAMG;AAEH;;;GAGG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,iBAFW,GAAG,EAIb;IADG,SAAc;IAGlB;;OAEG;IACH,sBAEC;IAED;;;OAGG;IACH,2BAHW,MAAM,GACJ,cAAc,CAa1B;IAED;;;;OAIG;IACH;;;;;;;;;;;MAuEC;IAED;;;;;;;;;;;OAWG;IACH,mCAoDC;IAED;;;;;OAKG;IACH,cALW,MAAM,WACN,MAAM,EAAE,WACR,cAAc,GACZ,aAAa,CAyCzB;IAED;;;;;;OAMG;IACH,uBAcC;IAED;;;;;OAKG;IACH,iBAWC;IAED;;;;;OAKG;IACH,6BAeC;IAED;;;;OAIG;IACH,4BA8BC;IAED;;;;OAIG;IACH,+BAYC;CACJ;4BArcY,OAAO,qBAAqB,EAAE,iBAAiB;+BAC/C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,UAAU;6BACxC,OAAO,UAAU,EAAE,cAAc;4BACjC,OAAO,UAAU,EAAE,aAAa;kBAChC,OAAO,UAAU,EAAE,GAAG;4BACtB,OAAO,UAAU,EAAE,aAAa;;;;6BAUhC,EACT;;kBAKe,MAAM,KAAK,OAAO;;4BAKxB;IACZ,MAAU,MAAM,CAAA;CACb;8BAIS;IACZ,MAAU,MAAM,CAAA;CACb;wBAIS,eAAe,GAAG,aAAa,GAAG,GAAG;;UAKvC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC;8BACK,MAAM,EAAE,KAAK,MAAM,EAAE;gBACnC,SAAS,EAAE;;;UAKjB,MAAM;gBACA,GAAG,SAAS,IAAI,MAAM,EAAE,EAAE,CAAC,KAAK,EAAE;WACvC,SAAS;yBACK,MAAM,EAAE;gBACjB,MAAM;kBACJ,QAAQ,EAAE;;uBAKhB;IACZ,WAAe,CAAC,EAAE,WAAW,CAAA;CAC1B;yBAIS;IACZ,IAAQ,EAAG,MAAM,CAAA;CACd,GAAG;IACN,IAAQ,EAAM,MAAM,CAAA;IACpB,QAAY,EAAE,UAAU,CAAA;CACrB,GAAG;IACN,IAAQ,EAAO,KAAK,CAAA;IACpB,OAAW,EAAI,UAAU,CAAA;IACzB,SAAa,EAAE,UAAU,CAAA;CACtB,GAAG;IACN,IAAQ,EAAM,QAAQ,CAAA;IACtB,QAAY,EAAE,UAAU,CAAA;CACrB,GAAG;IACN,IAAQ,EAAQ,QAAQ,CAAA;IACxB,UAAc,EAAE,eAAe,EAAE,CAAA;CAC9B,GAAG;IACN,IAAQ,EAAU,MAAM,CAAA;IACxB,YAAgB,EAAE;QAAC,MAAM,MAAM,CAAC;QAAC,UAAU,EAAE,eAAe,EAAE,CAAA;KAAC,EAAE,CAAA;CAC9D;8BAIS;IACZ,MAAU,MAAM,CAAA;CACb,GAAG,UAAU;0BAIJ;IACZ,SAAa,EAAE,MAAM,CAAA;IACrB,UAAc,EAAE,MAAM,CAAA;IACtB,YAAgB,EAAE,UAAU,CAAA;CACzB;wBAIS,EACT"}
|
package/types/lib/index.d.ts
DELETED
package/types/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.js"],"names":[],"mappings":";kBAGa,OAAO,UAAU,EAAE,GAAG"}
|
package/types/lib/load.d.ts
DELETED
package/types/lib/load.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/lib/load.js"],"names":[],"mappings":"AAeA;;GAEG;AACH,+BAFa,GAAG,CAcf;kBA1BY,OAAO,UAAU,EAAE,GAAG"}
|
package/types/runtime/Cast.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import("@helios-lang/uplc").UplcData} UplcData
|
|
3
|
-
* @typedef {import("../codegen/index.js").TypeSchema} TypeSchema
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @template [TStrict=UplcData]
|
|
7
|
-
* @template [TPermissive=UplcData]
|
|
8
|
-
*/
|
|
9
|
-
export class Cast<TStrict = import("@helios-lang/ledger").UplcData, TPermissive = import("@helios-lang/ledger").UplcData> {
|
|
10
|
-
/**
|
|
11
|
-
* @param {TypeSchema} schema
|
|
12
|
-
*/
|
|
13
|
-
constructor(schema: TypeSchema);
|
|
14
|
-
/**
|
|
15
|
-
* @readonly
|
|
16
|
-
* @type {TypeSchema}
|
|
17
|
-
*/
|
|
18
|
-
readonly schema: TypeSchema;
|
|
19
|
-
/**
|
|
20
|
-
* @param {UplcData} data
|
|
21
|
-
* @returns {TStrict}
|
|
22
|
-
*/
|
|
23
|
-
fromUplcData(data: UplcData): TStrict;
|
|
24
|
-
/**
|
|
25
|
-
* @param {TPermissive} x
|
|
26
|
-
* @returns {UplcData}
|
|
27
|
-
*/
|
|
28
|
-
toUplcData(x: TPermissive): UplcData;
|
|
29
|
-
}
|
|
30
|
-
export type UplcData = import("@helios-lang/uplc").UplcData;
|
|
31
|
-
export type TypeSchema = import("../codegen/index.js").TypeSchema;
|
|
32
|
-
//# sourceMappingURL=Cast.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Cast.d.ts","sourceRoot":"","sources":["../../src/runtime/Cast.js"],"names":[],"mappings":"AAgCA;;;GAGG;AAEH;;;GAGG;AACH;IAOI;;OAEG;IACH,oBAFW,UAAU,EAIpB;IAXD;;;OAGG;IACH,iBAFU,UAAU,CAEd;IASN;;;OAGG;IACH,mBAHW,QAAQ,GACN,OAAO,CAInB;IAED;;;OAGG;IACH,cAHW,WAAW,GACT,QAAQ,CAIpB;CACJ;uBArCY,OAAO,mBAAmB,EAAE,QAAQ;yBACpC,OAAO,qBAAqB,EAAE,UAAU"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export type LoadedValidator = import("../codegen/index.js").LoadedValidator;
|
|
2
|
-
export type MintingContext<TRedeemerStrict, TRedeemerPermissive> = import("@helios-lang/ledger").MintingContext<TRedeemerStrict, TRedeemerPermissive>;
|
|
3
|
-
export type SpendingContext<TDatumStrict, TDatumPermissive, TRedeemerStrict, TRedeemerPermissive> = import("@helios-lang/ledger").SpendingContext<TDatumStrict, TDatumPermissive, TRedeemerStrict, TRedeemerPermissive>;
|
|
4
|
-
export type StakingContext<TRedeemerStrict, TRedeemerPermissive> = import("@helios-lang/ledger").StakingContext<TRedeemerStrict, TRedeemerPermissive>;
|
|
5
|
-
export type PermissiveType<C extends Cast<any, any>> = import("../cast/index.js").PermissiveType<C>;
|
|
6
|
-
export type StrictType<C extends Cast<any, any>> = import("../cast/index.js").StrictType<C>;
|
|
7
|
-
export type AnyContractValidatorHash = (ValidatorHash<SpendingContext<any, any, any, any>> | MintingPolicyHash<MintingContext<any, any>> | StakingValidatorHash<StakingContext<any, any>>);
|
|
8
|
-
export type ContractValidatorHash<V extends import("../codegen/LoadedValidator.js").LoadedValidator> = V extends {
|
|
9
|
-
"$purpose": "spending";
|
|
10
|
-
"$Datum": Cast;
|
|
11
|
-
} ? ValidatorHash<SpendingContext<StrictType<V["$Datum"]>, PermissiveType<V["$Datum"]>, StrictType<V["$Redeemer"]>, PermissiveType<V["$Redeemer"]>>> : V extends {
|
|
12
|
-
"$purpose": "minting";
|
|
13
|
-
} ? MintingPolicyHash<MintingContext<StrictType<V["$Redeemer"]>, PermissiveType<V["$Redeemer"]>>> : V extends {
|
|
14
|
-
"$purpose": ("certifying" | "rewarding");
|
|
15
|
-
} ? StakingValidatorHash<StakingContext<StrictType<V["$Redeemer"]>, PermissiveType<V["$Redeemer"]>>> : never;
|
|
16
|
-
export type ContractContext<T extends {
|
|
17
|
-
[name: string]: import("../codegen/LoadedValidator.js").LoadedValidator;
|
|
18
|
-
}> = { [K in keyof T]: ContractValidatorHash<T[K]>; };
|
|
19
|
-
import { Cast } from "../cast/index.js";
|
|
20
|
-
import { ValidatorHash } from "@helios-lang/ledger";
|
|
21
|
-
import { MintingPolicyHash } from "@helios-lang/ledger";
|
|
22
|
-
import { StakingValidatorHash } from "@helios-lang/ledger";
|
|
23
|
-
//# sourceMappingURL=ContractContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContractContext.d.ts","sourceRoot":"","sources":["../../src/runtime/ContractContext.js"],"names":[],"mappings":"8BAQa,OAAO,qBAAqB,EAAE,eAAe;mEAM7C,OAAO,qBAAqB,EAAE,cAAc,CAAC,eAAe,EAAE,mBAAmB,CAAC;oGAQlF,OAAO,qBAAqB,EAAE,eAAe,CAAC,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,CAAC;mEAMnH,OAAO,qBAAqB,EAAE,cAAc,CAAC,eAAe,EAAE,mBAAmB,CAAC;uDAKlF,OAAO,kBAAkB,EAAE,cAAc,CAAC,CAAC,CAAC;mDAK5C,OAAO,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;uCAIxC,CACZ,cAAkB,gBAAgB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,GACtD,kBAAsB,eAAe,GAAG,EAAE,GAAG,CAAC,CAAC,GAC/C,qBAAyB,eAAe,GAAG,EAAE,GAAG,CAAC,CAAC,CAC/C;uGAKS,CAAC,SAAS;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,IAAI,CAAA;CAAC,GAAG,cACjE,gBACA,WAAqB,CAAC,CAAC,QAAQ,CAAC,CAAC,EACjC,eAAyB,CAAC,CAAC,QAAQ,CAAC,CAAC,EACrC,WAAqB,CAAC,CAAC,WAAW,CAAC,CAAC,EACpC,eAAyB,CAAC,CAAC,WAAW,CAAC,CAAC,CAC/B,CACF,GACP,CAAO,SAAS;IAAC,UAAU,EAAE,SAAS,CAAA;CAAC,GAAG,kBAC1C,eACA,WAAqB,CAAC,CAAC,WAAW,CAAC,CAAC,EACpC,eAAyB,CAAC,CAAC,WAAW,CAAC,CAAC,CAC/B,CACF,GACP,CAAO,SAAS;IAAC,UAAU,EAAE,CAAC,YAAY,GAAG,WAAW,CAAC,CAAA;CAAC,GAAG,qBAC7D,eACA,WAAqB,CAAC,CAAC,WAAW,CAAC,CAAC,EACpC,eAAyB,CAAC,CAAC,WAAW,CAAC,CAAC,CAC/B,CACF,GAAG,KAAK;;;;qBAjEK,kBAAkB;8BADhC,qBAAqB;kCAArB,qBAAqB;qCAArB,qBAAqB"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import("../codegen/LoadedModule.js").LoadedModule} LoadedModule
|
|
3
|
-
* @typedef {import("../codegen/LoadedValidator.js").LoadedValidator} LoadedValidator
|
|
4
|
-
* @typedef {import("../lib/index.js").Lib} Lib
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @template {{[name: string]: LoadedValidator}} T
|
|
8
|
-
* @typedef {import("./ContractContext.js").ContractContext<T>} ContractContext
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* @template {{[name: string]: LoadedValidator}} T
|
|
12
|
-
*/
|
|
13
|
-
export class ContractContextBuilder<T extends {
|
|
14
|
-
[name: string]: import("./DagCompiler.js").LoadedValidator;
|
|
15
|
-
}> {
|
|
16
|
-
/**
|
|
17
|
-
* @returns {ContractContextBuilder<{}>}
|
|
18
|
-
*/
|
|
19
|
-
static "new"(): ContractContextBuilder<{}>;
|
|
20
|
-
/**
|
|
21
|
-
* @private
|
|
22
|
-
* @param {T} validators
|
|
23
|
-
*/
|
|
24
|
-
private constructor();
|
|
25
|
-
/**
|
|
26
|
-
* @private
|
|
27
|
-
* @readonly
|
|
28
|
-
* @type {T}
|
|
29
|
-
*/
|
|
30
|
-
private readonly validators;
|
|
31
|
-
/**
|
|
32
|
-
* @template {LoadedValidator} V
|
|
33
|
-
* @param {V} validator
|
|
34
|
-
* @returns {ContractContextBuilder<T & {
|
|
35
|
-
* [K in V["$name"]]: V
|
|
36
|
-
* }>}
|
|
37
|
-
*/
|
|
38
|
-
with<V extends import("./DagCompiler.js").LoadedValidator>(validator: V): ContractContextBuilder<T & { [K in V["$name"]]: V; }>;
|
|
39
|
-
/**
|
|
40
|
-
* @param {Option<{[name: string]: string}>} expectedHashes
|
|
41
|
-
* @returns {ContractContext<T>}
|
|
42
|
-
*/
|
|
43
|
-
build(expectedHashes?: Option<{
|
|
44
|
-
[name: string]: string;
|
|
45
|
-
}>): ContractContext<T>;
|
|
46
|
-
}
|
|
47
|
-
export type LoadedModule = import("../codegen/LoadedModule.js").LoadedModule;
|
|
48
|
-
export type LoadedValidator = import("../codegen/LoadedValidator.js").LoadedValidator;
|
|
49
|
-
export type Lib = import("../lib/index.js").Lib;
|
|
50
|
-
export type ContractContext<T extends {
|
|
51
|
-
[name: string]: import("./DagCompiler.js").LoadedValidator;
|
|
52
|
-
}> = import("./ContractContext.js").ContractContext<T>;
|
|
53
|
-
//# sourceMappingURL=ContractContextBuilder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContractContextBuilder.d.ts","sourceRoot":"","sources":["../../src/runtime/ContractContextBuilder.js"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH;;;GAGG;AAEH;;GAEG;AACH;;;IAgBI;;OAEG;IACH,gBAFa,uBAAuB,EAAE,CAAC,CAItC;IAbD;;;OAGG;IACH,sBAEC;IAbD;;;;OAIG;IACH,4BAAU;IAiBV;;;;;;OAMG;IACH,gIAKC;IAED;;;OAGG;IACH;;SAFa,gBAAgB,CAAC,CAAC,CAU9B;CACJ;2BA/DY,OAAO,4BAA4B,EAAE,YAAY;8BACjD,OAAO,+BAA+B,EAAE,eAAe;kBACvD,OAAO,iBAAiB,EAAE,GAAG;;;KAK7B,OAAO,sBAAsB,EAAE,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {LoadedValidator} validator
|
|
3
|
-
* @returns {string[]}
|
|
4
|
-
*/
|
|
5
|
-
export function getModuleDependencies(validator: LoadedValidator): string[];
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {import("../codegen/LoadedValidator.js").LoadedValidator} LoadedValidator
|
|
8
|
-
* @typedef {import("../lib/index.js").Lib} Lib
|
|
9
|
-
* @typedef {import("./ContractContext.js").AnyContractValidatorHash} AnyContractValidatorHash
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Compiles a set of validators that depend on eachothers hashes (forming a Directed Acyclical Graph)
|
|
13
|
-
*/
|
|
14
|
-
export class DagCompiler {
|
|
15
|
-
/**
|
|
16
|
-
* @param {Lib} lib
|
|
17
|
-
*/
|
|
18
|
-
constructor(lib: Lib);
|
|
19
|
-
/**
|
|
20
|
-
* @private
|
|
21
|
-
* @readonly
|
|
22
|
-
* @type {Lib}
|
|
23
|
-
*/
|
|
24
|
-
private readonly lib;
|
|
25
|
-
/**
|
|
26
|
-
* @private
|
|
27
|
-
* @readonly
|
|
28
|
-
* @type {{[name: string]: AnyContractValidatorHash}}
|
|
29
|
-
*/
|
|
30
|
-
private readonly cache;
|
|
31
|
-
/**
|
|
32
|
-
* @param {LoadedValidator[]} validators
|
|
33
|
-
* @param {Option<{[name: string]: string}>} expectedHashes
|
|
34
|
-
* @returns {{[name: string]: AnyContractValidatorHash}}
|
|
35
|
-
*/
|
|
36
|
-
build(validators: LoadedValidator[], expectedHashes?: Option<{
|
|
37
|
-
[name: string]: string;
|
|
38
|
-
}>): {
|
|
39
|
-
[name: string]: import("./ContractContext.js").AnyContractValidatorHash;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* @private
|
|
43
|
-
* @param {LoadedValidator} validator
|
|
44
|
-
* @param {UplcProgramV2} program
|
|
45
|
-
* @param {string} hash - although this can be derived from `program`, reuse this to save some effort
|
|
46
|
-
*/
|
|
47
|
-
private addToCache;
|
|
48
|
-
/**
|
|
49
|
-
* @private
|
|
50
|
-
* @param {LoadedValidator} validator
|
|
51
|
-
* @returns {{[name: string]: string}} - TODO: do we really need the purpose?
|
|
52
|
-
*/
|
|
53
|
-
private getHashDependencies;
|
|
54
|
-
/**
|
|
55
|
-
* @private
|
|
56
|
-
* @param {LoadedValidator[]} validators
|
|
57
|
-
* @returns {{[name: string]: any}}
|
|
58
|
-
*/
|
|
59
|
-
private getHashTypes;
|
|
60
|
-
}
|
|
61
|
-
export type LoadedValidator = import("../codegen/LoadedValidator.js").LoadedValidator;
|
|
62
|
-
export type Lib = import("../lib/index.js").Lib;
|
|
63
|
-
export type AnyContractValidatorHash = import("./ContractContext.js").AnyContractValidatorHash;
|
|
64
|
-
//# sourceMappingURL=DagCompiler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DagCompiler.d.ts","sourceRoot":"","sources":["../../src/runtime/DagCompiler.js"],"names":[],"mappings":"AA4MA;;;GAGG;AACH,iDAHW,eAAe,GACb,MAAM,EAAE,CAsBpB;AA3ND;;;;GAIG;AAEH;;GAEG;AACH;IAeI;;OAEG;IACH,iBAFW,GAAG,EAKb;IApBD;;;;OAIG;IACH,qBAAG;IAEH;;;;OAIG;IACH,uBAAK;IAUL;;;;OAIG;IACH,kBAJW,eAAe,EAAE;;;;MAkF3B;IAED;;;;;OAKG;IACH,mBA6BC;IAED;;;;OAIG;IACH,4BAoBC;IAED;;;;OAIG;IACH,qBAMC;CACJ;8BAhMY,OAAO,+BAA+B,EAAE,eAAe;kBACvD,OAAO,iBAAiB,EAAE,GAAG;uCAC7B,OAAO,sBAAsB,EAAE,wBAAwB"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export type PermissiveType<C extends Cast<import("@helios-lang/uplc/types/data/UplcData.js").UplcData, import("@helios-lang/uplc/types/data/UplcData.js").UplcData>> = C extends Cast<any, infer TPermissive> ? TPermissive : never;
|
|
2
|
-
import { Cast } from "../cast/Cast.js";
|
|
3
|
-
//# sourceMappingURL=PermissiveType.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PermissiveType.d.ts","sourceRoot":"","sources":["../../src/runtime/PermissiveType.js"],"names":[],"mappings":";qBAAqB,WAAW"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export type StrictType<C extends Cast<import("@helios-lang/uplc/types/data/UplcData.js").UplcData, import("@helios-lang/uplc/types/data/UplcData.js").UplcData>> = C extends Cast<infer TStrict, any> ? TStrict : never;
|
|
2
|
-
import { Cast } from "../cast/Cast.js";
|
|
3
|
-
//# sourceMappingURL=StrictType.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StrictType.d.ts","sourceRoot":"","sources":["../../src/runtime/StrictType.js"],"names":[],"mappings":";qBAAqB,WAAW"}
|
package/types/runtime/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.js"],"names":[],"mappings":""}
|