matthias
@iammatthias
Anyone have good notes or docs on using v2 frames with Vite?
1 reply
0 recast
2 reactions
Steve
@stevedylandev.eth
Anything specific? Or just a general guide? Still got this which uses React Vite: https://orbiter.host/blog/how-to-deploy-a-v2-frame-on-orbiter
1 reply
0 recast
1 reaction
matthias
@iammatthias
I think this should get me most of the way there! Thanks! Looks like this skips the wallet provider stuff?
1 reply
0 recast
1 reaction
Steve
@stevedylandev.eth
Np! Yeah I purposely went a minimal route to cover just the basics. There is an SDK method for retrieving accounts that can get you started, I’d need to look into some other examples they have using wagmi to see how it would work out. https://docs.farcaster.xyz/developers/frames/v2/spec#wallet-ethprovider
1 reply
0 recast
1 reaction
Steve
@stevedylandev.eth
https://github.com/orbiterhost/v2frame/tree/wallet-demo Did a little experimenting and got wagmi working with our existing v2 frame template (check out the wallet-demo branch)! Lets a user connect a wallet and write to a contract. Definitely a few things to know: - In order for wagmi to work with V2 frames you need a connector interface with the frames SDK. I copied the code used in the frame docs and added it here: https://github.com/orbiterhost/v2frame/blob/wallet-demo/src/utils/connector.ts - That connector goes into the wagmi config: https://github.com/orbiterhost/v2frame/blob/d4505ae3d634964a4f73e178a1ef41be6c7b05cf/src/utils/config.ts#L10 - Lastly the config goes into the wagmi provider, which wraps the app: https://github.com/orbiterhost/v2frame/blob/wallet-demo/src/main.tsx - Once all of this is setup you can start using wagmi! Check out the example in App.tsx
1 reply
0 recast
1 reaction
Steve
@stevedylandev.eth
One other thing to note is that when you connect a user's wallet you need to import the wagmi config and specify the special connector used to make it work! https://github.com/orbiterhost/v2frame/blob/d4505ae3d634964a4f73e178a1ef41be6c7b05cf/src/App.tsx#L121
0 reply
0 recast
1 reaction