Closed Snehagupta1907 closed 2 months ago
@Snehagupta1907 I'm not able to reproduce this. Can you try testing it in our example dApp ? https://rainbowkit-example.vercel.app/
@magiziz Can you share the version cause when i am trying to use for even send transaction this error coming
coming from file VM of rainbowkit
try { let t = (e = Yf.phantom) == null ? void 0 : e.ethereum; if (t) { if (!this.detected.length) { this.setProvider(t), window.dispatchEvent(new Event("ethereum#initialized")); return } switch (yield t.request({ method: "wallet_selectEthereumProvider", params: [] })) { case "ALWAYS_USE_PHANTOM": case "CONTINUE_WITH_PHANTOM": { this.setProvider(t); break } case "CONTINUE_WITH_METAMASK": case "ALWAYS_USE_METAMASK": { let[o] = this.detected; for (let s of this.detected) s.isMetaMask && this.setProvider(s); !this.targetProvider && o && this.setProvider(o); break } } } } catch (t) { console.error(t) } finally { this.isSelectingExtension = !1 }
This complete script of that VM
https://streamnft-rent.vercel.app/polygon%20amoy
try lending nft on bayc polygon amoy ....if you want i can share the nft
if my google chrome has both the phatom wallet and metamask extension, my application doesn't load and just crashes. Removing either one makes the app work again. Sorry if this is irrelevant to the above conversation but the interplay between those two wallets is causing me issues as well, thanks.
yes exactly ...if we delete one wallet it works fine but expected is that should work always irrespective of wallets in the browser
@Snehagupta1907 The code you provided doesn't seem to use any Wagmi hooks. Can you share a minimal reproducible example which uses Wagmi and RainbowKit ? CodeSandbox or github repo link would be enough.
@MatthewGreenberg The app seems to work fine if i enable both extensions. You can test it here as well https://rainbowkit-example.vercel.app
code is using the wagmi hooks....and sorry i can't share the code repo as it's private
version of wagmi and rainbowkit which i am using i have shatre that above
can you share your code for the application if possible
I ahve share the code snippet where it is throwing error can you please look it up ASAP
@Snehagupta1907 Here is the source code for the example dApp https://github.com/rainbow-me/rainbowkit/tree/main/packages/example
The code you provided is from a webpack build file and i can't see any Wagmi hooks being used. Can you share a small reproducible example which uses Wagmi and RainbowKit ?
you can refer to this here clearly it is checking phantom and metamask
and error t is thrown...user rejected error
i am using ether js for contract integration
@Snehagupta1907 I'm not able to see that you use Wagmi here. Are you manually accessing the window.ethereum
API without using Wagmi ?
i am using wagmi...idk from which module that code is coming
I'm going to close this issue since no minimal reproducible example was provided. Feel free to re-open this issue with a reproducible example or create a new one.
Is there an existing issue for this?
RainbowKit Version
2.1.3
wagmi Version
2.6.7
Current Behavior
If the browser has phantom and metamask wallet then doing any transaction using metamask user rejected request error thrown but if we delete the phantom wallet from browsers everything works fine.
issue is here
this.selectExtension = ()=>jt(this, null, function*() { var e; if (!this.targetProvider && !this.isSelectingExtension) { this.isSelectingExtension = !0; try { let t = (e = Yf.phantom) == null ? void 0 : e.ethereum; if (t) { if (!this.detected.length) { this.setProvider(t), window.dispatchEvent(new Event("ethereum#initialized")); return } switch (yield t.request({ method: "wallet_selectEthereumProvider", params: [] })) { case "ALWAYS_USE_PHANTOM": case "CONTINUE_WITH_PHANTOM": { this.setProvider(t); break } case "CONTINUE_WITH_METAMASK": case "ALWAYS_USE_METAMASK": { let[o] = this.detected; for (let s of this.detected) s.isMetaMask && this.setProvider(s); !this.targetProvider && o && this.setProvider(o); break } } } } catch (t) { console.error(t) } finally { this.isSelectingExtension = !1 } }
Expected Behavior
We want that if the browser has any wallet irrespective, if we choose metamask and it get connected so transaction should proceed.
Steps To Reproduce
Just install both metamask and phantom try to do evm transaction from metamask.
like any send transaction method for let say on polygon amoy chain ....keeping metamask and phantom wallet in the browser
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
No response
Anything else?
Use chrome browser