@helios-lang/contract-utils 0.2.12 → 0.2.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helios-lang/contract-utils",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
4
4
  "description": "Convenience and type-safety utilities for using Helios validators from within Typescript",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
@@ -39,7 +39,7 @@
39
39
  "@helios-lang/codec-utils": "^0.1.30",
40
40
  "@helios-lang/compiler-utils": "^0.1.25",
41
41
  "@helios-lang/ledger": "^0.2.8",
42
- "@helios-lang/type-utils": "^0.1.20",
42
+ "@helios-lang/type-utils": "^0.1.21",
43
43
  "@helios-lang/uplc": "^0.1.31"
44
44
  }
45
45
  }
@@ -18,7 +18,11 @@ export {}
18
18
  */
19
19
 
20
20
  /**
21
- * @template {((args: Record<string, UplcData>) => UplcData)} T
21
+ * @template {((args: {
22
+ * $currentScript? : string
23
+ * } & {
24
+ * [key: string]: UplcData
25
+ * }) => UplcData)} T
22
26
  */
23
27
  export class UserFunc {
24
28
  /**
@@ -170,7 +170,7 @@ export class LoadedScriptsWriter {
170
170
  * @private
171
171
  */
172
172
  writeHeaders() {
173
- this.writeImport("@helios-lang/contract-utils", "Cast")
173
+ this.writeImport("@helios-lang/contract-utils", "Cast", "UserFunc")
174
174
  this.writeImport(
175
175
  "@helios-lang/ledger",
176
176
  "Address",
@@ -14,9 +14,17 @@
14
14
  * }} UserFuncProps
15
15
  */
16
16
  /**
17
- * @template {((args: Record<string, UplcData>) => UplcData)} T
17
+ * @template {((args: {
18
+ * $currentScript? : string
19
+ * } & {
20
+ * [key: string]: UplcData
21
+ * }) => UplcData)} T
18
22
  */
19
- export class UserFunc<T extends (args: Record<string, UplcData>) => UplcData> {
23
+ export class UserFunc<T extends (args: {
24
+ $currentScript?: string | undefined;
25
+ } & {
26
+ [key: string]: import("@helios-lang/uplc").UplcData;
27
+ }) => UplcData> {
20
28
  /**
21
29
  * @param {UserFuncProps} props
22
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"UserFunc.d.ts","sourceRoot":"","sources":["../../src/cast/UserFunc.js"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,uCAFsB,OAAO,MAAM,EAAE,QAAQ,CAAC,KAAK,QAAQ;IASvD;;OAEG;IACH,mBAFW,aAAa,EAIvB;IAXD;;;OAGG;IACH,gBAFU,aAAa,CAElB;CAQR;yBAhCY,OAAO,yBAAyB,EAAE,UAAU;uBAC5C,OAAO,mBAAmB,EAAE,QAAQ;4BAIpC;IACZ,qBAAyB,EAAE,OAAO,CAAA;IAClC,qBAAyB,EAAE,OAAO,CAAA;IAClC,SAAa,EAAE;QACf,MAAY,MAAM,CAAA;QAClB,IAAU,EAAE,UAAU,CAAA;KACjB,EAAE,CAAA;IACP,OAAW,EAAE,UAAU,CAAA;CACpB"}
1
+ {"version":3,"file":"UserFunc.d.ts","sourceRoot":"","sources":["../../src/cast/UserFunc.js"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH;;;;MAFS,QAAQ;IASb;;OAEG;IACH,mBAFW,aAAa,EAIvB;IAXD;;;OAGG;IACH,gBAFU,aAAa,CAElB;CAQR;yBApCY,OAAO,yBAAyB,EAAE,UAAU;uBAC5C,OAAO,mBAAmB,EAAE,QAAQ;4BAIpC;IACZ,qBAAyB,EAAE,OAAO,CAAA;IAClC,qBAAyB,EAAE,OAAO,CAAA;IAClC,SAAa,EAAE;QACf,MAAY,MAAM,CAAA;QAClB,IAAU,EAAE,UAAU,CAAA;KACjB,EAAE,CAAA;IACP,OAAW,EAAE,UAAU,CAAA;CACpB"}