Crate program_utils

Crate program_utils 

Source
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