@project-serum/anchor
Advanced tools
Changelog
[0.20.0] - 2022-01-06
init_if_needed
now checks rent exemption when init is not needed (#1250).associated_token::authority
is used (#1240).workspace
and Wallet
exports (#1137).recent
to processed
and max
to finalized
(#1128)translateAddress
which currently leads to failing browser code. Now uses PublicKey
constructor instead of prototype chain constructor name checking which doesn't work in the presence of code minifying/mangling(#1138)init_if_needed
and init is not needed(#1221)programdata_address: Option<Pubkey>
field to Program
account. Will be populated if account is a program owned by the upgradable bpf loader (#1125)serialize
function because it has a default impl now. Similarly, they no longer have to implement try_deserialize
which now delegates to try_deserialize_unchecked
by default(#1156).set_inner
method to Account<'a, T>
to enable easy updates (#1177).fetch
and fetchMultiple
(#1171).AsRef<T>
for Account<'a, T>
(#1173)anchor expand
command which wraps around cargo expand
(#1160)Rc<dyn Signer>
instead of Keypair
(#975).#[repr(packed)]
to #[repr(C)]
for zero copy accounts (#1106).prelude
module or the accounts
module but not longer directly under the root.
Deprecated account types are no longer imported by the prelude (#1208).Changelog
[0.19.0] - 2021-12-08
deprecated
attribute to ProgramAccount
(#1014).Cargo.toml
into extracted IDL (#1061).deprecated
attribute to Loader
(#1078).init_if_needed
attribute now checks that given attributes (e.g. space, owner, token::authority etc.) are validated even when init is not needed (#1096).ErrorCode::AccountNotInitialized
error to separate the situation when the account has the wrong owner from when it does not exist (#1024).no-log-ix-name
flag (#1057).ProgramData
and UpgradableLoaderState
can now be passed into Account
as generics. see UpgradeableLoaderState. UpgradableLoaderState
can also be matched on to get ProgramData
, but when ProgramData
is used instead, anchor does the serialization and checking that it is actually program data for you (#1095).postInstructions
and preInstructions
as a replacement for (the now deprecated) instructions
(#1007).getAccountInfo
helper method to account namespace/client (#1084).Changelog
[0.18.2] - 2021-11-14
SystemAccount<'info>
account type for generic wallet addresses or accounts owned by the system program (#954)idl parse
subcommand (#941).os
and cpu
to npm package @project-serum/anchor-cli
(#976).Changelog
[0.18.0] - 2021-10-24
solana-test-validator
in Anchor.toml (#834).target/types
directory now created on build to store a TypeScript types file for each program's IDL (#795).Program<T>
can now be typed with an IDL type (#795).mint::freeze_authority
keyword for mint initialization within #[derive(Accounts)]
(#835).AccountLoader
type for zero_copy
accounts with support for CPI (#792).#[account(init_if_needed)]
keyword for allowing one to invoke the same instruction even if the account was created already (#906).signer
, mut
, has_one
, owner
, raw constraints and address
(#905, #913).#[account(signer)]
constraint now enforce signer when the "cpi"
feature is enabled (#849).Changelog
[0.17.0] - 2021-10-03
localnet
command for starting a local solana-test-validator
with the workspace deployed (#820).CpiContext
accounts must now be used with the accounts struct generated in the crate::cpi::accounts::*
module. These structs correspond to the accounts context for each instruction, except that each field is of type AccountInfo
(#824).Changelog
[0.16.2] - 2021-09-27
--detach
flag to anchor test
(#770).associated_token
keyword for initializing associated token accounts within #[derive(Accounts)]
(#790).AccountMeta
s for Rust clients now properly set the isSigner
field (#762).