forked from polkadot-js/extension
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Integrate SubWallet with EVM Dapp #235
Milestone
Comments
Please check issues:
Some improve:
|
Expect: Refer experience of MetaMask when connect to https://portal.astar.network |
This was referenced Jun 17, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview
SubWallet now support EVM Account (H160) and also can interact with EVM via web3.js but now package
extension-dapp
andextension-inject
need to be improvove for devliver these feature with the way like MetaMask done for browser DApp.EVM DApp methods
Here is most basic feature we need to provide for EVM DApp.
How to MetaMask extension interact with DApp?
MetaMask will publish a provider to browser window with name ethereum. DApp interact with MetaMask extension via this object.
ethereum.request
eg:ethereum.request({ method: 'eth_requestAccounts' });
ethereum.on('event_name', callback: () => {}))
.Difference between MetaMask and SubWallet
Solution
We aim to provide an interface similar to MetaMask to reduce integration effort from products that already have supported MetaMask but because some diffrerences they will not be the same.
Concept:
window.ethereum
if MetaMask to other wallet not existsSubWallet
similar toethereum
ofMetaMask
, SubWallet will interact to account and chains like the way metamask do when interact with DApp via evm provider.Design Interface
accountChanged
andchainChanged
events.Todo
Change on SubConnect
Migrate to mutipackages architech
Create new
@subwallet/wallet-connect
in repository SubWallet: A connect lib support both Substrate and EVM interface.Use wallet-connect instead of current lib/wallets
Examples of MetaMask on SubConnect
Example of SubWallet - EVM Connect
Change on SubWallet
provider.on(eventName, callback)
provider.request(method, param)
Improvement:
The text was updated successfully, but these errors were encountered: