1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
//! # pina
//!
//! A performant Solana smart contract framework built on top of
//! [`pinocchio`](https://docs.rs/pinocchio) — a lightweight alternative to
//! `solana-program` that massively reduces dependency bloat and compute units.
//!
//! ## Features
//!
//! - **Zero-copy account deserialization** via `bytemuck` — no heap allocation.
//! - **`no_std` compatible** — designed for on-chain deployment to the SBF
//! target.
//! - **Discriminator system** — every account, instruction, and event type
//! carries a discriminator as its first field, enabling safe type
//! identification.
//! - **Validation chaining** — chain assertions on `AccountView` references
//! (e.g. `account.assert_signer()?.assert_writable()?.assert_owner(&id)?`).
//! - **Proc-macro sugar** — `#[account]`, `#[instruction]`, `#[event]`,
//! `#[error]`, `#[discriminator]`, and `#[derive(Accounts)]` reduce
//! boilerplate.
//! - **CPI helpers** — account creation, PDA allocation, and token operations.
//!
//! ## Crate features
//!
//! - `logs` *(default)* — enables on-chain logging via `solana-program-log`.
//! - `derive` *(default)* — enables the `pina_macros` proc-macro crate.
//! - `token` — enables SPL token / token-2022 helpers and associated token
//! account utilities.
/// Re-export of the [`bytemuck`] crate for zero-copy serialization.
pub use bytemuck;
/// Marker trait for types that can be safely cast from any byte pattern.
pub use Pod;
/// Marker trait for types that can be safely zeroed.
pub use Zeroable;
/// Re-export all proc macros from `pina_macros` when the `derive` feature is
/// enabled.
pub use *;
/// Macro for implementing bidirectional conversion between Pod wrappers and
/// standard integers.
pub use impl_int_conversion;
/// Re-export of the [`pinocchio`] crate for low-level Solana program
/// primitives.
pub use pinocchio;
/// A Solana account as seen by the runtime during instruction execution.
pub use AccountView;
/// A 32-byte Solana public key / address.
pub use Address;
/// The result type returned by Solana program entrypoints and instruction
/// handlers.
pub use ProgramResult;
/// Number of bytes in a Solana address (32).
pub use ADDRESS_BYTES;
/// Maximum length in bytes of a single PDA seed.
pub use MAX_SEED_LEN;
/// Maximum number of seeds allowed when deriving a PDA.
pub use MAX_SEEDS;
/// A single seed byte slice used in PDA signing.
pub use Seed;
/// A set of seeds that identifies a PDA signer for CPI calls.
pub use Signer;
/// The Solana program entrypoint attribute.
pub use entrypoint;
/// Error type returned by Solana programs.
pub use ProgramError;
/// An account reference passed as part of an instruction.
pub use InstructionAccount;
/// A view of a cross-program invocation instruction.
pub use InstructionView;
/// Macro for declaring a Solana program entrypoint.
pub use program_entrypoint;
/// Solana sysvar access utilities.
pub use sysvars;
/// Re-export of `pinocchio_associated_token_account` for ATA operations.
pub use pinocchio_associated_token_account as associated_token_account;
/// Re-export of `pinocchio_system` for system program CPI helpers.
pub use pinocchio_system as system;
/// Re-export of `pinocchio_token` for SPL Token program CPI helpers.
pub use pinocchio_token as token;
/// Re-export of `pinocchio_token_2022` for Token-2022 program CPI helpers.
pub use pinocchio_token_2022 as token_2022;
/// Alignment-safe Pod primitive wrappers (`PodBool`, `PodU16`, `PodU64`,
/// etc.).
pub use *;
/// Macro for creating a compile-time [`Address`] from a base-58 string
/// literal.
pub use address;
/// Macro for declaring a program ID constant with associated `ID` and `id()`
/// items.
pub use declare_id;
/// Re-export of `solana_program_log` for on-chain logging utilities.
pub use solana_program_log;
/// A logger instance for formatting on-chain log messages.
pub use Logger;
/// Logs the current compute unit usage to the Solana runtime.
pub use log_cu_usage;
/// Re-export of the [`typed_builder`] crate for compile-time checked builder
/// patterns.
pub use typed_builder;
/// Derive macro that generates a type-safe builder with compile-time field
/// checking.
pub use TypedBuilder;
/// CPI helpers for account creation, PDA allocation, and account closure.
pub use crate*;
/// Built-in framework error types.
pub use crate*;
/// PDA (Program Derived Address) derivation and verification functions.
pub use crate*;
/// Core traits for account validation, deserialization, and instruction
/// processing.
pub use crate*;
/// Typed instruction construction and account metadata helpers.
pub use crateInstructionBuilder;
/// Utility functions for instruction parsing, assertions, and token address
/// derivation.
pub use crate*;
/// Sets up a `no_std` Solana program entrypoint.
///
/// This macro wires up the BPF entrypoint, disables the default allocator, and
/// installs a minimal panic handler. The entry function receives:
///
/// ```ignore
/// fn process_instruction(
/// program_id: &Address,
/// accounts: &[AccountView],
/// data: &[u8],
/// ) -> ProgramResult
/// ```
///
/// Usage:
///
/// ```ignore
/// nostd_entrypoint!(process_instruction);
/// ```
///
/// An optional second argument overrides the maximum number of transaction
/// accounts (defaults to `pinocchio::MAX_TX_ACCOUNTS`).
/// Logs a message to the Solana runtime.
///
/// Supports two forms:
/// - `log!("simple string literal")` — works in all crates
/// - `log!("format: {}", value)` — works in pina and crates that depend on
/// `solana-program-log` directly (the proc macro generates absolute paths)
///
/// When the `logs` feature is disabled this is a no-op that compiles to
/// nothing.
/// Re-exports commonly used traits and helpers for instruction modules.
///
/// `use pina::prelude::*;` is the recommended import style inside on-chain
/// modules that want validation traits without long import lists.
///
/// <!-- {=pinaMdtManagedDocNote|trim|linePrefix:"/// ":true} -->/// This section is synchronized by `mdt` from `api-docs.t.md`.<!-- {/pinaMdtManagedDocNote} -->