mertimus / nft-sales-bot Goto Github PK
View Code? Open in Web Editor NEWA short sales bot/script for tracking NFT sales on Solana
A short sales bot/script for tracking NFT sales on Solana
Hi. I need to trigger the bot for NEW sales.
I modified code:
const runSalesBot = async () => {
console.log("starting sales bot...");
const mostRecentSignature = await solanaConnection.getSignaturesForAddress(projectPubKey, { limit: 1 });
const options = { until: mostRecentSignature[0].signature }
let signatures;
let lastKnownSignature;
//const options = {};
while (true) {
try {
const signatures = await solanaConnection.getSignaturesForAddress(projectPubKey, options);
if (!signatures.length) {
console.log("polling...")
await timer(pollingInterval);
continue;
}
} catch (err) {
console.log("error fetching signatures: ", err);
continue;
}
Output:
starting sales bot...
polling...
polling...
polling...
polling...
polling...
polling...
polling...
polling...
polling...
polling...
polling...
/home/opc/nft-sales-bot/sales_bot.js:46
for (let i = signatures.length - 1; i >= 0; i--) {
^
TypeError: Cannot read properties of undefined (reading 'length')
at runSalesBot (/home/opc/nft-sales-bot/sales_bot.js:46:33)
What i need to do? Thanks in advance
Hi I am trying to run your bot on my local machine but get this error:
(base) C02R4002GW6W:nft-sales-bot local$ PROJECT_ADDRESS=EooDxue4oQCschn3U4EkBTcCLz5Mk3YMqx18YWeb6pW7 DISCORD_URL=https://discordapp.com/api/webhooks/924497703629635634/rxYwOwsN8ZR40sOWCPYATy4ih5rT0OoJ13Sio7okdtg9MHA2j7WszSsBOsgcyZG-f9fu node sales_bot.js
/Users/local/Desktop/nft-sales-bot/sales_bot.js:14
const { metadata: { Metadata } } = programs;
^
TypeError: Cannot read property 'Metadata' of undefined
at Object. (/Users/local/Desktop/nft-sales-bot/sales_bot.js:14:21)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
Hi guys,
I ran the script on replit, but after a while it stopped without showing any issue.
Do you guys have any idea how we could do so it never stops?
Thanks
Mathieu
Hi just followed your instructions but after setting the environnement variable I got the following messages :
"Not a supported marketplace"
"Not a supported marketplace"
"Not a supported marketplace"
"Not a supported marketplace"
"Not a supported marketplace"
May you help me ?
In the example provided in the readme, to only grab current sales without history. There seems to be an issue when setting the signatures variable with const. If you change this to let it won't break the rest of the function.
while (true) {
**let signatures** = await solanaConnection.getSignaturesForAddress(projectPubKey, options);
What is this supposed to be exactly, can you provide an example?
when i run the full command:
PROJECT_ADDRESS=.... DISCORD_URL=https://discord.com/api/webhooks/.... node sales_bot.js
I get the error "please set your environment variables!"
i've also tried to create a .env file with those variables in but nothing, always the same
Hello! thanks for your bot
i'm trying to test this, but keep getting this error:
Sale at 19/10/2021 00:55:56 ---> 0.00145768 SOL
Signature: 3TMekK4FFTkM27PqmdecKSnJz5J7LsjEU7ND3oU53vt3v6tgcK39YAEA8UcBJ6GiiuuJHaqxz2chFADVah3LoqhN
Name: Fluidal 10
Image: https://www.arweave.net/UrheObpaTYGkefK82j3-Tj53VgqLNjg8aFvrvDEtUE4?ext=png
Marketplace: Magic Eden
error while going through signatures: TypeError: Cannot read property 'name' of undefined
at runSalesBot (/home/crohr/repos/solana_bots_ventas/nft-sales-bot/sales_bot.js:62:59)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:95:5)
First thanks for the discord bot, its simple and does exactly what we require.
We keep getting asked for a twitter bot also, and as per birth of this project the prices banded about are high.
Is there any chance you plan on bringing in support for twitter posting also?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.