import fetch from 'node-fetch'; import prompt from 'prompt-sync' import {playAudioFile} from 'audic'; let symbol = prompt({ sigint: true })('enter symbol here ') let url = `https://api-mainnet.magiceden.dev/v2/collections/${symbol}/stats` const response = await fetch(url); const data = await response.json(); const collectionFP = data.floorPrice console.log(collectionFP) const alarm = prompt({ sigint: true })('enter alarm here ') * 1000000000 function checkPrice() { if (collectionFP < alarm ) { playAudioFile('coffin.mp3') console.log(`${symbol} price alert`) } } setInterval(checkPrice, 30000); // setInterval(() => { // checkPrice() // }, 10000); // let mainURL = 'https://api-mainnet.magiceden.dev/v2/collections?offset=0&limit=200'