pub struct HopperCtx<'a, T>where
T: HopperAccounts<'a>,{
pub accounts: T,
pub bumps: <T as HopperAccounts<'a>>::Bumps,
pub program_id: &'a Address,
pub instruction_data: &'a [u8],
pub remaining_accounts: &'a [AccountView],
}Expand description
Typed instruction context carrying validated accounts, bumps, and metadata.
Replaces Anchor’s Context<T> with Hopper-native semantics: receipts,
explain, schema access, and remaining accounts.
Fields§
§accounts: TValidated accounts struct.
bumps: <T as HopperAccounts<'a>>::BumpsResolved PDA bumps.
program_id: &'a AddressThe executing program’s address.
instruction_data: &'a [u8]Remaining unparsed instruction data (after dispatch tag).
remaining_accounts: &'a [AccountView]Accounts not consumed by the struct (for CPI or dynamic use).
Implementations§
Source§impl<'a, T> HopperCtx<'a, T>where
T: HopperAccounts<'a>,
impl<'a, T> HopperCtx<'a, T>where
T: HopperAccounts<'a>,
Sourcepub fn emit_receipt(&self) -> Result<(), ProgramError>
pub fn emit_receipt(&self) -> Result<(), ProgramError>
Emit a default receipt for the current mutation.
Routes to the existing Hopper receipt infrastructure when a receipt profile is bound to this context.
Sourcepub fn new(
accounts: T,
bumps: <T as HopperAccounts<'a>>::Bumps,
program_id: &'a Address,
instruction_data: &'a [u8],
remaining_accounts: &'a [AccountView],
) -> HopperCtx<'a, T>
pub fn new( accounts: T, bumps: <T as HopperAccounts<'a>>::Bumps, program_id: &'a Address, instruction_data: &'a [u8], remaining_accounts: &'a [AccountView], ) -> HopperCtx<'a, T>
Construct a context from pre-validated parts.
Callers must ensure all accounts have already been validated.
Typically used by derive-generated try_from_accounts or entry().
Auto Trait Implementations§
impl<'a, T> Freeze for HopperCtx<'a, T>
impl<'a, T> RefUnwindSafe for HopperCtx<'a, T>
impl<'a, T> Send for HopperCtx<'a, T>
impl<'a, T> Sync for HopperCtx<'a, T>
impl<'a, T> Unpin for HopperCtx<'a, T>
impl<'a, T> UnsafeUnpin for HopperCtx<'a, T>
impl<'a, T> UnwindSafe for HopperCtx<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more