@subql/types-cosmos
Advanced tools
Comparing version 3.3.0 to 3.4.0
@@ -9,2 +9,6 @@ # Changelog | ||
## [3.4.0] - 2024-05-02 | ||
### Changed | ||
- Update `@subql/types-core` and use types from there (#254) | ||
## [3.3.0] - 2024-04-10 | ||
@@ -116,3 +120,4 @@ ### Changed | ||
## [0.0.5] - 2022-06-15 | ||
[Unreleased]: https://github.com/subquery/subql-cosmos/compare/types-cosmos/3.3.0...HEAD | ||
[Unreleased]: https://github.com/subquery/subql-cosmos/compare/types-cosmos/3.4.0...HEAD | ||
[3.4.0]: https://github.com/subquery/subql-cosmos/compare/types-cosmos/3.3.0...types-cosmos/3.4.0 | ||
[3.3.0]: https://github.com/subquery/subql-cosmos/compare/types-cosmos/3.2.4...types-cosmos/3.3.0 | ||
@@ -119,0 +124,0 @@ [3.2.4]: https://github.com/subquery/subql-cosmos/compare/types-cosmos/3.2.3...types-cosmos/3.2.4 |
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate'; | ||
import { Registry } from '@cosmjs/proto-signing'; | ||
import { BaseTemplateDataSource, IProjectNetworkConfig, CommonSubqueryProject, DictionaryQueryEntry, FileReference, Processor, ProjectManifestV1_0_0, BlockFilter, BaseHandler, BaseMapping, BaseDataSource, BaseCustomDataSource } from '@subql/types-core'; | ||
import { BaseTemplateDataSource, IProjectNetworkConfig, CommonSubqueryProject, FileReference, Processor, ProjectManifestV1_0_0, BlockFilter, BaseHandler, BaseMapping, BaseDataSource, BaseCustomDataSource, SecondLayerHandlerProcessor_0_0_0, SecondLayerHandlerProcessor_1_0_0, DsProcessor } from '@subql/types-core'; | ||
import { CosmosBlock, CosmosTransaction, CosmosMessage, CosmosEvent } from './interfaces'; | ||
@@ -50,8 +50,2 @@ export type RuntimeDatasourceTemplate = BaseTemplateDataSource<CosmosRuntimeDatasource>; | ||
}; | ||
type CosmosRuntimeFilterMap = { | ||
[CosmosHandlerKind.Block]: {}; | ||
[CosmosHandlerKind.Transaction]: {}; | ||
[CosmosHandlerKind.Message]: CosmosMessageFilter; | ||
[CosmosHandlerKind.Event]: CosmosEventFilter; | ||
}; | ||
/** | ||
@@ -298,23 +292,4 @@ * Represents a Cosmos subquery network configuration, which is based on the CommonSubqueryNetworkConfig template. | ||
} | ||
export type SecondLayerHandlerProcessorArray<K extends string, F, T, DS extends CosmosCustomDatasource<K> = CosmosCustomDatasource<K>> = SecondLayerHandlerProcessor<CosmosHandlerKind.Block, F, T, DS> | SecondLayerHandlerProcessor<CosmosHandlerKind.Transaction, F, T, DS> | SecondLayerHandlerProcessor<CosmosHandlerKind.Message, F, T, DS> | SecondLayerHandlerProcessor<CosmosHandlerKind.Event, F, T, DS>; | ||
export interface CosmosDatasourceProcessor<K extends string, F, DS extends CosmosCustomDatasource<K> = CosmosCustomDatasource<K>, P extends Record<string, SecondLayerHandlerProcessorArray<K, F, any, DS>> = Record<string, SecondLayerHandlerProcessorArray<K, F, any, DS>>> { | ||
kind: K; | ||
validate(ds: DS, assets: Record<string, string>): void; | ||
dsFilterProcessor(ds: DS, api: CosmWasmClient): boolean; | ||
handlerProcessors: P; | ||
} | ||
interface SecondLayerHandlerProcessorBase<K extends CosmosHandlerKind, F, DS extends CosmosCustomDatasource = CosmosCustomDatasource> { | ||
baseHandlerKind: K; | ||
baseFilter: CosmosRuntimeFilterMap[K] | CosmosRuntimeFilterMap[K][]; | ||
filterValidator: (filter?: F) => void; | ||
dictionaryQuery?: (filter: F, ds: DS) => DictionaryQueryEntry | undefined; | ||
} | ||
export interface SecondLayerHandlerProcessor_0_0_0<K extends CosmosHandlerKind, F, E, DS extends CosmosCustomDatasource = CosmosCustomDatasource> extends SecondLayerHandlerProcessorBase<K, F, DS> { | ||
specVersion: undefined; | ||
transformer: HandlerInputTransformer_0_0_0<K, E, DS>; | ||
filterProcessor: (filter: F | undefined, input: CosmosRuntimeHandlerInputMap[K], ds: DS) => boolean; | ||
} | ||
export interface SecondLayerHandlerProcessor_1_0_0<K extends CosmosHandlerKind, F, E, DS extends CosmosCustomDatasource = CosmosCustomDatasource> extends SecondLayerHandlerProcessorBase<K, F, DS> { | ||
specVersion: '1.0.0'; | ||
transformer: HandlerInputTransformer_1_0_0<K, F, E, DS>; | ||
export type SecondLayerHandlerProcessor<K extends CosmosHandlerKind, F extends Record<string, unknown>, // EthereumRuntimeFilterMap? | ||
E, DS extends CosmosCustomDatasource = CosmosCustomDatasource> = SecondLayerHandlerProcessor_0_0_0<CosmosRuntimeHandlerInputMap, K, F, E, DS, CosmWasmClient> | (SecondLayerHandlerProcessor_1_0_0<CosmosRuntimeHandlerInputMap, K, F, E, DS, CosmWasmClient> & { | ||
filterProcessor: (params: { | ||
@@ -326,4 +301,5 @@ filter: F | undefined; | ||
}) => boolean; | ||
} | ||
export type SecondLayerHandlerProcessor<K extends CosmosHandlerKind, F, E, DS extends CosmosCustomDatasource = CosmosCustomDatasource> = SecondLayerHandlerProcessor_0_0_0<K, F, E, DS> | SecondLayerHandlerProcessor_1_0_0<K, F, E, DS>; | ||
}); | ||
export type SecondLayerHandlerProcessorArray<K extends string, F extends Record<string, unknown>, T, DS extends CosmosCustomDatasource<K> = CosmosCustomDatasource<K>> = SecondLayerHandlerProcessor<CosmosHandlerKind.Block, F, T, DS> | SecondLayerHandlerProcessor<CosmosHandlerKind.Transaction, F, T, DS> | SecondLayerHandlerProcessor<CosmosHandlerKind.Message, F, T, DS> | SecondLayerHandlerProcessor<CosmosHandlerKind.Event, F, T, DS>; | ||
export type CosmosDatasourceProcessor<K extends string, F extends Record<string, unknown>, DS extends CosmosCustomDatasource<K> = CosmosCustomDatasource<K>, P extends Record<string, SecondLayerHandlerProcessorArray<K, F, any, DS>> = Record<string, SecondLayerHandlerProcessorArray<K, F, any, DS>>> = DsProcessor<DS, P, CosmWasmClient>; | ||
/** | ||
@@ -330,0 +306,0 @@ * Represents a Cosmos project configuration based on the CommonSubqueryProject template. |
{ | ||
"name": "@subql/types-cosmos", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "", | ||
@@ -22,4 +22,4 @@ "homepage": "https://github.com/subquery/subql-cosmos", | ||
"@cosmjs/stargate": "^0.32.3", | ||
"@subql/types-core": "^0.6.0" | ||
"@subql/types-core": "^0.7.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
131306
465
+ Added@subql/types-core@0.7.0(transitive)
- Removed@subql/types-core@0.6.0(transitive)
Updated@subql/types-core@^0.7.0