diff --git a/packages/web3-eth/CHANGELOG.md b/packages/web3-eth/CHANGELOG.md index f98fa852c05..e68c56c0613 100644 --- a/packages/web3-eth/CHANGELOG.md +++ b/packages/web3-eth/CHANGELOG.md @@ -191,4 +191,8 @@ Documentation: - Added to `Web3Config` property `contractDataInputFill` allowing users to have the choice using property `data`, `input` or `both` for contract methods to be sent to the RPC provider when creating contracts. (#6377) (#6400) -## [Unreleased] \ No newline at end of file +## [Unreleased] + +### Fixed + +- Ensure provider.supportsSubscriptions exists before watching by subscription (#6440) diff --git a/packages/web3-eth/src/utils/watch_transaction_for_confirmations.ts b/packages/web3-eth/src/utils/watch_transaction_for_confirmations.ts index 414494bb3d5..e6826fea10d 100644 --- a/packages/web3-eth/src/utils/watch_transaction_for_confirmations.ts +++ b/packages/web3-eth/src/utils/watch_transaction_for_confirmations.ts @@ -61,7 +61,7 @@ export function watchTransactionForConfirmations< // so a subscription for newBlockHeaders can be made instead of polling const provider: Web3BaseProvider = web3Context.requestManager.provider as Web3BaseProvider; - if (provider.supportsSubscriptions()) { + if (provider && 'supportsSubscriptions' in provider && provider.supportsSubscriptions()) { watchTransactionBySubscription({ web3Context, transactionReceipt,