INNER CODE UNIT · TypeScript
delayFunction
bitman09/pumpfun-sniper-bot · src/index.ts:300
const delayFunction = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
for (let attempt = 1; attempt <= retries; attempt++) {
try {
const nft = await metaplex.nfts().findByMint({ mintAddress: mintPublicKey });
return nft.json; // Returns the token's ticker/symbol
} catch (error) {
if (attempt < retries) {
await delayFunction(delay);
} else {
return false;
}
}
}
};
const runBot = () => {