INNER CODE UNIT · TypeScript
main
bitman09/pumpfun-sniper-bot · src/burn.ts:104
async function main() {
const privateKey = process.env.PRIVATE_KEY?.trim();
const rpc = process.env.RPC_ENDPOINT?.trim();
if (!privateKey || !rpc) {
console.error("PRIVATE_KEY and RPC_ENDPOINT must be set in .env");
process.exit(1);
}
const connection = new Connection(rpc, "confirmed");
const payer = Keypair.fromSecretKey(base58.decode(privateKey));
console.log("Wallet:", payer.publicKey.toBase58());
console.log("Fetching token accounts...\n");
const rows: TokenAccountRow[] = [];
for (const programId of [TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID]) {