Expand description
Anchor-compatible instruction discriminators for Kvault.
Each instruction is identified by the first 8 bytes of
SHA-256("global:<snake_case_name>"). The constants are computed at
compile time via a const-compatible SHA-256 implementation.
Enums§
- Kvault
Instruction - Known Kvault instruction types, identified by their 8-byte discriminator.
Statics§
- BUY
- Discriminator for the
buyinstruction. - DEPOSIT
- Discriminator for the
depositinstruction. - INVEST
- Discriminator for the
investinstruction. - INVEST_
WITH_ MAX_ AMOUNT - Discriminator for the
invest_with_max_amountinstruction. - REDEEM_
IN_ KIND - Discriminator for the
redeem_in_kindinstruction. - SELL
- Discriminator for the
sellinstruction. - WITHDRAW
- Discriminator for the
withdrawinstruction. - WITHDRAW_
FROM_ AVAILABLE - Discriminator for the
withdraw_from_availableinstruction.
Functions§
- compute_
discriminator - Compute the 8-byte Anchor discriminator for a given instruction name.
- identify_
instruction - Identify a Kvault instruction from its raw instruction data.
- sha256_
first8 - Const-compatible SHA-256 returning only the first 8 bytes. Supports messages up to 119 bytes (two 64-byte blocks).