Skip to content

feat: add nested sol recovery#8306

Draft
at31416 wants to merge 1 commit intomasterfrom
coin-7674
Draft

feat: add nested sol recovery#8306
at31416 wants to merge 1 commit intomasterfrom
coin-7674

Conversation

@at31416
Copy link
Contributor

@at31416 at31416 commented Mar 17, 2026

This pull request adds support for recovering tokens from nested Associated Token Accounts (ATAs) in the Solana SDK. A nested ATA is an ATA owned by another ATA rather than a wallet address. The changes introduce a new instruction type, builder, and related utilities to handle this recovery process, ensuring users can recover tokens from these complex account structures.

Support for Recovering Nested ATAs:

  • Added new instruction type and builder:

    • Introduced RecoverNestedAssociatedTokenAccount to ValidInstructionTypesEnum and InstructionBuilderTypes, and updated all relevant lists and type unions to support this new instruction. [1] [2] [3] [4] [5]
    • Implemented the RecoverNestedAtaBuilder class to construct transactions for recovering tokens from nested ATAs.
    • Added a new factory method getRecoverNestedAtaBuilder to the TransactionBuilderFactory. [1] [2]
  • Instruction parsing and construction:

    • Updated the instruction params factory and parsing logic to recognize and handle the new AtaRecoverNested type, including key indexes and parsing logic for the new instruction. [1] [2] [3]
    • Added a function to build the actual Solana instruction for recovering nested ATAs in solInstructionFactory, and integrated it into the main instruction factory switch. [1] [2] [3] [4]

Utility and Type Enhancements:

  • Updated constants and utils:
    • Added new constants for instruction indexes and updated transaction type detection and instruction type parsing to handle the new instruction. [1] [2] [3] [4]
    • Extended SolRecoveryOptions to include nested ATA recovery parameters.

Ticket: COIN-7674

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