-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
Description
It would be great if Shank could capture all the PDAs of a program in the IRL so they can be auto-generated by Solita (See metaplex-foundation/metaplex-program-library#420).
I'm not sure if something like this is feasible with Rust macro, but this is what I have in mind.
#[repr(C)]
- #[derive(Clone, Debug, PartialEq, BorshSerialize, BorshDeserialize, ShankAccount)]
+ #[derive(Clone, Debug, PartialEq, BorshSerialize, BorshDeserialize, ShankPda)]
+ #[seed(0, literal="metadata")]
+ #[seed(1, programId)]
+ #[seed(2, name="mint", desc="The public key of the mint account")]
+ #[seed(3, literal="edition")]
pub struct MasterEditionV2 {
pub key: Key,
pub supply: u64,
pub max_supply: Option<u64>,
}Where a seed can be one of three types:
literal="something": The seed is literally the string"something".programId: The seed is the ID of the program.name="something", desc="some description": The seed is a custom parameter that needs to be provided.