Skip to content

The New web3.js - Release Candidate `rc.1`

Pre-release
Pre-release
Compare
Choose a tag to compare
@steveluscher steveluscher released this 09 Aug 18:26
· 91 commits to master since this release
b7aa3f6

v2.0.0-rc.1 (2024-08-09)

Since we published the first Release Candidate of @solana/web3.js@2.0.0 your feedback has helped us to catch bugs that we missed during development. A special thank you today to @WilfredAlmeida the reports that led to the fixes in this, updated Release Candidate rc.1.

Also new in this release are handy tools that help you load key pairs and to derive public CryptoKey instances from private CryptoKey instances.

To install the Release Candidate:

npm install --save @solana/web3.js@rc
  • Try the runnable examples in the examples/ directory to get a feel for the API.
  • Use the example dApp at https://solana-labs.github.io/solana-web3.js/example/ – source available here – for an example of how to build transactions with the new web3.js for use with wallets.
  • Install TypeScript clients for on-chain programs like System and Token, then build a useful application or backend service.

Before the general release of web3.js, shortly before Breakpoint 2024 in September, we want to collect as much feedback as possible from you. If you find a bug, are missing a feature, or would like an API modified, file a GitHub Issue.

Changelog since Release Candidate rc.0

  • #3050 7d310f6 Thanks @lorisleiva! - Add a createKeyPairFromPrivateKeyBytes helper that creates a keypair from the 32-byte private key bytes.

    import { createKeyPairFromPrivateKeyBytes } from '@solana/keys';
    
    const { privateKey, publicKey } = await createKeyPairFromPrivateKeyBytes(new Uint8Array([...]));
  • #3049 f9a8446 Thanks @lorisleiva! - Add a getPublicKeyFromPrivateKey helper that, given an extractable CryptoKey private key, gets the corresponding public key as a CryptoKey.

    import { createPrivateKeyFromBytes, getPublicKeyFromPrivateKey } from '@solana/keys';
    
    const privateKey = await createPrivateKeyFromBytes(new Uint8Array([...]), true);
    
    const publicKey = await getPublicKeyFromPrivateKey(privateKey);
    const extractablePublicKey = await getPublicKeyFromPrivateKey(privateKey, true);
  • #3051 1ad523d Thanks @lorisleiva! - Add a createKeyPairSignerFromPrivateKeyBytes helper that compose createKeyPairFromPrivateKeyBytes and createSignerFromKeyPair.

  • #3071 b4bf318 Thanks @steveluscher! - Created a helper that you can use to race two or more promises without having to worry about them leaking memory

  • #3070 f2bb4e8 Thanks @steveluscher! - Created a package for dealing with JavaScript Promises, and copied the implementation of getAbortablePromise into it

  • #3072 c122c75 Thanks @steveluscher! - Fixed a memory leak with transaction confirmation and subscriptions