-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add mew wallet * fix: id, qr code * fix: name * chore: remove unnecessary code * chore: cleanup, add installed property * devop: run lint * chore: updated changeset example usage --------- Co-authored-by: Jesus Morales Jr <jmjles@gmail.com> Co-authored-by: Gamaliel Padillo <gamalielgad1234@gmail.com>
- Loading branch information
1 parent
a27618a
commit 3399df5
Showing
7 changed files
with
139 additions
and
3 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,27 @@ | ||
--- | ||
'@rainbow-me/rainbowkit': patch | ||
--- | ||
|
||
MEW Wallet Support | ||
|
||
**Example usage** | ||
|
||
```ts | ||
import { | ||
getDefaultWallets, | ||
connectorsForWallets, | ||
} from '@rainbow-me/rainbowkit'; | ||
import { mewWallet } from '@rainbow-me/rainbowkit/wallets'; | ||
const connectors = connectorsForWallets([ | ||
...wallets, | ||
{ | ||
groupName: 'Other', | ||
wallets: [ | ||
argentWallet({ chains }), | ||
trustWallet({ chains }), | ||
mewWallet({ chains }), | ||
ledgerWallet({ chains }), | ||
], | ||
}, | ||
]); | ||
``` |
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
49 changes: 49 additions & 0 deletions
49
packages/rainbowkit/src/wallets/walletConnectors/mewWallet/mewWallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions
43
packages/rainbowkit/src/wallets/walletConnectors/mewWallet/mewWallet.ts
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,43 @@ | ||
/* eslint-disable sort-keys-fix/sort-keys-fix */ | ||
import { InjectedConnector } from 'wagmi/connectors/injected'; | ||
import { Chain } from '../../../components/RainbowKitProvider/RainbowKitChainContext'; | ||
import { Wallet } from '../../Wallet'; | ||
export interface MewWalletOptions { | ||
chains: Chain[]; | ||
shimDisconnect?: boolean; | ||
} | ||
|
||
export const mewWallet = ({ | ||
chains, | ||
shimDisconnect, | ||
}: MewWalletOptions): Wallet => { | ||
const isMewWalletInjected = | ||
typeof window !== 'undefined' && | ||
Boolean( | ||
( | ||
window.ethereum as typeof window.ethereum & | ||
(undefined | { isMEWwallet?: boolean }) | ||
)?.isMEWwallet | ||
); | ||
return { | ||
id: 'mew', | ||
name: 'MEW wallet', | ||
iconUrl: async () => (await import('./mewWallet.svg')).default, | ||
iconBackground: '#fff', | ||
installed: isMewWalletInjected, | ||
downloadUrls: { | ||
android: | ||
'https://play.google.com/store/apps/details?id=com.myetherwallet.mewwallet&referrer=utm_source%3Drainbow', | ||
ios: 'https://apps.apple.com/app/apple-store/id1464614025?pt=118781877&mt=8&ct=rainbow', | ||
qrCode: 'https://www.mewwallet.com/', | ||
}, | ||
createConnector: () => { | ||
return { | ||
connector: new InjectedConnector({ | ||
chains, | ||
options: { shimDisconnect }, | ||
}), | ||
}; | ||
}, | ||
}; | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
3399df5
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-rainbowdotme.vercel.app
rainbowkit-example.vercel.app
3399df5
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-git-main-rainbowdotme.vercel.app
rainbowkit-site-rainbowdotme.vercel.app
rainbowkit.com
www.rainbowkit.com