tornado-subgraph/mustache/templates/proxy/create-yaml.js

36 lines
846 B
JavaScript
Raw Normal View History

2021-06-08 19:08:11 +03:00
const Contracts = require('./contracts');
module.exports = {
createYaml: (env) => {
2021-06-09 16:43:04 +03:00
const createProxyBlock = ({ name, network, address }) => ({
2021-06-08 19:08:11 +03:00
name,
2021-06-09 16:43:04 +03:00
network,
2021-06-08 19:08:11 +03:00
mappingFile: '../src/mapping-encrypted-note.ts',
2021-06-09 15:34:06 +03:00
abi: 'Proxy',
startBlock: 7941563,
2021-06-08 19:08:11 +03:00
address,
entities: ['EncryptedNote'],
abis: [
{
event: 'Proxy',
2021-06-09 15:34:06 +03:00
path: '../abis/Proxy.json'
2021-06-08 19:08:11 +03:00
}
],
events: [
{
event: 'EncryptedNote(indexed address,bytes)',
handler: 'handleEncryptedNote',
}
],
});
2021-06-09 16:43:04 +03:00
return Contracts.map(({ prod, name, network, address }) => {
2021-06-09 15:34:06 +03:00
const startBlocks = { prod };
2021-06-09 16:43:04 +03:00
if (network === env) {
return createProxyBlock({ name, startBlocks, network, address })
}
}).filter(e => e !== undefined);
2021-06-08 19:08:11 +03:00
},
};