Skip to content

Commit

Permalink
rainbowkit v2 and wagmi v2 support (#1747)
Browse files Browse the repository at this point in the history
* chore: deprecate bitkeepWallet (#1687)

* refactor: deprecate walletconnect v1 connectors, api (#1688)

* chore: deprecate walletconnect legacy

* chore: remove v1 customization from walletconnect v2 guides

* chore: temporarily remove examples

In preparation for RainbowKit and Wagmi breaking changes

* refactor: default wallet connectors (#1689)

* feat: getDefaultConfig (#1690)

* feat: getDefaultConfig util

* fix: expose appLogoUrl in CoinbaseWalletOptions

* fix: expose metadata in walletconnect options

* fix: chain imports consistency

* refactor: wallet connectors provider checks, deprecate @wagmi/core types (#1693)

* chore: remove @wagmi/core depen

* fix: getDefaultConfig walletConnect options

* chore: remove InjectedConnectorOptions from wallet connectors

* chore: adopt getInjectedConnector in more connectors

* feat: namespace support in getInjectedConnector

* refactor: hasInjectedProvider usage

* refactor: adopt getInjectedConnector in connectors

* feat: drilldown namespace support in getWindowProviderNamespace

* chore: adopt getInjectedConnector over custom getProvider

* refactor: metamask InjectedConnector creator, isMetaMaskInjected

* fix: getInjectedConnector internal window checking

* fix: metamask button behavior

* chore: beta version packages

* chore: temporarily remove generated-test-app

* chore: fix lockfile

* Revert "chore: temporarily remove generated-test-app"

This reverts commit 3303207.

* chore: add beta tag to release script, update branch

* docs: v2 beta migration guide (#1696)

* chore: add beta tag to release script

* chore: migration guide scaffold

* chore: copy guide from @mago/v2-docs-changesets

* chore: sitemap update

* Revert "chore: temporarily remove generated-test-app"

This reverts commit 3303207.

* chore: guide improvements

* chore: docs cleanup

* chore: tweaks

* chore: remove beta note

* chore: tweak diffs

* chore: tweak

* chore: remove wagmi provider in example

* fix: broken title

* chore: subsections

* fix: rainbowkit diff title

* fix: subheader prominence

* chore: tweaks

* chore: tweaks

* feat: wagmi v2 migration, eip-6963 wallet support (#1601)

* rainbowkit-wagmi-v2

* fix: remove "installed" and "createConnector" because of EIP6963 support

* fix: use latest wagmi hooks and replace the old ones

* fix: add latest changes to add URI with wagmi alpha

* fix: remove outdated wagmi values and use new hooks

* fix: update wallets back to normal

* fix: all wallet connectors to use "createConnector" with their own provier

* fix: setup connectorsForWallets properly

* fix: refactor tests

* fix: use wallet connectors

* fix: refactor wallets

* fix: use onQrCode when listening to the wallet connect provider

* fix: integrate connect wallet on mobile

* fix: connectors should be using installed true or false as a sign for connector.ready in wagmiv2

* fix: merge EIP6963

* fix: make sure every project is integrated with wagmiv2

* fix: linting

* fix: lint errors

* feat: latest changes for eip6963 / wagmiv2

* fix: chain modal

* fix: prettify code

* fix: refactor test file to be matched with wagmiv2

* fix: linting issues

* fix: styles

* fix: cleanup code

* fix: cleanup connectors and code

* fix: @ts-expect-error touch callout

* fix: update to latest wagmi@beta / viem@beta version alongside with react tanstack query

* fix: inject "rkDetails" into connector instead of running through some conflicts

* fix: QueryClientProvider

* fix: cleanup

* fix: cleanup

* fix: tsc errors

* fix: preserve symlink

* fix: prettify

* fix: prettify

* fix: prettify

* fix: prettify

* fix: rainbowkit chains

* fix: types

* fix: cleanup <Provider /> and docs

* fix: update peer dependencies

* fix: add readonly tuple type for rainbowkit chains

* fix: chain tuple types with Chain and RainbowKitChain

* fix: merge conflicts

* fix: rainbow wallet and wallet button example lint issues

* fix: minor stuff

* fix: cleanup

* fix: linting issues with i18n

* fix: cleanup to only use goerli if testnet is provided

* fix: goerli

* fix: put wagmi before <QueryClientProvider />

* fix: create-react-app cleanup

* fix: with-remix example cleanup

* fix: filter out to only use rainbowkit connectors for <WalletButtonRendered />

* fix: cleanup code to use Chain from wagmi/chains

* fix: cleanup addLatestWalletId on mobile and desktop

* chore: dependency upgrade

* feat: combine eip6963 connectors with eip1193 connectors

* fix: refactor eip6963 connectors with mobile version

* chore: upgrade wagmi, viem to rc

* chore: merge conflicts

* chore: rename 'combineEIP6963WithRkConnectors' with 'mergeEIP6963WithRkConnectors' and add changeset

* chore: add rainbow button and wallet button updates to changeset

* fix: merge conflicts

* fix: useTransactionStore typing

* chore: upgrade to viem 2.0.0

* chore: upgrade @tanstack/react-query

* revert: rainbow button CHANGELOG.MD

* refactor: rename 'wagmiConfig' to 'config'

* revert: add back removed items from rainbowkit index.ts file

* chore: upgrade from viem@2.0.0 to viem@2.0.0-rc.3

* refactor: use 'import type' for types and interfaces

* chore: add rpc calls to the transporter as environment variables

* refactor: update changeset

* chore: update viem and wagmi v2 to latest version

* chore: upgradde viem to 2.0.0

* chore: upgrade wagmi to v2

* chore: tanstack minor version flex

* fix: merge conflicts

* chore: remove testnets from tests

* chore: changeset tweaks for prod release

* chore: add migration guide and updated docs to match latest wagmi v2 and rainbowkit beta versions

* fix: update changeset to include latest wagmi@rc version

* refactor: use ^15.17.1 version of @tanstack/react-query and update pnpm-lock.yaml

* fix: link to migration guide page

* fix: incorrect wagmi rc version, should use prod

fix: incorrect wagmi rc version, should use prod

* chore: changeset for rainbowkit-siwe-next-auth

* chore: fix create-rainbowkit template with minor bump

* chore: tweak new wagmi branding

* chore: migration guide changes for simplicity

* fix: chain object docs

* fix: wagmi capitalization

* fix: cra example consistency

* revert: locale file changes for review simplicity

* refactor: rename walletOptions to walletDetails

* refactor: add back WalletConnect options and refactor wallet connect singleton instance

* refactor: change WalletConnect id variable and bring back walletConnectWallet.test.ts file

* fix: chain modal test typos

* chore: adding comments and using 'wcId' as the default wallet connect id for custom logic

* refactor: remove exmples/*/**

* refactor: remove examples changeset

* chore: add sepolia networks

* fix: remove unused 'bsc' chain

* refactor: remove custom 'useChainId' hook and use wagmi's 'useChainId'

* refactor: test files & chain modal

* fix: small typo

* fix: remove console log

* refactor: remove locales

* fix: typo

* chore: improve comments with walletConnect merging

* chore: remove 'hidden' explanation comments due to 'injectedWallet' deprecation

* chore: update 'migration-guide'

* chore: expose  type for wallet creation purposes

* chore: add 'RainbowKitWalletConnectParameters' type

* chore: refactor 'getWalletConnectConnector' to use new 'RainbowKitWalletConnectParameters' type

* chore: replace 'WalletConnectParameters' with 'RainbowKitWalletConnectParameters' for custom wallets

* fix: docs updates

* chore: cleanup docs

* revert: migrate docs, changesets to @mago/v2-docs-changesets

* chore: standardize preserveSymlinks

* chore: upgrade wagmi, viem, tanstack/react-query

* refactor: remove 'wcId' and cleanup test / connectors

* fix: remove 'false' for multiInjectedDiscovery

* fix: format document

* fix: update 'getDefaultConfig' to force some properties

* fix: remove declare global window

* fix: upgrade viem and wagmi dependencies

* revert: upgrade viem and wagmi dependencies

* refactor: 'getDefaultConfig' and packages

* refactor: remove 'chains' from <RainbowKitProvider />

* refactor: remove const with readonly [Chain, ...Chain[] type

* refactor: 'connectorsForWallets' to use wallet functions and cleanup connectors

* refactor: 'getDefaultConfig'

* refactor: 'getDefaultWallets'

* fix: remove mewWallet

* fix: use 'Chain' for initialChain prop

* refactor: browserWallet to injectedWallet

* revert: temporarily remove generated-test-app

* fix: remove transports definitions in examples

* chore: update wagmi, viem

* refactor: 'getDefaultWallets' and 'connectorsForWallets'

* fix: wagmi / viem typescript errors

* fix: bring back generated-test-app to keep pnpm lock file upto date

* chore: add beta tag to release script

* revert: use `wallets` prop instead of `walletList`

* fix: add 'useAsImage' to avoid EIP6963 internal image bugs with 'background' urls

* fix: push a change for connector emitters

* fix: don't call connectors on server side to not expose unlimited event emitters

* fix: make sure WalletButtonRendered is mounted before throwing error

* fix: add back example project id for examples

* fix: missing connector_group.installed string

* revert: wagmi, viem peer drift

* fix: amend peer specifier

* fix: connector emitter cleanup

* chore: upgrade to wagmi 2.2.0

chore: upgrade to wagmi 2.2.0

chore: upgrade to wagmi 2.2.0

* fix: amend peer specifier

* chore: deprecate example projectId warning

* chore: bump beta version

* fix: mock connectors on locale tests

* chore: fix lockfile after merge issue

* fix: mock connector for <ConnectModal /> test

* fix: update mock to true

* chore: upgrade wagmi, viem (#1708)

* chore: update wagmi to 2.2.1

* chore: update viem to 2.0.10

* fix: handle unhandled rejection silent

* chore: update viem to 2.1.1

* chore: fixed peer version

* Revert "fix: handle unhandled rejection silent"

This reverts commit 6a609e0.

---------

Co-authored-by: Magomed Khamidov <53529533+KosmosKey@users.noreply.github.com>

* fix: cleanup as readonly chains array

* fix: emitter not found (#1712)

* chore: update wagmi, viem

* chore: bump beta version

---------

Co-authored-by: Daniel Sinclair <d@niel.nyc>

* chore: rainbowButton connector fallback injected option

* chore: upgrade wagmi, @tanstack/react-query, viem (#1745)

* chore: remove empty array return due to 'ssr' option in 'createConfig'

* chore: remove injected fallback

* chore: let user specify all wagmi options (#1743)

* fix: remove mounted logic on WalletButtonRendered

* chore: bring back examples (#1746)

* chore: expose `Chain` type and refactor `getDefaultConfig` (#1742)

* chore: expose 'Chains' type and refactor getDefaultConfig

* refactor: provideRainbowKitChains

* example: add custom chain avalanche

* revert: chains type

---------

Co-authored-by: Daniel Sinclair <d@niel.nyc>

* chore: i18n updates

* chore: bump beta version

* chore: beta example cleanups (#1749)

* chore: example cleanup

* chore: use projectId and appName as a one line for cleanliness

* chore: remove mounted logic due to ssr support from wagmi

* chore: add ssr true to docs

* chore: format example projects

chore: format example projects

chore: format

chore: cleanup with-next-app

chore: prettify entry.server.tsx

* chore: normalize chain from account rather than chain from persist state

* revert: remove useChainId

* refactor: chain modal chain id and test file (#1751)

* chore: small fix for SIWE

* revert: remove pageSession

* chore: sign-in with ethereum with multi wallet connections (#1758)

* chore: add watchConnectors

* chore: support sign-in with ethereum multiple connection instances

* chore: bump beta version

* chore: bump version

* chore: update sitemap

* fix: missing safeWallet, braveWallet exports

chore: add back safeWallet due to non supported eip6963

fix: missing braveWallet

* chore: beta version bump

* docs: v2 migration guides, docs, changesets (#1697)

* chore: changsets and docs from #1601

* merge: @daniel/migration-guide-v2

* chore: update docs

* chore: update docs with new APIs and wagmi v2 changes

* chore: update changesets

* chore: update changesets

* chore: update changesets

* chore: update 2.x.x wagmi version

* fix: use single quote instead of double quote

* fix: use single quote instead of double quote #2

* fix: refactor custom-wallets.mdx

* chore: small tweak

* chore: update introduction video

* fix: remove chains prop from migration guide

* chore: update custom wallets, chains and installation sections

* chore: update custom chains

* chore: update custom wallet list

* chore: tweak

* chore: update custom chains and tweak stuff

* chore: tweak changeset and migration

* chore: update rainbow button guide

* chore: update docs and tweak changesets

* chore: rainbowkit to major version 2.x.x changeset change

* chore: update sitemap

* fix: missing tanstack/react-query installs

* fix: missing @tanstack/react-query imports

* fix: create-rainbowkit minor bump

* fix: simplify changeset and migration guide

* fix: rainbow button changeset

* fix: removed beta link from changeset

* fix: removed beta callout

* fix: peer references

* fix: remove incorrect file

* fix: tweak

* fix: chains docs

* fix: latest reference

* fix: tanstack, injectedWallet references

* fix: intro

* fix: duplicate tanstack install reference

* fix: rainbow button readme

* fix: wallet connectors reference

* fix: queryclientprovider reference

* fix: imports for connectorsforwallets

* fix: favor viem@2.x

* fix: migrate migration guide to guide article

* chore: update sitemap

---------

Co-authored-by: Magomed Khamidov <53529533+KosmosKey@users.noreply.github.com>

* beta i18n updates (#1763)

* New translations custom-wallet-list.mdx (Chinese Simplified)

* New translations custom-wallet-list.mdx (Portuguese, Brazilian)

* New translations custom-wallet-list.mdx (Indonesian)

* New translations custom-wallet-list.mdx (Thai)

* New translations custom-wallet-list.mdx (Hindi)

* New translations custom-wallets.mdx (Ukrainian)

* New translations custom-wallets.mdx (Indonesian)

* New translations custom-wallets.mdx (Thai)

* New translations installation.mdx (Turkish)

* New translations installation.mdx (Ukrainian)

* New translations installation.mdx (Chinese Simplified)

* New translations installation.mdx (Portuguese, Brazilian)

* New translations installation.mdx (Indonesian)

* New translations installation.mdx (Thai)

* New translations installation.mdx (Hindi)

* New translations installation.mdx (Spanish, Latin America)

* New translations introduction.mdx (Turkish)

* New translations introduction.mdx (Ukrainian)

* New translations introduction.mdx (Chinese Simplified)

* New translations introduction.mdx (Portuguese, Brazilian)

* New translations introduction.mdx (Indonesian)

* New translations introduction.mdx (Thai)

* New translations introduction.mdx (Hindi)

* New translations introduction.mdx (Spanish, Latin America)

* New translations migration-guide.mdx (French)

* New translations migration-guide.mdx (Arabic)

* New translations migration-guide.mdx (Japanese)

* New translations migration-guide.mdx (Korean)

* New translations migration-guide.mdx (Russian)

* New translations migration-guide.mdx (Turkish)

* New translations migration-guide.mdx (Ukrainian)

* New translations migration-guide.mdx (Chinese Simplified)

* New translations migration-guide.mdx (Portuguese, Brazilian)

* New translations migration-guide.mdx (Indonesian)

* New translations migration-guide.mdx (Thai)

* New translations migration-guide.mdx (Hindi)

* New translations migration-guide.mdx (Spanish, Latin America)

* New translations theming.mdx (French)

* New translations theming.mdx (Arabic)

* New translations theming.mdx (Japanese)

* New translations theming.mdx (Korean)

* New translations theming.mdx (Russian)

* New translations rainbow-button.mdx (French)

* New translations rainbow-button.mdx (Arabic)

* New translations rainbow-button.mdx (Japanese)

* New translations rainbow-button.mdx (Korean)

* New translations rainbow-button.mdx (Russian)

* New translations rainbowkit-wagmi-v2.mdx (French)

* New translations theming.mdx (Turkish)

* New translations theming.mdx (Ukrainian)

* New translations theming.mdx (Portuguese, Brazilian)

* New translations theming.mdx (Indonesian)

* New translations theming.mdx (Thai)

* New translations theming.mdx (Hindi)

* New translations theming.mdx (Spanish, Latin America)

* New translations rainbow-button.mdx (Turkish)

* New translations rainbow-button.mdx (Ukrainian)

* New translations rainbow-button.mdx (Chinese Simplified)

* New translations rainbow-button.mdx (Portuguese, Brazilian)

* New translations rainbow-button.mdx (Indonesian)

* New translations rainbow-button.mdx (Thai)

* New translations rainbow-button.mdx (Hindi)

* New translations rainbow-button.mdx (Spanish, Latin America)

* New translations rainbowkit-wagmi-v2.mdx (Arabic)

* New translations rainbowkit-wagmi-v2.mdx (Japanese)

* New translations rainbowkit-wagmi-v2.mdx (Korean)

* New translations rainbowkit-wagmi-v2.mdx (Russian)

* New translations rainbowkit-wagmi-v2.mdx (Turkish)

* New translations rainbowkit-wagmi-v2.mdx (Ukrainian)

* New translations rainbowkit-wagmi-v2.mdx (Chinese Simplified)

* New translations rainbowkit-wagmi-v2.mdx (Portuguese, Brazilian)

* New translations rainbowkit-wagmi-v2.mdx (Indonesian)

* New translations rainbowkit-wagmi-v2.mdx (Thai)

* New translations rainbowkit-wagmi-v2.mdx (Hindi)

* New translations rainbowkit-wagmi-v2.mdx (Spanish, Latin America)

* New translations custom-connect-button.mdx (Ukrainian)

* New translations custom-wallets.mdx (Hindi)

* New translations custom-wallets.mdx (Turkish)

* New translations theming.mdx (Chinese Simplified)

* New translations authentication.mdx (French)

* New translations authentication.mdx (Arabic)

* New translations authentication.mdx (Japanese)

* New translations authentication.mdx (Korean)

* New translations authentication.mdx (Russian)

* New translations authentication.mdx (Turkish)

* New translations authentication.mdx (Ukrainian)

* New translations authentication.mdx (Chinese Simplified)

* New translations authentication.mdx (Indonesian)

* New translations authentication.mdx (Thai)

* New translations authentication.mdx (Hindi)

* New translations chains.mdx (French)

* New translations chains.mdx (Arabic)

* New translations chains.mdx (Japanese)

* New translations chains.mdx (Korean)

* New translations chains.mdx (Russian)

* New translations chains.mdx (Turkish)

* New translations chains.mdx (Ukrainian)

* New translations chains.mdx (Chinese Simplified)

* New translations chains.mdx (Indonesian)

* New translations chains.mdx (Thai)

* New translations chains.mdx (Hindi)

* New translations connect-button.mdx (Chinese Simplified)

* New translations cool-mode.mdx (Chinese Simplified)

* New translations custom-app-info.mdx (Chinese Simplified)

* New translations custom-authentication.mdx (French)

* New translations custom-authentication.mdx (Arabic)

* New translations custom-authentication.mdx (Japanese)

* New translations custom-authentication.mdx (Korean)

* New translations custom-authentication.mdx (Russian)

* New translations custom-authentication.mdx (Turkish)

* New translations custom-authentication.mdx (Ukrainian)

* New translations custom-authentication.mdx (Indonesian)

* New translations custom-authentication.mdx (Thai)

* New translations custom-authentication.mdx (Hindi)

* New translations custom-avatars.mdx (Chinese Simplified)

* New translations custom-chains.mdx (French)

* New translations custom-chains.mdx (Arabic)

* New translations custom-chains.mdx (Japanese)

* New translations custom-chains.mdx (Korean)

* New translations custom-chains.mdx (Russian)

* New translations custom-chains.mdx (Turkish)

* New translations custom-chains.mdx (Ukrainian)

* New translations custom-chains.mdx (Indonesian)

* New translations custom-chains.mdx (Thai)

* New translations custom-chains.mdx (Hindi)

* New translations custom-connect-button.mdx (French)

* New translations custom-connect-button.mdx (Ukrainian)

* New translations custom-connect-button.mdx (Chinese Simplified)

* New translations custom-connect-button.mdx (Indonesian)

* New translations custom-theme.mdx (Chinese Simplified)

* New translations custom-wallet-list.mdx (French)

* New translations custom-wallet-list.mdx (Arabic)

* New translations custom-wallet-list.mdx (Japanese)

* New translations custom-wallet-list.mdx (Korean)

* New translations custom-wallet-list.mdx (Russian)

* New translations custom-wallet-list.mdx (Turkish)

* New translations custom-wallet-list.mdx (Ukrainian)

* New translations custom-wallet-list.mdx (Chinese Simplified)

* New translations custom-wallet-list.mdx (Indonesian)

* New translations custom-wallet-list.mdx (Thai)

* New translations custom-wallet-list.mdx (Hindi)

* New translations custom-wallets.mdx (French)

* New translations custom-wallets.mdx (Arabic)

* New translations custom-wallets.mdx (Japanese)

* New translations custom-wallets.mdx (Korean)

* New translations custom-wallets.mdx (Russian)

* New translations custom-wallets.mdx (Turkish)

* New translations custom-wallets.mdx (Ukrainian)

* New translations custom-wallets.mdx (Chinese Simplified)

* New translations custom-wallets.mdx (Indonesian)

* New translations custom-wallets.mdx (Thai)

* New translations custom-wallets.mdx (Hindi)

* New translations installation.mdx (French)

* New translations installation.mdx (Arabic)

* New translations installation.mdx (Japanese)

* New translations installation.mdx (Korean)

* New translations installation.mdx (Russian)

* New translations installation.mdx (Turkish)

* New translations installation.mdx (Ukrainian)

* New translations installation.mdx (Chinese Simplified)

* New translations installation.mdx (Indonesian)

* New translations installation.mdx (Thai)

* New translations installation.mdx (Hindi)

* New translations introduction.mdx (French)

* New translations introduction.mdx (Arabic)

* New translations introduction.mdx (Japanese)

* New translations introduction.mdx (Korean)

* New translations introduction.mdx (Russian)

* New translations introduction.mdx (Turkish)

* New translations introduction.mdx (Ukrainian)

* New translations introduction.mdx (Chinese Simplified)

* New translations introduction.mdx (Indonesian)

* New translations introduction.mdx (Thai)

* New translations introduction.mdx (Hindi)

* New translations localization.mdx (French)

* New translations localization.mdx (Arabic)

* New translations localization.mdx (Japanese)

* New translations localization.mdx (Korean)

* New translations localization.mdx (Russian)

* New translations localization.mdx (Turkish)

* New translations localization.mdx (Ukrainian)

* New translations localization.mdx (Chinese Simplified)

* New translations localization.mdx (Indonesian)

* New translations localization.mdx (Thai)

* New translations localization.mdx (Hindi)

* New translations migration-guide.mdx (French)

* New translations migration-guide.mdx (Arabic)

* New translations migration-guide.mdx (Japanese)

* New translations migration-guide.mdx (Korean)

* New translations migration-guide.mdx (Russian)

* New translations migration-guide.mdx (Turkish)

* New translations migration-guide.mdx (Ukrainian)

* New translations migration-guide.mdx (Chinese Simplified)

* New translations migration-guide.mdx (Portuguese, Brazilian)

* New translations migration-guide.mdx (Indonesian)

* New translations migration-guide.mdx (Thai)

* New translations migration-guide.mdx (Hindi)

* New translations migration-guide.mdx (Spanish, Latin America)

* New translations modal-hooks.mdx (Chinese Simplified)

* New translations recent-transactions.mdx (Chinese Simplified)

* New translations theming.mdx (French)

* New translations theming.mdx (Arabic)

* New translations theming.mdx (Japanese)

* New translations theming.mdx (Korean)

* New translations theming.mdx (Russian)

* New translations theming.mdx (Turkish)

* New translations theming.mdx (Ukrainian)

* New translations theming.mdx (Chinese Simplified)

* New translations theming.mdx (Indonesian)

* New translations theming.mdx (Thai)

* New translations theming.mdx (Hindi)

* New translations wallet-button.mdx (Chinese Simplified)

* New translations rainbow-button.mdx (French)

* New translations rainbow-button.mdx (Arabic)

* New translations rainbow-button.mdx (Japanese)

* New translations rainbow-button.mdx (Korean)

* New translations rainbow-button.mdx (Russian)

* New translations rainbow-button.mdx (Turkish)

* New translations rainbow-button.mdx (Ukrainian)

* New translations rainbow-button.mdx (Chinese Simplified)

* New translations rainbow-button.mdx (Indonesian)

* New translations rainbow-button.mdx (Thai)

* New translations rainbow-button.mdx (Hindi)

* New translations rainbowkit-wagmi-v2.mdx (French)

* New translations rainbowkit-wagmi-v2.mdx (Arabic)

* New translations rainbowkit-wagmi-v2.mdx (Japanese)

* New translations rainbowkit-wagmi-v2.mdx (Korean)

* New translations rainbowkit-wagmi-v2.mdx (Russian)

* New translations rainbowkit-wagmi-v2.mdx (Turkish)

* New translations rainbowkit-wagmi-v2.mdx (Ukrainian)

* New translations rainbowkit-wagmi-v2.mdx (Chinese Simplified)

* New translations rainbowkit-wagmi-v2.mdx (Portuguese, Brazilian)

* New translations rainbowkit-wagmi-v2.mdx (Indonesian)

* New translations rainbowkit-wagmi-v2.mdx (Thai)

* New translations rainbowkit-wagmi-v2.mdx (Hindi)

* New translations rainbowkit-wagmi-v2.mdx (Spanish, Latin America)

* New translations walletconnect-v2.mdx (French)

* New translations walletconnect-v2.mdx (Arabic)

* New translations walletconnect-v2.mdx (Japanese)

* New translations walletconnect-v2.mdx (Korean)

* New translations walletconnect-v2.mdx (Russian)

* New translations walletconnect-v2.mdx (Turkish)

* New translations walletconnect-v2.mdx (Ukrainian)

* New translations walletconnect-v2.mdx (Chinese Simplified)

* New translations walletconnect-v2.mdx (Indonesian)

* New translations walletconnect-v2.mdx (Thai)

* New translations walletconnect-v2.mdx (Hindi)

* remove dups

* chore: main branch revert

* chore: beta i18n updates

* chore: update sitemap

---------

Co-authored-by: Daniel Sinclair <d@niel.nyc>
  • Loading branch information
magiziz and DanielSinclair authored Feb 11, 2024
1 parent 42b0661 commit aa0269e
Show file tree
Hide file tree
Showing 363 changed files with 18,612 additions and 13,048 deletions.
7 changes: 7 additions & 0 deletions .changeset/clean-yaks-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@rainbow-me/rainbowkit-siwe-next-auth": minor
---

RainbowKit has reached v2 alongside [wagmi](https://wagmi.sh), which includes [breaking changes](https://wagmi.sh/react/guides/migrate-from-v1-to-v2).

`0.4.x` now requires `@rainbow-me/rainbowkit` v2, specifically: `2.x.x`.
97 changes: 97 additions & 0 deletions .changeset/loud-carrots-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
"@rainbow-me/rainbowkit": major
---

**Breaking:**

The [wagmi](https://wagmi.sh) and [viem](https://viem.sh) peer dependencies have reached `2.x.x` with breaking changes.

Follow the steps below to migrate.

**1. Upgrade RainbowKit, `wagmi`, and `viem` to their latest versions**

```bash
npm i @rainbow-me/rainbowkit@2 wagmi@2 viem@2.x
```

**2. Install `@tanstack/react-query` peer dependency**

With Wagmi v2, [TanStack Query](https://tanstack.com/query/v5/docs/react/overview) is now a required peer dependency.

Install it with the following command:

```bash
npm i @tanstack/react-query
```

**3. Upgrade your RainbowKit and Wagmi configurations**

```diff
import '@rainbow-me/rainbowkit/styles.css'

+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
- import { createPublicClient, http } from 'viem'
- import { WagmiConfig } from 'wagmi'
+ import { WagmiProvider, http } from 'wagmi'
- import { configureChains, createConfig } from 'wagmi'
import { mainnet } from 'wagmi/chains'
import { RainbowKitProvider } from '@rainbow-me/rainbowkit'
- import { getDefaultWallets, connectorsForWallets } from '@rainbow-me/rainbowkit'
+ import { getDefaultConfig } from '@rainbow-me/rainbowkit'

/* getDefaultWallets is now optional */
- const { wallets } = getDefaultWallets({
- appName: 'RainbowKit demo',
- projectId: 'YOUR_PROJECT_ID',
- chains,
- })

/* connectorsForWallets is now optional */
- const connectors = connectorsForWallets([...wallets])

- const { chains, publicClient } = configureChains(
- [mainnet, sepolia],
- [publicProvider(), publicProvider()],
- )

- const config = createConfig({
- autoConnect: true,
- publicClient,
- })

/* New API that includes Wagmi's createConfig and bundles getDefaultWallets and connectorsForWallets */
+ const config = getDefaultConfig({
+ appName: 'RainbowKit demo',
+ projectId: 'YOUR_PROJECT_ID',
+ chains: [mainnet],
+ transports: {
+ [mainnet.id]: http(),
+ },
+ })

+ const queryClient = new QueryClient()

const App = () => {
return (
- <WagmiConfig config={config}>
+ <WagmiProvider config={config}>
+ <QueryClientProvider client={queryClient}>
- <RainbowKitProvider chains={chains}>
+ <RainbowKitProvider>
{/* Your App */}
</RainbowKitProvider>
+ </QueryClientProvider>
- </WagmiConfig>
+ </WagmiProvider>
)
}
```

[You can read an in-depth migration guide here](https://rainbowkit.com/guides/rainbowkit-wagmi-v2).

**4. Check for breaking changes in `wagmi` and `viem`**

If you use `wagmi` hooks and `viem` actions in your dApp, you will need to follow the migration guides for v2:

- [Wagmi v2 Migration Guide](https://wagmi.sh/react/guides/migrate-from-v1-to-v2)
- [Viem v2 Breaking Changes](https://viem.sh/docs/migration-guide.html#_2-x-x-breaking-changes)
54 changes: 54 additions & 0 deletions .changeset/silent-maps-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
"@rainbow-me/rainbow-button": minor
---

**Breaking:**

The [wagmi](https://wagmi.sh) and [viem](https://viem.sh) peer dependencies have reached `2.x.x` with breaking changes.

Follow the steps below to migrate.

**1. Upgrade Rainbow Button, `wagmi`, and `viem` to their latest versions****

```bash
npm i @rainbow-me/rainbow-button@2 wagmi@2 viem@2.x
```

**2. Install `@tanstack/react-query` peer dependency**

With Wagmi v2, [TanStack Query](https://tanstack.com/query/v5/docs/react/overview) is now a required peer dependency.

Install it with the following command:

```bash
npm i @tanstack/react-query
```

**3. Upgrade your Rainbow Button and Wagmi configurations**

`RainbowConnector` is now `rainbowConnector`, and requires `appName` and no longer accepts the `chains` parameter.

```diff
- import { RainbowConnector } from '@rainbow-me/rainbow-button'
+ import { rainbowConnector } from '@rainbow-me/rainbow-button'
import { createConfig } from 'wagmi'

const config = createConfig({
- connectors: [new RainbowConnector({ chains, projectId })],
+ connectors: [
+ rainbowConnector({
+ appName: "RainbowKit demo",
+ projectId: "YOUR_PROJECT_ID",
+ }),
+ ],
})
```

Follow the [Wagmi v2 Migration Guide](https://wagmi.sh/react/guides/migrate-from-v1-to-v2) for additional configuration changes.

**4. Check for breaking changes in `wagmi` and `viem`**

If you use `wagmi` hooks and `viem` actions in your dApp, you will need to follow the full migration guides for v2:

- [Wagmi v2 Migration Guide](https://wagmi.sh/react/guides/migrate-from-v1-to-v2)
- [Viem v2 Breaking Changes](https://viem.sh/docs/migration-guide.html#_2-x-x-breaking-changes)
9 changes: 9 additions & 0 deletions .changeset/soft-hotels-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@rainbow-me/create-rainbowkit": minor
---

Migrated template to Wagmi v2 with the following package changes:

- updated `wagmi` from `1.4.x` to `^2.0.0`
- updated `viem` from `1.21.x` to `^2.0.0`
- added `@tanstack/react-query` dependency with version `^5`
7 changes: 7 additions & 0 deletions .changeset/stale-ears-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"site": patch
---

- Added migration guide for `@rainbow-me/rainbowkit` `2.x.x` breaking changes.
- Updated all documentation section to include the latest Wagmi, Viem and TanStack Query usage
- Added migration guide for `2.x.x` breaking changes
7 changes: 4 additions & 3 deletions examples/with-create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
"react": "^18.2.0",
"typescript": "^5.0.4",
"util": "0.12.4",
"viem": "~1.21.4",
"wagmi": "~1.4.13",
"viem": "^2.7.3",
"wagmi": "^2.5.5",
"@tanstack/react-query": "^5.18.1",
"web-vitals": "^2.1.4",
"buffer": "npm:buffer@6.0.3"
},
Expand Down Expand Up @@ -45,4 +46,4 @@
"last 1 safari version"
]
}
}
}
43 changes: 17 additions & 26 deletions examples/with-create-react-app/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import '@rainbow-me/rainbowkit/styles.css';
import './polyfills';
import './index.css';
import '@rainbow-me/rainbowkit/styles.css';
import React from 'react';
import ReactDOM from 'react-dom/client';
import reportWebVitals from './reportWebVitals';

import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit';
import { configureChains, createConfig, WagmiConfig } from 'wagmi';
import { publicProvider } from 'wagmi/providers/public';
import { getDefaultConfig, RainbowKitProvider } from '@rainbow-me/rainbowkit';
import { WagmiProvider } from 'wagmi';
import {
arbitrum,
base,
Expand All @@ -19,9 +17,12 @@ import {
} from 'wagmi/chains';

import App from './App';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

const { chains, publicClient, webSocketPublicClient } = configureChains(
[
const config = getDefaultConfig({
appName: 'RainbowKit demo',
projectId: 'YOUR_PROJECT_ID',
chains: [
mainnet,
polygon,
optimism,
Expand All @@ -30,33 +31,23 @@ const { chains, publicClient, webSocketPublicClient } = configureChains(
zora,
...(process.env.REACT_APP_ENABLE_TESTNETS === 'true' ? [sepolia] : []),
],
[publicProvider()]
);

const { connectors } = getDefaultWallets({
appName: 'RainbowKit demo',
projectId: 'YOUR_PROJECT_ID',
chains,
});

const wagmiConfig = createConfig({
autoConnect: true,
connectors,
publicClient,
webSocketPublicClient,
});

const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);

const queryClient = new QueryClient();

root.render(
<React.StrictMode>
<WagmiConfig config={wagmiConfig}>
<RainbowKitProvider chains={chains}>
<App />
</RainbowKitProvider>
</WagmiConfig>
<WagmiProvider config={config}>
<QueryClientProvider client={queryClient}>
<RainbowKitProvider>
<App />
</RainbowKitProvider>
</QueryClientProvider>
</WagmiProvider>
</React.StrictMode>
);

Expand Down
77 changes: 30 additions & 47 deletions examples/with-next-app-i18n/app/[locale]/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ import * as React from 'react';
import {
RainbowKitProvider,
getDefaultWallets,
connectorsForWallets,
Locale,
getDefaultConfig,
} from '@rainbow-me/rainbowkit';
import {
argentWallet,
trustWallet,
ledgerWallet,
} from '@rainbow-me/rainbowkit/wallets';
import { configureChains, createConfig, WagmiConfig } from 'wagmi';
import { publicProvider } from 'wagmi/providers/public';
import { WagmiProvider } from 'wagmi';
import {
arbitrum,
base,
Expand All @@ -23,9 +22,14 @@ import {
sepolia,
zora,
} from 'wagmi/chains';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

const { chains, publicClient, webSocketPublicClient } = configureChains(
[
const { wallets } = getDefaultWallets();

const config = getDefaultConfig({
appName: 'RainbowKit demo',
projectId: 'YOUR_PROJECT_ID',
chains: [
mainnet,
polygon,
optimism,
Expand All @@ -34,51 +38,30 @@ const { chains, publicClient, webSocketPublicClient } = configureChains(
zora,
...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []),
],
[publicProvider()]
);

const projectId = 'YOUR_PROJECT_ID';

const { wallets } = getDefaultWallets({
appName: 'RainbowKit demo',
projectId,
chains,
wallets: [
...wallets,
{
groupName: 'Other',
wallets: [argentWallet, trustWallet, ledgerWallet],
},
],
ssr: true,
});

const demoAppInfo = {
appName: 'Rainbowkit Demo',
};

const connectors = connectorsForWallets([
...wallets,
{
groupName: 'Other',
wallets: [
argentWallet({ projectId, chains }),
trustWallet({ projectId, chains }),
ledgerWallet({ projectId, chains }),
],
},
]);

const wagmiConfig = createConfig({
autoConnect: true,
connectors,
publicClient,
webSocketPublicClient,
});
const queryClient = new QueryClient();

export function Providers(
{ children, locale }:
{ children: React.ReactNode, locale: Locale }
) {
const [mounted, setMounted] = React.useState(false);
React.useEffect(() => setMounted(true), []);
export function Providers({
children,
locale,
}: {
children: React.ReactNode;
locale: Locale;
}) {
return (
<WagmiConfig config={wagmiConfig}>
<RainbowKitProvider chains={chains} appInfo={demoAppInfo} locale={locale}>
{mounted && children}
</RainbowKitProvider>
</WagmiConfig>
<WagmiProvider config={config}>
<QueryClientProvider client={queryClient}>
<RainbowKitProvider locale={locale}>{children}</RainbowKitProvider>
</QueryClientProvider>
</WagmiProvider>
);
}
Loading

0 comments on commit aa0269e

Please sign in to comment.