Derive Macro shank::ShankAccount

source ·
#[derive(ShankAccount)]
{
    // Attributes available to this derive:
    #[padding]
}
Expand description

Annotates a struct that shank will consider an account containing de/serializable data.

Examples

use shank::ShankAccount;
use borsh::{BorshDeserialize, BorshSerialize};

#[derive(Clone, BorshSerialize, BorshDeserialize, ShankAccount)]
pub struct Metadata {
    pub update_authority: Pubkey,
    pub mint: Pubkey,
    pub primary_sale_happened: bool,
}

Note

The fields of a ShankAccount struct can reference other types as long as they are annotated with BorshSerialize or BorshDeserialize.