@helios-lang/contract-utils 0.2.15 → 0.2.17

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.15",
3
+ "version": "0.2.17",
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",
@@ -282,6 +282,9 @@ export class LoadedScriptsWriter {
282
282
  )
283
283
 
284
284
  this.writeTypes(m.types)
285
+ if (m.functions) {
286
+ this.writeFunctions(m.functions)
287
+ }
285
288
 
286
289
  this.definition.write(`}\n`)
287
290
  this.declaration.write(`}\n`)
@@ -364,9 +367,11 @@ function genFuncType(fn) {
364
367
  fields.push("$currentScript: string")
365
368
  }
366
369
 
367
- fn.arguments.forEach(({ name, type: _type }) => {
368
- fields.push(`${name}: UplcData`)
370
+ fn.arguments.forEach(({ name, type: _type }, i) => {
371
+ if (!name.startsWith("_")) {
372
+ fields.push(`${name}: UplcData`)
373
+ }
369
374
  })
370
375
 
371
- return `({${fields.join(", ")}}) => UplcData`
376
+ return `(args: {${fields.join(", ")}}) => UplcData`
372
377
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LoadedScriptsWriter.d.ts","sourceRoot":"","sources":["../../src/codegen/LoadedScriptsWriter.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH;IAUI;;;OAGG;IACH,gBAFa,mBAAmB,CAQ/B;IAfG,yBAAoC;IACpC,0BAAqC;IACrC,uBAAkC;IAetC;;;OAGG;IACH;;QAFa,mBAAmB,CAgC/B;IAED;;;OAGG;IACH;;QAFa,mBAAmB,CAkC/B;IAED;;OAEG;IACH,YAFa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAQpC;IAED;;;;;OAKG;IACH,cAKC;IAED;;;;;OAKG;IACH,sBALW,MAAM,YACN,MAAM,eACN,MAAM,EAAE,GACN,mBAAmB,CAmB/B;IAED;;;;OAIG;IACH,kBAJW,MAAM,kBACN,MAAM,EAAE,GACN,mBAAmB,CAQ/B;IAED;;OAEG;IACH,qBA6BC;IAED;;OAEG;IACH,kBAFW,OAAO,MAAM,EAAE,UAAU,CAAC,QAyBpC;IAED;;OAEG;IACH,0BAFW,OAAO,MAAM,EAAE,mBAAmB,CAAC,QAuB7C;IAED;;;OAGG;IACH,oBA4BC;IAED;;;OAGG;IACH,uBAmDC;CACJ;gCAtVY,OAAO,wBAAwB,EAAE,iBAAiB;kCAClD,OAAO,wBAAwB,EAAE,mBAAmB;mCACpD,OAAO,2BAA2B,EAAE,oBAAoB;yBACxD,OAAO,iBAAiB,EAAE,UAAU;6BAPpB,0BAA0B"}
1
+ {"version":3,"file":"LoadedScriptsWriter.d.ts","sourceRoot":"","sources":["../../src/codegen/LoadedScriptsWriter.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH;IAUI;;;OAGG;IACH,gBAFa,mBAAmB,CAQ/B;IAfG,yBAAoC;IACpC,0BAAqC;IACrC,uBAAkC;IAetC;;;OAGG;IACH;;QAFa,mBAAmB,CAgC/B;IAED;;;OAGG;IACH;;QAFa,mBAAmB,CAkC/B;IAED;;OAEG;IACH,YAFa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAQpC;IAED;;;;;OAKG;IACH,cAKC;IAED;;;;;OAKG;IACH,sBALW,MAAM,YACN,MAAM,eACN,MAAM,EAAE,GACN,mBAAmB,CAmB/B;IAED;;;;OAIG;IACH,kBAJW,MAAM,kBACN,MAAM,EAAE,GACN,mBAAmB,CAQ/B;IAED;;OAEG;IACH,qBA6BC;IAED;;OAEG;IACH,kBAFW,OAAO,MAAM,EAAE,UAAU,CAAC,QAyBpC;IAED;;OAEG;IACH,0BAFW,OAAO,MAAM,EAAE,mBAAmB,CAAC,QAuB7C;IAED;;;OAGG;IACH,oBA+BC;IAED;;;OAGG;IACH,uBAmDC;CACJ;gCAzVY,OAAO,wBAAwB,EAAE,iBAAiB;kCAClD,OAAO,wBAAwB,EAAE,mBAAmB;mCACpD,OAAO,2BAA2B,EAAE,oBAAoB;yBACxD,OAAO,iBAAiB,EAAE,UAAU;6BAPpB,0BAA0B"}