Skip to content

Releases

v3.2.1

Choose a tag to compare

@github-actions github-actions released this 10 Nov 21:19
a325305

Full changelog: v3.2.0...v3.2.1

Published Packages

Installation

pnpm add @solana/web3.js@3.2.1 @solana/wallet-adapter@3.2.1

Highlights

@solana/web3.js

  • stackHeight on inner instructions: CompiledInnerInstruction.instructions elements now declare stackHeight?: number. The RPC already returned the field, so callers no longer need a cast to read it. (#4049)

    const tx = await connection.getTransaction(sig, {maxSupportedTransactionVersion: 0});
    tx?.meta?.innerInstructions?.[0].instructions[0].stackHeight; // number | undefined

Behavior changes

Breaking change in a patch release

getTransactionsForAddress no longer accepts encoding: 'base58'. We are shipping it as a patch because:

  • The method and the option both arrived in 3.2.0 four days ago, so very few projects are using this already.

  • Agave already rejects base58 when maxSupportedTransactionVersion is 1 or higher. base64 carries the same bytes at a lower cost.

  • Removing it now keeps new code on base64 and makes a later move to v1 transactions easier.

     await connection.getTransactionsForAddress(address, {
       transactionDetails: 'full',
    -  encoding: 'base58',
    +  encoding: 'base64',
     });
Maintenance (dependencies, CI, docs)

Security and dependency updates

  • Bump the minor-and-patch dev dependency group: oxfmt, oxlint, playwright, rollup, next, mocha, @types/* (#4043)
  • Bump the minor-and-patch dev dependency group: oxfmt, oxlint, playwright, vite, rolldown, rollup; dedupe @babel/runtime (#4047)

CI and tooling

  • Preview release notes before publish approval (#4042)
    • Type declarations are now bundled with Rolldown instead of Rollup. lib/index.d.ts has the same 402 exports, with the same names and targets, as before. The only differences are formatting and three dropped file-header comments. (#4051)

Release

Contributors

v3.2.0

Choose a tag to compare

@github-actions github-actions released this 06 Nov 22:07
94f1f54

Full changelog: v3.1.1...v3.2.0

Published Packages

Installation

pnpm add @solana/web3.js@3.2.0 @solana/wallet-adapter@3.2.0

Highlights

@solana/web3.js

  • Connection.getTransactionsForAddress: wraps Kit's getTransactionsForAddress, an extra RPC method some providers offer (Helius, QuickNode, Triton, etc.). By default it returns results at the signature level. With transactionDetails: 'full' it returns full transactions in any encoding. It supports filters (slot, blockTime, signature, status, tokenAccounts) and pagination. (#4002) @amilz
  • clusterApiUrl('mainnet'): a new 'mainnet' cluster that points at https://api.mainnet.solana.com/. 'mainnet-beta' still works but is now deprecated. (#3995)
  • More accurate block metadata types: innerInstructions and token balances are now typed as nullable or optional, matching what the RPC actually returns. Strict TypeScript users may need to add null checks. Thanks @snuff12! (#4014)
  • Bumped to @solana/kit 8.6. MessageV1 now uses Kit's transaction-config helpers instead of local copies. (#4013)

@solana/wallet-adapter

  • Bumped to @solana/kit-plugin-wallet 0.23. signOffchainMessage and the check on sign-in (SIWS) offchain messages now go through the plugin. (#4019)

Build

  • JavaScript bundles are now built with Rolldown instead of Rollup. The bundles ship the same files, exports and dependencies as before, and are 6–12% smaller. index.iife.min.js is minified by esbuild (whitespace only). (#4029, #4009)

Behavior changes (@solana/wallet-adapter)

  • WalletAdapterNetwork.Mainnet is now 'mainnet' (was 'mainnet-beta'). If you store the network value, map old 'mainnet-beta' values to the new one. (#3995)
  • verifySignIn now requires the standard offchain message encoding, and requires that account.publicKey matches account.address. (#4019)
  • signOffchainMessage now rejects with WalletSignOffchainMessageError unless the wallet signed exactly the requested message with the connected account. (#4019)
  • signIn with useOffchainMessage on wallets older than solana:signIn 1.1.0 now rejects with WalletSignInError instead of WalletNotReadyError. (#4019)
Maintenance (dependencies, CI, docs)

Security and dependency updates

  • Bump vite to ^8.3.5 to patch launch-editor advisories (#3998)
  • Bump markdown-it to 14.3.3 (#3999)
  • Bump next from 16.3.8 to 16.4.1 (#4004)
  • Patch toml and vitest advisories (#4005)
  • Patch undici and serialize-javascript (#4007)
  • Resolve pnpm audit advisories and add audit-fix workflow (#4020)
  • Dedupe lockfile (#4023)
  • Bump major dev dependencies (#4036)

CI and tooling

  • Add dependabot config (#4000)
  • Bump actions and remove stale bot workflows (#4003)
  • Add pnpm audit job (#4010)
  • Ignore @solana-program/stake in dependabot (#4024)
  • Bump the actions group (#4038)
  • Fix npm trusted publishing after setup-node v7 (#4040)
  • Run npm publish in the release environment (#4041)
  • Add private test wallet for agent-browser (#3994)

Docs

  • Add agent note and fix README links (#3996)
  • Point web3.js npm badge at the latest tag (#4008)

Release

v3.1.1

Choose a tag to compare

@github-actions github-actions released this 19 Oct 20:15
3921a61

v3.1.1

V3 Migration Details

Full changelog: v3.1.0...v3.1.1

Published Packages

Installation

pnpm add @solana/web3.js@3.1.1 @solana/wallet-adapter@3.1.1

v3.1.0

Choose a tag to compare

@github-actions github-actions released this 15 Oct 17:57
63b4f87

v3.1.0

Full changelog: v3.0.2...v3.1.0

Published Packages

Installation

pnpm add @solana/web3.js@3.1.0 @solana/wallet-adapter@3.1.0

What's Changed

  • fix(web3.js): handle nullish memcmp in data-size filters by @snuff12 in #3977
  • fix(web3.js): reject unsupported memcmp encodings in getProgramAccounts filters by @amilz in #3978
  • docs(web3.js): note planned durable nonce deprecation on nonce APIs by @amilz in #3979
  • chore(wallet-adapter): bump @solana/surfpool to ^1.6.1 by @amilz in #3981
  • chore: bump next from 16.3.6 to 16.3.8 in the npm_and_yarn group across 1 directory by @dependabot[bot] in #3982
  • feat(examples): add web3.js v3 basics node scripts by @amilz in #3980
  • chore(web3.js): bump to @solana/kit 8.5 ^8.5.0 and support verifySignature change by @amilz in #3984
  • ci: skip PR hygiene checks on closed pull requests by @amilz in #3988
  • feat(web3.js): make Connection a Kit client (rpc, rpcSubscriptions, getMinimumBalance) by @amilz in #3983
  • fix(web3.js): skip ws error log when the socket closes with no active subscriptions by @amilz in #3987
  • feat(examples): add Anchor 2 example and use Connection as a Kit client by @amilz in #3985
  • chore: bump version to v3.1.0 by @amilz in #3989

Connection now implements a Kit client

That means you can pass it straight to Kit-native libraries like Anchor 2 and the Codama-generated @solana-program/* clients, without building a second RPC.

Anchor 2: give a Connection and Keypair to AnchorProvider:

import {AnchorProvider, Program} from '@anchor-lang/core';
import {Connection, Keypair, sendAndConfirmTransaction, Transaction} from '@solana/web3.js';

const connection = new Connection(rpcUrl, 'confirmed');
const provider = new AnchorProvider(connection, trader);
const program = new Program<Whirlpool>(idl, provider);

const {data: pool} = await program.account.whirlpool.fetch(SOL_USDC_POOL);

const swapIx = await program.methods
  .swap(USDC_IN, 0n, MAX_SQRT_PRICE, true, false)
  .accounts({whirlpool: SOL_USDC_POOL, tokenVaultA: pool.tokenVaultA, /* ... */})
  .instruction();

