diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index e0e0ab09a6..c557e80a45 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "5.4.1", + "changes": [ + { + "note": "Fix extra space in `provider.send` signature", + "pr": 2428 + } + ] + }, { "version": "5.4.0", "changes": [ diff --git a/packages/utils/src/provider_utils.ts b/packages/utils/src/provider_utils.ts index 69b8b0f8bf..a2d81bb848 100644 --- a/packages/utils/src/provider_utils.ts +++ b/packages/utils/src/provider_utils.ts @@ -74,7 +74,7 @@ export const providerUtils = { } else if ((supportedProvider as any).send !== undefined) { // HACK(fabio): Detect if the `send` method has the old interface `send(payload, cb)` such // as in versions < Web3.js@1.0.0-beta.37. If so, do a simple re-mapping - if (_.includes((supportedProvider as any).send.toString(), 'function (payload, callback)')) { + if (_.includes((supportedProvider as any).send.toString().replace(' ', ''), 'function(payload,callback)')) { provider.sendAsync = (supportedProvider as any).send.bind(supportedProvider); return provider; } else {