vla*_*who 9 blockchain ethereum web3js web3-donotuse metamask
我正在构建一个分散的应用程序,用户可以在其中将他们的加密货币钱包 (Metamask) 连接到我的网站。
They can initiate a connection request by clicking a button. On success, the wallet is connected and my website can interact with it.
Is there any way to initiate a disconnect request? Similar to a 'Log out' button. Currently, the users have to manually disconnect their wallet within Metamask settings which is not a straightforward process.
以下是我用来断开您连接的帐户(假设您只有一个)与应用程序的连接的方法:
await window.ethereum.request({
method: "eth_requestAccounts",
params: [{eth_accounts: {}}]
})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
843 次 |
| 最近记录: |