With hardware wallets in mind, this SDK is designed for easy of use and to allow the user close accounts of multiple wallets at once.
Some of the key features are:
Claim 0.002 SOL for every account closed.
No gas fee is charged, wallets with no funds can use the tool.
Close list of accounts or all accounts of a wallet.
Close accounts of one or multiple wallets in a single function.
Receive your rent of all accounts in a single address.
Close accounts of all wallets in a folder.
Attention! To close a solana account, the account must be empty. Any remaning balance on the accounts will be burned on the closing process. Use the tool with caution, any miss use can lead to lost of funds.
The service has no costs. Sol Dust Vacuum only charges a small percentage on each account closed (0.0003 SOL).
Quick start
install
npm install sol-dust-vacuum-sdk
yarn add sol-dust-vacuum-sdk
Closing solana accounts from one wallet
import { SDV } from'sol-dust-vacuum-sdk'import { Keypair } from'@solana/web3.js'import fs from'fs'asyncfunctionmain() {// your JSON walletconstjsonFile=fs.readFileSync(process.cwd() +"/wallet.json",'utf8'); constwallet=Keypair.fromSecretKey(newUint8Array(JSON.parse(jsonFile.toString())));// you can specify your wallet path instead//const wallet = process.cwd() + "/wallet.json" // Get your API key at https://soldustvacuum.app/sdk/keysconstsdv=newSDV("YOUR_API_KEY_HERE") // List of tokens to close.consttokens= ["rSzXH2jd6e6Mdro2MdRWHpRXA8QdZ8638AWi4fopump"] constsignature=awaitsdv.closeAccounts(wallet, tokens)console.log(signature)}main()
Use custom RPC endpoint
import { SDV } from'sol-dust-vacuum-sdk'import { Keypair } from'@solana/web3.js'import fs from'fs'asyncfunctionmain() {// your JSON walletconstjsonFile=fs.readFileSync(process.cwd() +"/wallet.json",'utf8'); constwallet=Keypair.fromSecretKey(newUint8Array(JSON.parse(jsonFile.toString())));// you can specify your wallet path instead//const wallet = process.cwd() + "/wallet.json" constRPC_URL="<YOUR_CUSTOM_RPC_ENDPOINT>"// Get your API key at https://soldustvacuum.app/sdk/keysconstsdv=newSDV("YOUR_API_KEY_HERE") // List of tokens to close.consttokens= ["rSzXH2jd6e6Mdro2MdRWHpRXA8QdZ8638AWi4fopump"] constsignature=awaitsdv.closeAccounts(wallet, tokens,RPC_URL)console.log(signature)}main()
How to receive all funds in one address
import { SDV } from'sol-dust-vacuum-sdk'import { Keypair } from'@solana/web3.js'import fs from'fs'asyncfunctionmain() {// your JSON walletconstjsonFile=fs.readFileSync(process.cwd() +"/wallet.json",'utf8'); constwallet=Keypair.fromSecretKey(newUint8Array(JSON.parse(jsonFile.toString())));// you can specify your wallet path instead//const wallet = process.cwd() + "/wallet.json" constRPC_URL="<YOUR_CUSTOM_RPC_ENDPOINT>"constreceiver="DUSTPnALb5327hRCfxQdzHutuxeh88J4EWaT7eqq1PWP"// Get your API key at https://soldustvacuum.app/sdk/keysconstsdv=newSDV("YOUR_API_KEY_HERE") // List of tokens to close.consttokens= ["rSzXH2jd6e6Mdro2MdRWHpRXA8QdZ8638AWi4fopump"] constsignature=awaitsdv.closeAccounts(wallet, tokens,RPC_URL, receiver)console.log(signature)}main()
How to use
Closing solana accounts from one wallet
import { SDV } from'sol-dust-vacuum-sdk'import { Keypair } from'@solana/web3.js'import fs from'fs'asyncfunctionmain() {// your JSON walletconstjsonFile=fs.readFileSync(process.cwd() +"/wallet.json",'utf8'); constwallet=Keypair.fromSecretKey(newUint8Array(JSON.parse(jsonFile.toString())));// you can specify your wallet path instead//const wallet = process.cwd() + "/wallet.json" // Get your API key at https://soldustvacuum.app/sdk/keysconstsdv=newSDV("YOUR_API_KEY_HERE") // List of tokens to close.consttokens= ["rSzXH2jd6e6Mdro2MdRWHpRXA8QdZ8638AWi4fopump"] constsignature=awaitsdv.closeAccounts(wallet, tokens)console.log(signature)}main()
Closing all solana accounts from one wallet
import { SDV } from'sol-dust-vacuum-sdk'import { Keypair } from'@solana/web3.js'import fs from'fs'asyncfunctionmain() {// your JSON walletconstjsonFile=fs.readFileSync(process.cwd() +"/wallet.json",'utf8'); constwallet=Keypair.fromSecretKey(newUint8Array(JSON.parse(jsonFile.toString())));// you can specify your wallet path instead//const wallet = process.cwd() + "/wallet.json" // Get your API key at https://soldustvacuum.app/sdk/keysconstsdv=newSDV("YOUR_API_KEY_HERE") // List of tokens to keep, any other token will be closed.consttokensToKeep= ["rSzXH2jd6e6Mdro2MdRWHpRXA8QdZ8638AWi4fopump"] constsignature=awaitsdv.closeAllAccounts(wallet, tokensToKeep)console.log(signature)}main()
Closing solana accounts from multiple wallets
import { SDV } from'sol-dust-vacuum-sdk'import { Keypair } from'@solana/web3.js'import fs from'fs'asyncfunctionmain() {// your JSON walletconstcwd=process.cwd();constjsonFile1=fs.readFileSync(cwd +"/wallet1.json",'utf8');constwallet1=Keypair.fromSecretKey(newUint8Array(JSON.parse(jsonFile1.toString())));constjsonFile2=fs.readFileSync(cwd +"/wallet2.json",'utf8');constwallet2=Keypair.fromSecretKey(newUint8Array(JSON.parse(jsonFile2.toString())));// you can specify your wallet path instead//const wallet1 = cwd + "/wallet1.json" //const wallet2 = cwd + "/wallet2.json" // Get your API key at https://soldustvacuum.app/sdk/keysconstsdv=newSDV("YOUR_API_KEY_HERE") // List of tokens to close.consttokens= ["rSzXH2jd6e6Mdro2MdRWHpRXA8QdZ8638AWi4fopump"] constsignature=awaitsdv.closeAccountsBatch([wallet1, wallet2], tokens)console.log(signature)}main()
Closing all solana accounts from multiple wallets
import { SDV } from'sol-dust-vacuum-sdk'import { Keypair } from'@solana/web3.js'import fs from'fs'asyncfunctionmain() {// your JSON walletconstcwd=process.cwd();constjsonFile1=fs.readFileSync(cwd +"/wallet1.json",'utf8');constwallet1=Keypair.fromSecretKey(newUint8Array(JSON.parse(jsonFile1.toString())));constjsonFile2=fs.readFileSync(cwd +"/wallet2.json",'utf8');constwallet2=Keypair.fromSecretKey(newUint8Array(JSON.parse(jsonFile2.toString())));// you can specify your wallet path instead//const wallet1 = cwd + "/wallet1.json" //const wallet2 = cwd + "/wallet2.json" // Get your API key at https://soldustvacuum.app/sdk/keysconstsdv=newSDV("YOUR_API_KEY_HERE") // List of tokens to keep, any other token will be closed.consttokensToKeep= ["rSzXH2jd6e6Mdro2MdRWHpRXA8QdZ8638AWi4fopump"] // if tokens to keep is not provided all tokens will be selectedconstsignature=awaitsdv.closeAllAccountsBatch([wallet1, wallet2]) //const signature = await sdv.closeAllAccountsBatch([wallet1, wallet2], tokensToKeep) console.log(signature)}main()
Close solana accounts from all wallet in a folder
import { SDV } from'sol-dust-vacuum-sdk'import { Keypair } from'@solana/web3.js'import fs from'fs'asyncfunctionmain() {// will read all json wallets on the folderconstwalletFolder=process.cwd() +"/wallets"// Get your API key at https://soldustvacuum.app/sdk/keysconstsdv=newSDV("YOUR_API_KEY_HERE") // List of tokens to close.consttokens= ["rSzXH2jd6e6Mdro2MdRWHpRXA8QdZ8638AWi4fopump"] constsignature=awaitsdv.closeAccountsFolder(walletFolder, tokens) console.log(signature)}main()
Close all solana accounts from all wallet in a folder
import { SDV } from'sol-dust-vacuum-sdk'import { Keypair } from'@solana/web3.js'import fs from'fs'asyncfunctionmain() {// will read all json wallets on the folderconstwalletFolder=process.cwd() +"/wallets"// Get your API key at https://soldustvacuum.app/sdk/keysconstsdv=newSDV("YOUR_API_KEY_HERE") // List of tokens to keep, any other token will be closed.consttokensToKeep= ["rSzXH2jd6e6Mdro2MdRWHpRXA8QdZ8638AWi4fopump"] // if tokens to keep is not provided all tokens will be selectedconstsignature=awaitsdv.closeAllAccountsFolder(walletFolder) //const signature = await sdv.closeAllAccountsFolder(walletFolder, tokensToKeep) console.log(signature)}main()