feat(sdk-coin-sol): add ATA closure support for Solana wallets#8582
feat(sdk-coin-sol): add ATA closure support for Solana wallets#8582abhijeet8986 merged 1 commit intomasterfrom
Conversation
c773490 to
65efc72
Compare
|
@claude review |
zahin-mohammad
left a comment
There was a problem hiding this comment.
Will discuss on slack.
65efc72 to
e7f136e
Compare
zahin-mohammad
left a comment
There was a problem hiding this comment.
This approach is better then before, but I think we can take it further!
f405493 to
1865880
Compare
zahin-mohammad
left a comment
There was a problem hiding this comment.
much better, thank you!
There was a problem hiding this comment.
Pull request overview
Adds Solana Associated Token Account (ATA) closure support, including bulk close transactions and transaction verification/type detection.
Changes:
- Extends
CloseAtaBuilderto support multiple close-ATA instructions in a single transaction. - Adds Sol coin verification to enforce close-ATA rent destinations match the wallet root address.
- Updates Sol transaction type detection to classify close-ATA transactions, and adds unit tests for single/bulk close flows.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/sdk-core/src/bitgo/wallet/wallet.ts | Adds a new prebuildTxWithIntent switch case for close-ATA prebuilds. |
| modules/sdk-coin-sol/src/lib/closeAtaBuilder.ts | Refactors builder to support single + bulk close-ATA instruction construction. |
| modules/sdk-coin-sol/src/sol.ts | Adds close-ATA verification logic during verifyTransaction(). |
| modules/sdk-coin-sol/src/lib/utils.ts | Updates Sol tx type detection to recognize close-ATA transactions. |
| modules/sdk-coin-sol/test/unit/transactionBuilder/closeAtaBuilder.ts | Adds comprehensive unit tests for single/bulk close-ATA builder behavior and parsing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1865880 to
5db0125
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
TICKET: CHALO-174
5db0125 to
89150c9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
CloseAtaBuilder: Bulk close via addCloseAtaInstruction(); legacy single-ATA setters unchanged. Cannot mix the two APIs (prevents corrupting _closeAtaEntries). Parsed txs repopulate entries without locking API mode.
getTransactionType: Any close-ATA instruction → CloseAssociatedTokenAccount (Phase 1: no transfer+close in same tx).
Sol.verifyCloseAtaTransaction: Every close instruction’s destinationAddress must equal wallet root; skips if root is missing. Hooked from verifyTransaction when tx type is close-ATA.
Wallet: prebuildTransactionTxRequests case closeAssociatedTokenAccount → prebuildTxWithIntent({ intentType: 'closeAssociatedTokenAccount', recipients, memo }) — aligned with public-types; no ataAddresses.
Test plan
Unit: closeAtaBuilder (single, bulk, validation, API-mix errors, raw round-trip, fixture).
Manual: prebuildAndSignTransaction with type: 'closeAssociatedTokenAccount' and recipients (zero amounts) on testnet.
Linear: CHALO-174