await sendAndConfirmTransaction(connection, new Transaction().add(swapIx), [trader]);

Solana program clients: pass the Connection to helpers that need rent. You don't need to call getMinimumBalanceForRentExemption or build createAccount yourself:

import {getCreateMintInstructionPlan} from '@solana-program/token';
import {Connection, Keypair, sendAndConfirmTransaction, Transaction} from '@solana/web3.js';

const connection = new Connection(rpcUrl, 'confirmed');
const mint = await Keypair.generate();

const createMint = await getCreateMintInstructionPlan(connection, {
  decimals: 6,
  mintAuthority: payer.publicKey,
  newMint: mint,
  payer,
});

await sendAndConfirmTransaction(connection, new Transaction().add(createMint), [payer, mint]);

Full examples: examples/ecosystem/anchor and examples/basics

New Contributors

Full Changelog: v3.0.2...v3.1.0

v3.0.2

Choose a tag to compare

@github-actions github-actions released this 07 Oct 18:23
7c8b33e

v3.0.2

Full changelog: v3.0.1...v3.0.2

Published Packages

Installation

pnpm add @solana/web3.js@3.0.2 @solana/wallet-adapter@3.0.2

What's Changed

  • chore: bump wallet plugin and react by @amilz in #3971
  • chore: adopt new contributing, issue, and PR policies by @amilz in #3973
  • chore(deps): bump oxfmt to 0.72 to patch tinypool advisories by @amilz in #3972
  • chore: bump version to v3.0.2 by @amilz in #3974

