diff --git a/CHANGELOG.md b/CHANGELOG.md index be8ca8aa95..b42606212f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The minor version will be incremented upon a breaking change and the patch versi ### Fixes - lang: Eliminate variable allocations that build up stack space for token extension code generation ([#2913](https://github.com/coral-xyz/anchor/pull/2913)). +- ts: Fix incorrect `maxSupportedTransactionVersion` in `AnchorProvider.send*()` methods ([#2922](https://github.com/coral-xyz/anchor/pull/2922)). ### Breaking diff --git a/ts/packages/anchor/src/provider.ts b/ts/packages/anchor/src/provider.ts index 2edfbcefda..82e3ad81ba 100644 --- a/ts/packages/anchor/src/provider.ts +++ b/ts/packages/anchor/src/provider.ts @@ -174,8 +174,10 @@ export class AnchorProvider implements Provider { ? tx.signatures?.[0] || new Uint8Array() : tx.signature ?? new Uint8Array() ); + const maxVer = isVersionedTransaction(tx) ? 0 : undefined; const failedTx = await this.connection.getTransaction(txSig, { commitment: "confirmed", + maxSupportedTransactionVersion: maxVer, }); if (!failedTx) { throw err; @@ -256,8 +258,10 @@ export class AnchorProvider implements Provider { ? tx.signatures?.[0] || new Uint8Array() : tx.signature ?? new Uint8Array() ); + const maxVer = isVersionedTransaction(tx) ? 0 : undefined; const failedTx = await this.connection.getTransaction(txSig, { commitment: "confirmed", + maxSupportedTransactionVersion: maxVer, }); if (!failedTx) { throw err;