globe-and-citizen / cnc-portal

The Crypto Native Portal, an app that creates a mechanism to financially acknowledge the micro contributions of Open Source collaborators along with tools that promote effective governance.
3 stars 1 forks source link

[Feature] Move from EtherJs to viem, by using wagmi #349

Open hermannleboss opened 4 days ago

hermannleboss commented 4 days ago

Description

We need to move from etherjs to Viem, and use wagmi on top of it.

Acceptance Criteria

dasarathg68 commented 3 days ago

Notes for future reference:

350 sets up and initializes wagmi in the frontend.

Further, it uses a function setupApp() to improve testability of the main.ts file.

export function setupApp() {
  const app = createApp(App)
  const queryClient = new QueryClient()

  app.use(createPinia())
  app.use(router)
  app.use(WagmiPlugin, { config })
  app.use(VueQueryPlugin, { queryClient })

  return app
}
setupApp().mount('#app')

I have set wagmi.config.ts based on best practices that allow us to leverage both the @wagmi/core and @wagmi/vue libraries since some composables like deploy aren't available for Vue just yet. In a different project, I have played around with all of the functions that we would need for the CNC portal and if you need a reference, then here's what you would need to use: https://github.com/dasarathg68/GovernanceX/blob/main/app/src/views/HomeView.vue https://wagmi.sh/vue/getting-started https://wagmi.sh/core/getting-started