Expand description
Program utility functions
Macros§
- ensure_
single_ feature - Macro to ensure exactly one feature from a list is enabled
- log_
everywhere - mini helper to log from native Rust or to the program log Very useful for debugging when you have to run some code on Solana and via native Rust
- transfer_
lamports_ anchor - Macro for transferring lamports between accounts that implement the Lamports trait
Functions§
- check_
program_ account - Checks that the supplied program ID is the correct one
- checked_
from_ u256_ le_ bytes_ to_ u64 - Converts a little-endian 256-bit unsigned integer to a 64-bit unsigned integer.
- current_
time - Returns the current Unix timestamp as a
u64. - from_
u64_ to_ u256_ le_ bytes - Converts from little endian u64 type to [u8; 32] type
- next_
optional_ account_ info - Tries to fetch the next account as an optional account from the account iterator
- transfer_
lamports - Transfers lamports from one account to another.
- validate_
mpl_ token_ metadata_ key - Checks if the key is from sysvar instructions
- validate_
rent_ key - Checks if the key is from rent
- validate_
spl_ associated_ token_ account_ key - Checks if the key is from spl associated token account
- validate_
system_ account_ key - Checks if the key is from system account
- validate_
sysvar_ instructions_ key - Checks if the key is from sysvar instructions