@graphprotocol/graph-cli
Version:
CLI for building for and deploying to The Graph
40 lines (39 loc) • 1.49 kB
TypeScript
import immutable from 'immutable';
import Subgraph from '../subgraph.js';
import { ContractCtor } from './contract.js';
import { SubgraphOptions } from './subgraph.js';
export default class Protocol {
static fromDataSources(dataSourcesAndTemplates: any): Protocol;
name: ProtocolName;
config: ProtocolConfig;
constructor(datasource: any);
static availableProtocols(): immutable.Collection<ProtocolName, immutable.List<string>>;
static normalizeName(name: ProtocolName): ProtocolName;
displayName(): string;
isValidKindName(kind: string): boolean;
hasABIs(): boolean;
hasContract(): boolean;
isSubstreams(): boolean;
hasEvents(): boolean;
hasTemplates(): boolean;
hasDataSourceMappingFile(): boolean;
getTypeGenerator(options: any): any;
getTemplateCodeGen(template: any): any;
getABI(): any;
getSubgraph(options: SubgraphOptions): Subgraph;
getContract(): ContractCtor | undefined;
getManifestScaffold(): any;
getMappingScaffold(): any;
isComposedSubgraph(): boolean;
}
export type ProtocolName = 'arweave' | 'ethereum' | 'near' | 'cosmos' | 'substreams' | 'substreams/triggers' | 'subgraph';
export interface ProtocolConfig {
displayName: string;
abi?: any;
contract?: ContractCtor;
getTemplateCodeGen?: (template: any) => any;
getTypeGenerator?: (options: any) => any;
getSubgraph(options: SubgraphOptions): Subgraph;
manifestScaffold: any;
mappingScaffold: any;
}