From 63d83866e126c57fa896f480b3f5cb180754a88e Mon Sep 17 00:00:00 2001 From: Alex Bakoushin Date: Tue, 27 Aug 2024 21:37:20 +0200 Subject: [PATCH] feat: add Valora wallet (#2156) * feat: add Valora wallet * chore: add Valora to the example * chore: add Valora to the docs * chore: add changeset * fix: update icon * chore: update website links * chore: update description * chore: tweak changeset --------- Co-authored-by: Daniel Sinclair <4412473+DanielSinclair@users.noreply.github.com> --- .changeset/bright-boxes-punch.md | 7 +++ packages/example/src/wagmi.ts | 2 + packages/rainbowkit/src/locales/en_US.json | 17 ++++++ .../src/wallets/walletConnectors/index.ts | 2 + .../valoraWallet/valoraWallet.svg | 1 + .../valoraWallet/valoraWallet.ts | 52 +++++++++++++++++++ site/data/en-US/docs/custom-wallet-list.mdx | 6 +++ 7 files changed, 87 insertions(+) create mode 100644 .changeset/bright-boxes-punch.md create mode 100644 packages/rainbowkit/src/wallets/walletConnectors/valoraWallet/valoraWallet.svg create mode 100644 packages/rainbowkit/src/wallets/walletConnectors/valoraWallet/valoraWallet.ts diff --git a/.changeset/bright-boxes-punch.md b/.changeset/bright-boxes-punch.md new file mode 100644 index 0000000000..cf4802ac9f --- /dev/null +++ b/.changeset/bright-boxes-punch.md @@ -0,0 +1,7 @@ +--- +"@rainbow-me/rainbowkit": patch +"example": patch +"site": patch +--- + +Added Valora support with `valorWallet` wallet connector diff --git a/packages/example/src/wagmi.ts b/packages/example/src/wagmi.ts index 4db20b523c..8b74e5d64d 100644 --- a/packages/example/src/wagmi.ts +++ b/packages/example/src/wagmi.ts @@ -51,6 +51,7 @@ import { tokenaryWallet, trustWallet, uniswapWallet, + valoraWallet, walletConnectWallet, xdefiWallet, zealWallet, @@ -228,6 +229,7 @@ export const config = getDefaultConfig({ tokenaryWallet, trustWallet, uniswapWallet, + valoraWallet, xdefiWallet, zealWallet, zerionWallet, diff --git a/packages/rainbowkit/src/locales/en_US.json b/packages/rainbowkit/src/locales/en_US.json index 69fcb9cd8a..3b8478173c 100644 --- a/packages/rainbowkit/src/locales/en_US.json +++ b/packages/rainbowkit/src/locales/en_US.json @@ -1349,6 +1349,23 @@ "description": "Tap WalletConnect then Switch to Scanner. After you scan, a connection prompt will appear for you to connect your wallet." } } + }, + + "valora": { + "qr_code": { + "step1": { + "title": "Open the Valora app", + "description": "We recommend putting Valora on your home screen for quicker access." + }, + "step2": { + "title": "Create or import a wallet", + "description": "Create a new wallet or import an existing one." + }, + "step3": { + "title": "Tap the scan button", + "description": "After you scan, a connection prompt will appear for you to connect your wallet." + } + } } } } diff --git a/packages/rainbowkit/src/wallets/walletConnectors/index.ts b/packages/rainbowkit/src/wallets/walletConnectors/index.ts index 7e30b15de6..21d8ac198c 100644 --- a/packages/rainbowkit/src/wallets/walletConnectors/index.ts +++ b/packages/rainbowkit/src/wallets/walletConnectors/index.ts @@ -52,6 +52,7 @@ import { tokenPocketWallet } from './tokenPocketWallet/tokenPocketWallet'; import { tokenaryWallet } from './tokenaryWallet/tokenaryWallet'; import { trustWallet } from './trustWallet/trustWallet'; import { uniswapWallet } from './uniswapWallet/uniswapWallet'; +import { valoraWallet } from './valoraWallet/valoraWallet'; import { walletConnectWallet } from './walletConnectWallet/walletConnectWallet'; import { xdefiWallet } from './xdefiWallet/xdefiWallet'; import { zealWallet } from './zealWallet/zealWallet'; @@ -112,6 +113,7 @@ export { tokenPocketWallet, trustWallet, uniswapWallet, + valoraWallet, walletConnectWallet, xdefiWallet, zealWallet, diff --git a/packages/rainbowkit/src/wallets/walletConnectors/valoraWallet/valoraWallet.svg b/packages/rainbowkit/src/wallets/walletConnectors/valoraWallet/valoraWallet.svg new file mode 100644 index 0000000000..cc90162a0d --- /dev/null +++ b/packages/rainbowkit/src/wallets/walletConnectors/valoraWallet/valoraWallet.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/rainbowkit/src/wallets/walletConnectors/valoraWallet/valoraWallet.ts b/packages/rainbowkit/src/wallets/walletConnectors/valoraWallet/valoraWallet.ts new file mode 100644 index 0000000000..d227896807 --- /dev/null +++ b/packages/rainbowkit/src/wallets/walletConnectors/valoraWallet/valoraWallet.ts @@ -0,0 +1,52 @@ +import { isAndroid } from '../../../utils/isMobile'; +import { DefaultWalletOptions, Wallet } from '../../Wallet'; +import { getWalletConnectConnector } from '../../getWalletConnectConnector'; + +export type ValoraWalletOptions = DefaultWalletOptions; + +export const valoraWallet = ({ + projectId, + walletConnectParameters, +}: ValoraWalletOptions): Wallet => ({ + id: 'valora', + name: 'Valora', + iconUrl: async () => (await import('./valoraWallet.svg')).default, + iconBackground: '#FFFFFF', + downloadUrls: { + ios: 'https://apps.apple.com/app/id1520414263?mt=8', + android: 'https://play.google.com/store/apps/details?id=co.clabs.valora', + mobile: 'https://valora.xyz', + qrCode: 'https://valora.xyz', + }, + mobile: { + getUri: (uri: string) => + isAndroid() ? uri : `celo://wallet/wc?uri=${encodeURIComponent(uri)}`, + }, + qrCode: { + getUri: (uri: string) => uri, + instructions: { + learnMoreUrl: 'https://valora.xyz/', + steps: [ + { + description: 'wallet_connectors.valora.qr_code.step1.description', + step: 'install', + title: 'wallet_connectors.valora.qr_code.step1.title', + }, + { + description: 'wallet_connectors.valora.qr_code.step2.description', + step: 'create', + title: 'wallet_connectors.valora.qr_code.step2.title', + }, + { + description: 'wallet_connectors.valora.qr_code.step3.description', + step: 'scan', + title: 'wallet_connectors.valora.qr_code.step3.title', + }, + ], + }, + }, + createConnector: getWalletConnectConnector({ + projectId, + walletConnectParameters, + }), +}); diff --git a/site/data/en-US/docs/custom-wallet-list.mdx b/site/data/en-US/docs/custom-wallet-list.mdx index c840a0e858..a6e95bfcca 100644 --- a/site/data/en-US/docs/custom-wallet-list.mdx +++ b/site/data/en-US/docs/custom-wallet-list.mdx @@ -379,6 +379,12 @@ import { trustWallet } from '@rainbow-me/rainbowkit/wallets'; import { uniswapWallet } from '@rainbow-me/rainbowkit/wallets'; ``` +#### Valora + +```tsx +import { valoraWallet } from '@rainbow-me/rainbowkit/wallets'; +``` + #### XDEFI Wallet ```tsx