@helios-lang/contract-utils 0.1.19 → 0.1.23
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/examples/multi-validator/README.md +5 -0
- package/examples/{spending → multi-validator}/contract.js +7 -2
- package/examples/{spending → multi-validator}/index.d.ts +1 -1
- package/examples/{spending → multi-validator}/index.js +3 -3
- package/examples/{spending → multi-validator}/spending.hl +3 -2
- package/package.json +6 -6
- package/src/{runtime → cast}/Cast.js +31 -8
- package/src/cast/index.js +12 -0
- package/src/codegen/LoadedModule.js +9 -0
- package/src/codegen/{TypescriptWriter.js → LoadedScriptsWriter.js} +117 -107
- package/src/codegen/LoadedValidator.js +23 -0
- package/src/codegen/{Module.js → TypeCheckedModule.js} +3 -3
- package/src/codegen/{Validator.js → TypeCheckedValidator.js} +5 -8
- package/src/codegen/TypeSchema.js +4 -0
- package/src/codegen/index.js +5 -4
- package/src/compiler/CompilerLib.js +51 -0
- package/src/{lib/Libg_v0_16.js → compiler/CompilerLib_v0_16.js} +243 -254
- package/src/compiler/index.js +6 -0
- package/src/compiler/ops.js +137 -0
- package/src/context/ContractContext.js +78 -0
- package/src/context/ContractContextBuilder.js +69 -0
- package/src/context/DagCompiler.js +229 -0
- package/src/context/index.js +1 -0
- package/src/hl2ts.js +31 -59
- package/src/index.js +12 -1
- package/types/cast/Cast.d.ts +32 -0
- package/types/cast/Cast.d.ts.map +1 -0
- package/types/cast/PermissiveType.d.ts +3 -0
- package/types/cast/PermissiveType.d.ts.map +1 -0
- package/types/cast/StrictType.d.ts +3 -0
- package/types/cast/StrictType.d.ts.map +1 -0
- package/types/cast/index.d.ts +5 -0
- package/types/cast/index.d.ts.map +1 -0
- package/types/codegen/LoadedModule.d.ts +6 -0
- package/types/codegen/LoadedModule.d.ts.map +1 -0
- package/types/codegen/LoadedScriptsWriter.d.ts +56 -0
- package/types/codegen/LoadedScriptsWriter.d.ts.map +1 -0
- package/types/codegen/LoadedValidator.d.ts +16 -0
- package/types/codegen/LoadedValidator.d.ts.map +1 -0
- package/types/codegen/TypeCheckedModule.d.ts +11 -0
- package/types/codegen/TypeCheckedModule.d.ts.map +1 -0
- package/types/codegen/TypeCheckedValidator.d.ts +8 -0
- package/types/codegen/TypeCheckedValidator.d.ts.map +1 -0
- package/types/codegen/TypeSchema.d.ts +10 -0
- package/types/codegen/TypeSchema.d.ts.map +1 -1
- package/types/codegen/TypescriptWriter.d.ts +4 -4
- package/types/codegen/Validator.d.ts +1 -1
- package/types/codegen/index.d.ts +5 -4
- package/types/codegen/index.d.ts.map +1 -1
- package/types/compiler/CompilerLib.d.ts +45 -0
- package/types/compiler/CompilerLib.d.ts.map +1 -0
- package/types/compiler/CompilerLib_v0_16.d.ts +270 -0
- package/types/compiler/CompilerLib_v0_16.d.ts.map +1 -0
- package/types/compiler/index.d.ts +4 -0
- package/types/compiler/index.d.ts.map +1 -0
- package/types/compiler/ops.d.ts +24 -0
- package/types/compiler/ops.d.ts.map +1 -0
- package/types/context/ContractContext.d.ts +23 -0
- package/types/context/ContractContext.d.ts.map +1 -0
- package/types/context/ContractContextBuilder.d.ts +53 -0
- package/types/context/ContractContextBuilder.d.ts.map +1 -0
- package/types/context/DagCompiler.d.ts +64 -0
- package/types/context/DagCompiler.d.ts.map +1 -0
- package/types/context/index.d.ts +2 -0
- package/types/context/index.d.ts.map +1 -0
- package/types/hl2ts.d.ts +8 -4
- package/types/hl2ts.d.ts.map +1 -1
- package/types/index.d.ts +4 -1
- package/types/index.d.ts.map +1 -1
- package/types/lib/Lib.d.ts +13 -71
- package/types/lib/Lib.d.ts.map +1 -1
- package/types/lib/Libg_v0_16.d.ts +53 -52
- package/types/lib/Libg_v0_16.d.ts.map +1 -1
- package/types/lib/index.d.ts +0 -1
- package/types/lib/index.d.ts.map +1 -1
- package/types/lib/load.d.ts +1 -7
- package/types/lib/load.d.ts.map +1 -1
- package/types/runtime/ContractContext.d.ts +22 -43
- package/types/runtime/ContractContext.d.ts.map +1 -1
- package/types/runtime/ContractContextBuilder.d.ts +15 -123
- package/types/runtime/ContractContextBuilder.d.ts.map +1 -1
- package/types/runtime/DagCompiler.d.ts +64 -0
- package/types/runtime/DagCompiler.d.ts.map +1 -0
- package/types/runtime/PermissiveType.d.ts +1 -1
- package/types/runtime/StrictType.d.ts +1 -1
- package/types/runtime/index.d.ts +0 -2
- package/src/codegen/Writer.js +0 -37
- package/src/lib/Lib.js +0 -56
- package/src/lib/index.js +0 -6
- package/src/lib/load.js +0 -26
- package/src/runtime/ContractContext.js +0 -35
- package/src/runtime/ContractContextBuilder.js +0 -340
- package/src/runtime/index.js +0 -3
- /package/examples/{spending → multi-validator}/minting.hl +0 -0
- /package/examples/{spending → multi-validator}/package-lock.json +0 -0
- /package/examples/{spending → multi-validator}/package.json +0 -0
- /package/examples/{spending → multi-validator}/utils.hl +0 -0
- /package/src/{runtime → cast}/PermissiveType.js +0 -0
- /package/src/{runtime → cast}/StrictType.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissiveType.d.ts","sourceRoot":"","sources":["../../src/cast/PermissiveType.js"],"names":[],"mappings":";qBAAqB,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StrictType.d.ts","sourceRoot":"","sources":["../../src/cast/StrictType.js"],"names":[],"mappings":";qBAAqB,WAAW"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Cast };
|
|
2
|
+
export type PermissiveType<C extends Cast<any, any>> = import("./PermissiveType.js").PermissiveType<C>;
|
|
3
|
+
export type StrictType<C extends Cast<any, any>> = import("./StrictType.js").StrictType<C>;
|
|
4
|
+
import { Cast } from "./Cast.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cast/index.js"],"names":[],"mappings":";uDAKa,OAAO,qBAAqB,EAAE,cAAc,CAAC,CAAC,CAAC;mDAK/C,OAAO,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;qBAV/B,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadedModule.d.ts","sourceRoot":"","sources":["../../src/codegen/LoadedModule.js"],"names":[],"mappings":"2BAGa;IACZ,KAAS,EAAE,MAAM,CAAA;IACjB,WAAe,EAAE,MAAM,CAAA;IACvB,aAAiB,EAAE,YAAY,EAAE,CAAA;CAC9B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("./TypeCheckedModule.js").TypeCheckedModule} TypeCheckedModule
|
|
3
|
+
* @typedef {import("./TypeCheckedValidator.js").TypeCheckedValidator} TypeCheckedValidator
|
|
4
|
+
*/
|
|
5
|
+
export class LoadedScriptsWriter {
|
|
6
|
+
/**
|
|
7
|
+
* Constructs a LoadedScriptsWriter instance and initializes it be writing the header
|
|
8
|
+
* @returns {LoadedScriptsWriter}
|
|
9
|
+
*/
|
|
10
|
+
static "new"(): LoadedScriptsWriter;
|
|
11
|
+
definition: StringWriter;
|
|
12
|
+
declaration: StringWriter;
|
|
13
|
+
/**
|
|
14
|
+
* @param {{[name: string]: TypeCheckedModule}} ms
|
|
15
|
+
* @returns {LoadedScriptsWriter}
|
|
16
|
+
*/
|
|
17
|
+
writeModules(ms: {
|
|
18
|
+
[name: string]: import("./TypeCheckedModule.js").TypeCheckedModule;
|
|
19
|
+
}): LoadedScriptsWriter;
|
|
20
|
+
/**
|
|
21
|
+
* @param {{[name: string]: TypeCheckedValidator}} validators
|
|
22
|
+
* @returns {LoadedScriptsWriter}
|
|
23
|
+
*/
|
|
24
|
+
writeValidators(validators: {
|
|
25
|
+
[name: string]: import("./TypeCheckedValidator.js").TypeCheckedValidator;
|
|
26
|
+
}): LoadedScriptsWriter;
|
|
27
|
+
/**
|
|
28
|
+
* @returns {[string, string]}
|
|
29
|
+
*/
|
|
30
|
+
finalize(): [string, string];
|
|
31
|
+
/**
|
|
32
|
+
* @private
|
|
33
|
+
* @param {string} def
|
|
34
|
+
* @param {string} decl
|
|
35
|
+
* @returns {LoadedScriptsWriter}
|
|
36
|
+
*/
|
|
37
|
+
private write;
|
|
38
|
+
/**
|
|
39
|
+
* @private
|
|
40
|
+
*/
|
|
41
|
+
private writeHeaders;
|
|
42
|
+
/**
|
|
43
|
+
* @private
|
|
44
|
+
* @param {TypeCheckedModule} m
|
|
45
|
+
*/
|
|
46
|
+
private writeModule;
|
|
47
|
+
/**
|
|
48
|
+
* @private
|
|
49
|
+
* @param {TypeCheckedValidator} v
|
|
50
|
+
*/
|
|
51
|
+
private writeValidator;
|
|
52
|
+
}
|
|
53
|
+
export type TypeCheckedModule = import("./TypeCheckedModule.js").TypeCheckedModule;
|
|
54
|
+
export type TypeCheckedValidator = import("./TypeCheckedValidator.js").TypeCheckedValidator;
|
|
55
|
+
import { StringWriter } from "@helios-lang/codec-utils";
|
|
56
|
+
//# sourceMappingURL=LoadedScriptsWriter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadedScriptsWriter.d.ts","sourceRoot":"","sources":["../../src/codegen/LoadedScriptsWriter.js"],"names":[],"mappings":"AAGA;;;GAGG;AAEH;IASI;;;OAGG;IACH,gBAFa,mBAAmB,CAQ/B;IAdG,yBAAoC;IACpC,0BAAqC;IAezC;;;OAGG;IACH;;QAFa,mBAAmB,CAgC/B;IAED;;;OAGG;IACH;;QAFa,mBAAmB,CAkC/B;IAED;;OAEG;IACH,YAFa,CAAC,MAAM,EAAE,MAAM,CAAC,CAI5B;IAED;;;;;OAKG;IACH,cAKC;IAED;;OAEG;IACH,qBAcC;IAED;;;OAGG;IACH,oBAiBC;IAED;;;OAGG;IACH,uBA+BC;CACJ;gCArMY,OAAO,wBAAwB,EAAE,iBAAiB;mCAClD,OAAO,2BAA2B,EAAE,oBAAoB;6BALxC,0BAA0B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type LoadedModule = import("./LoadedModule.js").LoadedModule;
|
|
2
|
+
export type LoadedValidator = {
|
|
3
|
+
$name: string;
|
|
4
|
+
$sourceCode: string;
|
|
5
|
+
$dependencies: LoadedModule[];
|
|
6
|
+
$hashDependencies: LoadedValidator[];
|
|
7
|
+
$dependsOnOwnHash: boolean;
|
|
8
|
+
$Redeemer: Cast;
|
|
9
|
+
} & ({
|
|
10
|
+
$purpose: "spending";
|
|
11
|
+
$Datum: Cast;
|
|
12
|
+
} | {
|
|
13
|
+
$purpose: "minting" | "certifying" | "rewarding" | "staking";
|
|
14
|
+
});
|
|
15
|
+
import { Cast } from "../cast/Cast.js";
|
|
16
|
+
//# sourceMappingURL=LoadedValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadedValidator.d.ts","sourceRoot":"","sources":["../../src/codegen/LoadedValidator.js"],"names":[],"mappings":"2BAGa,OAAO,mBAAmB,EAAE,YAAY;8BAIxC;IACZ,KAAS,EAAE,MAAM,CAAA;IACjB,WAAe,EAAE,MAAM,CAAA;IACvB,aAAiB,EAAE,YAAY,EAAE,CAAA;IACjC,iBAAqB,EAAE,eAAe,EAAE,CAAA;IACxC,iBAAqB,EAAE,OAAO,CAAA;IAC9B,SAAa,EAAE,IAAI,CAAA;CAChB,GAAG,CACN;IACA,QAAc,EAAE,UAAU,CAAA;IAC1B,MAAY,EAAE,IAAI,CAAA;CACb,GAAG;IACR,QAAc,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAA;CAC7D,CACF;qBArBiB,iBAAiB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type TypeSchema = import("./TypeSchema.js").TypeSchema;
|
|
2
|
+
export type TypeCheckedModule = {
|
|
3
|
+
name: string;
|
|
4
|
+
purpose: string;
|
|
5
|
+
sourceCode: string;
|
|
6
|
+
moduleDepedencies: string[];
|
|
7
|
+
types: {
|
|
8
|
+
[name: string]: import("./TypeSchema.js").TypeSchema;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=TypeCheckedModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeCheckedModule.d.ts","sourceRoot":"","sources":["../../src/codegen/TypeCheckedModule.js"],"names":[],"mappings":"yBAGa,OAAO,iBAAiB,EAAE,UAAU;;UAKtC,MAAM;aACH,MAAM;gBACH,MAAM;uBACC,MAAM,EAAE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type TypeCheckedModule = import("./TypeCheckedModule.js").TypeCheckedModule;
|
|
2
|
+
export type TypeSchema = import("./TypeSchema.js").TypeSchema;
|
|
3
|
+
export type TypeCheckedValidator = TypeCheckedModule & {
|
|
4
|
+
hashDependencies: string[];
|
|
5
|
+
Redeemer: TypeSchema;
|
|
6
|
+
Datum?: TypeSchema;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=TypeCheckedValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeCheckedValidator.d.ts","sourceRoot":"","sources":["../../src/codegen/TypeCheckedValidator.js"],"names":[],"mappings":"gCAGa,OAAO,wBAAwB,EAAE,iBAAiB;yBAClD,OAAO,iBAAiB,EAAE,UAAU;mCAIpC,iBAAiB,GAAG;IAChC,gBAAoB,EAAE,MAAM,EAAE,CAAA;IAC9B,QAAY,EAAE,UAAU,CAAA;IACxB,KAAS,CAAC,EAAE,UAAU,CAAA;CACnB"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* TODO: references and ids for recursive types and more descriptive codegen
|
|
3
|
+
* TODO: use `kind: "internal" | "list" | "map" | "struct" | "option" | "enum"` instead of `primitiveType` etc.
|
|
4
|
+
* TODO: additional property for struct: `format: "list" | "map"`
|
|
5
|
+
* TODO: rename primitiveType -> internalType
|
|
2
6
|
* @typedef {{
|
|
3
7
|
* primitiveType: string
|
|
4
8
|
* } | {
|
|
@@ -28,6 +32,12 @@
|
|
|
28
32
|
* @returns {[string, string]} - the first entry is the canonical type, the second is the permissive type
|
|
29
33
|
*/
|
|
30
34
|
export function genTypes(schema: TypeSchema): [string, string];
|
|
35
|
+
/**
|
|
36
|
+
* TODO: references and ids for recursive types and more descriptive codegen
|
|
37
|
+
* TODO: use `kind: "internal" | "list" | "map" | "struct" | "option" | "enum"` instead of `primitiveType` etc.
|
|
38
|
+
* TODO: additional property for struct: `format: "list" | "map"`
|
|
39
|
+
* TODO: rename primitiveType -> internalType
|
|
40
|
+
*/
|
|
31
41
|
export type TypeSchema = {
|
|
32
42
|
primitiveType: string;
|
|
33
43
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeSchema.d.ts","sourceRoot":"","sources":["../../src/codegen/TypeSchema.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"TypeSchema.d.ts","sourceRoot":"","sources":["../../src/codegen/TypeSchema.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;GAGG;AACH,iCAHW,UAAU,GACR,CAAC,MAAM,EAAE,MAAM,CAAC,CA0H5B;;;;;;;yBArJY;IACZ,aAAmB,EAAE,MAAM,CAAA;CACxB,GAAG;IACN,YAAkB,EAAE,UAAU,CAAA;CAC3B,GAAG;IACN,UAAgB,EAAE,UAAU,CAAA;IAC5B,YAAkB,EAAE,UAAU,CAAA;CAC3B,GAAG;IACN,cAAoB,EAAE,UAAU,CAAA;CAC7B,GAAG;IACN,gBAAsB,EAAE;QACxB,MAAgB,MAAM,CAAA;QACtB,IAAc,EAAE,UAAU,CAAA;KACnB,EAAE,CAAA;CACN,GAAG;IACN,gBAAsB,EAAE;QACxB,MAAiB,MAAM,CAAC;QACxB,UAAqB,EAAE;YACvB,MAAqB,MAAM,CAAA;YAC3B,IAAmB,EAAE,UAAU,CAAA;SACnB,EAAE,CAAA;KACP,EAAE,CAAA;CACN"}
|
|
@@ -30,21 +30,21 @@ export class TypescriptWriter {
|
|
|
30
30
|
* @param {{[name: string]: Module}} ms
|
|
31
31
|
*/
|
|
32
32
|
writeModules(ms: {
|
|
33
|
-
[name: string]: import("./
|
|
33
|
+
[name: string]: import("./TypeCheckedModule.js").Module;
|
|
34
34
|
}): void;
|
|
35
35
|
/**
|
|
36
36
|
*
|
|
37
37
|
* @param {{[name: string]: Validator}} validators
|
|
38
38
|
*/
|
|
39
39
|
writeValidators(validators: {
|
|
40
|
-
[name: string]: import("./
|
|
40
|
+
[name: string]: import("./TypeCheckedValidator.js").Validator;
|
|
41
41
|
}): void;
|
|
42
42
|
/**
|
|
43
43
|
* @returns {[string, string]}
|
|
44
44
|
*/
|
|
45
45
|
finalize(): [string, string];
|
|
46
46
|
}
|
|
47
|
-
export type Module = import("./
|
|
48
|
-
export type Validator = import("./
|
|
47
|
+
export type Module = import("./TypeCheckedModule.js").Module;
|
|
48
|
+
export type Validator = import("./TypeCheckedValidator.js").Validator;
|
|
49
49
|
import { Writer } from "./Writer.js";
|
|
50
50
|
//# sourceMappingURL=TypescriptWriter.d.ts.map
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export const _: {};
|
|
15
15
|
export type TypeSchema = import("./TypeSchema.js").TypeSchema;
|
|
16
|
-
export type Module = import("./
|
|
16
|
+
export type Module = import("./TypeCheckedModule.js").Module;
|
|
17
17
|
export type Validator = Module & {
|
|
18
18
|
hashDependencies: string[];
|
|
19
19
|
Redeemer: TypeSchema;
|
package/types/codegen/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
3
|
-
export type
|
|
1
|
+
export { LoadedScriptsWriter } from "./LoadedScriptsWriter.js";
|
|
2
|
+
export type LoadedModule = import("./LoadedModule.js").LoadedModule;
|
|
3
|
+
export type LoadedValidator = import("./LoadedValidator.js").LoadedValidator;
|
|
4
|
+
export type TypeCheckedModule = import("./TypeCheckedModule.js").TypeCheckedModule;
|
|
5
|
+
export type TypeCheckedValidator = import("./TypeCheckedValidator.js").TypeCheckedValidator;
|
|
4
6
|
export type TypeSchema = import("./TypeSchema.js").TypeSchema;
|
|
5
|
-
export type Validator = import("./Validator.js").Validator;
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.js"],"names":[],"mappings":";2BAGa,OAAO,mBAAmB,EAAE,YAAY;8BACxC,OAAO,sBAAsB,EAAE,eAAe;gCAC9C,OAAO,wBAAwB,EAAE,iBAAiB;mCAClD,OAAO,2BAA2B,EAAE,oBAAoB;yBACxD,OAAO,iBAAiB,EAAE,UAAU"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type InternalTypeDetails = import("../codegen/index.js").TypeSchema;
|
|
2
|
+
export type TypeCheckedModule = import("../codegen/index.js").TypeCheckedModule;
|
|
3
|
+
export type TypeCheckedValidator = import("../codegen/index.js").TypeCheckedValidator;
|
|
4
|
+
export type CompileOptions = {
|
|
5
|
+
allValidatorHashTypes: {
|
|
6
|
+
[name: string]: any;
|
|
7
|
+
};
|
|
8
|
+
hashDependencies: {
|
|
9
|
+
[name: string]: string;
|
|
10
|
+
};
|
|
11
|
+
dependsOnOwnHash?: boolean | undefined;
|
|
12
|
+
ownHash?: string | undefined;
|
|
13
|
+
optimize: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type CompileOutput = {
|
|
16
|
+
cborHex: string;
|
|
17
|
+
prettyIR: string;
|
|
18
|
+
};
|
|
19
|
+
export type TypeCheckOutput = {
|
|
20
|
+
modules: {
|
|
21
|
+
[name: string]: import("../codegen/TypeCheckedModule.js").TypeCheckedModule;
|
|
22
|
+
};
|
|
23
|
+
validators: {
|
|
24
|
+
[name: string]: import("../codegen/TypeCheckedValidator.js").TypeCheckedValidator;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export type SourceDetails = {
|
|
28
|
+
name: string;
|
|
29
|
+
purpose: string;
|
|
30
|
+
sourceCode: string;
|
|
31
|
+
};
|
|
32
|
+
export type CompilerLib = {
|
|
33
|
+
version: string;
|
|
34
|
+
getScriptHashType: (purpose: string) => any;
|
|
35
|
+
typeCheck: (validators: string[], modules: string[]) => {
|
|
36
|
+
modules: {
|
|
37
|
+
[name: string]: import("../codegen/TypeCheckedModule.js").TypeCheckedModule;
|
|
38
|
+
};
|
|
39
|
+
validators: {
|
|
40
|
+
[name: string]: import("../codegen/TypeCheckedValidator.js").TypeCheckedValidator;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
compile: (main: string, modules: string[], options: CompileOptions) => CompileOutput;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=CompilerLib.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompilerLib.d.ts","sourceRoot":"","sources":["../../src/compiler/CompilerLib.js"],"names":[],"mappings":"kCAGa,OAAO,qBAAqB,EAAE,UAAU;gCACxC,OAAO,qBAAqB,EAAE,iBAAiB;mCAC/C,OAAO,qBAAqB,EAAE,oBAAoB;;;;;;;;;;cAShD,OAAO;;4BAKT;IACZ,OAAW,EAAE,MAAM,CAAA;IACnB,QAAY,EAAE,MAAM,CAAA;CACjB;;;;;;;;;4BAWS;IACZ,MAAU,MAAM,CAAA;IAChB,OAAW,EAAE,MAAM,CAAA;IACnB,UAAc,EAAE,MAAM,CAAA;CACnB;;aAKU,MAAM;iCACc,MAAM,KAAK,GAAG;4BACnB,MAAM,EAAE,WAAW,MAAM,EAAE;;;;;;;;oBAInC,MAAM,WAAW,MAAM,EAAE,WAAW,cAAc,KAAK,aAAa"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("../codegen/index.js").TypeCheckedModule} TypeCheckedModule
|
|
3
|
+
* @typedef {import("../codegen/index.js").TypeCheckedValidator} TypeCheckedValidator
|
|
4
|
+
|
|
5
|
+
* @typedef {import("../codegen/index.js").TypeSchema} InternalTypeDetails
|
|
6
|
+
* @typedef {import("./CompilerLib.js").CompileOptions} CompileOptions
|
|
7
|
+
* @typedef {import("./CompilerLib.js").CompileOutput} CompileOutput
|
|
8
|
+
* @typedef {import("./CompilerLib.js").CompilerLib} CompilerLib
|
|
9
|
+
* @typedef {import("./CompilerLib.js").SourceDetails} SourceDetails
|
|
10
|
+
* @typedef {import("./CompilerLib.js").TypeCheckOutput} TypeCheckOutput
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {{
|
|
14
|
+
* [name: string]: string[]
|
|
15
|
+
* }} DagDependencies
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* @typedef {{
|
|
19
|
+
* }} ScriptHashType
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {{
|
|
23
|
+
* includes: (m: string) => boolean
|
|
24
|
+
* }} IR
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {{
|
|
28
|
+
* name: string
|
|
29
|
+
* }} EnumStatement
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* @typedef {{
|
|
33
|
+
* name: string
|
|
34
|
+
* }} StructStatement
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* @typedef {StructStatement | EnumStatement | any} Statement
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* @typedef {{
|
|
41
|
+
* src: {
|
|
42
|
+
* raw: string
|
|
43
|
+
* }
|
|
44
|
+
* }} Site
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* @typedef {{
|
|
48
|
+
* value: string
|
|
49
|
+
* site: Site
|
|
50
|
+
* }} WordToken
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* @typedef {{
|
|
54
|
+
* name: WordToken
|
|
55
|
+
* filterDependencies: (all: Module[]) => Module[]
|
|
56
|
+
* statements: Statement[]
|
|
57
|
+
* }} Module
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* @typedef {{
|
|
61
|
+
* name: string
|
|
62
|
+
* purpose: "testing" | "minting" | "spending" | "staking" | "endpoint" | "module" | "unknown"
|
|
63
|
+
* toIR: (ctx: any, extra: Map<string, IR>) => IR
|
|
64
|
+
* types: UserTypes
|
|
65
|
+
* mainImportedModules: Module[]
|
|
66
|
+
* mainModule: Module
|
|
67
|
+
* mainArgTypes: DataType[]
|
|
68
|
+
* }} Program
|
|
69
|
+
*/
|
|
70
|
+
/**
|
|
71
|
+
* @typedef {{
|
|
72
|
+
* typeDetails?: TypeDetails
|
|
73
|
+
* }} DataType
|
|
74
|
+
*/
|
|
75
|
+
/**
|
|
76
|
+
* @typedef {{
|
|
77
|
+
* type: string
|
|
78
|
+
* } | {
|
|
79
|
+
* type: "List"
|
|
80
|
+
* itemType: TypeSchema
|
|
81
|
+
* } | {
|
|
82
|
+
* type: "Map"
|
|
83
|
+
* keyType: TypeSchema
|
|
84
|
+
* valueType: TypeSchema
|
|
85
|
+
* } | {
|
|
86
|
+
* type: "Option"
|
|
87
|
+
* someType: TypeSchema
|
|
88
|
+
* } | {
|
|
89
|
+
* type: "Struct"
|
|
90
|
+
* fieldTypes: NamedTypeSchema[]
|
|
91
|
+
* } | {
|
|
92
|
+
* type: "Enum"
|
|
93
|
+
* variantTypes: {name: string, fieldTypes: NamedTypeSchema[]}[]
|
|
94
|
+
* }} TypeSchema
|
|
95
|
+
*/
|
|
96
|
+
/**
|
|
97
|
+
* @typedef {{
|
|
98
|
+
* name: string
|
|
99
|
+
* } & TypeSchema} NamedTypeSchema
|
|
100
|
+
*/
|
|
101
|
+
/**
|
|
102
|
+
* @typedef {{
|
|
103
|
+
* inputType: string
|
|
104
|
+
* outputType: string
|
|
105
|
+
* internalType: TypeSchema
|
|
106
|
+
* }} TypeDetails
|
|
107
|
+
*/
|
|
108
|
+
/**
|
|
109
|
+
* @typedef {{
|
|
110
|
+
* }} UserTypes
|
|
111
|
+
*/
|
|
112
|
+
/**
|
|
113
|
+
* @implements {CompilerLib}
|
|
114
|
+
*/
|
|
115
|
+
export class CompilerLib_v0_16 implements CompilerLib {
|
|
116
|
+
/**
|
|
117
|
+
* @param {any} lib
|
|
118
|
+
*/
|
|
119
|
+
constructor(lib: any);
|
|
120
|
+
lib: any;
|
|
121
|
+
/**
|
|
122
|
+
* @type {string}
|
|
123
|
+
*/
|
|
124
|
+
get version(): string;
|
|
125
|
+
/**
|
|
126
|
+
* @param {string} purpose
|
|
127
|
+
* @returns {ScriptHashType}
|
|
128
|
+
*/
|
|
129
|
+
getScriptHashType(purpose: string): ScriptHashType;
|
|
130
|
+
/**
|
|
131
|
+
* @param {string[]} validators
|
|
132
|
+
* @param {string[]} modules
|
|
133
|
+
* @returns {TypeCheckOutput}
|
|
134
|
+
*/
|
|
135
|
+
typeCheck(validators: string[], modules: string[]): TypeCheckOutput;
|
|
136
|
+
/**
|
|
137
|
+
* Generate additional IR definitions
|
|
138
|
+
* * dependency on own precalculated hash (eg. unoptimized program should use hash of optimized program)
|
|
139
|
+
* * dependency on own hash through methods defined on the ScriptContext
|
|
140
|
+
* * dependency on hashes of other validators
|
|
141
|
+
* @private
|
|
142
|
+
* @param {string} name - name of the validator being compiled
|
|
143
|
+
* @param {string} purpose - purpose the validator being compiled
|
|
144
|
+
* @param {number} nPosParams
|
|
145
|
+
* @param {CompileOptions} options
|
|
146
|
+
* @returns {Map<string, IR>}
|
|
147
|
+
*/
|
|
148
|
+
private generateExtraIRDefinitions;
|
|
149
|
+
/**
|
|
150
|
+
* @param {string} main
|
|
151
|
+
* @param {string[]} modules
|
|
152
|
+
* @param {CompileOptions} options
|
|
153
|
+
* @returns {CompileOutput}
|
|
154
|
+
*/
|
|
155
|
+
compile(main: string, modules: string[], options: CompileOptions): CompileOutput;
|
|
156
|
+
/**
|
|
157
|
+
* @private
|
|
158
|
+
* @param {string[]} validators
|
|
159
|
+
* @param {string[]} modules
|
|
160
|
+
* @param {{[name: string]: ScriptHashType}} validatorTypes
|
|
161
|
+
* @returns {Program[]}
|
|
162
|
+
*/
|
|
163
|
+
private createPrograms;
|
|
164
|
+
/**
|
|
165
|
+
* @private
|
|
166
|
+
* @param {Program} program
|
|
167
|
+
* @param {{[name: string]: ScriptHashType}} validatorTypes
|
|
168
|
+
* @returns {IR}
|
|
169
|
+
*/
|
|
170
|
+
private toTestIR;
|
|
171
|
+
/**
|
|
172
|
+
* @private
|
|
173
|
+
* @param {Program[]} validators
|
|
174
|
+
* @param {{[name: string]: ScriptHashType}} validatorTypes
|
|
175
|
+
* @returns {DagDependencies}
|
|
176
|
+
*/
|
|
177
|
+
private buildDagDependencies;
|
|
178
|
+
/**
|
|
179
|
+
* @private
|
|
180
|
+
* @param {TypeSchema} it
|
|
181
|
+
* @returns {InternalTypeDetails}
|
|
182
|
+
*/
|
|
183
|
+
private convertInternalType;
|
|
184
|
+
/**
|
|
185
|
+
* @private
|
|
186
|
+
* @param {DataType} dt
|
|
187
|
+
* @returns {InternalTypeDetails}
|
|
188
|
+
*/
|
|
189
|
+
private getInternalTypeDetails;
|
|
190
|
+
}
|
|
191
|
+
export type TypeCheckedModule = import("../codegen/index.js").TypeCheckedModule;
|
|
192
|
+
export type TypeCheckedValidator = import("../codegen/index.js").TypeCheckedValidator;
|
|
193
|
+
export type InternalTypeDetails = import("../codegen/index.js").TypeSchema;
|
|
194
|
+
export type CompileOptions = import("./CompilerLib.js").CompileOptions;
|
|
195
|
+
export type CompileOutput = import("./CompilerLib.js").CompileOutput;
|
|
196
|
+
export type CompilerLib = import("./CompilerLib.js").CompilerLib;
|
|
197
|
+
export type SourceDetails = import("./CompilerLib.js").SourceDetails;
|
|
198
|
+
export type TypeCheckOutput = import("./CompilerLib.js").TypeCheckOutput;
|
|
199
|
+
export type DagDependencies = {
|
|
200
|
+
[name: string]: string[];
|
|
201
|
+
};
|
|
202
|
+
export type ScriptHashType = {};
|
|
203
|
+
export type IR = {
|
|
204
|
+
includes: (m: string) => boolean;
|
|
205
|
+
};
|
|
206
|
+
export type EnumStatement = {
|
|
207
|
+
name: string;
|
|
208
|
+
};
|
|
209
|
+
export type StructStatement = {
|
|
210
|
+
name: string;
|
|
211
|
+
};
|
|
212
|
+
export type Statement = StructStatement | EnumStatement | any;
|
|
213
|
+
export type Site = {
|
|
214
|
+
src: {
|
|
215
|
+
raw: string;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
export type WordToken = {
|
|
219
|
+
value: string;
|
|
220
|
+
site: Site;
|
|
221
|
+
};
|
|
222
|
+
export type Module = {
|
|
223
|
+
name: WordToken;
|
|
224
|
+
filterDependencies: (all: Module[]) => Module[];
|
|
225
|
+
statements: Statement[];
|
|
226
|
+
};
|
|
227
|
+
export type Program = {
|
|
228
|
+
name: string;
|
|
229
|
+
purpose: "testing" | "minting" | "spending" | "staking" | "endpoint" | "module" | "unknown";
|
|
230
|
+
toIR: (ctx: any, extra: Map<string, IR>) => IR;
|
|
231
|
+
types: UserTypes;
|
|
232
|
+
mainImportedModules: Module[];
|
|
233
|
+
mainModule: Module;
|
|
234
|
+
mainArgTypes: DataType[];
|
|
235
|
+
};
|
|
236
|
+
export type DataType = {
|
|
237
|
+
typeDetails?: TypeDetails;
|
|
238
|
+
};
|
|
239
|
+
export type TypeSchema = {
|
|
240
|
+
type: string;
|
|
241
|
+
} | {
|
|
242
|
+
type: "List";
|
|
243
|
+
itemType: TypeSchema;
|
|
244
|
+
} | {
|
|
245
|
+
type: "Map";
|
|
246
|
+
keyType: TypeSchema;
|
|
247
|
+
valueType: TypeSchema;
|
|
248
|
+
} | {
|
|
249
|
+
type: "Option";
|
|
250
|
+
someType: TypeSchema;
|
|
251
|
+
} | {
|
|
252
|
+
type: "Struct";
|
|
253
|
+
fieldTypes: NamedTypeSchema[];
|
|
254
|
+
} | {
|
|
255
|
+
type: "Enum";
|
|
256
|
+
variantTypes: {
|
|
257
|
+
name: string;
|
|
258
|
+
fieldTypes: NamedTypeSchema[];
|
|
259
|
+
}[];
|
|
260
|
+
};
|
|
261
|
+
export type NamedTypeSchema = {
|
|
262
|
+
name: string;
|
|
263
|
+
} & TypeSchema;
|
|
264
|
+
export type TypeDetails = {
|
|
265
|
+
inputType: string;
|
|
266
|
+
outputType: string;
|
|
267
|
+
internalType: TypeSchema;
|
|
268
|
+
};
|
|
269
|
+
export type UserTypes = {};
|
|
270
|
+
//# sourceMappingURL=CompilerLib_v0_16.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompilerLib_v0_16.d.ts","sourceRoot":"","sources":["../../src/compiler/CompilerLib_v0_16.js"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compiler/index.js"],"names":[],"mappings":"0BAGa,OAAO,kBAAkB,EAAE,WAAW;8BACtC,OAAO,kBAAkB,EAAE,eAAe"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The compiler library is passed as an argument instead of loading locally, so any optional configuration of the library can be done externally
|
|
3
|
+
* @returns {CompilerLib}
|
|
4
|
+
*/
|
|
5
|
+
export function loadCompilerLib(): CompilerLib;
|
|
6
|
+
/**
|
|
7
|
+
* The compiler library is passed as an argument instead of loading locally, so any optional configuration of the library can be done externally
|
|
8
|
+
* @param {CompilerLib} lib
|
|
9
|
+
* @param {{[path: string]: string}} files
|
|
10
|
+
* @param {(current: string, rel: string) => string} relToAbs
|
|
11
|
+
* @returns {TypeCheckOutput}
|
|
12
|
+
*/
|
|
13
|
+
export function typeCheckFiles(lib: CompilerLib, files: {
|
|
14
|
+
[path: string]: string;
|
|
15
|
+
}, relToAbs: (current: string, rel: string) => string): TypeCheckOutput;
|
|
16
|
+
/**
|
|
17
|
+
* @param {CompilerLib} lib
|
|
18
|
+
* @param {string[]} scripts
|
|
19
|
+
* @returns {TypeCheckOutput}
|
|
20
|
+
*/
|
|
21
|
+
export function typeCheckScripts(lib: CompilerLib, scripts: string[]): TypeCheckOutput;
|
|
22
|
+
export type CompilerLib = import("./CompilerLib.js").CompilerLib;
|
|
23
|
+
export type TypeCheckOutput = import("./CompilerLib.js").TypeCheckOutput;
|
|
24
|
+
//# sourceMappingURL=ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ops.d.ts","sourceRoot":"","sources":["../../src/compiler/ops.js"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,mCAFa,WAAW,CAgBvB;AAED;;;;;;GAMG;AACH,oCALW,WAAW;;uBAED,MAAM,OAAO,MAAM,KAAK,MAAM,GACtC,eAAe,CAM3B;AAED;;;;GAIG;AACH,sCAJW,WAAW,WACX,MAAM,EAAE,GACN,eAAe,CAM3B;0BAtDY,OAAO,kBAAkB,EAAE,WAAW;8BACtC,OAAO,kBAAkB,EAAE,eAAe"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContractContext.d.ts","sourceRoot":"","sources":["../../src/context/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"}
|