@helios-lang/contract-utils 0.2.14 → 0.2.16

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.14",
3
+ "version": "0.2.16",
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",
@@ -18,11 +18,7 @@ export {}
18
18
  */
19
19
 
20
20
  /**
21
- * @template {((args: {
22
- * $currentScript? : string
23
- * } & {
24
- * [key: string]: UplcData
25
- * }) => UplcData)} T
21
+ * @template T
26
22
  */
27
23
  export class UserFunc {
28
24
  /**
@@ -364,9 +364,11 @@ function genFuncType(fn) {
364
364
  fields.push("$currentScript: string")
365
365
  }
366
366
 
367
- fn.arguments.forEach(({ name, type: _type }) => {
368
- fields.push(`${name}: UplcData`)
367
+ fn.arguments.forEach(({ name, type: _type }, i) => {
368
+ if (!name.startsWith("_")) {
369
+ fields.push(`${name}: UplcData`)
370
+ }
369
371
  })
370
372
 
371
- return `({${fields.join(", ")}}) => UplcData`
373
+ return `(args: {${fields.join(", ")}}) => UplcData`
372
374
  }
@@ -14,17 +14,9 @@
14
14
  * }} UserFuncProps
15
15
  */
16
16
  /**
17
- * @template {((args: {
18
- * $currentScript? : string
19
- * } & {
20
- * [key: string]: UplcData
21
- * }) => UplcData)} T
17
+ * @template T
22
18
  */
23
- export class UserFunc<T extends (args: {
24
- $currentScript?: string | undefined;
25
- } & {
26
- [key: string]: import("@helios-lang/uplc").UplcData;
27
- }) => UplcData> {
19
+ export class UserFunc<T> {
28
20
  /**
29
21
  * @param {UserFuncProps} props
30
22
  */
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"UserFunc.d.ts","sourceRoot":"","sources":["../../src/cast/UserFunc.js"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH;;GAEG;AACH;IAOI;;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"}