Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@coral-xyz/anchor

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coral-xyz/anchor - npm Package Versions

0.30.1

Diff

Changelog

Source

[0.30.1] - 2024-06-20

Features

  • idl: Allow overriding the idl build toolchain with the RUSTUP_TOOLCHAIN environment variable (#2941).
  • avm: Support customizing the installation location using AVM_HOME environment variable (#2917).
  • avm: Optimize avm list when GitHub API rate limits are reached (#2962)
  • idl, ts: Add accounts resolution for associated token accounts (#2927).
  • cli: Add --no-install option to the init command (#2945).
  • lang: Implement TryFromIntError for Error to be able to propagate integer conversion errors (#2950).
  • idl: Add ability to convert legacy IDLs (#2986).
  • ts: Extract Anchor error codes into their own package (#2983).
  • cli: Add additional solana arguments to the upgrade command (#2998).
  • spl: Export spl-associated-token-account crate (#2999).
  • lang: Support legacy IDLs with declare_program! (#2997).
  • cli: Add idl convert command (#3009).
  • cli: Add idl type command (#3017).
  • lang: Add anchor_lang::pubkey macro for declaring Pubkey const values (#3021).
  • cli: Sync program ids on the initial build (#3023).
  • idl: Remove anchor-syn dependency (#3030).
  • lang: Add const of program ID to declare_id! and declare_program! (#3019).
  • idl: Add separate spec crate (#3036).

Fixes

  • lang: Eliminate variable allocations that build up stack space for token extension code generation (#2913).
  • ts: Fix incorrect maxSupportedTransactionVersion in AnchorProvider.send*() methods (#2922).
  • cli: Use npm's configured default license for new projects made with anchor init (#2929).
  • cli: add filename to 'Unable to read keypair file' errors (#2932).
  • idl: Fix path resolution of the Cargo.lock of the project when generating idls for external types (#2946).
  • idl: Fix potential panic on external type resolution (#2954).
  • lang: Fix using defined types in instruction parameters with declare_program! (#2959).
  • lang: Fix using const generics with declare_program! (#2965).
  • lang: Fix using Vec<u8> type with declare_program! (#2966).
  • lang: Fix ProgramError::ArithmeticOverflow not found error (#2975).
  • lang: Fix using optional accounts with declare_program! (#2967).
  • lang: Fix instruction return type generation with declare_program! (#2977).
  • cli: Fix IDL write getting corrupted from retries (#2964).
  • idl: Fix unexpected_cfgs build warning (#2992).
  • lang: Make tuple struct fields public in declare_program! (#2994).
  • Remove rust-version from crate manifests (#3000).
  • cli: Fix upgradeable program clones (#3010).
  • ts: Fix using IDLs that have defined types as generic arguments (#3016).
  • idl: Fix generation with unsupported expressions (#3033).
  • idl: Fix using address constraint with field expressions (#3034).
  • lang: Fix using bytemuckunsafe account serialization with declare_program! (#3037).

Breaking

acheroncrypto
published 0.30.0 •

Changelog

Source

[0.30.0] - 2024-04-15

See the Anchor 0.30 release notes for a high-level overview of how to update.

Features

  • cli: Allow force init and new (#2698).
  • cli: Add verifiable option when deploy (#2705).
  • cli: Add support for passing arguments to the underlying solana program deploy command with anchor deploy (#2709).
  • lang: Add InstructionData::write_to implementation (#2733).
  • lang: Add #[interface(..)] attribute for instruction discriminator overrides (#2728).
  • ts: Add .interface(..) method for instruction discriminator overrides (#2728).
  • cli: Check anchor-lang and CLI version compatibility (#2753).
  • ts: Add missing IDL PDA seed types (#2752).
  • cli: idl close accepts optional --idl-address parameter (#2760).
  • cli: Add support for simple wildcard patterns in Anchor.toml's workspace.members and workspace.exclude. (#2785).
  • cli: Add --test-template option for init command (#2805).
  • cli: anchor test is able to run multiple commands (#2799).
  • cli: Check @coral-xyz/anchor package and CLI version compatibility (#2813).
  • cli: Accept package name as program name (#2816).
  • cli: Add ability to build and test only a specified program (#2823).
  • idl: Add new IDL spec (#2824).
  • idl: Add support for reprs (#2824).
  • idl: Add support for expression evaluation (#2824).
  • idl: Add support for using external types when generating the IDL (#2824).
  • idl, ts: Add unit and tuple struct support (#2824).
  • idl, ts: Add generics support (#2824).
  • ts: Add accountsPartial method to keep the old accounts method behavior (#2824).
  • ts: Make opts parameter of AnchorProvider constructor optional (#2843).
  • cli: Add --no-idl flag to the build command (#2847).
  • cli: Add priority fees to idl commands (#2845).
  • ts: Add prepend option to MethodBuilder preInstructions method (#2863).
  • lang: Add declare_program! macro (#2857).
  • cli: Add deactivate_feature flag to solana-test-validator config in Anchor.toml (#2872).
  • idl: Add docs field for constants (#2887).
  • idl: Store deployment addresses for other clusters (#2892).
  • lang: Add Event utility type to get events from bytes (#2897).
  • lang, spl: Add support for token extensions (#2789).
  • lang: Return overflow error from Lamports trait operations (#2907).

Fixes

  • syn: Add missing new_from_array method to Hash (#2682).
  • cli: Switch to Cargo feature resolver(resolver = "2") (#2676).
  • cli: Fix using user specific path for provider.wallet in Anchor.toml (#2696).
  • syn: Fix IDL constant seeds parsing (#2699).
  • cli: Display errors if toolchain override restoration fails (#2700).
  • cli: Fix commit based anchor_version override (#2704).
  • spl: Fix compilation with shmem feature enabled (#2722).
  • cli: Localhost default test validator address changes from localhost to 127.0.0.1, NodeJS 17 IP resolution changes for IPv6 (#2725).
  • lang: Eliminate temporary Vec allocations when serializing data with discriminant and set the default capacity to 256 bytes (#2691).
  • lang: Allow custom lifetime in Accounts structure (#2741).
  • lang: Remove try_to_vec usage while setting the return data in order to reduce heap memory usage (#2744)
  • cli: Show installation progress if Solana tools are not installed when using toolchain overrides (#2757).
  • ts: Fix formatting enums (#2763).
  • cli: Fix migrate command not working without global ts-node installation (#2767).
  • client, lang, spl, syn: Enable all features for docs.rs build (#2774).
  • ts: Fix construction of field layouts for type aliased instruction arguments (#2821)
  • idl: Fix IDL (#2824).
  • idl, ts: Make casing consistent (#2824).
  • ts: Fix not being able to use numbers in instruction, account, or event names in some cases due to case conversion (#2824).
  • cli: Fix excessive test validator requests (#2828).
  • client: Fix parse_logs_response to prevent panics when more than 1 outer instruction exists in logs (#2856).
  • avm, cli: Fix stdsimd feature compilation error from ahash when installing the CLI using newer Rust versions (#2867).
  • spl: Fix not being able to deserialize newer token 2022 extensions (#2876).
  • spl: Remove solana-program dependency (#2900).
  • spl: Make TokenAccount and Mint Copy (#2904).
  • ts: Add missing errors (#2906).

Breaking

  • cli: Make cargo build-sbf the default build command (#2694).
  • cli: Require explicit overflow-checks flag (#2716).
  • ts: Remove anchor-deprecated-state feature (#2717).
  • lang: Remove CLOSED_ACCOUNT_DISCRIMINATOR (#2726).
  • lang: Make bumps of optional accounts Option<u8> rather than u8 (#2730).
  • spl: Remove shared-memory program (#2747).
  • ts: Remove associated, account.associated and account.associatedAddress methods (#2749).
  • cli: idl upgrade command closes the IDL buffer account (#2760).
  • cli: Remove --jest option from the init command (#2805).
  • cli: Require idl-build feature in program Cargo.toml (#2824).
  • cli: Rename seeds feature to resolution and make it enabled by default (#2824).
  • cli: Remove idl parse command (#2824).
  • idl: Change IDL spec (#2824).
  • syn: Remove idl-parse and seeds features (#2824).
  • ts: Change accounts method to no longer accept resolvable accounts (#2824).
  • ts: Program instances use camelCase for everything (#2824).
  • ts: Remove discriminator functions (#2824).
  • ts: Remove programId parameter of the Program constructor (#2864).
  • idl, syn: Move IDL types from the anchor-syn crate to the new IDL crate (#2882).
  • idl: Add #[non_exhaustive] to IDL enums (#2890).
acheroncrypto
published 0.29.0 •

Changelog

Source

[0.29.0] - 2023-10-16

See the Anchor 0.29 release notes for a high-level overview of how to update.

Features

  • lang: Change all accounts to have a reference to AccountInfo (#2656).
  • lang: Add get_lamports, add_lamports and sub_lamports methods for all account types (#2552).
  • client: Add a helper struct DynSigner to simplify use of Client<C> where <C: Clone + Deref<Target = impl Signer>> with Solana clap CLI utils that loads Signer as Box<dyn Signer> (#2550).
  • lang: Allow CPI calls matching an interface without pinning program ID (#2559).
  • cli, lang: Add IDL generation through compilation. anchor build still uses parsing method to generate IDLs, use anchor idl build to generate IDLs with the build method (#2011).
  • avm: Add support for the .anchorversion file to facilitate switching between different versions of the anchor-cli (#2553).
  • ts: Add ability to access workspace programs independent of the casing used, e.g. anchor.workspace.myProgram, anchor.workspace.MyProgram... (#2579).
  • bench: Add benchmarking for program binary size (#2591).
  • spl: Export mpl-token-metadata crate (#2583).
  • spl: Add TokenRecordAccount for pNFTs (#2597).
  • ts: Add support for unnamed(tuple) enum in accounts (#2601).
  • cli: Add program template with multiple files for instructions, state... (#2602).
  • bench: Add benchmarking for stack memory usage (#2617).
  • lang: Box the inner enums of anchor_lang::error::Error to optimize anchor_lang::Result (#2600).
  • ts: Add strong type support for Program.addEventListener method (#2627).
  • syn: Add IdlBuild trait to implement IDL support for custom types (#2629).
  • spl: Add idl-build feature. IDL build method will not work without enabling this feature when using anchor-spl (#2629).
  • lang: Add support for type aliases in IDLs (#2637).
  • cli: Add test.upgradeable, test.genesis.upgradeable setting in Anchor.toml to support testing upgradeable programs (#2642).
  • cli, client, lang, spl: Update Solana toolchain and dependencies to 1.17.0, 1.16 remains supported (#2645).
  • spl: Add support for memo program (#2661).
  • avm: Add anchor-cli installation from commit (#2659).
  • cli: Add toolchain property in Anchor.toml to override Anchor and Solana versions (#2649).

Fixes

  • ts: Packages no longer depend on assert (#2535).
  • lang: Support for const in the InitSpace macro (#2555).
  • cli: Support workspace inheritance (#2570).
  • client: Compile with Solana 1.14 (#2572).
  • cli: Fix anchor build --no-docs adding docs to the IDL (#2575).
  • ts: Load workspace programs on-demand rather than loading all of them at once (#2579).
  • lang: Fix associated_token::token_program constraint (#2603).
  • cli: Fix anchor account command panicking outside of workspace (#2620).
  • lang: IDL named enum variant fields are now camelCase as opposed to snake_case, consistent with the other IDL types (#2633).
  • avm: Remove excessive panics and handle the errors gracefully (#2671).

Breaking

  • lang: Switch to type safe bumps in context (#2542).
  • syn: idl feature has been replaced with idl-build, idl-parse and idl-types features (#2011).
  • syn: IDL parse method now returns Result<Idl> instead of Result<Option<Idl>> (#2582).
  • spl: Update mpl-token-metadata dependency to use the client SDK instead of the program crate (#2632).
  • ts: Remove base64-js dependency (#2635).
  • syn: IdlTypeDefinitionTy enum has a new variant Alias (#2637).
  • cli, client, lang, spl: Solana 1.14 is no longer supported, minimum required Solana version is 1.16.0 (#2645).
  • cli: anchor_version and solana_version property in Anchor.toml that was being used in verifiable builds are moved inside toolchain. They are now being used for all commands in the workspace, not just verifiable builds (#2649).
acheroncrypto
published 0.28.1-beta.2 •

acheroncrypto
published 0.28.1-beta.1 •

acheroncrypto
published 0.28.0 •

Changelog

Source

[0.28.0] - 2023-06-09

Features

  • client: Add async feature flag to use an asynchronous anchor-client (#2488).
  • spl: Add metadata wrappers approve_collection_authority, bubblegum_set_collection_size, burn_edition_nft, burn_nft, revoke_collection_authority, set_token_standard, utilize, unverify_sized_collection_item, unverify_collection (#2430)
  • spl: Add token_program constraint to Token, Mint, and AssociatedToken accounts in order to override required token_program fields and use different token interface implementations in the same instruction (#2460)
  • cli: Add support for Solidity programs. anchor init and anchor new take an option --solidity which creates solidity code rather than rust. anchor build and anchor test work accordingly (#2421)
  • bench: Add benchmarking for compute units usage (#2466)
  • cli: idl set-buffer, idl set-authority and idl close take an option --print-only. which prints transaction in a base64 Borsh compatible format but not sent to the cluster. It's helpful when managing authority under a multisig, e.g., a user can create a proposal for a Custom Instruction in SPL Governance (#2486).
  • lang: Add emit_cpi! and #[event_cpi] macros(behind event-cpi feature flag) to store event logs in transaction metadata (#2438).
  • cli: Add keys sync command to sync program id declarations (#2505).
  • cli: Create new programs with correct program ids (#2509).
  • cli, client, lang, spl: Update Solana toolchain and dependencies to 1.16.0 and specify maximum version of <1.17.0 (#2512).
  • cli: anchor deploy command's --program-name argument accepts program lib names (#2519).

Fixes

  • ts: Narrowed AccountClient type to it's appropriate account type (#2440)
  • lang: Fix inability to use identifiers program_id, accounts, ix_data, remaining_accounts in instruction arguments (#2464)
  • cli: Fix incorrect metadata.address generation in IDL after deploying with a custom keypair (#2485)
  • cli: IDL commands no longer hang when the payer doesn't have funds to pay for the transaction fee (#2492)
  • cli: Fix anchor new not updating Anchor.toml (#2516).
  • client, lang, spl: Allow wider range of dependency versions to reduce dependency issues (#2524).

Breaking

  • lang: Identifiers that are intended for internal usage(program_id, accounts, ix_data, remaining_accounts) have been renamed with __ prefix (#2464)
  • spl: Remove the metadata::create_metadata_account_v2 deprecated wrapper since it was removed from token metadata program (#2480)
henrye
published 0.27.0 •

Changelog

Source

[0.27.0] - 2023-03-08

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 solana rpc client (#2322).
  • avm, cli: Use the rustls-tls feature of reqwest so that users don't need OpenSSL installed (#2385).
  • ts: Add VersionedTransaction support. Methods in the Provider class and Wallet interface now use the argument tx: Transaction | VersionedTransaction (#2427).
  • cli: Add --arch sbf option to compile programs using cargo build-sbf (#2398).
  • land: Support multiple programs with the same interface using Interface and InterfaceAccount types, related to token-2022 (#2386).

Fixes

  • 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 with sigVerify: false if no signers 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 solana-program version 1.14.16 and rust version 1.60, appears to still be incompatible with 1.15 CLI (#2420).

Breaking

  • lang: Remove deprecated account types: CpiAccount, Loader and ProgramAccount (#2375).
  • lang: Remove state and interface attributes (#2285).
  • lang: Remove deprecated literal constraint which has been replaced by #[account(constraint = {})] (#2379).
  • lang: account(zero_copy) and zero_copy attributes now derive the bytemuck::Pod and bytemuck::Zeroable traits instead of using unsafe impl (#2330). This imposes useful restrictions on the type, like not having padding bytes and all fields being Pod themselves. See bytemuck::Pod for details. This change requires adding bytemuck = { version = "1.4.0", features = ["derive", "min_const_generics"]} to your cargo.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 @solana/web3.js) and update associatedAddress to be synchronous (#2357).
henrye
published 0.26.0 •

Changelog

Source

[0.26.0] - 2022-12-15

Features

  • cli: Add --run to anchor test for running a subset of test suites (#1828).
  • client: Add transaction functions to RequestBuilder (#1958).
  • spl: Add create_metadata_accounts_v3 and set_collection_size wrappers (#2119).
  • spl: Add MetadataAccount account deserialization. (#2014).
  • spl: Add update_primary_sale_happened_via_token wrapper (#2173).
  • spl: Add sign_metadata and remove_creator_verification wrappers (#2175).
  • spl: Add initialize_account3 and initialize_mint2 (#2265).
  • spl: Change serum-dex to openbook-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 and thaw_delegated_account wrappers (#2164).
  • ts: Add feePayer check to AnchorProvider 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 Solana 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).

Fixes

  • 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).

Breaking

  • ts: SPL coders have been removed from the main Anchor package. (#2155)
  • lang: Remove rent from constraints (#2265).
  • spl: Remove rent from associated_token::Create (#2265).
  • lang: Add Discriminator and Owner trait implementation for structures representing instructions (#1997).
  • ts: '@coral-xyz/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 @coral-xyz/anchor package #2318.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc