GitHub

References

Account Types

Minimal reference examples for Anchor account types.

TypeExampleDescription
Account<'info, T>

Github Solpg

Account container that checks ownership on deserialization

AccountInfo<'info>

Github Solpg

AccountInfo can be used as a type but Unchecked Account should be used instead

AccountLoader<'info, T>

Github Solpg

Type facilitating on demand zero copy deserialization

Box<Account<'info, T>>
Box<InterfaceAccount<'info, T>>

Github Solpg

Box type to save stack space

Interface<'info, T>

Github Solpg

Type validating that the account is one of a set of given Programs

InterfaceAccount<'info, T>

Github Solpg

Account container that checks ownership on deserialization

Option<Account<'info, T>>

Github Solpg

Option type for optional accounts

Program<'info, T>

Github Solpg

Type validating that the account is the given Program

Signer<'info>

Github Solpg

Type validating that the account signed the transaction

SystemAccount<'info>

Github Solpg

Type validating that the account is owned by the system program

Sysvar<'info, T>

Github Solpg

Type validating that the account is a sysvar and deserializing it

UncheckedAccount<'info>

Github Solpg

Explicit wrapper for AccountInfo types to emphasize that no checks are performed

Previous
Account Constraints