Full Changelog: v3.0.1...v3.0.2

v3.0.1

Choose a tag to compare

@github-actions github-actions released this 05 Oct 16:34
f120283

v3.0.1

Full changelog: v3.0.0-rc.3...v3.0.1

Published Packages

Installation

pnpm add @solana/web3.js@3.0.1 @solana/wallet-adapter@3.0.1

What's Changed

  • chore: update version by @amilz in #3965
  • chore: bump kit to 8.4 and solana deps; pin stake to 0.9.0 by @amilz in #3968
  • chore: release web3.js and wallet-adapter 3.0.1 by @amilz in #3969

Full Changelog: v3.0.0...v3.0.1

v3.0.0

Choose a tag to compare

@github-actions github-actions released this 01 Oct 22:06
34bd582

v3.0.0

Published Packages

Installation

pnpm add @solana/web3.js@3 
pnpm add @solana/wallet-adapter

Highlights

  • @solana/wallet-adapter: new package (SIWS 1.1, standalone signing, example app)
  • Kit-native internals: PublicKey implements HasAddress for integration w/ Codama Clients
  • Hardening: fixes across confirmation strategies, durable nonces, websocket subscriptions, RPC response validation, and wallet output integrity
  • Repo: restructured to support inclusion of wallet adapter

What's Changed

  • fix: honor Connection commitment as Kit client default commitment by @amilz in #3883
  • refactor: restructure into a pnpm workspace monorepo by @amilz in #3872
  • feat: implement HasAddress on PublicKey by @amilz in #3887
  • chore: add justfile by @amilz in #3889
  • refactor: sign transactions with transaction signers by @amilz in #3888
  • feat: add @solana/wallet-adapter by @L0STE in #3884
  • feat: wallet adapter example by @amilz in #3890
  • chore(wallet-adapter): add assertion for endpoint and chain by @amilz in #3895
  • fix(wallet-adapter): skip redundant wallet reconnects by @amilz in #3896
  • fix(wallet-adapter): preserve concurrent transaction lifetime by @amilz in #3897
  • fix(wallet-adapter): isolate local storage state by key by @amilz in #3898
  • fix(web3.js): reject instructions carrying both Kit and legacy fields (SOLA8-86) by @amilz in #3894
  • fix(web3.js): copy message header at construction so caller mutation cannot change signed bytes (SOLA8-46) by @amilz in #3893
  • fix(web3.js): reconcile signature status before reporting blockheight expiry (SOLA8-99) by @amilz in #3892
  • fix: harden durable-nonce processing by @amilz in #3906
  • fix(web3.js): preserve RPC response metadata by @amilz in #3900
  • fix(web3.js): improve websocket subscription recovery by @amilz in #3899
  • fix: forward maxRetries from sendAndConfirmRawTransaction by @o-mid in #3901
  • fix(web3.js): confirm inherited confirmation strategies in raw send-and-confirm by @amilz in #3907
  • fix(wallet adapter): example improvements by @amilz in #3909
  • fix(web3.js): keep signature subscription alive after received notiff by @amilz in #3910
  • fix: require transaction signers for versioned extra signers by @o-mid in #3905
  • fix: report raw confirmation failures as send errors by @o-mid in #3903
  • fix(web3.js): forward getBlocks config when endSlot is undefined by @amilz in #3911
  • fix(web3.js): validate discriminator in decodeExtendLookupTable by @amilz in #3912
  • feat(web3.js): add getAgGenesisCert to Connection by @amilz in #3914
  • fix(web3.js): reject v1 config masks with unsupported bits by @amilz in #3913
  • chore(web3.js): harden PublicKey.verifySignature by @amilz in #3916
  • fix(web3.js)/block subscribe fields by @amilz in #3915
  • fix(web3.js): release local subscription handles on auto-disposal by @amilz in #3917
  • fix(web3.js): honor abort signal during durable-nonce reconciliation by @amilz in #3918
  • chore(web3.js): compiled instruction data into the decompiled instruction by @amilz in #3919
  • fix(wallet-adapter): validate send options before send txn by @amilz in #3920
  • fix(wallet-adapter): ignore a connect request superseded by a new selection by @amilz in #3921
  • fix(web3.js): reject ambiguous token and program account filters by @amilz in #3922
  • fix(wallet-adapter): refuse wallet output that drops caller signatures by @amilz in #3923
  • fix(web3.js): dispose signature listener even when the callback throws by @amilz in #3924
  • fix(web3.js): reject unsupported RPC transaction versions by @amilz in #3925
  • fix(web3.js): keep the subscription channel open when a notification cannot be decoded by @amilz in #3926
  • chore: add v1 max ix size by @amilz in #3927
  • fix(web3.js): reject non-lookup-table accounts in getAddressLookupTable by @amilz in #3929
  • fix(web3.js): prefer the nonce confirmation strategy when nonceInfo by @amilz in #3928
  • fix(web3.js): surface additional simulate fields by @amilz in #3930
  • fix(web3.js): return bigint lamports from stake split and withdraw decoders by @amilz in #3931
  • fix(web3.js): resolve send-and-confirm commitment properly by @amilz in #3935
  • fix(web3.js): populate SendTransactionError logs from preflight errors by @amilz in #3934
  • fix(web3.js): keep sig-status fallback errs from escaping as unhandled rej by @amilz in #3936
  • fix(web3.js)!: throw when getMinimumBalanceForRentExemption fails by @amilz in #3937
  • feat(web3.js): new rpc config params by @amilz in #3932
  • feat(wallet-adapter): add siws 1.1 by @amilz in #3938
  • ci: split pull request jobs and add a publish dist-tag selector by @amilz in #3944
  • docs: point 1.x users to the legacy branch/repos by @amilz in #3945
  • test(web3.js): bump @solana-program clients and cover PublicKey as HasAddress input by @amilz in #3946
  • fix(web3.js): execute IIFE bundles in smoke tests by @arunimshukla in #3943
  • build: adopt @solana-config/oxc for linting and formatting by @amilz in #3948
  • build: lint parity wallet adapter by @amilz in #3951
  • feat(example): add wallet features page to wallet adapter example by @amilz in #3953
  • chore: bump the npm_and_yarn group across 1 directory with 2 updates by @dependabot[bot] in #3952
  • chore: run ci on push to main by @amilz in #3954
  • fix(example): warn when wallet adapter example uses the public main rpc by @amilz in #3955
  • ci: point publish workflow guard at main instead of v3.x by @amilz in #3957
  • fix: typedoc on main by @amilz in #3956
  • build: apply more oxc web3js lint rules by @amilz in #3958
  • chore: dependabot security cleanup by @amilz in #3959
  • build: enable oxfmt sortImports by @amilz in #3960
  • ci: publish wallet-adapter alongside web3.js and bump both to 3.0.0 by @amilz in https...
