web3-react icon indicating copy to clipboard operation
web3-react copied to clipboard

Torus connector

Open OlremProj opened this issue 3 years ago • 6 comments

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

OlremProj avatar Apr 26 '22 20:04 OlremProj

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

vercel[bot] avatar Apr 26 '22 20:04 vercel[bot]

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();
  };

JustinlinPerp avatar May 06 '22 15:05 JustinlinPerp

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

OlremProj avatar May 09 '22 08:05 OlremProj

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)

vercel[bot] avatar May 09 '22 08:05 vercel[bot]

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.

JustinlinPerp avatar May 09 '22 09:05 JustinlinPerp

Hey @NoahZinsmeister, what do you think about this PR, can we speed up the merge? Or is there something missing / wrong?

flux0uz avatar May 13 '22 07:05 flux0uz

Has anyone published an unofficial version of this to npm?

JasoonS avatar Nov 03 '22 12:11 JasoonS

Hey! Unfortunately, we're not accepting external connectors to the core. Consider releasing this package as a separate individual npm package.

grabbou avatar Apr 05 '23 14:04 grabbou