-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
transfer hook: Add JS support for managing hook programs #5974
Comments
@buffalojoec Can I work on this if its still open? |
Sure! But since this issue was opened we've added a good amount of transfer hook support to Right now, I'd say we need the two instructions for manipulating your program's list of extra account metas, and maybe some extra API sugar for serialization of extra metas. We can just add this stuff to the What do you think? |
Sounds good, I'm new to Solana and would love to contribute. I looked at the code base and found these files:
|
@deepto98 You're close, but there's also an interface that Transfer Hook programs are implementing, and in order to create/update that program's list of extra required metas, we're going to add the two client-side instructions. That interface can be found here. What I would suggest is creating a file Like the Rust instructions, we can simply require a list of To do that, they'll leverage the layouts here. solana-program-library/token/js/src/extensions/transferHook/state.ts Lines 61 to 100 in 0ab6ed7
|
@buffalojoec Thanks for the pointers, I'll go through these and try to understand the architecture |
Problem
Currently, we've got some of the minimally necessary "extra account metas" support within
@solana/spl-token
. However, the toolset isn't complete for those who wish to create and test a transfer hook program against the interface.For example, the instructions one would use to hit their hook program and initialize or update extra account metas is not present in
@solana/spl-token
, nor is there support for creatingExtraAccountMeta
types with packed seed configurations, etc.Solution
I believe the best way to do this is to roll a
@solana/spl-transfer-hook
package and provide all of the necessary off-chain tooling from the Rust libraries.Then,
@solana/spl-token
can use this package to offer it's various tooling that matches Token2022's crate.The text was updated successfully, but these errors were encountered: