MCPcopy Create free account
hub / github.com/subquery/subql / getModulos

Function getModulos

packages/node-core/src/utils/project.ts:98–115  ·  view source on GitHub ↗
(
  dataSources: DS[],
  isCustomDs: IsCustomDs<DS, CDS>,
  blockHandlerKind: string
)

Source from the content-addressed store, hash-verified

96export type SubqlProjectDs<DS extends BaseDataSource> = DS;
97
98export function getModulos<DS extends BaseDataSource, CDS extends DS & BaseCustomDataSource>(
99 dataSources: DS[],
100 isCustomDs: IsCustomDs<DS, CDS>,
101 blockHandlerKind: string
102): number[] {
103 const modulos: number[] = [];
104 for (const ds of dataSources) {
105 if (isCustomDs(ds)) {
106 continue;
107 }
108 for (const handler of ds.mapping.handlers) {
109 if (handler.kind === blockHandlerKind && handler.filter && handler.filter.modulo) {
110 modulos.push(handler.filter.modulo);
111 }
112 }
113 }
114 return modulos;
115}
116
117export function isAssetsDs(ds: unknown): ds is BaseAssetsDataSource {
118 return !!(ds as any).assets;

Callers 2

project.spec.tsFile · 0.90
getModulosMethod · 0.90

Calls 1

isCustomDsFunction · 0.50

Tested by

no test coverage detected