Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit b56c9d8

Browse files
committed
fix: sending tx with injected provider
1 parent f4c7ff3 commit b56c9d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/web3-eth/src/utils/reject_if_block_timeout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ export async function rejectIfBlockTimeout(
161161
web3Context: Web3Context<EthExecutionAPI>,
162162
transactionHash?: Bytes,
163163
): Promise<[Promise<never>, ResourceCleaner]> {
164-
const provider: Web3BaseProvider = web3Context.requestManager.provider as Web3BaseProvider;
164+
const { provider } = web3Context.requestManager;
165165
let callingRes: [Promise<never>, ResourceCleaner];
166166
const starterBlockNumber = await getBlockNumber(web3Context, NUMBER_DATA_FORMAT);
167167
// TODO: once https://github.com/web3/web3.js/issues/5521 is implemented, remove checking for `enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout`
168168
if (
169-
provider.supportsSubscriptions() &&
169+
(provider as Web3BaseProvider).supportsSubscriptions?.() &&
170170
web3Context.enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout
171171
) {
172172
callingRes = await resolveBySubscription(web3Context, starterBlockNumber, transactionHash);

0 commit comments

Comments
 (0)