@dedot/codegen 0.2.0 → 0.3.0
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.
|
@@ -7,6 +7,7 @@ const QueryGen_js_1 = require("./QueryGen.js");
|
|
|
7
7
|
class EventsGen extends QueryGen_js_1.QueryGen {
|
|
8
8
|
generate(useSubPaths = false) {
|
|
9
9
|
this.typesGen.clearCache();
|
|
10
|
+
this.typesGen.typeImports.addKnownType('GenericSubstrateApi');
|
|
10
11
|
this.typesGen.typeImports.addContractType('GenericContractEvents', 'GenericContractEvent');
|
|
11
12
|
const { events } = this.contractMetadata.spec;
|
|
12
13
|
let eventsOut = '';
|
|
@@ -5,7 +5,9 @@ import { ContractQuery } from './query';
|
|
|
5
5
|
import { ContractTx } from './tx';
|
|
6
6
|
import { ConstructorQuery } from './constructor-query';
|
|
7
7
|
import { ConstructorTx } from './constructor-tx';
|
|
8
|
-
import { ContractEvents } from './events'
|
|
8
|
+
import { ContractEvents } from './events';
|
|
9
|
+
|
|
10
|
+
export * from './types';
|
|
9
11
|
|
|
10
12
|
export interface {{{contractName}}}<Rv extends RpcVersion = RpcV2, ChainApi extends VersionedGenericSubstrateApi = SubstrateApi> extends GenericContractApi<Rv, ChainApi> {
|
|
11
13
|
query: ContractQuery<ChainApi[Rv]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dedot/codegen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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,14 +18,14 @@
|
|
|
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.
|
|
22
|
-
"@dedot/codecs": "0.
|
|
23
|
-
"@dedot/contracts": "0.
|
|
24
|
-
"@dedot/providers": "0.
|
|
25
|
-
"@dedot/runtime-specs": "0.
|
|
26
|
-
"@dedot/shape": "0.
|
|
27
|
-
"@dedot/types": "0.
|
|
28
|
-
"@dedot/utils": "0.
|
|
21
|
+
"@dedot/api": "0.3.0",
|
|
22
|
+
"@dedot/codecs": "0.3.0",
|
|
23
|
+
"@dedot/contracts": "0.3.0",
|
|
24
|
+
"@dedot/providers": "0.3.0",
|
|
25
|
+
"@dedot/runtime-specs": "0.3.0",
|
|
26
|
+
"@dedot/shape": "0.3.0",
|
|
27
|
+
"@dedot/types": "0.3.0",
|
|
28
|
+
"@dedot/utils": "0.3.0",
|
|
29
29
|
"handlebars": "^4.7.8",
|
|
30
30
|
"prettier": "^3.3.3"
|
|
31
31
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"directory": "dist"
|
|
35
35
|
},
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "40d0f3c7eee292b7615649e6a5d54887bee75fe2",
|
|
38
38
|
"module": "./index.js",
|
|
39
39
|
"types": "./index.d.ts",
|
|
40
40
|
"exports": {
|
|
@@ -4,6 +4,7 @@ import { QueryGen } from './QueryGen.js';
|
|
|
4
4
|
export class EventsGen extends QueryGen {
|
|
5
5
|
generate(useSubPaths = false) {
|
|
6
6
|
this.typesGen.clearCache();
|
|
7
|
+
this.typesGen.typeImports.addKnownType('GenericSubstrateApi');
|
|
7
8
|
this.typesGen.typeImports.addContractType('GenericContractEvents', 'GenericContractEvent');
|
|
8
9
|
const { events } = this.contractMetadata.spec;
|
|
9
10
|
let eventsOut = '';
|
|
@@ -5,7 +5,9 @@ import { ContractQuery } from './query';
|
|
|
5
5
|
import { ContractTx } from './tx';
|
|
6
6
|
import { ConstructorQuery } from './constructor-query';
|
|
7
7
|
import { ConstructorTx } from './constructor-tx';
|
|
8
|
-
import { ContractEvents } from './events'
|
|
8
|
+
import { ContractEvents } from './events';
|
|
9
|
+
|
|
10
|
+
export * from './types';
|
|
9
11
|
|
|
10
12
|
export interface {{{contractName}}}<Rv extends RpcVersion = RpcV2, ChainApi extends VersionedGenericSubstrateApi = SubstrateApi> extends GenericContractApi<Rv, ChainApi> {
|
|
11
13
|
query: ContractQuery<ChainApi[Rv]>;
|