SDK
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.
Quick start
install
npm install sol-dust-vacuum-sdkyarn add sol-dust-vacuum-sdkClosing solana accounts from one wallet
import { SDV } from 'sol-dust-vacuum-sdk'
import { Keypair } from '@solana/web3.js'
import fs from 'fs'
async function main() {
// your JSON wallet
const jsonFile = fs.readFileSync(process.cwd() + "/wallet.json", 'utf8');
const wallet = Keypair.fromSecretKey(new Uint8Array(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/keys
const sdv = new SDV("YOUR_API_KEY_HERE")
// List of tokens to close.
const tokens = ["rSzXH2jd6e6Mdro2MdRWHpRXA8QdZ8638AWi4fopump"]
const signature = await sdv.closeAccounts(wallet, tokens)
console.log(signature)
}
main()
Use custom RPC endpoint
How to receive all funds in one address
How to use
Closing solana accounts from one wallet
Closing all solana accounts from one wallet
Closing solana accounts from multiple wallets
Closing all solana accounts from multiple wallets
Close solana accounts from all wallet in a folder
Close all solana accounts from all wallet in a folder
Last updated