Expand description
Verified Anchor runtime support (Milestone 2).
Re-exports§
pub use account_data::AccountData;pub use account_data::ProgramId;pub use account_data::System;pub use account::Account;pub use account::Signer;pub use account::Program;pub use account::SystemAccount;pub use account::UncheckedAccount;pub use context::Context;pub use borsh;pub use solana_program;pub use inventory;
Modules§
- account
- The six typed wrappers the M7a macro recognises. Each is a thin marker over
&'info AccountInfo<'info>;Account<'info, T>additionally carries the Borsh-deserialised T (the macro fills it intry_accounts). - account_
data - Traits that user types carry into typed-account wrappers.
- context
Context<'a, 'b, 'c, 'info, T>— mirrors stock Anchor’s signature so a verified-anchor instruction handler is type-identical to a stock-Anchor one.- prelude
- Recommended
use verified_anchor::prelude::*;— gives users the typed wrappers, traits,Context, and the derive macros in one import.
Macros§
- emit_
specs - Drop ONE call in your crate’s lib (e.g. bottom of
src/lib.rs). Expands to a test that, whenVERIFIED_ANCHOR_SPEC_DIRis set (bycargo verified-anchor check), writes spec files for every derived struct in this crate. Placing it in the lib is REQUIRED: the emitter must be same-crate as theinventory::submit!s (cross-crate harnesses dead-strip).
Structs§
- Spec
Entry - One registered
#[derive(VerifiedAccounts)]struct.
Enums§
- VAError
- Why account validation failed.
fieldis the struct field name that failed.
Traits§
- Accounts
- THE DEVELOPER SURFACE (M7a).
try_accountscallsSelf::validate(the proven layer) and Borsh-deserialises eachAccount<T>field. - Validate
- Implemented by
#[derive(VerifiedAccounts)]. Validation is positional over the runtime account slice (index = field declaration order), matching the LeanCtx.
Functions§
- collect_
specs - All registered structs in the current compilation artifact.
- write_
spec_ files - Write one spec file per registered struct into
dir. Filename is<name>.<kind>where kind islifecycleorvalidation; the file content is thelean_spec()literal. (No JSON — the literal is the whole content, so there’s nothing to escape.)