rainbow-me / rainbowkit

The best way to connect a wallet 🌈 🧰
https://rainbowkit.com
MIT License
2.36k stars 617 forks source link

[bug] not working as expected when setting preference to "smartWalletOnly" #2053

Closed KarmanMax closed 1 week ago

KarmanMax commented 3 weeks ago

Is there an existing issue for this?

RainbowKit Version

2.1.2

wagmi Version

2.9.10

Current Behavior

Case: the CoinbaseWallet extension enabled, and the coinbaseWallet's preference set to "smartWalletOnly", select Coinbase in the connect modal.

Behavior: it's not connecting to the Coinbase smart wallet as expected, it's connecting to the CoinbaseWallet extension instead.

Expected Behavior

always connect to the Coinbase smart wallet when the coinbaseWallet's preference set to "smartWalletOnly", whatever CoinbaseWallet extension(or mobile app) is available.

Steps To Reproduce

No response

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

No response

magiziz commented 2 weeks ago

@KarmanMax Can you provide a small reproducible example ?

KarmanMax commented 2 weeks ago

@KarmanMax Can you provide a small reproducible example ? sure. here is a simple example: https://github.com/KarmanMax/rainbow-test

magiziz commented 2 weeks ago

@KarmanMax I'm able to get the coinbase smart wallet window popup. Can you try in incognito mode ?

image

If we detect that you have coinbase wallet browser extension we would rather use that than the smart wallet option.

magiziz commented 2 weeks ago

@KarmanMax Any luck ?

KarmanMax commented 2 weeks ago

If we detect that you have coinbase wallet browser extension we would rather use that than the smart wallet option.

that's the issue I want to talk about here. As the preference named "smartWalletOnly", I thought it expects to always use the smart wallet whatever there is a coinbase wallet extension.

Actually what I want is something like what stargate does, which provides coinbase extension and smart wallet separately and the smart wallet option always popup the smart wallet connect modal whatever there is a coinbase wallet extension. And I want to implement this in rainbowkit, I tried adding a custom coinbaseWallet with preference set to "smartWalletOnly" but it doesn't behavior in that way. it will use coinbase wallet extension when the extension is available.

magiziz commented 2 weeks ago

@KarmanMax I see. You could create your own coinbaseWallet, but remove the rdns field and set preference to "smartWalletOnly". Can you try doing that and let me know if it works ?

KarmanMax commented 2 weeks ago

it works! thanks a lot @magiziz