@project-serum/anchor
Advanced tools
Changelog
[0.16.0] - 2021-09-16
Program
type introduced for executable accounts (#705).Signer
type introduced for signing accounts where data is not used (#705).UncheckedAccount
type introduced as a preferred alias for AccountInfo
(#745).#[account(owner = <pubkey>)]
now requires a Pubkey
instead of an account (#691).Changelog
[0.15.0] - 2021-09-07
Account
type to replace ProgramAccount
and CpiAccount
, both of which are deprecated (#686).Box
can be used with Account
types to reduce stack usage (#686).Owner
trait, which is automatically implemented by all #[account]
structs (#686).anchor-debug
only) (#681).declare_id!
(#686).Changelog
[0.14.0] - 2021-09-02
Unnamed
structs instead of panic (#605).#[account(init, seeds = [...], mint::decimals = <expr>, mint::authority = <expr>)]
(#562).AsRef<AccountInfo>
for AccountInfo
wrappers (#652).trait Key
by removing AccountInfo
cloning (#652).#[account(init, seeds = [...], token = <expr>, authority = <expr>)]
to #[account(init, token::mint = <expr> token::authority = <expr>)]
(#562).#[associated]
and #[account(associated = <target>, with = <target>)]
are both removed (#612).anchor launch
command (#634).#[account(init)]
now creates the account inside the same instruction to be consistent with initializing PDAs. To maintain the old behavior of init
, replace it with #[account(zero)]
(#641).bump
must be provided when using the seeds
constraint. This has been added as an extra safety constraint to ensure that whenever a PDA is initialized via a constraint the bump used is the one created by Pubkey::find_program_address
(#641).try_from_init
has been removed from Loader
, ProgramAccount
, and CpiAccount
and replaced with try_from_unchecked
(#641).AccountsInit
trait (#641).try_from
methods for ProgramAccount
, Loader
, and ProgramState
now take in an additional program_id: &Pubkey
parameter (#660).Changelog
[0.13.0] - 2021-08-08
[registry]
section in the Anchor toml (#570).anchor login <api-token>
command (#570).anchor publish <package>
command (#570).anchor_version
field to the Anchor.toml for specifying the anchor docker image to use for verifiable builds (#570).solana_version
field to the Anchor.toml for specifying the solana toolchain to use for verifiable builds (#570).init
(#587).Changelog
[0.12.0] - 2021-08-03
members
/ exclude
in config programs
section (#546).clusters.localnet
(#554).Changelog
[0.11.1] - 2021-07-09
require
macro for specifying assertions that return error codes on failure (#483).bump
keyword is added to the accounts constraints, which is used to add an optional bump seed to the end of a seeds
array. When used in conjunction with both init
and seeds
, then the program executes find_program_address
to assert that the given bump is the canonical bump (#483).