All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Note: Version 0 of Semantic Versioning is handled differently from version 1 and above. The minor version will be incremented upon a breaking change and the patch version will be incremented for features.
- spl: Add
MasterEditionAccount
account deserialization to spl metadata (#2393). - lang: Add the
InitSpace
derive macro to automatically calculate the space at the initialization of an account (#2346). - cli: Add
env
option to verifiable builds (#2325). - cli: Add
idl close
command to close a program's IDL account (#2329). - cli:
idl init
now supports very large IDL files (#2329). - spl: Add
transfer_checked
function (#2353). - spl: Add
approve_checked
function (#2401). - cli: Add
--skip-build
option to the verify command (#2387). - client: Add support for multithreading to the rust client: use flag
--multithreaded
(#2321). - client: Add
async_rpc
a method which returns a nonblocking safecoin rpc client (2322). - avm, cli: Use the
rustls-tls
feature ofreqwest
so that users don't need OpenSSL installed (#2385). - cli: Add
--arch sbf
option to compile programs usingcargo build-sbf
(#2398).
- ts: Make the return type of
AccountClient.fetchMultiple
match the account type being fetched (#2390) - cli: Don't regenerate idl in read_all_programs(). (#2332).
- ts:
provider.simulate
will send the transaction withsigVerify: false
if nosigners
are present (#2331). - cli: Failing commands will return the correct exit status. (#2370).
- idl: Update the IDL program to use non-deprecated account types (#2365).
- ts: Enum fields weren't being converted from snake_case to camelCase (#2378).
- lang/cli: Update to safecoin-program version 1.14.16 and rust version 1.60, appears to still be incompatible with 1.15 CLI (#2420).
- lang: Remove deprecated account types:
CpiAccount
,Loader
andProgramAccount
(#2375). - lang: Remove
state
andinterface
attributes (#2285). - lang: Remove deprecated literal constraint which has been replaced by
#[account(constraint = {})]
(#2379). - lang:
account(zero_copy)
andzero_copy
attributes now derive thebytemuck::Pod
andbytemuck::Zeroable
traits instead of usingunsafe impl
(#2330). This imposes useful restrictions on the type, like not having padding bytes and all fields beingPod
themselves. See bytemuck::Pod for details. This change requires addingbytemuck = { version = "1.4.0", features = ["derive", "min_const_generics"]}
to yourcargo.toml
. Legacy applications can still use#[account(zero_copy(unsafe))]
and#[zero_copy(unsafe)]
for the old behavior. - ts: Remove
createProgramAddressSync
,findProgramAddressSync
(now available in@safecoin/web3.js
) and updateassociatedAddress
to be synchronous (#2357).
- cli: Add
--run
toanchor test
for running a subset of test suites (#1828). - client: Add
transaction
functions to RequestBuilder (#1958). - spl: Add
create_metadata_accounts_v3
andset_collection_size
wrappers (#2119). - spl: Add
MetadataAccount
account deserialization. (#2014). - spl: Add
update_primary_sale_happened_via_token
wrapper (#2173). - spl: Add
sign_metadata
andremove_creator_verification
wrappers (#2175). - spl: Add
initialize_account3
andinitialize_mint2
(#2265). - spl: Change
serum-dex
toopenbook-dex
(#2308). - lang: Add parsing for consts from impl blocks for IDL PDA seeds generation (#2128).
- lang: Account closing reassigns to system program and reallocates (#2169).
- ts: Add coders for SPL programs (#2143).
- ts: Add
has_one
relations inference so accounts mapped via has_one relationships no longer need to be provided (#2160). - ts: Add ability to set args after setting accounts and retrieving pubkeys (#2160).
- ts: Add
.prepare()
to builder pattern (#2160). - spl: Add
freeze_delegated_account
andthaw_delegated_account
wrappers (#2164). - ts: Add
feePayer
check toAnchorProvider
methods, so that anchor writes the provider's wallet as fee payer if fee payer isn't already set (#2186). - ts: Add nested PDA inference (#2194).
- ts: Add ability to resolve missing accounts with a custom resolver (#2194).
- ts: Update the Safecoin web3 library used by anchor ts to version 1.64.0 (#2220).
- lang: Updates
AccountsClose
to make it safe to call manually (#2209). - lang: Update rust used in the repo version 1.62 (#2272).
- cli: Allow custom cluster config (#2271).
- ts: Add optional flag to parseLogs to throw an error on decoding failure (#2043).
- cli: Add
test.validator.geyser_plugin_config
support (#2016). - cli: Add
account
subcommand to cli (#1923) - cli: Add
ticks_per_slot
option to Validator args (#1875).
- lang: Fix parsing for bytes literals in the IDL (#2261).
- lang: Fix IDL
seed
generation for byte string literals (#2125). - ts: Update seeds inference to allow nested user defined structs within the seeds (#2198).
- event: Fix multiple event listeners with the same name (#2165).
- lang: Prevent the payer account from being initialized as a program account (#2284).
- ts: Fixing breaking change where null or undefined wallet throws an error (#2303).
- ts: Fixed
.fetchNullable()
to be robust towards accounts only holding a balance (#2301). - lang: Only add public enums to the IDL (#2309).
- lang: Fix heap intensive error mapping (#2313).
- ts: SPL coders have been removed from the main Anchor package. (#2155)
- lang: Remove
rent
from constraints (#2265). - spl: Remove
rent
fromassociated_token::Create
(#2265). - lang: Add
Discriminator
andOwner
trait implementation for structures representing instructions (#1997). - ts: '@safely-project/borsh' package is now part of the yarn monorepo (#2290). The borsh package needs to be built before the anchor package can be built but this should happen automatically when running
yarn build
in packages/anchor, see #2299 and #2306. - lang: Add support for optionally passing in accounts using the syntax
Optional<Account<'info, T>>
. Shouldn't affect existing programs but may be a breaking change to tools that use the anchor generated IDL. #2101. - ts: Switch from
@project-serum/anchor
to the@safely-project/anchor
package #2318.
- lang: Add
realloc
,realloc::payer
, andrealloc::zero
as a new constraint group for program accounts (#1986). - lang: Add
PartialEq
andEq
forsafe_anchor_lang::Error
(#1544). - cli: Add
--skip-build
toanchor publish
(#1786). - cli: Add
--program-keypair
toanchor deploy
(#1786). - cli: Add compilation optimizations to cli template (#1807).
- cli:
build
now adds docs to idl. This can be turned off with--no-docs
(#1561). - cli: Add
b
andt
aliases forbuild
andtest
respectively (#1823). - spl: Add more derived traits to
TokenAccount
toMint
(#1818). - spl: Add
sync_native
token program CPI wrapper function (#1833). - cli: Allow passing arguments to an underlying script with
anchor run
(#1914). - ts: Implement a coder for system program (#1920).
- ts: Add
program.coder.types
for encoding/decoding user-defined types (#1931). - client: Add
send_with_spinner_and_config
function to RequestBuilder (#1926). - ts: Implement a coder for SPL associated token program (#1939).
- ts: verbose error for missing
ANCHOR_WALLET
variable when usingNodeWallet.local()
(#1958). - ts: Add
MethodsBuilder#accountsStrict
for strict typing on ix account input (#2019). - Update safecoin dependencies to 1.10.29 (#2027).
- cli: Fix
anchor keys list
reading thetarget
folder in the wrong path (#2063). - cli: Move
overflow-checks
into workspaceCargo.toml
so that it will not be ignored by compiler (#1806). - lang: Fix missing account name information when deserialization fails when using
init
orzero
(#1800). - ts: Expose the wallet's publickey on the Provider (#1845).
- ts: Change
BROWSER
env variable toANCHOR_BROWSER
(#1233). - ts: Add transaction signature to
EventCallback
parameters (#1851). - ts: Change
EventParser#parseLogs
implementation to be a generator instead of callback function (#2018). - lang: Adds a new
&mut reallocs: BTreeSet<Pubkey>
argument toAccounts::try_accounts
(#1986).
- lang: Fix
returns
being serialized asnull
instead ofundefined
in IDL (#1782).
- lang: Fix
anchor build
failing ifTest.toml
included a relative path that didn't exist yet because it's created byanchor build
(#1772). - cli: Update js/ts template to use new
AnchorProvider
class (#1770).
- lang: Add support for multiple test suites with separate local validators (#1681).
- lang: Add return values to CPI client (#1598).
- ts: Add view functions (#1695).
- avm: New
avm update
command to update the Anchor CLI to the latest version (#1670). - cli: Update js/ts templates to use new
program.methods
syntax (#1732). - cli: Workspaces created with
anchor init
now come with theprettier
formatter and scripts included (#1741). - ts: Add
pubkeys
function to methods builder to get all instruction account addresses (#1733). - ts: Export
LangErrorCode
andLangErrorMessage
fromerror.ts
(#1756).
- avm:
avm install
no longer downloads the version if already installed in the machine (#1670). - cli: make
anchor test
fail when used with--skip-deploy
option and without--skip-local-validator
option but there already is a running validator (#1675). - lang: Return proper error instead of panicking if account length is smaller than discriminator in functions of
(Account)Loader
(#1678). - cli: Add
@types/bn.js
todevDependencies
in cli template (#1712). - ts: Event listener no longer crashes on Program Upgrade or any other unexpected log (#1757).
- avm:
avm install
switches to the newly installed version after installation finishes (#1670). - spl: Re-export the
safe_token
crate (#1665). - lang, cli, spl: Update safecoin toolchain to v1.9.13 (#1653 and #1751).
- lang:
Program
type now deserializesprogramdata_address
only on demand (#1723). - ts: Make
Provider
an interface and adjust its signatures and addAnchorProvider
implementor class (#1707). - spl: Change "to" to "from" in
token::burn
(#1080).
- cli: Add
anchor clean
command that's the same ascargo clean
but preserves keypairs insidetarget/deploy
(#1470). - cli: Running
anchor init
now initializes a new git repository for the workspace. This can be disabled with the--no-git
flag (#1605). - cli: Add support for
anchor idl fetch
to work outside anchor workspace (#1509). - cli: [[test.validator.clone]] also clones the program data account of programs owned by the bpf upgradeable loader (#1481).
- lang: Add new
AccountSysvarMismatch
error code and test cases for sysvars (#1535). - lang: Replace
std::io::Cursor
with a customWrite
impl that uses the Safecoin mem syscalls (#1589). - lang: Add
require_neq
,require_keys_neq
,require_gt
, andrequire_gte
comparison macros (#1622). - lang: Handle arrays with const as size in instruction data (#1623.
- spl: Add support for revoke instruction (#1493).
- ts: Add provider parameter to
Spl.token
factory method (#1597).
- ts: Fix the loss of strict typing using the
methods
namespace on builder functions (#1539). - spl: Update
spl/governance
to use new errors (#1582). - client: Fix
Cluster
'sFromStr
implementation (#1362). - lang: Implement
Key
forPubkey
again, soassociated_token::*
constraints can use pubkey targets again (#1601). - lang: Adjust error code so
#[error_code]
works with just importingsafe_anchor_lang::error_code
(#1610). - ts: Fix
safe-token
coder account parsing (#1604). - cli: Fix
npm install
fallback ifyarn
install doesn't work (#1643). - lang: Fix bug where
owner = <target>
would not compile because of missing type annotation (#1648). - ts: Adjust
send
andsimulate
functions inprovider.ts
, so they use the return value ofWallet.signTransaction
(#1527).
- ts: Mark
transaction
,instruction
,simulate
andrpc
program namespaces as deprecated in favor ofmethods
(#1539). - ts: No longer allow manual setting of globally resolvable program public keys in
methods#accounts()
. ([#1548][https://github.com/safely-project/anchor/pull/1548]) - lang/ts: Events are now emitted using the
sol_log_data
syscall (#1608). - lang: Remove space calculation using
#[derive(Default)]
(#1519). - lang: Add support for logging expected and actual values and pubkeys. Add
require_eq
andrequire_keys_eq
macros. Add default error code torequire
macro (#1572). - lang: Add
system_program
CPI wrapper functions. Makesystem_program
module public instead of re-exportingsystem_program::System
(#1629). - cli:
avm use
no long prompts [y/n] if an install is needed first - it just tells the user toavm install
(#1565) - ts: Add
AnchorError
with program stack and also a program stack for non-AnchorError
errors (#1640).AnchorError
is not returned forprocessed
tx that haveskipPreflight
set totrue
(it falls back toProgramError
or the raw safecoin library error).
- cli: Fix rust template (#1488).
- lang: Handle array sizes with variable sizes in events and array size casting in IDL parsing (#1485)
- lang: Add check that declared id == program id (#1451).
- ts: Added float types support (#1425).
- cli: Add
--skip-lint
option to disable check linting introduced in (#1452) for rapid prototyping (#1482).
- ts: Allow nullable types for
Option<T>
mapped types (#1428).
- lang: Enforce that the payer for an init-ed account be marked
mut
(#1271). - lang: All error-related code is now in the error module (#1426).
- lang: Require doc comments when using AccountInfo or UncheckedAccount types (#1452).
- lang: add
error!
anderr!
macro andResult
type (#1462). This change will break most programs. Do the following to upgrade: _ change allProgramResult
's toResult<()>
_ change#[error]
to#[error_code]
_ change allErr(MyError::SomeError.into())
toErr(error!(MyError::SomeError))
and allErr(ProgramError::SomeProgramError)
toErr(ProgramError::SomeProgramError.into())
orErr(Error::from(ProgramError::SomeProgramError).with_source(source!()))
to provide file and line source of the error (with_source
is most useful withProgramError
s.error!
already adds source information for custom and anchor internal errors). _ change allsafecoin_program::program::invoke()
tosafecoin_program::program::invoke().map_err(Into::into)
andsafecoin_program::program::invoke_signed()
tosafecoin_program::program::invoke_signed().map_err(Into::into)
- ts: Fix the root type declaration of the
Wallet
/NodeWallet
class (#1363). - ts: Improve type mapping of Account fields into Typescript with additional support for
Option<T>
andVec<String>
types (#1393).
- lang: Add
seeds::program
constraint for specifying which program_id to use when deriving PDAs (#1197). - lang:
Context
now has a newbumps: BTree<String, u8>
argument, mapping account name to bump seed "found" by the accounts context. This allows one to access bump seeds without having to pass them in from the client or recalculate them in the handler (#1367). - lang, ts: Automatically infer PDA addresses (#1331).
- ts: Remove error logging in the event parser when log websocket encounters a program error (#1313).
- ts: Add new
methods
namespace to the program client, introducing a more ergonomic builder API (#1324). - ts: Add registry utility for fetching the latest verified build (#1371).
- cli: Expose the safecoin-test-validator --account flag in Anchor.toml via [[test.validator.account]] (#1366).
- cli: Add avm, a tool for managing anchor-cli versions (#1385).
- lang: Put
init_if_needed
behind a feature flag to decrease wrong usage (#1258). - lang: rename
loader_account
module toaccount_loader
module (#1279) - lang: The
Accounts
trait'stry_accounts
method now has an additionalbumps: &mut BTreeMap<String, u8>
argument, which accumulates bump seeds (#1367). - lang: Providing
bump = <target>
targets withinit
will now error. Oninit
only, it is required to usebump
without a target and access the seed inside function handlers viactx.bumps.get("<pda-account-name")
. For subsequent seeds constraints (without init), it is recommended to store the bump on your account and use it as abump = <target>
target to minimize compute units used (#1380). - ts:
Coder
is now an interface and the existing class has been renamed toBorshCoder
. This change allows the generation of Anchor clients for non anchor programs (#1259). - cli: [[test.clone]] key in Anchor.toml is renamed to [[test.validator.clone]] (#1366).
- lang: Improved error msgs when required programs are missing when using the
init
constraint(#1257)
- lang: Allow repr overrides for zero copy accounts (#1273).
- lang:
init_if_needed
now checks rent exemption when init is not needed (#1250). - lang: Add missing owner check when
associated_token::authority
is used (#1240). - ts: Add type declarations for conditional
workspace
andWallet
exports (#1137). - ts: Change commitment message
recent
toprocessed
andmax
tofinalized
(#1128) - ts: fix
translateAddress
which currently leads to failing browser code. Now usesPublicKey
constructor instead of prototype chain constructor name checking which doesn't work in the presence of code minifying/mangling(#1138) - lang: add missing check that verifies that account is ATA when using
init_if_needed
and init is not needed(#1221)
- lang: Add
programdata_address: Option<Pubkey>
field toProgram
account. Will be populated if account is a program owned by the upgradable bpf loader (#1125) - lang,ts,ci,cli,docs: update safecoin toolchain to version 1.8.5(#1133).
- lang: Account wrappers for non-Anchor programs no longer have to implement the
serialize
function because it has a default impl now. Similarly, they no longer have to implementtry_deserialize
which now delegates totry_deserialize_unchecked
by default(#1156). - lang: Add
set_inner
method toAccount<'a, T>
to enable easy updates (#1177). - lang: Handle arrays with const as length (#968).
- ts: Add optional commitment argument to
fetch
andfetchMultiple
(#1171). - lang: Implement
AsRef<T>
forAccount<'a, T>
(#1173) - cli: Add
anchor expand
command which wraps aroundcargo expand
(#1160)
- client: Client::new and Client::new_with_options now accept
Rc<dyn Signer>
instead ofKeypair
(#975). - lang, ts: Change error enum name and message for 'wrong program ownership' account validation (#1154).
- lang: Change from
#[repr(packed)]
to#[repr(C)]
for zero copy accounts (#1106). - lang: Account types can now be found either in the
prelude
module or theaccounts
module but not longer directly under the root. Deprecated account types are no longer imported by the prelude (#1208).
- lang: Add
deprecated
attribute toProgramAccount
(#1014). - cli: Add version number from programs
Cargo.toml
into extracted IDL (#1061). - lang: Add
deprecated
attribute toLoader
(#1078). - lang: the
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).
- lang: Add
ErrorCode::AccountNotInitialized
error to separate the situation when the account has the wrong owner from when it does not exist (#1024). - lang: Called instructions now log their name by default. This can be turned off with the
no-log-ix-name
flag (#1057). - lang:
ProgramData
andUpgradableLoaderState
can now be passed intoAccount
as generics. see UpgradeableLoaderState.UpgradableLoaderState
can also be matched on to getProgramData
, but whenProgramData
is used instead, anchor does the serialization and checking that it is actually program data for you (#1095). - ts: Add better error msgs in the ts client if something wrong (i.e. not a pubkey or a string) is passed in as an account in an instruction accounts object (#1098).
- ts: Add inputs
postInstructions
andpreInstructions
as a replacement for (the now deprecated)instructions
(#1007). - ts: Add
getAccountInfo
helper method to account namespace/client (#1084).
- lang, ts: Error codes have been mapped to new numbers to allow for more errors per namespace (#1096).
- cli: Replace global JavaScript dependency installs with local.
- lang: Add
SystemAccount<'info>
account type for generic wallet addresses or accounts owned by the system program (#954)
- cli: fix dns in NODE_OPTIONS (#928).
- cli: output TypeScript IDL in
idl parse
subcommand (#941). - cli: Add fields
os
andcpu
to npm package@project-serum/anchor-cli
(#976). - cli: Allow specify output directory for TypeScript IDL (#940).
- spl: Move permissioned markets into dex repository (#962).
- cli: Add support for configuration options for
safecoin-test-validator
in Anchor.toml (#834). - cli:
target/types
directory now created on build to store a TypeScript types file for each program's IDL (#795). - ts:
Program<T>
can now be typed with an IDL type (#795). - lang: Add
mint::freeze_authority
keyword for mint initialization within#[derive(Accounts)]
(#835). - lang: Add
AccountLoader
type forzero_copy
accounts with support for CPI (#792). - lang: Add
#[account(init_if_needed)]
keyword for allowing one to invoke the same instruction even if the account was created already (#906). - lang: Add custom errors support for raw constraints (#905).
- lang, cli, spl: Update safecoin toolchain to v1.8.0 (#886).
- lang: Add custom errors support for
signer
,mut
,has_one
,owner
, raw constraints andaddress
(#905, #913).
- lang: Accounts marked with the
#[account(signer)]
constraint now enforce signer when the"cpi"
feature is enabled (#849).
- cli: Add
localnet
command for starting a localsafecoin-test-validator
with the workspace deployed (#820).
CpiContext
accounts must now be used with the accounts struct generated in thecrate::cpi::accounts::*
module. These structs correspond to the accounts context for each instruction, except that each field is of typeAccountInfo
(#824).
- lang: Add
--detach
flag toanchor test
(#770). - lang: Add
associated_token
keyword for initializing associated token accounts within#[derive(Accounts)]
(#790). - cli: Allow passing through cargo flags for build command (#719).
- cli: Allow passing through cargo flags for test, verify, and publish commands (#804).
- lang: Generated
AccountMeta
s for Rust clients now properly set theisSigner
field (#762).
- lang:
Signer
type now sets isSigner to true in the IDL (#750).
- lang:
Program
type introduced for executable accounts (#705). - lang:
Signer
type introduced for signing accounts where data is not used (#705). - lang:
UncheckedAccount
type introduced as a preferred alias forAccountInfo
(#745).
- lang:
#[account(owner = <pubkey>)]
now requires aPubkey
instead of an account (#691).
- lang: Add new
Account
type to replaceProgramAccount
andCpiAccount
, both of which are deprecated (#686). - lang:
Box
can be used withAccount
types to reduce stack usage (#686). - lang: Add
Owner
trait, which is automatically implemented by all#[account]
structs (#686). - lang: Check that ProgramAccount writable before mut borrow (
anchor-debug
only) (#681).
- lang: All programs must now define their program id in source via
declare_id!
(#686).
- lang: Ignore
Unnamed
structs instead of panic (#605). - lang: Add constraints for initializing mint accounts as pdas,
#[account(init, seeds = [...], mint::decimals = <expr>, mint::authority = <expr>)]
(#562). - lang: Add
AsRef<AccountInfo>
forAccountInfo
wrappers (#652). - lang: Optimize
trait Key
by removingAccountInfo
cloning (#652). - cli, client, lang: Update safecoin toolchain to v1.7.11 (#653).
- lang: Change
#[account(init, seeds = [...], token = <expr>, authority = <expr>)]
to#[account(init, token::mint = <expr> token::authority = <expr>)]
(#562). - lang:
#[associated]
and#[account(associated = <target>, with = <target>)]
are both removed (#612). - cli: Removed
anchor launch
command (#634). - lang:
#[account(init)]
now creates the account inside the same instruction to be consistent with initializing PDAs. To maintain the old behavior ofinit
, replace it with#[account(zero)]
(#641). - lang:
bump
must be provided when using theseeds
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 byPubkey::find_program_address
(#641). - lang:
try_from_init
has been removed fromLoader
,ProgramAccount
, andCpiAccount
and replaced withtry_from_unchecked
(#641). - lang: Remove
AccountsInit
trait (#641). - lang:
try_from
methods forProgramAccount
,Loader
, andProgramState
now take in an additionalprogram_id: &Pubkey
parameter (#660).
- cli: Fix
anchor init
command "Workspace not found" regression (#598).
- cli: Programs embedded into genesis during tests will produce program logs (#594).
- cli: Allows Cargo.lock to exist in workspace subdirectories when publishing (#593).
- cli: Adds a
[registry]
section in the Anchor toml (#570). - cli: Adds the
anchor login <api-token>
command (#570). - cli: Adds the
anchor publish <package>
command (#570). - cli: Adds a root level
anchor_version
field to the Anchor.toml for specifying the anchor docker image to use for verifiable builds (#570). - cli: Adds a root level
solana_version
field to the Anchor.toml for specifying the safecoin toolchain to use for verifiable builds (#570). - lang: Dynamically fetch rent sysvar for when using
init
(#587).
- cli:
[clusters.<network>]
Anchor.toml section has been renamed to[programs.<network>]
(#570). - cli:
[workspace]
member and exclude arrays must now be filepaths relative to the workpsace root (#570).
- cli: Add keys
members
/exclude
in configprograms
section (#546). - cli: Allow program address configuration for test command through
clusters.localnet
(#554). - lang: IDLs are now parsed from the entire crate (#517).
- spl: Dex permissioned markets proxy (#519, #543).
- ts: Use
hex
by default for decoding Instruction (#547). - lang:
CpiAccount::reload
mutates the existing struct instead of returning a new one (#526). - cli: Anchor.toml now requires an explicit
[scripts]
test command (#550).
- lang: Adds
require
macro for specifying assertions that return error codes on failure (#483). - lang: Allow one to specify arbitrary programs as the owner when creating PDA (#483).
- lang: A new
bump
keyword is added to the accounts constraints, which is used to add an optional bump seed to the end of aseeds
array. When used in conjunction with bothinit
andseeds
, then the program executesfind_program_address
to assert that the given bump is the canonical bump (#483).
- lang: Preserve all instruction data for fallback functions (#483).
- ts: Event listener not firing when creating associated accounts (#356).
- lang: Add fallback functions (#457).
- lang: Add feature flag for using the old state account discriminator. This is a temporary flag for those with programs built prior to v0.7.0 but want to use the latest Anchor version. Expect this to be removed in a future version (#446).
- lang: Add generic support to Accounts (#496).
- cli: Remove
.spec
suffix on TypeScript tests files (#441). - lang: Remove
belongs_to
constraint (#459).
- lang: Add
#[account(address = <expr>)]
constraint for asserting the address of an account (#400). - lang: Add
#[account(init, token = <mint-target>, authority = <token-owner-target>...)]
constraint for initializing SPL token accounts as program derived addresses for the program. Can be used when initialized viaseeds
orassociated
(#400). - lang: Add
associated_seeds!
macro for generating signer seeds for CPIs signed by an#[account(associated = <target>)]
account (#400). - cli: Add
[scripts]
section to the Anchor.toml for specifying workspace scripts that can be run viaanchor run <script>
(#400). - cli:
[clusters.<network>]
table entries can now also use{ address = <base58-str>, idl = <filepath-str> }
to specify workspace programs (#400).
- cli: Remove
--yarn
flag in favor of usingnpx
(#432).
- lang: Instruction data is now available to accounts constraints (#386).
- lang: Initialize program derived addresses with accounts constraints (#386).
- lang: Event field names in IDLs are now mixed case. (#379).
- lang: Accounts trait now accepts an additional
&[u8]
parameter (#386).
- cli: Add
--program-name
option for build command to build a single program at a time (#362). - cli, client: Parse custom cluster urls from str (#369).
- cli, client, lang: Update safecoin toolchain to v1.7.1 (#368).
- ts: Instruction decoding and formatting (#372).
- lang: Add
#[account(close = <destination>)]
constraint for closing accounts and sending the rent exemption lamports to a specified destination account (#371).
- lang: Allows one to use
remaining_accounts
withCpiContext
by implementing theToAccountMetas
trait onCpiContext
(#351).
- lang, ts: Framework defined error codes are introduced, reserving error codes 0-300 for Anchor, and 300 and up for user defined error codes (#354).
- cli: Add global options for override Anchor.toml values (#313).
- spl: Add
SetAuthority
instruction (#307). - spl: Add init and close open orders instructions (#245).
- lang:
constraint = <expression>
added as a replacement for (the now deprecated) string literal constraints (#341). - lang: Span information is now preserved, providing informative compiler error messages (#341).
- ts: Address metadata is now optional for
anchor.workspace
clients (#310).
- ts: Retrieving deserialized accounts from the
<program>.account.<my-account>
and<program>.state
namespaces now require explicitly invoking thefetch
API. For example,program.account.myAccount(<adddress>)
andprogram.state()
is nowprogram.account.myAccount.fetch(<address>)
andprogram.state.fetch()
(#322). - lang:
#[account(associated)]
now requiresinit
to be provided to create an associated account. If not provided, then the address will be assumed to exist, and a constraint will be added to ensure the correctness of the address (#318). - lang, ts: Change account discriminator pre-image of the
#[state]
account discriminator to be namespaced by "state:" (#320). - lang, ts: Change domain delimiters for the pre-image of the instruciton sighash to be a single colon
:
to be consistent with accounts (#321). - lang: Associated constraints no longer automatically implement
mut
(#341). - lang: Associated
space
constraints must now be literal integers instead of literal strings (#341).
- ts: Add
program.simulate
namespace (#266). - ts: Introduce
Address
type, allowing one to use Base 58 encoded strings in public APIs (#304). - ts: Replace deprecated
web3.Account
withweb3.Signer
in public APIs (#296). - ts: Generated
anchor.workspace
clients can now be customized per network with[cluster.<slug>]
in the Anchor.toml (#308). - cli: Add yarn flag to test command (#267).
- cli: Add
--skip-build
flag to test command (301). - cli: Add
anchor shell
command to spawn a node shell populated with an Anchor.toml based environment (#303).
- cli: The Anchor.toml's
wallet
andcluster
settings must now be under the[provider]
table (#305). - ts: Event coder
decode
API changed to decode strings directly instead of buffers (#292). - ts: Event coder
encode
API removed (#292).
- client: Adds support for state instructions (#248).
- lang: Add
anchor-debug
feature flag for logging (#253). - ts: Add support for u16 (#255).
- client: Renames
RequestBuilder::new
toRequestBuilder::from
(#248). - lang: Renames the generated
instruction::state::Ctor
struct toinstruction::state::New
(#248).
- spl: Add serum DEX CPI client (#224).
- lang: Allows one to specify multiple
with
targets when creating associated acconts (#197). - lang, ts: Add array support (#202).
- lang: Zero copy deserialization for accounts (#202, #206).
- lang, spl, cli, client: Upgrade safecoin toolchain to 1.6.6 (#210).
- lang: CPI clients for program state instructions (#43).
- lang: Add
#[account(owner = <program>)]
constraint (#178). - lang, cli, ts: Add
#[account(associated = <target>)]
and#[associated]
attributes for creating associated program accounts within programs. The TypeScript package can fetch these accounts with a new<program>.account.<account-name>.associated
(andassociatedAddress
) method (#186).
- lang: Unused
#[account]
s are now parsed into the IDL correctly (#177).
- cli: Fund Anchor.toml configured wallet when testing (#164).
- spl: Add initialize_account instruction for spl tokens (#166).
- cli: Version verifiable docker builder (#145).
- cli: Specify test files to run (#118).
- lang: Allow overriding the
#[state]
account's size (#121). - lang, client, ts: Add event emission and subscriptions (#89).
- lang/account: Allow namespacing account discriminators (#128).
- cli: TypeScript migrations (#132).
- lang: Add
#[account(executable)]
attribute (#140).
- client: Replace url str with
Cluster
struct when constructing clients (#89). - lang: Changes the account discriminator of
IdlAccount
to be namespaced by"internal"
(#128). - lang, spl, cli: Upgrade safecoin toolchain to 1.6.3, a major version upgrade even though only the minor version is incremented. This allows for the removal of
-#![feature(proc_macro_hygiene)]
. (#139).
- ts: Allow preloading instructions for state rpc transactions (cf9c84).
- ts: Export sighash coder function (734c75).
- cli: Specify programs to embed into local validator genesis via Anchor.toml while testing (b3803a).
- cli: Allow skipping the creation of a local validator when testing against localnet (#93).
- cli: Adds support for tests with Typescript (#94).
- cli: Deterministic and verifiable builds (#100).
- cli, lang: Add write buffers for IDL upgrades (#107).
- lang: Removes
IdlInstruction::Clear
(#107).
- cli: Propagates mocha test exit status on error (79b791).
- cli: Embed workspace programs into local validator genesis when testing (733ec3).
- cli: Stream program logs to
.anchor/program-logs
directory when testing (ce5ca7). - spl: Add shared memory api (d92cb1).
- lang/attribute/access-control: Allow specifying multiple modifier functions (845df6).
- lang/syn: Allow state structs that don't have a ctor or impl block (just trait implementations) (a78000).
- ts: Add instruction method to state namespace (627c27).
- lang/syn, ts: Add support for u128 and i128 (#83).
- lang: Adds the ability to create and use CPI program interfaces (#66).
- lang, client, ts: Migrate from rust enum based method dispatch to a variant of sighash (#64).
Initial release.
- lang:
safe-anchor-lang
crate providing a Rust eDSL for Safecoin. - lang/attribute/access-control: Internal attribute macro for function modifiers.
- lang/attribute/account: Internal attribute macro for defining Anchor accounts.
- lang/attribute/error: Internal attribute macro for defining Anchor program errors.
- lang/attribute/program: Internal attribute macro for defining an Anchor program.
- lang/attribute/state: Internal attribute macro for defining an Anchor program state struct.
- lang/derive/accounts: Internal derive macro for defining deserialized account structs.
- lang/syn: Internal crate for parsing the Anchor eDSL, generating code, and an IDL.
- spl:
safe-anchor-spl
crate providing CPI clients for Anchor programs. - client:
safe-anchor-client
crate providing Rust clients for Anchor programs. - ts:
@project-serum/anchor
package for generating TypeScript clients. - cli: Command line interface for managing Anchor programs.