Skip to content

feat(cli): support recovering nested associated token accounts - #1384

Open
ink-splatters wants to merge 1 commit into
solana-program:mainfrom
ink-splatters:feat/cli/recover-nested
Open

feat(cli): support recovering nested associated token accounts#1384
ink-splatters wants to merge 1 commit into
solana-program:mainfrom
ink-splatters:feat/cli/recover-nested

Conversation

@ink-splatters

Copy link
Copy Markdown

Description

Add recover-nested CLI command that:

  • transfers the stranded balance into the user’s associated token account;
  • closes the nested account and returns its rent to the wallet owner.

The command invokes the existing instruction: RecoverNested of the Associated Token Account program.

Rationale

A sender can reuse the address of an associated token account which had been closed [e.g. to reclaim rent].

Some wallets treat such addresses as wallet owners and ask the Associated Token Account program to create another token account for the payment.

The resulting nested account is not listed under the recipient’s wallet, and recovering its balance currently requires custom code.

@ink-splatters
ink-splatters force-pushed the feat/cli/recover-nested branch 2 times, most recently from bae2799 to 05f38de Compare August 17, 2026 00:10
@ink-splatters
ink-splatters force-pushed the feat/cli/recover-nested branch from 05f38de to b59a5a6 Compare August 22, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant