#instructions #programs #solana #sysvar #introspection #serialization #documentation

solana-instructions-sysvar

Type for instruction introspection during execution of Solana programs

4 releases (2 stable)

2.2.1 Feb 12, 2025
2.2.0 Feb 7, 2025
0.0.2 Dec 11, 2024
0.0.1 Dec 10, 2024

#635 in Magic Beans

Download history 73/week @ 2024-12-04 229/week @ 2024-12-11 1/week @ 2024-12-18 1/week @ 2025-01-08 8954/week @ 2025-02-05 17827/week @ 2025-02-12

26,781 downloads per month
Used in 189 crates (5 directly)

Apache-2.0

185KB
3K SLoC

The serialized instructions of the current transaction.

The instructions sysvar provides access to the serialized instruction data for the currently-running transaction. This allows for instruction introspection, which is required for correctly interoperating with native programs like the secp256k1 and ed25519 programs.

Unlike other sysvars, the data in the instructions sysvar is not accessed through a type that implements the Sysvar trait. Instead, the instruction sysvar is accessed through several free functions within this module.

See also the Solana documentation on the instructions sysvar.

Examples

For a complete example of how the instructions sysvar is used see the documentation for secp256k1_instruction in the solana-sdk crate.

Dependencies

~0.3–5.5MB
~17K SLoC