@helios-lang/contract-utils 0.1.34 → 0.1.36
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/package.json +1 -1
- package/src/codegen/LoadedScriptsWriter.js +6 -6
- package/src/codegen/TypeSchema.js +5 -2
- package/src/context/ContractContext.js +1 -1
- package/src/index.js +3 -0
- package/types/codegen/TypeSchema.d.ts.map +1 -1
- package/types/context/ContractContext.d.ts +1 -1
- package/types/context/ContractContext.d.ts.map +1 -1
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -177,16 +177,16 @@ export class LoadedScriptsWriter {
|
|
|
177
177
|
|
|
178
178
|
this.declaration.write(
|
|
179
179
|
`export const ${m.name}: {
|
|
180
|
-
$name:
|
|
181
|
-
$purpose:
|
|
180
|
+
$name: "${m.name}"
|
|
181
|
+
$purpose: "${m.purpose}"
|
|
182
182
|
$sourceCode: string
|
|
183
183
|
$dependencies: [${m.moduleDepedencies.map((d) => `typeof ${d}`).join(", ")}],\n`
|
|
184
184
|
)
|
|
185
185
|
|
|
186
186
|
this.combined.write(
|
|
187
187
|
`export const ${m.name} = {
|
|
188
|
-
$name: "${m.name}" as
|
|
189
|
-
$purpose: "${m.purpose}" as
|
|
188
|
+
$name: "${m.name}" as const,
|
|
189
|
+
$purpose: "${m.purpose}" as const,
|
|
190
190
|
$sourceCode: ${JSON.stringify(m.sourceCode)} as string,
|
|
191
191
|
$dependencies: [${m.moduleDepedencies.join(", ")}],\n`
|
|
192
192
|
)
|
|
@@ -235,8 +235,8 @@ ${datumTypes ? ` $Datum: Cast<${datumTypes[0]}, ${datumTypes[1]}>,\n` : ""}`
|
|
|
235
235
|
|
|
236
236
|
this.combined.write(
|
|
237
237
|
`export const ${v.name} = {
|
|
238
|
-
$name: "${v.name}" as
|
|
239
|
-
$purpose: "${v.purpose}" as
|
|
238
|
+
$name: "${v.name}" as const,
|
|
239
|
+
$purpose: "${v.purpose}" as const,
|
|
240
240
|
$sourceCode: ${JSON.stringify(v.sourceCode)} as string,
|
|
241
241
|
$dependencies: [${v.moduleDepedencies.join(", ")}],
|
|
242
242
|
$hashDependencies: [${v.hashDependencies.filter((d) => d != v.name).join(", ")}],
|
|
@@ -48,8 +48,11 @@ export function genTypes(schema) {
|
|
|
48
48
|
return ["boolean", "boolean"]
|
|
49
49
|
case "ByteArray":
|
|
50
50
|
return ["number[]", "number[]"]
|
|
51
|
-
case "
|
|
52
|
-
return [
|
|
51
|
+
case "SpendingCredential":
|
|
52
|
+
return [
|
|
53
|
+
"SpendingCredential",
|
|
54
|
+
"SpendingCredential | PubKeyHash | ValidatorHash"
|
|
55
|
+
]
|
|
53
56
|
case "Data":
|
|
54
57
|
return ["UplcData", "UplcData"]
|
|
55
58
|
case "Duration":
|
|
@@ -63,7 +63,7 @@ import { Cast } from "../cast/index.js"
|
|
|
63
63
|
* PermissiveType<V["$Redeemer"]>
|
|
64
64
|
* >
|
|
65
65
|
* > :
|
|
66
|
-
* V extends {"$purpose": ("certifying" | "rewarding")} ? StakingValidatorHash<
|
|
66
|
+
* V extends {"$purpose": ("certifying" | "rewarding" | "staking")} ? StakingValidatorHash<
|
|
67
67
|
* StakingContext<
|
|
68
68
|
* StrictType<V["$Redeemer"]>,
|
|
69
69
|
* PermissiveType<V["$Redeemer"]>
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { Cast } from "./cast/index.js"
|
|
2
2
|
export { ContractContextBuilder } from "./context/index.js"
|
|
3
|
+
export { typeCheckFiles, typeCheckScripts } from "./compiler/ops.js"
|
|
4
|
+
export { LoadedScriptsWriter } from "./codegen/LoadedScriptsWriter.js"
|
|
5
|
+
export { loadCompilerLib } from "./compiler/ops.js"
|
|
3
6
|
|
|
4
7
|
/**
|
|
5
8
|
* @template {import("./cast/index.js").Cast} C
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,CA6H5B;;;;;;;yBAxJY;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"}
|
|
@@ -11,7 +11,7 @@ export type ContractValidatorHash<V extends import("../codegen/LoadedValidator.j
|
|
|
11
11
|
} ? ValidatorHash<SpendingContext<StrictType<V["$Datum"]>, PermissiveType<V["$Datum"]>, StrictType<V["$Redeemer"]>, PermissiveType<V["$Redeemer"]>>> : V extends {
|
|
12
12
|
"$purpose": "minting";
|
|
13
13
|
} ? MintingPolicyHash<MintingContext<StrictType<V["$Redeemer"]>, PermissiveType<V["$Redeemer"]>>> : V extends {
|
|
14
|
-
"$purpose": ("certifying" | "rewarding");
|
|
14
|
+
"$purpose": ("certifying" | "rewarding" | "staking");
|
|
15
15
|
} ? StakingValidatorHash<StakingContext<StrictType<V["$Redeemer"]>, PermissiveType<V["$Redeemer"]>>> : never;
|
|
16
16
|
export type ContractContext<T extends {
|
|
17
17
|
[name: string]: import("../codegen/LoadedValidator.js").LoadedValidator;
|
|
@@ -1 +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,EACp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,GACP,CAAO,SAAS;IAAC,UAAU,EAAE,CAAC,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC,CAAA;CAAC,GAAG,qBACzE,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"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { Cast } from "./cast/index.js";
|
|
2
2
|
export { ContractContextBuilder } from "./context/index.js";
|
|
3
|
+
export { LoadedScriptsWriter } from "./codegen/LoadedScriptsWriter.js";
|
|
3
4
|
export type StrictType<C extends import("./cast/Cast.js").Cast<any, any>> = import("./cast/index.js").StrictType<C>;
|
|
4
5
|
export type PermissiveType<C extends import("./cast/Cast.js").Cast<any, any>> = import("./cast/index.js").PermissiveType<C>;
|
|
6
|
+
export { typeCheckFiles, typeCheckScripts, loadCompilerLib } from "./compiler/ops.js";
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;;4EAQa,OAAO,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;gFAKvC,OAAO,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC"}
|