Skip to content

Commit

Permalink
feat: compassWallet connector (#1837)
Browse files Browse the repository at this point in the history
* feat: compass wallet

* refactor: chrome production link

* chore: avoid exposing getInjectedConnector, optimize logo svg, update compassWallet and update docs

* chore: update en_US.json

* chore: update logo

* chore: optimize compassWallet.svg

* chore: changeset

---------

Co-authored-by: Himanshu Singh <himanshusingh@Himanshus-MacBook-Air.local>
Co-authored-by: MK <mago.khamidov@gmail.com>
Co-authored-by: Daniel Sinclair <d@niel.nyc>
  • Loading branch information
4 people committed Apr 23, 2024
1 parent f14120c commit 7ab6e50
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-zebras-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rainbow-me/rainbowkit": patch
---

Added Compass Wallet support with `compassWallet` wallet connector
19 changes: 19 additions & 0 deletions packages/example/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
bybitWallet,
clvWallet,
coin98Wallet,
compassWallet,
coreWallet,
dawnWallet,
desigWallet,
Expand Down Expand Up @@ -126,6 +127,22 @@ const avalanche = {
},
} as const satisfies Chain;

const sei = {
id: 713715,
name: 'Sei',
iconUrl:
'https://s3.coinmarketcap.com/static-gravity/image/992744cfbd5e40f5920018ee7a830b98.png',
iconBackground: '#fff',
nativeCurrency: { name: 'Sei', symbol: 'SEI', decimals: 18 },
rpcUrls: {
default: { http: ['https://evm-rpc.arctic-1.seinetwork.io'] },
},
blockExplorers: {
default: { name: 'Sei Explorer', url: 'https://www.seiscan.app' },
},
contracts: {},
} as const satisfies Chain;

const config = getDefaultConfig({
appName: 'RainbowKit Demo',
projectId,
Expand All @@ -143,6 +160,7 @@ const config = getDefaultConfig({
zetachain,
ronin,
klaytn,
sei,
...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true'
? [
sepolia,
Expand Down Expand Up @@ -172,6 +190,7 @@ const config = getDefaultConfig({
bloomWallet,
bybitWallet,
clvWallet,
compassWallet,
coin98Wallet,
coreWallet,
dawnWallet,
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 @@ -453,6 +453,23 @@
}
},

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

"core": {
"qr_code": {
"step1": {
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,48 @@
import { Wallet } from '../../Wallet';
import {
getInjectedConnector,
hasInjectedProvider,
} from '../../getInjectedConnector';

export const compassWallet = (): Wallet => {
const isCompassInjected = hasInjectedProvider({ namespace: 'compassEvm' });

return {
id: 'compass',
name: 'Compass Wallet',
installed: isCompassInjected,
iconUrl: async () => (await import('./compassWallet.svg')).default,
iconBackground: '#fff',
downloadUrls: {
chrome:
'https://chromewebstore.google.com/detail/compass-wallet-for-sei/anokgmphncpekkhclmingpimjmcooifb',
browserExtension: 'https://compasswallet.io/download',
},
extension: {
instructions: {
learnMoreUrl: 'https://compasswallet.io/download',
steps: [
{
description:
'wallet_connectors.compass.extension.step1.description',
step: 'install',
title: 'wallet_connectors.compass.extension.step1.title',
},
{
description:
'wallet_connectors.compass.extension.step2.description',
step: 'create',
title: 'wallet_connectors.compass.extension.step2.title',
},
{
description:
'wallet_connectors.compass.extension.step3.description',
step: 'refresh',
title: 'wallet_connectors.compass.extension.step3.title',
},
],
},
},
createConnector: getInjectedConnector({ namespace: 'compassEvm' }),
};
};
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 @@ -9,6 +9,7 @@ import { bybitWallet } from './bybitWallet/bybitWallet';
import { clvWallet } from './clvWallet/clvWallet';
import { coin98Wallet } from './coin98Wallet/coin98Wallet';
import { coinbaseWallet } from './coinbaseWallet/coinbaseWallet';
import { compassWallet } from './compassWallet/compassWallet';
import { coreWallet } from './coreWallet/coreWallet';
import { dawnWallet } from './dawnWallet/dawnWallet';
import { desigWallet } from './desigWallet/desigWallet';
Expand Down Expand Up @@ -61,6 +62,7 @@ export {
clvWallet,
coin98Wallet,
coinbaseWallet,
compassWallet,
coreWallet,
dawnWallet,
desigWallet,
Expand Down
6 changes: 6 additions & 0 deletions site/data/en-US/docs/custom-wallet-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ import { braveWallet } from '@rainbow-me/rainbowkit/wallets';
import { coinbaseWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Compass Wallet

```tsx
import { compassWallet } from '@rainbow-me/rainbowkit/compassWallet';
```

#### Coin98 Wallet

```tsx
Expand Down

0 comments on commit 7ab6e50

Please sign in to comment.