Skip to content

Conversation

@dnlbui
Copy link
Contributor

@dnlbui dnlbui commented Sep 23, 2024

https://linear.app/shm/issue/RED-289/[new-validator-design]-rainbowkit-used-in-gui-is-very-outdated-on-107

resources used:
https://www.rainbowkit.com/docs/migration-guide
https://wagmi.sh/react/guides/migrate-from-v1-to-v2#updated-createconfig-parameters
https://viem.sh/docs/migration-guide.html#_2-x-x-breaking-changes

Summary:
This PR updates related dependencies to rainbowkit upgrade to their latest versions, for compatibility and removing deprecated functions. The changes have been tested locally + w/ WaterNet Dashboard installer and are confirmed to work as expected.

Context:

  • The version of rainbowkit used for connecting wallets was outdated.
  • wagmi and related dependencies needed updates due to deprecations and compatibility issues.
  • tanstack dependencies were required for compilation.

Changes Made:

  1. Dependency Updates:

    • Updated @rainbow-me/rainbowkit from 1.0.7 to 2.1.6.
    • Added @tanstack/query-core version 5.56.2.
    • Added @tanstack/react-query version 5.56.2.
    • Updated viem from 1.3.0 to 2.21.9.
    • Updated wagmi from 1.3.9 to 2.12.12.
  2. Code Adjustments:

    • Modified imports and configurations to align with the updated wagmi and rainbowkit versions.
    • Removed deprecated functions and replaced them with updated implementations.
  3. Testing:

    • Tested locally and verified functionality with the dashboard.
    • Tested using waternet dashboard installer by switching to GUI feature branch after install.
    • Ensured that staking, unstaking, and login/logout work without issues.

The code changes include updating the npm dependencies to their latest versions and fixing the type casting for the Ethereum provider in the StakeForm, useUnstake, and useStake components. The type casting is changed from "ethereum as ExternalProvider" to "ethereum as unknown as ExternalProvider" to address a type error.
…cludes Wagmi's createConfig and replaces getDefaultWallets and connectorsForWallets
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.

2 participants