Expand description
Batch account operations.
Common multi-account patterns as single methods with clearer intent and fewer repeated unsafe blocks. These are operations that every serious Solana program needs but nobody bundles at the substrate level.
Functions§
- close_
and_ transfer - Transfer all lamports from
sourcetodestinationand zero the source. - realloc_
checked - Checked realloc that also ensures the account remains rent-exempt after resizing.
- require_
account_ type - Assert that an account has the expected discriminator AND is owned by the given program. This two-check combo is the most common “is this the right account type?” pattern in Solana programs.
- require_
address - Assert that an account’s address matches an expected address.
- require_
rent_ exempt - Verify that an account is rent-exempt given the current rent parameters.
- require_
same_ address - Assert that two accounts have the same address.
- transfer_
lamports - Transfer
amountlamports between two accounts without CPI. - zero_
data - Zero the data bytes of an account without changing lamports or owner.