Read more

@solana/web3.js v1.99.0

Choose a tag to compare

@github-actions github-actions released this 08 Sep 16:19
0b60048

@solana/web3.js v1.99.0

Add v1 Transaction read support #3866

Installation

pnpm add @solana/web3.js@1.99.0

https://www.npmjs.com/package/@solana/web3.js/v/1.99.0

@solana/web3.js v3.0.0-rc.3

Pre-release

Choose a tag to compare

@github-actions github-actions released this 02 Sep 17:52
e516465

@solana/web3.js v3.0.0-rc.3

Installation

pnpm add @solana/web3.js@3.0.0-rc.3

https://www.npmjs.com/package/@solana/web3.js/v/3.0.0-rc.3

What's Changed

  • feat: add v1 transaction support to v3.x by @amilz in #3861 (Learn More about V1 Transactions)

  • refactor: Address class removed — PublicKey is canonical again by @amilz in #3870 to avoid collision with kit's branded Address string. No alias export. PublicKey.toBase58() returns kit's branded Address, so it's assignable wherever kit expects an address.

Thanks @dhl, @Woody4618, @catmcgee, @MicaiahReid

Full Changelog: v3.0.0-rc.2...v3.0.0-rc.3

@solana/web3.js v1.99.0-beta.0

Pre-release

Choose a tag to compare

@github-actions github-actions released this 01 Sep 17:38
acf925d

@solana/web3.js v1.99.0-beta.0'

Add v1 Transaction read support #3866

Installation

pnpm add @solana/web3.js@1.99.0-beta.0

https://www.npmjs.com/package/@solana/web3.js/v/1.99.0-beta.0