diff --git a/packages/web3-core/CHANGELOG.md b/packages/web3-core/CHANGELOG.md index 50b5f611377..e8f5cec1c62 100644 --- a/packages/web3-core/CHANGELOG.md +++ b/packages/web3-core/CHANGELOG.md @@ -168,3 +168,8 @@ Documentation: ### Fixed - Fixed rpc errors not being sent as an inner error when using the `send` method on request manager (#6300). + +### Added + +- To fix issue #6190, added the functionality to introduce different timeout value for Web3. (#6336) + diff --git a/packages/web3-core/src/web3_batch_request.ts b/packages/web3-core/src/web3_batch_request.ts index c232a4edc9a..10a3eaf4693 100644 --- a/packages/web3-core/src/web3_batch_request.ts +++ b/packages/web3-core/src/web3_batch_request.ts @@ -48,13 +48,15 @@ export class Web3BatchRequest { } // eslint-disable-next-line class-methods-use-this - public async execute(): Promise> { + public async execute(options?: { + timeout?: number; + }): Promise> { if (this.requests.length === 0) { return Promise.resolve([]); } const request = new Web3DeferredPromise>({ - timeout: DEFAULT_BATCH_REQUEST_TIMEOUT, + timeout: options?.timeout ?? DEFAULT_BATCH_REQUEST_TIMEOUT, eagerStart: true, timeoutMessage: 'Batch request timeout', }); diff --git a/packages/web3/CHANGELOG.md b/packages/web3/CHANGELOG.md index 94d16f82db4..be877af8fc2 100644 --- a/packages/web3/CHANGELOG.md +++ b/packages/web3/CHANGELOG.md @@ -140,3 +140,7 @@ Documentation: - Added minimum support of web3.extend function ## [Unreleased] + +### Added + +- To fix issue #6190, added the functionality to introduce different timeout value for Web3. (#6336) \ No newline at end of file