Skip to content

Commit

Permalink
fix: ethereum.providers support for coinbaseWallet (#1582)
Browse files Browse the repository at this point in the history
* fix: ethereum.providers support for coinbase wallet

* chore: changeset
  • Loading branch information
DanielSinclair authored Oct 25, 2023
1 parent c426e1f commit e2075b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/little-panthers-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rainbow-me/rainbowkit": patch
---

Improved Coinbase Wallet detection when multiple wallets are active
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CoinbaseWalletConnector } from 'wagmi/connectors/coinbaseWallet';
import { Chain } from '../../../components/RainbowKitProvider/RainbowKitChainContext';
import { isIOS } from '../../../utils/isMobile';
import { Wallet } from '../../Wallet';
import { hasInjectedProvider } from '../../getInjectedConnector';

export interface CoinbaseWalletOptions {
appName: string;
Expand All @@ -13,8 +14,7 @@ export const coinbaseWallet = ({
chains,
...options
}: CoinbaseWalletOptions): Wallet => {
const isCoinbaseWalletInjected =
typeof window !== 'undefined' && window.ethereum?.isCoinbaseWallet === true;
const isCoinbaseWalletInjected = hasInjectedProvider('isCoinbaseWallet');

return {
id: 'coinbase',
Expand Down

2 comments on commit e2075b3

@vercel
Copy link

@vercel vercel bot commented on e2075b3 Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on e2075b3 Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.