Skip to content

Commit

Permalink
chore: update script
Browse files Browse the repository at this point in the history
  • Loading branch information
cinnabarhorse committed Oct 15, 2024
1 parent b44de66 commit d10cc50
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions scripts/query/queryGotchiOwnersAtBlock.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import axios from "axios";
import { maticGraphUrl } from "./queryAavegotchis";
import readline from "readline";

interface Aavegotchi {
id: string;
Expand Down Expand Up @@ -138,26 +137,11 @@ async function queryAllGotchiOwners(blockNumber: number) {
console.log("Results saved to gotchiOwnersByInteraction.json");
}

// New function to get user input
function getUserInput(prompt: string): Promise<string> {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});

return new Promise((resolve) => {
rl.question(prompt, (answer) => {
rl.close();
resolve(answer);
});
});
}

// Modified main execution function
async function main() {
try {
const blockNumberInput = await getUserInput("Enter the block number: ");
const blockNumber = parseInt(blockNumberInput, 10);
// const blockNumberInput = await getUserInput("Enter the block number: ");
const blockNumber = 63019151; //parseInt(blockNumberInput, 10);

if (isNaN(blockNumber)) {
throw new Error("Invalid block number");
Expand Down

0 comments on commit d10cc50

Please sign in to comment.