(chainInfo: ChainInfo, subqlDir: string)
| 50 | |
| 51 | // Pull a network starter, as base project. Then mapping, manifest, schema can be overridden, copy over abi files |
| 52 | export async function prepareProject(chainInfo: ChainInfo, subqlDir: string): Promise<void> { |
| 53 | const exampleProjects = await fetchExampleProjects( |
| 54 | networkFamilyToTemplateNetwork(chainInfo.networkFamily), |
| 55 | chainInfo.chainId |
| 56 | ); |
| 57 | const templateProject = exampleProjects.find((p) => p.name.includes('-starter')); |
| 58 | if (!templateProject) { |
| 59 | throw new Error( |
| 60 | `Could not find subquery template for network ${chainInfo.networkFamily} chain ${chainInfo.chainId}` |
| 61 | ); |
| 62 | } |
| 63 | await cloneProjectTemplate(path.parse(subqlDir).dir, path.parse(subqlDir).name, templateProject); |
| 64 | } |
| 65 | |
| 66 | export async function getChainIdByNetworkName(networkFamily: NETWORK_FAMILY, chainName: string): Promise<string> { |
| 67 | const graphFamily = networkFamily.toLowerCase() === 'ethereum' ? 'eip155' : networkFamily.toLowerCase(); |
no test coverage detected