Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add createAta instruction if needed for transfer (#266)
# Pull Request Description Handles creating the AssociatedTokenAccount for a token if the receiver doesn't have one initialized. [Test transaction](https://solscan.io/tx/2Bnh3J1hUUntTmJyiDX18vbhEDnGxKNYqnVoAJLm1nPqtBcqxP9LsaKdhe6UXpoXKma6cWvqyneMzHhSLPFZDKbi) <img width="1391" alt="image" src="https://github.com/user-attachments/assets/a8f70fa7-c75c-4974-ae74-6dbc811ffa01" /> ## Changes Made This PR adds the following changes: <!-- List the key changes made in this PR --> - Fixes issue when trying to send tokens to an account that has not initialized the associated token account ## Implementation Details <!-- Provide technical details about the implementation --> - Checks for the account with a try-catch block - Adds `createAssociatedTokenAccountInstruction` to the transaction if needed ## Checklist - [x] I have tested these changes locally - [ ] I have updated the documentation - [x] I have added a transaction link - [ ] I have added the prompt used to test it
- Loading branch information