-
Notifications
You must be signed in to change notification settings - Fork 9
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
Update rainbowKit example for Rainbowkit / wagmi V2 #23
base: main
Are you sure you want to change the base?
Conversation
[FIX] iconUrl -> Magic
Hey @johnashu, did you get it to work with rainbow kit? import { env } from '@/env'
import { dedicatedWalletConnector } from '@magiclabs/wagmi-connector'
import type { Wallet } from '@rainbow-me/rainbowkit'
import type { Chain } from 'viem'
import { polygon } from 'viem/chains'
import { createConnector } from 'wagmi'
export const createMagicConnector = ({ chain }: { chain: Chain }): Wallet => ({
id: 'magic',
name: 'Magic',
iconUrl: 'https://svgshare.com/i/pXA.svg',
iconBackground: '#fff',
installed: true,
iconAccent: '#b4acfc',
createConnector: (walletDetails) => {
const magicConnector = dedicatedWalletConnector({
chains: [chain],
options: {
customLogo: 'https://iq.social/images/iq-logo.svg',
apiKey: env.NEXT_PUBLIC_MAGIC_API_KEY,
accentColor: '#ea3b87',
oauthOptions: {
providers: ['google', 'facebook', 'twitter', 'discord'],
},
isDarkMode: false,
magicSdkConfiguration: {
network: {
chainId: chain.id,
rpcUrl: chain.rpcUrls.default.http[0],
},
},
},
})
return createConnector((config) => ({
...magicConnector(config),
...walletDetails,
}))
},
})
export const magicWallet = () => createMagicConnector({ chain: polygon }) |
Happens on page refresh, would be great if you could share a minimal production of your solution if it works great, thanks 👏 |
hey Lope, im having the same problem , on page reload i cant get the user address, did you find how to fix it? |
Hi, @rodri595. Damn, no I couldn’t figure out why it happened too. Had to switch to walletconnect. |
I was expecting your help haha but actually i just made it work by downgrading the libs to the one on the wagmi-connector-demo v2 also made sure to have the yarn.lock file, i force install the dependencies ( npm -f i) and now with your config of the dedicated wallet it seems it works perfeclty and on reload the state persists 😀😀 glad it helps and feel free to ask 👋 |
No worries at all! 😅 Thanks for sharing your solution. It'd be really helpful if you could share the |
im using vite, this are my current and the only ones important would be last 4 as you can see they are not i order as per i just add them manually from the demo version
https://github.com/magiclabs/wagmi-magic-connector-demo-v2 --IMPORTANT-- and then just do a clean force install since it work i didnt try to update the magic connectorv2.1.. let me know if it works! |
Hey @Adebesin-Cell / @rodri595, I just pushed out a version that fixes the app state issue. Upgrading to v2.1.1 should resolve it. |
[FIX] iconUrl -> Magic
THe example for RAinbowKit was not working.. This will..