-
Notifications
You must be signed in to change notification settings - Fork 609
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use ethers peer dependency for providers (#307)
- Loading branch information
1 parent
aa025d7
commit 4062169
Showing
11 changed files
with
63 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@rainbow-me/rainbowkit': patch | ||
--- | ||
|
||
Add `ethers` to peer dependencies to ensure consistent versioning with wagmi | ||
|
||
We previously had a direct dependency on `@ethersproject/providers`, but this meant that provider instances generated by RainbowKit could potentially clash with the version of Ethers.js installed alongside wagmi. To avoid this, we’re now relying on the `ethers` peer dependency that wagmi already requires, ensuring that there's only ever a single copy of `ethers` between them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { | ||
StaticJsonRpcProvider, | ||
WebSocketProvider, | ||
} from '@ethersproject/providers'; | ||
import { providers } from 'ethers'; | ||
import { ApiProvider } from './ApiProvider'; | ||
|
||
export const fallback = (): ApiProvider< | ||
StaticJsonRpcProvider, | ||
WebSocketProvider | ||
providers.StaticJsonRpcProvider, | ||
providers.WebSocketProvider | ||
> => { | ||
return function (chain) { | ||
if (!chain.rpcUrls.default) return null; | ||
if (!chain.rpcUrls.default) { | ||
return null; | ||
} | ||
|
||
return { | ||
chain, | ||
provider: () => | ||
new StaticJsonRpcProvider(chain.rpcUrls.default, chain.id), | ||
new providers.StaticJsonRpcProvider(chain.rpcUrls.default, chain.id), | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
4062169
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rainbowkit-example – ./
rainbowkit-example-git-main-rainbowdotme.vercel.app
rainbowkit-example.vercel.app
rainbowkit-example-rainbowdotme.vercel.app
4062169
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rainbowkit-site – ./
rainbowkit.vercel.app
rainbowkit-site-rainbowdotme.vercel.app
rainbowkit-site-git-main-rainbowdotme.vercel.app
www.rainbowkit.com
rainbowkit.com