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

Deprecated event listener #4786

@antonio-fr

Description

@antonio-fr

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Running web3.js with Metamask, the latter informs with a warning that the "close" may be removed in any future version.

new window.Web3(window.ethereum)

➡️
MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.
For more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect

_warnOfDeprecation @ inpage.js:1
on @ inpage.js:1
u.setProvider @ web3.js:15
e @ web3.js:15
packageInit @ web3.js:3
d @ web3.js:15
Web3Wallet @ wallet.js...
startWeb3 @ xxx

Expected Behavior

Should use a current method, not a deprecated one.

Steps to Reproduce

Use dist/web3.min.js v1.7.0 in a browser with Metamask :
new window.Web3(window.ethereum)

Web3.js Version

1.7.0

Environment

  • Operating System: Win10
  • Browser: Chromium 97.0.4692.71
  • Node.js Version: 16.13.0
  • NPM Version: 8.1.0

Anything Else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.x1.0 related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions