UNPKG

@graphprotocol/graph-cli

Version:

CLI for building for and deploying to The Graph

19 lines (18 loc) 532 B
import { strings } from 'gluegun'; export const source = ({ contract, startBlock, }) => ` address: '${contract}' startBlock: ${startBlock}`; export const mapping = ({ entities, contractName, }) => ` kind: ethereum/events apiVersion: 0.0.9 language: wasm/assemblyscript entities: - ExampleEntity handlers: ${entities .map(entity => ` - handler: handle${entity} entity: ${entity}`) .join(' ')} file: ./src/${strings.kebabCase(contractName)}.ts `;