Skip to content

Commit

Permalink
support export eth network module (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiqiang90 authored Jun 23, 2024
1 parent aee0663 commit 925b6cc
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/common-ethereum/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Add alias `parseProjectManifest`, also follow type of `INetworkCommonModule` (#318)

## [3.10.0] - 2024-06-18
### Changed
- Update `@subql/common` dependency
Expand Down
10 changes: 10 additions & 0 deletions packages/common-ethereum/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@

export * from './codegen';
export * from './project';

import {INetworkCommonModule} from '@subql/types-core';
import {SubqlDatasource, SubqlRuntimeDatasource, SubqlCustomDatasource} from '@subql/types-ethereum';
import * as p from './project';

// This provides a compiled time check to ensure that the correct exports are provided
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = {
...p,
} satisfies INetworkCommonModule<SubqlDatasource, SubqlRuntimeDatasource, SubqlCustomDatasource>;
3 changes: 3 additions & 0 deletions packages/common-ethereum/src/project/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ export * from './models';
export * from './types';
export * from './utils';
export * from './versioned';

import {parseEthereumProjectManifest} from './load';
export {parseEthereumProjectManifest as parseProjectManifest};
3 changes: 3 additions & 0 deletions packages/types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Add type `EthereumNetworkModule` to support eth module (#318)

## [3.7.0] - 2024-06-12
### Changed
- Deprecated flare SDK (#2428)
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"dependencies": {
"@ethersproject/abstract-provider": "^5.6.1",
"@ethersproject/providers": "^5.7.2",
"@subql/types-core": "^0.7.0"
"@subql/types-core": "^0.8.1-0"
}
}
16 changes: 16 additions & 0 deletions packages/types/src/modular.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2020-2024 SubQuery Pte Ltd authors & contributors
// SPDX-License-Identifier: GPL-3.0

import {INetworkCommonModule} from '@subql/types-core';
import {Data} from 'ejs';
import {SubqlRuntimeDatasource} from './project';

export interface EthereumNetworkModule extends INetworkCommonModule {
generateAbis?(
datasources: SubqlRuntimeDatasource[],
projectPath: string,
prepareDirPath: (path: string, recreate: boolean) => Promise<void>,
renderTemplate: (templatePath: string, outputPath: string, templateData: Data) => Promise<void>
): Promise<void>;
parseContractPath?(path: string): {name: string; rawName: string; path: string[]};
}
11 changes: 10 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3192,13 +3192,22 @@ __metadata:
languageName: node
linkType: hard

"@subql/types-core@npm:^0.8.1-0":
version: 0.8.1-0
resolution: "@subql/types-core@npm:0.8.1-0"
dependencies:
package-json-type: ^1.0.3
checksum: 563a62faec865502780ef7f07240c29f74722f881710a9583fa1ba9d66664171b321bb092d754ad96028de9fe787fc77d83a9e3e3b6fdaaee2f84f5cd409674a
languageName: node
linkType: hard

"@subql/types-ethereum@workspace:*, @subql/types-ethereum@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@subql/types-ethereum@workspace:packages/types"
dependencies:
"@ethersproject/abstract-provider": ^5.6.1
"@ethersproject/providers": ^5.7.2
"@subql/types-core": ^0.7.0
"@subql/types-core": ^0.8.1-0
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 925b6cc

Please sign in to comment.