Add support for remaining accounts resolution #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds two strategy for resolving remaining accounts on a given instruction:
arg
, which expects an array ofPublicKey
,Signer
or both as an (extra) argument, and use that arg to fill remaining accounts.resolver
for custom remaining accounts resolution.For example, imagine the following example that burns Compressed NFTs and accepts the "Proof" of the leaf to burn as remaining accounts.
Given an array of
PublicKey
as the Proof, before this PR we would need to do the following:After this PR, we can now pass the proof directly as an extra argument of the burn instruction like so:
To make this work, we simply need to tell Kinobi that the remaining accounts of the burn instruction rely on an extra argument called
proof
.