INNER CODE UNIT · TypeScript
batch
bitman09/pumpfun-sniper-bot · src/burn.ts:161
const batch = rows.slice(i, i + BATCH_SIZE);
const batchIx: TransactionInstruction[] = [];
for (const row of batch) {
batchIx.push(...(await buildBurnCloseInstructions(row, payer.publicKey)));
}
const batchNum = Math.floor(i / BATCH_SIZE) + 1;
try {
const sig = await sendTx(connection, payer, batchIx);
burned += batch.length;
console.log(`Batch ${batchNum}: ${batch.length} token(s) — ${sig}`);
} catch (err) {
console.error(`Batch ${batchNum} failed, retrying one-by-one...`);
for (const row of batch) {
try {
const ix = await buildBurnCloseInstructions(row, payer.publicKey);
const sig = await sendTx(connection, payer, ix);