-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RequestManager depends on deprecated event when used with MetaMask #3651
Comments
Thanks for this catch! We've been looking into ways to add further e2e tests with metamask to help catch these bugs (the new release caused a few issues). Right now we're thinking about using the mm app example and integrating it to our existing UI test, but it is ultimately a manual process. Any ideas on potentially automating it? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
The breaking changes (extension version |
See the following snippet for where we emit the relevant events: https://github.com/MetaMask/inpage-provider/blob/d474406b2d8a99b8303e5e269a86dd5a070c7963/src/MetaMaskInpageProvider.ts/#L269-L276 You should use the |
The following PR should fix it, although I haven't tested it. Feel free to edit/adopt/re-implement as required: #3864 |
Refs: https://github.com/ethereum/web3.js/blob/1.x/packages/web3-core-requestmanager/src/index.js#L101-L108
web3-core-requestmanager
depends on the providerdata
event, and makes assumptions about its state. I'm not sure if this even was ever intended for consumer usage in the misty past, but by now, it's superfluous.For MetaMask providers (
ethereum.isMetaMask && typeof ethereum.request === 'function'
), please use the EIP-1193message
event, described in our docs: https://docs.metamask.io/guide/ethereum-provider.html#messageThe
message
event emits with an object of the form{ method: string, data: any }
. Formethod === 'eth_subscription'
, the result is given asdata.result
.The text was updated successfully, but these errors were encountered: