Skip to content
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

[bug] connect modal not showing custom wallet button #1903

Open
1 task done
technophile-04 opened this issue Apr 1, 2024 · 3 comments · May be fixed by #1869
Open
1 task done

[bug] connect modal not showing custom wallet button #1903

technophile-04 opened this issue Apr 1, 2024 · 3 comments · May be fixed by #1869

Comments

@technophile-04
Copy link

technophile-04 commented Apr 1, 2024

Is there an existing issue for this?

  • I have searched the existing issues

RainbowKit Version

^2.0.4

wagmi Version

^2.5.11

Current Behavior

The custom wallet button is not rendered inside connect modal when having custom connector + custom wallet.

Expected Behavior

Similar to rainbowkit v1 it should render custom wallet button in connect modal.

Steps To Reproduce

For easy debuggin and MRR, I have just forked this rainbowkit repo and added our custom connector to packages/examples dir. It has very minimal changes, checkout the file changes here => https://github.com/technophile-04/rainbowkit/pull/1/files

Steps to setup :

  1. Clone the repo + switch to branch :
git clone -b burner-mrr https://github.com/technophile-04/rainbowkit.git
  1. Cd in dir and pnpm install :
cd rainbowkit && pnpm install
  1. Run the dev server :
pnpm run dev
  1. Visit https://lochost:3000

Steps to reproduce :

  1. Make sure you disconnect from metamask / any other wallet
  2. Refresh the page and should be automatically connected to randomly generate account (burner account)
  3. Disconnect and notice that burner wallet button is not rendered in connect modal
Example Video :
Screen.Recording.2024-04-01.at.3.02.50.PM.mov

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

https://github.com/technophile-04/rainbowkit/pull/1/files

Anything else?

Context :

We have been trying to migrate from wagmi v1 => v2 in scaffold-eth/scaffold-eth-2#700, everything works fine with burner wallet being connected and making transactions also no TS errors.

But when you disconnect and try to connect, the burner wallet button does not show up in connect modal

Wagmi, Rainbow V1 Wagmi, Rainbow V2
Screenshot 2024-04-01 at 2 57 55 PM Screenshot 2024-04-01 at 3 14 08 PM
@magiziz
Copy link
Contributor

magiziz commented Apr 1, 2024

@technophile-04 Creating wallets in v2 is kind of complicated, but if you look at this coinbaseWallet example we have here. You can see that we have a parameter walletDetails which is spread operated later in the wallet itself. Can you try doing that approach and see if it works ?

We're looking to simplify wallet creation process, but for now can you go for that approach ?

@technophile-04 technophile-04 changed the title [bug] connect modal not custom wallet button [bug] connect modal not showing custom wallet button Apr 1, 2024
@technophile-04
Copy link
Author

technophile-04 commented Apr 1, 2024

You can see that we have a parameter walletDetails which is spread operated later in the wallet itself. Can you try doing that approach and see if it works ?

Thanks @magiziz !! Just tried it out and works like a charm !

Demo image :

Screenshot 2024-04-01 at 11 48 19 PM

We're looking to simplify wallet creation process

Nice, Thanks !!

Some small suggestions:

  • It would have been nice if we have somehow mentioned about spreading walletDetails in docs here
  • Maybe utilizing typescript to make sure that the developer's passed-in function returns required walletDetails properties

^ lol not sure if the above things makes sense, since I don't have over all context so please feel free to ignore it


If anyone in future stumbled upon this or needs help with custom wallet you can find a naive example here : https://github.com/technophile-04/rainbowkit/pull/1/files


Thanks @magiziz again ! Please feel free to close this issue 🙌

@magiziz
Copy link
Contributor

magiziz commented Apr 1, 2024

@technophile-04 Glad it worked out. Yeah we also have a PR opened here and we'll make sure to make it simpler for users to create wallets 🙏

@magiziz magiziz linked a pull request Apr 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants