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

feat: allow for custom ids passed in through a config #23

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ByteAtATime
Copy link

This PR adds a pretty neat feature: the possibility to include multiple burner connectors at once.

Previously, we would pass in the connector like this:

const wallets = [metaMaskWallet, rainbowkitBurnerWallet];

Now, you can pass in a custom id parameter, allowing you to simultaneously have two burner wallets in the same app. For example:

const wallets = [
  metaMaskWallet.
  rainbowkitBurnerWallet, // backwards compatible!
  rainbowkitBurnerWallet({ id: "burner-1", name: "Burner Wallet #1" }),
  rainbowkitBurnerWallet({ id: "burner-2", name: "Burner Wallet #2", storageKey: "custom-localstorage-private-key" }),
]

The id parameter is used by wagmi to differentiate between different connectors, as well as for storing the private key (by default, it stores the key in localStorage at {id}.pk). The localStorage key can be overridden using the storageKey field.

@ByteAtATime
Copy link
Author

Just thought of this: should we have something that tracks the registered IDs, to make sure there are no duplicates?

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 this pull request may close these issues.

1 participant