Expand description
Hopper Runtime – canonical semantic runtime surface.
Hopper Runtime owns the public rules, validation, typed loading, CPI
semantics, and execution context that authored Hopper code targets.
Hopper Native owns the raw execution boundary. Pinocchio and
solana-program remain compatibility backends isolated behind compat/.
Re-exports§
pub use account::AccountView;pub use account::RemainingAccounts;pub use account_wrappers::Account;pub use account_wrappers::InitAccount;pub use account_wrappers::Program;pub use account_wrappers::ProgramId;pub use account_wrappers::Signer as HopperSigner;pub use account_wrappers::SystemId;pub use address::Address;pub use audit::AccountAudit;pub use audit::DuplicateAccount;pub use borrow::Ref;pub use borrow::RefMut;pub use policy::HopperInstructionPolicy;pub use policy::HopperProgramPolicy;pub use ref_only::HopperRefOnly;pub use context::Context;pub use cpi::invoke;pub use cpi::invoke_signed;pub use error::ProgramError;pub use field_map::FieldInfo;pub use field_map::FieldMap;pub use foreign::ForeignLens;pub use foreign::ForeignManifest;pub use interop::TransparentAddress;pub use migrate::apply_pending_migrations;pub use migrate::LayoutMigration;pub use migrate::MigrationEdge;pub use tail::read_tail;pub use tail::read_tail_len;pub use tail::tail_payload;pub use tail::write_tail;pub use tail::TailCodec;pub use instruction::CpiAccount;pub use instruction::InstructionAccount;pub use instruction::InstructionView;pub use instruction::Seed;pub use instruction::Signer;pub use layout::HopperHeader;pub use layout::LayoutContract;pub use layout::LayoutInfo;pub use result::ProgramResult;pub use zerocopy::AccountLayout;pub use zerocopy::WireLayout;pub use zerocopy::ZeroCopy;pub use segment::Segment;pub use segment::TypedSegment;pub use segment_borrow::AccessKind;pub use segment_borrow::SegmentBorrow;pub use segment_borrow::SegmentBorrowGuard;pub use segment_borrow::SegmentBorrowRegistry;pub use segment_lease::SegRef;pub use segment_lease::SegRefMut;pub use segment_lease::SegmentLease;
Modules§
- account
- Hopper-owned account view for Solana programs.
- account_
wrappers - Anchor-grade typed account wrappers for
#[hopper::context]. - address
- Hopper-owned address type for Solana programs.
- audit
- borrow
- Hopper-owned borrow guards for account data.
- context
- Execution context for Hopper programs.
- cpi
- Cross-program invocation for Hopper programs.
- cpi_
event - Self-CPI event emission primitives.
- crank
- Crank marker type emitted by the
#[hopper::crank]attribute. - dyn_cpi
- Stack-allocated variable-length CPI builder.
- error
- Hopper-owned program error type for Solana on-chain programs.
- field_
map - Field-level layout descriptors for inspectable state contracts.
- foreign
- Manifest-backed foreign-account lenses.
- instruction
- Hopper-owned CPI instruction types.
- interop
- Cross-framework type interop for Hopper.
- layout
- Layout contracts as runtime truth.
- log
- Backend-neutral logging helpers.
- migrate
- Schema-epoch in-place migration runtime.
- option_
byte - Zero-copy, tag-validated optional values for instruction args.
- pda
- Hopper-owned PDA ergonomics on top of the active backend substrate.
- pod
Pod, the canonical runtime-layer “safe to interpret from raw bytes” marker.- policy
- Program-level safety policy.
- ref_
only - Compile-proven borrow-guard constraint.
- remaining
- Remaining-accounts accessor with strict and passthrough modes.
- rent
- Rent-exemption helpers.
- result
- Canonical result type for Hopper programs.
- segment
- Runtime-local segment primitive.
- segment_
borrow - Segment-level borrow registry for fine-grained access control.
- segment_
lease - RAII-leased typed segment guards.
- syscall
- Small compatibility shims for individual runtime syscalls used directly by Hopper-owned crates.
- syscalls
- Minimal syscall shims exposed through Hopper Runtime.
- system
- TEMPORARY: backend facade for System Program CPI builders.
- tail
- Hybrid serialization tail for
#[hopper::state(dynamic_tail = T)]. - token
- TEMPORARY: backend facade for SPL Token CPI builders.
- token_
2022_ ext - Zero-copy Token-2022 extension TLV readers.
- utils
- Small utilities for Hopper program authors.
- zerocopy
- Unified zero-copy trait family.
Macros§
- address
- Compile-time base58 address literal.
- err
- Return an error immediately. Parallel to Anchor’s
err!. - error
- Alias for
err!. Anchor compatibility shim so ported code needs no rename. Functionally identical. - fast_
entrypoint - Backward-compatible alias for the fast Hopper entrypoint macro.
- hopper_
emit_ cpi - Emit a Hopper event via self-CPI for reliable indexing.
- hopper_
entrypoint - Declare the explicit Hopper runtime entrypoint bridge.
- hopper_
fast_ entrypoint - Declare the fast two-argument Hopper entrypoint.
- hopper_
lazy_ entrypoint - Declare the Hopper lazy entrypoint.
- hopper_
log - Cheap structured logging for hot handlers.
- hopper_
unsafe_ region - Auditable raw-pointer boundary.
- layout_
migrations - Compose a layout’s
LayoutMigration::MIGRATIONSchain from a list of#[hopper::migrate]-emitted edge constants. - lazy_
entrypoint - Backward-compatible alias for the lazy Hopper entrypoint macro.
- msg
- Backend-neutral logging macro.
- no_
allocator - nostd_
panic_ handler - program_
entrypoint - Declare the canonical Hopper program entrypoint.
- require
- Early-return with an error if the condition is false.
- require_
eq - Assert two values are equal, returning an error on mismatch.
- require_
gt - Assert
left > rightstrictly. - require_
gte - Assert
left >= right, returning the supplied error on underrun. Useful for lamport / balance checks. - require_
keys_ eq - Assert two public keys (or any byte slices convertible via
[
AsRef<[u8; 32]>]) are equal. Narrower thanrequire_eq!but matches the ergonomic spelling ecosystem migrators coming from Anchor / Jiminy are familiar with. - require_
keys_ neq - Assert two public keys are not equal. Used for pinning distinct
accounts (authority != user, source != destination). Same coercion
and error semantics as
require_keys_eq!. - require_
lt - Assert
left < rightstrictly. Anchor-parity sibling ofrequire_gt!. Default error isProgramError::InvalidArgumentbecause a failed ordering check most often flags a bad user input. - require_
lte - Assert
left <= right. Anchor-parity sibling ofrequire_gte!. - require_
neq - Assert two values are not equal. Early-returns with the supplied
error on match (or
ProgramError::InvalidArgumentin the short form). Symmetric withrequire_eq!. - seeds
- Convenience macro for building an array of
Seedfrom expressions.
Constants§
Traits§
- Pod
- Marker for types that can be safely overlaid on raw account bytes.