Skip to content

Commit

Permalink
feat: bestWallet connector (rainbow-me#2193)
Browse files Browse the repository at this point in the history
* Add Bestwallet to RainbowKit

* chore: changeset

---------

Co-authored-by: PratikPatil10 <[email protected]>
Co-authored-by: Daniel Sinclair <[email protected]>
  • Loading branch information
3 people authored Sep 26, 2024
1 parent f93cd0e commit 6393498
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-dolls-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rainbow-me/rainbowkit": patch
---

Added Best Wallet support with `bestWallet` wallet connector
2 changes: 2 additions & 0 deletions packages/example/src/wagmi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type Chain, getDefaultConfig } from '@rainbow-me/rainbowkit';
import {
argentWallet,
bestWallet,
bifrostWallet,
binanceWallet,
bitgetWallet,
Expand Down Expand Up @@ -184,6 +185,7 @@ export const config = getDefaultConfig({
groupName: 'Other',
wallets: [
argentWallet,
bestWallet,
bifrostWallet,
binanceWallet,
bitgetWallet,
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 @@ -243,6 +243,23 @@
}
},

"best": {
"qr_code": {
"step1": {
"title": "Open the Best Wallet app",
"description": "Add Best Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},

"bifrost": {
"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,56 @@
import type { Wallet } from '../../Wallet';
import { getWalletConnectConnector } from '../../getWalletConnectConnector';
import type { DefaultWalletOptions } from './../../Wallet';

export type BestWalletOptions = DefaultWalletOptions;

export const bestWallet = ({
projectId,
walletConnectParameters,
}: BestWalletOptions): Wallet => ({
id: 'bestWallet',
name: 'Best Wallet',
iconUrl: async () => (await import('./bestWallet.svg')).default,
iconBackground: '#5961FF',
downloadUrls: {
android:
'https://play.google.com/store/apps/details?id=com.bestwallet.mobile',
ios: 'https://apps.apple.com/in/app/best-wallet-buy-sell-crypto/id6451312105',
mobile: 'https://bestwallet.com/',
qrCode: 'https://bestwallet.com/',
},

mobile: {
getUri: (uri: string) => {
return `bw://connect/wc?uri=${encodeURIComponent(uri)}`;
},
},
qrCode: {
getUri: (uri: string) => uri,
instructions: {
learnMoreUrl: 'https://bestwallet.com/',
steps: [
{
description: 'wallet_connectors.best.qr_code.step1.description',
step: 'install',
title: 'wallet_connectors.best.qr_code.step1.title',
},
{
description: 'wallet_connectors.best.qr_code.step2.description',
step: 'create',
title: 'wallet_connectors.best.qr_code.step2.title',
},
{
description: 'wallet_connectors.best.qr_code.step3.description',
step: 'scan',
title: 'wallet_connectors.best.qr_code.step3.title',
},
],
},
},

createConnector: getWalletConnectConnector({
projectId,
walletConnectParameters,
}),
});
2 changes: 2 additions & 0 deletions packages/rainbowkit/src/wallets/walletConnectors/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { argentWallet } from './argentWallet/argentWallet';
import { bestWallet } from './bestWallet/bestWallet';
import { bifrostWallet } from './bifrostWallet/bifrostWallet';
import { binanceWallet } from './binanceWallet/binanceWallet';
import { bitgetWallet } from './bitgetWallet/bitgetWallet';
Expand Down Expand Up @@ -61,6 +62,7 @@ import { zerionWallet } from './zerionWallet/zerionWallet';

export {
argentWallet,
bestWallet,
bifrostWallet,
binanceWallet,
bitgetWallet,
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 @@ -110,6 +110,12 @@ import { oneInchWallet } from '@rainbow-me/rainbowkit/wallets';
import { argentWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Best Wallet

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

#### Binance Web3 Wallet

```tsx
Expand Down

0 comments on commit 6393498

Please sign in to comment.