Skip to content

Commit

Permalink
fix getUserTVLByBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
MHHard committed Apr 17, 2024
1 parent 076698e commit d2ed50c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions adapters/celer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,23 @@ export const getUserTVLByBlock = async (data: BlockData) => {
usd_price: 0,
});
});
return csvRows;
};

const getData = async () => {
// Write the CSV output to a file
const dataList = await getUserTVLByBlock({
blockNumber: 19506984,
blockTimestamp: 1711429021,
});
const ws = fs.createWriteStream("outputData.csv");
write(csvRows, { headers: true })
write(dataList, { headers: true })
.pipe(ws)
.on("finish", () => {
console.log("CSV file has been written.");
});
};

getUserTVLByBlock({ blockNumber: 19506984, blockTimestamp: 1711429021 });
getData().then(() => {
console.log("Done");
});

0 comments on commit d2ed50c

Please sign in to comment.