UNPKG

3.97 kBTypeScriptView Raw
1import { Subgraph as ISubgraph } from './protocols/subgraph';
2import { ManifestZodSchema } from './manifest';
3type ResolveFile = (path: string) => string;
4export default class Subgraph {
5 static validate(data: any, protocol: any, { resolveFile }: {
6 resolveFile: ResolveFile;
7 }): Promise<any>;
8 static validateSchema(manifest: ManifestZodSchema, { resolveFile }: {
9 resolveFile: ResolveFile;
10 }): void;
11 static validateRepository(manifest: ManifestZodSchema): {
12 path: string[];
13 message: string;
14 }[];
15 static validateDescription(manifest: ManifestZodSchema): {
16 path: string[];
17 message: string;
18 }[];
19 static validateHandlers(manifest: ManifestZodSchema, protocol: any, protocolSubgraph: ISubgraph): any;
20 static validateContractValues(manifest: ManifestZodSchema, protocol: any): any;
21 static validateUniqueDataSourceNames(manifest: ManifestZodSchema): any;
22 static validateUniqueTemplateNames(manifest: ManifestZodSchema): any;
23 static dump(manifest: ManifestZodSchema): string;
24 static load(filename: string, { protocol, skipValidation }?: {
25 protocol?: any;
26 skipValidation?: boolean;
27 }): Promise<{
28 result: {
29 specVersion: string;
30 schema: {
31 file: string;
32 };
33 dataSources: {
34 kind: string;
35 name: string;
36 network: string;
37 source: {
38 address: string;
39 abi: string;
40 startBlock?: number | bigint | undefined;
41 };
42 mapping: {
43 file: string;
44 kind: "ethereum/events";
45 apiVersion: string;
46 language: "wasm/assemblyscript";
47 entities: string[];
48 eventHandlers?: {
49 event: string;
50 handler: string;
51 topic0?: string | undefined;
52 }[] | undefined;
53 callHandlers?: {
54 function: string;
55 handler: string;
56 }[] | undefined;
57 blockHandlers?: {
58 handler: string;
59 filter?: {
60 kind: "call";
61 } | undefined;
62 }[] | undefined;
63 };
64 }[];
65 description?: string | undefined;
66 repository?: string | undefined;
67 graft?: {
68 base: string;
69 block: bigint;
70 } | undefined;
71 templates?: {
72 kind: string;
73 name: string;
74 network: string;
75 source: {
76 abi: string;
77 startBlock?: number | bigint | undefined;
78 };
79 mapping: {
80 file: string;
81 kind: "ethereum/events";
82 apiVersion: string;
83 language: "wasm/assemblyscript";
84 entities: string[];
85 eventHandlers?: {
86 event: string;
87 handler: string;
88 topic0?: string | undefined;
89 }[] | undefined;
90 callHandlers?: {
91 function: string;
92 handler: string;
93 }[] | undefined;
94 blockHandlers?: {
95 handler: string;
96 filter?: {
97 kind: "call";
98 } | undefined;
99 }[] | undefined;
100 };
101 }[] | undefined;
102 };
103 warning: string | null;
104 }>;
105 static write(manifest: any, filename: string): Promise<void>;
106}
107export {};