-
Notifications
You must be signed in to change notification settings - Fork 251
Update metamask connector WIP #2326
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
base: master
Are you sure you want to change the base?
Update metamask connector WIP #2326
Conversation
|
@adonesky1 is attempting to deploy a commit to the Consensys Team on Vercel. A member of the Team first needs to authorize it. |
| from: account, | ||
| to: account, | ||
| value: parseEther("0.01"), | ||
| value: parseEther("0.0001"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to keep these changes. I had to make them because pressing Send ETH causes an eth_estimateGas to fire which fails with an error because my test account doesn't have enough ETH. The error is not surfaced to the dapp/console in a clear way
| function rpcUrlToWsUrl(rpcUrl: string) { | ||
| if (!rpcUrl) throw new Error("Please configure https endpoint for solana rpc"); | ||
| // TODO revert back (just temporarily to avoid configuring solana rpc) | ||
| if (!rpcUrl) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
| this.metamaskInstance = await this.metamaskPromise; | ||
| // TODO: Remove this hack | ||
| // Hack to ensure the ConnectEvm instance has fully resumed the connection | ||
| await new Promise((resolve) => setTimeout(resolve, 2000)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this awful delay to ensure that this async call in the ConnectEvm constructor has fully resolved. We need to fix this on the connect-monorepo side
| // if (options.autoConnect) { | ||
| // this.rehydrated = false; | ||
| // this.emit(CONNECTOR_EVENTS.REHYDRATION_ERROR, new Error("Failed to resume existing MetaMask Connect session.") as Web3AuthError); | ||
| // } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this commented code can be dropped?.. Not sure if it's more appropriate to throw an error if we fail to resume a previous session OR if we just say the connector is ready for new connections
| supportedNetworks: { | ||
| // Fallback public RPC endpoints if no Infura key is provided | ||
| // "eip155:1": "https://eth.llamarpc.com", | ||
| "eip155:1": "https://mainnet.infura.io/v3/de3198afe5f44ee99d155c9843001539", | ||
| "eip155:5": "https://goerli.infura.io/v3/demo", | ||
| "eip155:11155111": "https://sepolia.infura.io/v3/demo", | ||
| "eip155:137": "https://polygon-rpc.com", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got cross origin problem when using the web3auth provided rpc urls
WIP