Expand description
willow: A collection of utilities for building Solana programs with pinocchio
This crate provides utilities for:
- Account management with automatic serialization/deserialization
- Context validation
- Program Derived Address (PDA) creation
- Associated Token Account (ATA) creation
§Example
ⓘ
use willow::prelude::*;
#[derive(WillowAccount)]
pub struct Vault {
pub owner: Pubkey,
pub total_assets: u64,
pub bump: u8,
}
impl Vault {
pub fn initialize(&mut self, owner: Pubkey, bump: u8) -> ProgramResult {
self.owner = owner;
self.total_assets = 0;
self.bump = bump;
Ok(())
}
}Re-exports§
pub use account::PinoAccount;pub use account::WillowAccount;pub use account::AccountInfoExt;pub use account::SerializationHelper;pub use context::PinoContext;pub use ata::AtaBuilder;pub use account::FixedString;pub use account::FixedBytes;