Skip to main content
7 votes
Accepted

How can I delete all PDA accounts for my program (anchor)?

You can close PDAs using anchor. Here's an example from my own code, closing my Counts PDA: #[derive(Accounts)] #[instruction(countsbump: u8)] pub struct CloseCounts<'info> { #[account(mut)] ...
AllBlooming's user avatar
  • 2,309
2 votes
Accepted

how to delete an element in a Vector Struct at Rust Anchor

In general, iterating through a vector while removing elements is very error-prone. If you have 10 elements in your vector, and you remove the first element, and then you try to remove the 10th ...
Jon C's user avatar
  • 19.6k
1 vote

How can i delete my token?

If this is/was a token account, it sounds like you want to close the account to recover your rent fees. Without code, some wallets (I believe SolFlare) offer the ability to close accounts to recover ...
Whiteseal's user avatar
  • 3,597

Only top scored, non community-wiki answers of a minimum length are eligible