starknet_factory.js
1 import { 2 filter, 3 transform as jediswapTransform, 4 factory as jediswapFactory, 5 } from "../common/jediswap.js"; 6 7 export const config = { 8 // streamUrl: "https://mainnet.starknet.a5a.ch", 9 streamUrl: "http://localhost:7171", 10 startingBlock: 486_000, 11 network: "starknet", 12 filter, 13 sinkType: "mongo", 14 sinkOptions: { 15 database: "example", 16 collectionNames: ["pairs", "events"], 17 }, 18 }; 19 20 export function factory({ header, events }) { 21 const { filter, data } = jediswapFactory({ header, events }); 22 23 const dataWithCollection = data.map((data) => ({ 24 collection: "pairs", 25 data, 26 })); 27 28 return { 29 filter, 30 data: dataWithCollection, 31 }; 32 } 33 34 export default function transform({ header, events }) { 35 return jediswapTransform({ header, events }).map((data) => ({ 36 collection: "events", 37 data, 38 })); 39 }