Skip to main content

hopper_dispatch_8

Macro hopper_dispatch_8 

Source
macro_rules! hopper_dispatch_8 {
    (
        $program_id:expr, $accounts:expr, $data:expr;
        $( [ $($disc:literal),+ ] => $handler:expr ),+ $(,)?
    ) => { ... };
}
Expand description

8-byte discriminator dispatch (Anchor/Quasar compatible).

Uses 8-byte discriminators instead of 1-byte tags. This allows interoperability with Anchor IDLs and Quasar programs.

hopper_dispatch_8! {
    program_id, accounts, instruction_data;
    [0xe4, 0x45, 0xa5, 0x2e, 0x51, 0xcb, 0x9a, 0x1d] => initialize,
    [0xf2, 0x23, 0xc6, 0x89, 0x52, 0xe1, 0xf2, 0xb6] => deposit,
}