Skip to content

Commit

Permalink
feat: add nest wallet (#2006)
Browse files Browse the repository at this point in the history
* feat: nest wallet support

* chore: changeset

* chore: minify image

---------

Co-authored-by: Daniel Sinclair <d@niel.nyc>
  • Loading branch information
ppong and DanielSinclair authored May 29, 2024
1 parent 62a2966 commit 2180ddd
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-hairs-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rainbow-me/rainbowkit": patch
---

Added Nest Wallet support with `nestWallet` wallet connector
2 changes: 2 additions & 0 deletions packages/example/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
ledgerWallet,
magicEdenWallet,
mewWallet,
nestWallet,
oktoWallet,
okxWallet,
omniWallet,
Expand Down Expand Up @@ -209,6 +210,7 @@ const config = getDefaultConfig({
ledgerWallet,
magicEdenWallet,
mewWallet,
nestWallet,
oktoWallet,
okxWallet,
omniWallet,
Expand Down
17 changes: 17 additions & 0 deletions packages/rainbowkit/src/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,23 @@
}
},

"nestwallet": {
"extension": {
"step1": {
"title": "Install the NestWallet extension",
"description": "We recommend pinning NestWallet to your taskbar for quicker access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
},
"step3": {
"title": "Refresh your browser",
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
}
}
},

"okx": {
"qr_code": {
"step1": {
Expand Down
1 change: 1 addition & 0 deletions packages/rainbowkit/src/types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type WalletProviderFlags =
| 'isKuCoinWallet'
| 'isMathWallet'
| 'isMetaMask'
| 'isNestWallet'
| 'isOkxWallet'
| 'isOKExWallet'
| 'isOneInchAndroidWallet'
Expand Down
2 changes: 2 additions & 0 deletions packages/rainbowkit/src/wallets/walletConnectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { ledgerWallet } from './ledgerWallet/ledgerWallet';
import { magicEdenWallet } from './magicEdenWallet/magicEdenWallet';
import { metaMaskWallet } from './metaMaskWallet/metaMaskWallet';
import { mewWallet } from './mewWallet/mewWallet';
import { nestWallet } from './nestWallet/nestWallet';
import { oktoWallet } from './oktoWallet/oktoWallet';
import { okxWallet } from './okxWallet/okxWallet';
import { omniWallet } from './omniWallet/omniWallet';
Expand Down Expand Up @@ -82,6 +83,7 @@ export {
magicEdenWallet,
metaMaskWallet,
mewWallet,
nestWallet,
oktoWallet,
okxWallet,
omniWallet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function isMetaMask(ethereum?: WindowProvider['ethereum']): boolean {
if (ethereum.isImToken) return false;
if (ethereum.isKuCoinWallet) return false;
if (ethereum.isMathWallet) return false;
if (ethereum.isNestWallet) return false;
if (ethereum.isOkxWallet || ethereum.isOKExWallet) return false;
if (ethereum.isOneInchIOSWallet || ethereum.isOneInchAndroidWallet)
return false;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Wallet } from '../../Wallet';
import {
getInjectedConnector,
hasInjectedProvider,
} from '../../getInjectedConnector';

export const nestWallet = (): Wallet => ({
id: 'nest',
name: 'Nest',
iconUrl: async () => (await import('./nestWallet.svg')).default,
iconBackground: '#fff0',
installed: hasInjectedProvider({ flag: 'isNestWallet' }),
downloadUrls: {
browserExtension: 'https://nestwallet.xyz',
},
extension: {
instructions: {
learnMoreUrl: 'https://nestwallet.xyz',
steps: [
{
description:
'wallet_connectors.nestwallet.extension.step1.description',
step: 'install',
title: 'wallet_connectors.nestwallet.extension.step1.title',
},
{
description:
'wallet_connectors.nestwallet.extension.step2.description',
step: 'create',
title: 'wallet_connectors.nestwallet.extension.step2.title',
},
{
description:
'wallet_connectors.nestwallet.extension.step3.description',
step: 'refresh',
title: 'wallet_connectors.nestwallet.extension.step3.title',
},
],
},
},
createConnector: getInjectedConnector({ flag: 'isNestWallet' }),
});

0 comments on commit 2180ddd

Please sign in to comment.