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
7d310f6Thanks @lorisleiva! - Add acreateKeyPairFromPrivateKeyByteshelper that creates a keypair from the 32-byte private key bytes.import { createKeyPairFromPrivateKeyBytes } from '@solana/keys'; const { privateKey, publicKey } = await createKeyPairFromPrivateKeyBytes(new Uint8Array([...]));
-
#3049
f9a8446Thanks @lorisleiva! - Add agetPublicKeyFromPrivateKeyhelper that, given an extractableCryptoKeyprivate key, gets the corresponding public key as aCryptoKey.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
1ad523dThanks @lorisleiva! - Add acreateKeyPairSignerFromPrivateKeyByteshelper that composecreateKeyPairFromPrivateKeyBytesandcreateSignerFromKeyPair. -
#3071
b4bf318Thanks @steveluscher! - Created a helper that you can use to race two or more promises without having to worry about them leaking memory -
#3070
f2bb4e8Thanks @steveluscher! - Created a package for dealing with JavaScript Promises, and copied the implementation ofgetAbortablePromiseinto it -
#3072
c122c75Thanks @steveluscher! - Fixed a memory leak with transaction confirmation and subscriptions