Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add associated token account IDL #3468

Conversation

acheroncrypto
Copy link
Contributor

Follow up on #3373, added Anchor IDL for associated-token-account program.

Please let me know if this is appropriate. I have been waiting to submit the remaining IDLs until I receive a feedback.

@mergify mergify bot added the community Community contribution label Aug 13, 2022
@joncinque
Copy link
Contributor

Thanks for your contribution. Are you sure that these IDLs work? I was trying to read into how anchor generates instructions and couldn't find it in the documentation, but it looks like it might hash the instruction name in order to generate a part of the instruction data, whereas the SPL instruction data is just one byte counting up from 0.

@acheroncrypto
Copy link
Contributor Author

Yes you are correct, Anchor programs have 8 byte discriminator up front, that's why we also use a coder. I've made a repository of SPL Anchor clients and tests here: https://github.com/acheroncrypto/native-to-anchor

Here are the tests for associated-token-address https://github.com/acheroncrypto/native-to-anchor/blob/master/client/tests/src/spl/associated-token-account.ts

I wasn't sure where to put all of these so made a repo for it, most of the SPL is tested. Curious to know what you think!

@joncinque
Copy link
Contributor

Would this IDL be usable without the custom coder, which is provided in a separate library? If it requires an additional outside library, it would probably do better to live in that other library

@acheroncrypto
Copy link
Contributor Author

Yes I agree, I think there was a miscommunication for where to submit these IDLs but now that they have been merged into Anchor coral-xyz/anchor#2143 this PR can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants