A Solana token incinerator that burns all SPL tokens and closes token accounts to free up hidden SOL (rent).
- Burns all SPL tokens with balance
- Closes token accounts to recover rent (hidden SOL)
- Batched transactions for efficiency
bun install- Copy the example environment file:
cp .env.example .env- Edit
.envand add your private key and RPC URL:
SOLANA_PRIVATE_KEY=your_base58_encoded_private_key_here
SOLANA_RPC_URL=https://api.mainnet-beta.solana.comRun the script:
bun run index.tsThe script will:
- Phase 1: Burn all SPL tokens that have a balance
- Phase 2: Close all token accounts (both empty and newly emptied) to recover rent
- Scans your wallet for all SPL token accounts
- Separates tokens with balance from empty accounts
- Burns all tokens with balance in batched transactions
- Closes all token accounts to free up the rent (hidden SOL)
- Shows a summary of SOL recovered
SOLANA_PRIVATE_KEYorPRIVATE_KEY: Your wallet's private key (base58 encoded)SOLANA_RPC_URLorRPC_URL: Solana RPC endpoint (defaults to mainnet-beta)
Warning: This script permanently burns tokens and closes accounts. Make sure you want to do this before running!