web3-react
web3-react copied to clipboard
Torus connector
There is code to handle torus connect, disconnect and switch chain (to switch chain you must disconnect before, it seems torus not allowed to switch in wallet already logged in), and update example-next. I really like to know your point on my code. I actually worked on unit test and I have some problem with mock some Torus function. I'm based on metamask and coinbase module to create mine It's PR refer to issue : issue on torus
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/noahwz/web3-react/A1L9T1133Ux1U6awYe8yk8JrLuSa
✅ Preview: Failed
I am curious that I am using @web3-react/torus-connector": "^6.2.9" and I tried to switch chains like you said. Deactivate then Activate. However, when I dived into the implementation of Deactivate , it's only like the following code snippet.XD Is that the reason why I can't switch chains?
_proto.deactivate = function deactivate() {
return Promise.resolve();
};
I am curious that I am using @web3-react/torus-connector": "^6.2.9" and I tried to switch chains like you said. Deactivate then Activate. However, when I dived into the implementation of Deactivate , it's only like the following code snippet.XD Is that the reason why I can't switch chains?
_proto.deactivate = function deactivate() { return Promise.resolve(); };
I don't know why it's not handled in v6 but in this PR on v8 beta it's handled, so if you want to use V6 it's seems you can access to torus method through the instance and call "this.torus.logout()". Because on Torus to switch chain you need to really logout from the wallet dans re - loggin
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| web3-react | ❌ Failed (Inspect) | May 11, 2022 at 7:35AM (UTC) |
I also found another interesting thing. In v6, somehow they don't listen chainChanged event like other wallets. So if I switch chains on the torus wallet, my webapp can't detect that. If using Metamask, my webapp can detect that. Anyway, wait for this PR. Thanks.
Hey @NoahZinsmeister, what do you think about this PR, can we speed up the merge? Or is there something missing / wrong?
Has anyone published an unofficial version of this to npm?
Hey! Unfortunately, we're not accepting external connectors to the core. Consider releasing this package as a separate individual npm package.