pina
Core runtime crate for building Solana programs on top of pinocchio.
It provides zero-copy account loaders, discriminator-aware account/instruction/event modeling, account validation traits, and no_std entrypoint helpers.
Installation
Enable optional token helpers:
What This Crate Includes
nostd_entrypoint!forno_stdSolana entrypoint wiring.#[account],#[instruction],#[event],#[error],#[discriminator], and#[derive(Accounts)]integration via the defaultderivefeature.- Validation chains on
AccountView(assert_signer,assert_writable,assert_owner, PDA checks, sysvar checks, and more). - Zero-copy POD wrappers (
PodU*,PodI*,PodBool) for stable on-chain layouts. - CPI helpers for system/token operations.
Feature Flags
| Feature | Default | Description |
|---|---|---|
derive |
Yes | Enables proc macros (#[account], #[instruction], etc.) |
logs |
Yes | Enables on-chain logging via solana-program-log |
token |
No | Enables SPL token / token-2022 helpers and ATA utilities |
Minimal Program Skeleton
use *;
declare_id!;
nostd_entrypoint!;
Related Crates
pina_macros: proc-macro implementations for the attributes and derives used here.pina_cli: CLI/library used to generate Codama IDLs from Pina programs.pina_sdk_ids: shared Solana program/sysvar IDs.
Codama IDLs
pina models are designed to be extracted into Codama IDLs through pina_cli.
From there you can generate JS clients with Codama renderers, or Pina-style Rust clients using this repository's pina_codama_renderer tool.