From 63934984b1669ea592063ef12f8f66d57d84876a Mon Sep 17 00:00:00 2001 From: BestWeb3 Date: Thu, 26 Sep 2024 11:37:40 +0530 Subject: [PATCH] feat: bestWallet connector (#2193) * Add Bestwallet to RainbowKit * chore: changeset --------- Co-authored-by: PratikPatil10 Co-authored-by: Daniel Sinclair --- .changeset/tough-dolls-run.md | 5 ++ packages/example/src/wagmi.ts | 2 + packages/rainbowkit/src/locales/en_US.json | 17 ++++++ .../bestWallet/bestWallet.svg | 11 ++++ .../walletConnectors/bestWallet/bestWallet.ts | 56 +++++++++++++++++++ .../src/wallets/walletConnectors/index.ts | 2 + site/data/en-US/docs/custom-wallet-list.mdx | 6 ++ 7 files changed, 99 insertions(+) create mode 100644 .changeset/tough-dolls-run.md create mode 100644 packages/rainbowkit/src/wallets/walletConnectors/bestWallet/bestWallet.svg create mode 100644 packages/rainbowkit/src/wallets/walletConnectors/bestWallet/bestWallet.ts diff --git a/.changeset/tough-dolls-run.md b/.changeset/tough-dolls-run.md new file mode 100644 index 000000000..c4e38097f --- /dev/null +++ b/.changeset/tough-dolls-run.md @@ -0,0 +1,5 @@ +--- +"@rainbow-me/rainbowkit": patch +--- + +Added Best Wallet support with `bestWallet` wallet connector diff --git a/packages/example/src/wagmi.ts b/packages/example/src/wagmi.ts index 139c9c0aa..6c6b46051 100644 --- a/packages/example/src/wagmi.ts +++ b/packages/example/src/wagmi.ts @@ -1,6 +1,7 @@ import { type Chain, getDefaultConfig } from '@rainbow-me/rainbowkit'; import { argentWallet, + bestWallet, bifrostWallet, binanceWallet, bitgetWallet, @@ -184,6 +185,7 @@ export const config = getDefaultConfig({ groupName: 'Other', wallets: [ argentWallet, + bestWallet, bifrostWallet, binanceWallet, bitgetWallet, diff --git a/packages/rainbowkit/src/locales/en_US.json b/packages/rainbowkit/src/locales/en_US.json index 724229b11..6b96a61ec 100644 --- a/packages/rainbowkit/src/locales/en_US.json +++ b/packages/rainbowkit/src/locales/en_US.json @@ -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": { diff --git a/packages/rainbowkit/src/wallets/walletConnectors/bestWallet/bestWallet.svg b/packages/rainbowkit/src/wallets/walletConnectors/bestWallet/bestWallet.svg new file mode 100644 index 000000000..863f32267 --- /dev/null +++ b/packages/rainbowkit/src/wallets/walletConnectors/bestWallet/bestWallet.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/packages/rainbowkit/src/wallets/walletConnectors/bestWallet/bestWallet.ts b/packages/rainbowkit/src/wallets/walletConnectors/bestWallet/bestWallet.ts new file mode 100644 index 000000000..7bd99074d --- /dev/null +++ b/packages/rainbowkit/src/wallets/walletConnectors/bestWallet/bestWallet.ts @@ -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, + }), +}); diff --git a/packages/rainbowkit/src/wallets/walletConnectors/index.ts b/packages/rainbowkit/src/wallets/walletConnectors/index.ts index b8593430d..0cfec1462 100644 --- a/packages/rainbowkit/src/wallets/walletConnectors/index.ts +++ b/packages/rainbowkit/src/wallets/walletConnectors/index.ts @@ -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'; @@ -61,6 +62,7 @@ import { zerionWallet } from './zerionWallet/zerionWallet'; export { argentWallet, + bestWallet, bifrostWallet, binanceWallet, bitgetWallet, diff --git a/site/data/en-US/docs/custom-wallet-list.mdx b/site/data/en-US/docs/custom-wallet-list.mdx index 5c1d8397f..0563882ec 100644 --- a/site/data/en-US/docs/custom-wallet-list.mdx +++ b/site/data/en-US/docs/custom-wallet-list.mdx @@ -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