@dedot/codegen 0.1.0 → 0.1.1-next.066b3f1e.2

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.
@@ -10,10 +10,10 @@ class EventsGen extends QueryGen_js_1.QueryGen {
10
10
  this.typesGen.typeImports.addContractType('GenericContractEvents', 'GenericContractEvent');
11
11
  const { events } = this.contractMetadata.spec;
12
12
  let eventsOut = '';
13
+ const isV5 = this.contractMetadata.version === 5;
13
14
  events.forEach((event) => {
14
15
  const { docs, label } = event;
15
- const isV5 = 'signature_topic' in event;
16
- eventsOut += `${(0, utils_js_1.commentBlock)(docs, '\n', isV5 ? event.signature_topic ? `@signature_topic: ${event.signature_topic}` : '- Anonymous event' : '')}`;
16
+ eventsOut += `${(0, utils_js_1.commentBlock)(docs, '\n', isV5 ? ('signature_topic' in event ? `@signature_topic: ${event.signature_topic}` : '- Anonymous event') : '')}`;
17
17
  eventsOut += `${(0, utils_1.stringPascalCase)(label)}: ${this.#generateEventDef(event)};\n\n`;
18
18
  });
19
19
  const importTypes = this.typesGen.typeImports.toImports({ useSubPaths });
@@ -28,7 +28,7 @@ class EventsGen extends QueryGen_js_1.QueryGen {
28
28
  }
29
29
  generateParamsOut(args) {
30
30
  return args
31
- .map(({ type: { type }, label, docs, indexed }) => `${(0, utils_js_1.commentBlock)(docs, '\n', `@indexed: ${indexed}`)}${(0, utils_1.stringCamelCase)(label)}: ${this.typesGen.generateType(type, 1)}`)
31
+ .map(({ type: { type }, label, docs, indexed }) => `${(0, utils_js_1.commentBlock)(docs, '\n', `@indexed: ${indexed}`)}${(0, utils_1.stringCamelCase)(label)}: ${this.typesGen.generateType(type, 1, true)}`)
32
32
  .join(', ');
33
33
  }
34
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedot/codegen",
3
- "version": "0.1.0",
3
+ "version": "0.1.1-next.066b3f1e.2+066b3f1",
4
4
  "description": "Generate types",
5
5
  "author": "Thang X. Vu <thang@coongcrafts.io>",
6
6
  "homepage": "https://github.com/dedotdev/dedot/tree/main/packages/codegen",
@@ -18,13 +18,13 @@
18
18
  "copy": "cp -R ./src/chaintypes/templates ./dist/chaintypes && cp -R ./src/chaintypes/templates ./dist/cjs/chaintypes && cp -R ./src/typink/templates ./dist/typink && cp -R ./src/typink/templates ./dist/cjs/typink"
19
19
  },
20
20
  "dependencies": {
21
- "@dedot/api": "0.1.0",
22
- "@dedot/codecs": "0.1.0",
23
- "@dedot/providers": "0.1.0",
24
- "@dedot/runtime-specs": "0.1.0",
25
- "@dedot/shape": "0.1.0",
26
- "@dedot/types": "0.1.0",
27
- "@dedot/utils": "0.1.0",
21
+ "@dedot/api": "0.1.1-next.066b3f1e.2+066b3f1",
22
+ "@dedot/codecs": "0.1.1-next.066b3f1e.2+066b3f1",
23
+ "@dedot/providers": "0.1.1-next.066b3f1e.2+066b3f1",
24
+ "@dedot/runtime-specs": "0.1.1-next.066b3f1e.2+066b3f1",
25
+ "@dedot/shape": "0.1.1-next.066b3f1e.2+066b3f1",
26
+ "@dedot/types": "0.1.1-next.066b3f1e.2+066b3f1",
27
+ "@dedot/utils": "0.1.1-next.066b3f1e.2+066b3f1",
28
28
  "handlebars": "^4.7.8",
29
29
  "prettier": "^3.3.3"
30
30
  },
@@ -33,7 +33,7 @@
33
33
  "directory": "dist"
34
34
  },
35
35
  "license": "Apache-2.0",
36
- "gitHead": "c8220a4ab4b171fe04adb49759318bde865d7c17",
36
+ "gitHead": "066b3f1e519f03d80f859f9a9ffb93d22de13626",
37
37
  "module": "./index.js",
38
38
  "types": "./index.d.ts",
39
39
  "exports": {
@@ -7,10 +7,10 @@ export class EventsGen extends QueryGen {
7
7
  this.typesGen.typeImports.addContractType('GenericContractEvents', 'GenericContractEvent');
8
8
  const { events } = this.contractMetadata.spec;
9
9
  let eventsOut = '';
10
+ const isV5 = this.contractMetadata.version === 5;
10
11
  events.forEach((event) => {
11
12
  const { docs, label } = event;
12
- const isV5 = 'signature_topic' in event;
13
- eventsOut += `${commentBlock(docs, '\n', isV5 ? event.signature_topic ? `@signature_topic: ${event.signature_topic}` : '- Anonymous event' : '')}`;
13
+ eventsOut += `${commentBlock(docs, '\n', isV5 ? ('signature_topic' in event ? `@signature_topic: ${event.signature_topic}` : '- Anonymous event') : '')}`;
14
14
  eventsOut += `${stringPascalCase(label)}: ${this.#generateEventDef(event)};\n\n`;
15
15
  });
16
16
  const importTypes = this.typesGen.typeImports.toImports({ useSubPaths });
@@ -25,7 +25,7 @@ export class EventsGen extends QueryGen {
25
25
  }
26
26
  generateParamsOut(args) {
27
27
  return args
28
- .map(({ type: { type }, label, docs, indexed }) => `${commentBlock(docs, '\n', `@indexed: ${indexed}`)}${stringCamelCase(label)}: ${this.typesGen.generateType(type, 1)}`)
28
+ .map(({ type: { type }, label, docs, indexed }) => `${commentBlock(docs, '\n', `@indexed: ${indexed}`)}${stringCamelCase(label)}: ${this.typesGen.generateType(type, 1, true)}`)
29
29
  .join(', ');
30
30
  }
31
31
  }