From 4e5261058b5987bc1b57505bea926c9bcee5fa5a Mon Sep 17 00:00:00 2001 From: Sergiy Pash Date: Mon, 21 Oct 2024 22:42:20 +0100 Subject: [PATCH] feat: wigwam wallet support (#2206) * Wigwam wallet support * feat: wigwam wallet support * fix: rollback additional translations * fix: rollback single quote * fix: format docs --- packages/example/src/wagmi.ts | 2 + packages/rainbowkit/src/locales/en_US.json | 17 +++++++ packages/rainbowkit/src/types/utils.ts | 1 + .../src/wallets/walletConnectors/index.ts | 2 + .../wigwamWallet/wigwamWallet.svg | 9 ++++ .../wigwamWallet/wigwamWallet.ts | 49 +++++++++++++++++++ site/data/en-US/docs/custom-wallet-list.mdx | 6 +++ 7 files changed, 86 insertions(+) create mode 100644 packages/rainbowkit/src/wallets/walletConnectors/wigwamWallet/wigwamWallet.svg create mode 100644 packages/rainbowkit/src/wallets/walletConnectors/wigwamWallet/wigwamWallet.ts diff --git a/packages/example/src/wagmi.ts b/packages/example/src/wagmi.ts index c7c958579d..2c9f9d03cd 100644 --- a/packages/example/src/wagmi.ts +++ b/packages/example/src/wagmi.ts @@ -55,6 +55,7 @@ import { uniswapWallet, valoraWallet, walletConnectWallet, + wigwamWallet, xdefiWallet, zealWallet, zerionWallet, @@ -235,6 +236,7 @@ export const config = getDefaultConfig({ trustWallet, uniswapWallet, valoraWallet, + wigwamWallet, xdefiWallet, zealWallet, zerionWallet, diff --git a/packages/rainbowkit/src/locales/en_US.json b/packages/rainbowkit/src/locales/en_US.json index 6b96a61ec7..b2ac6761f5 100644 --- a/packages/rainbowkit/src/locales/en_US.json +++ b/packages/rainbowkit/src/locales/en_US.json @@ -1148,6 +1148,23 @@ } }, + "wigwam": { + "extension": { + "step1": { + "title": "Install the Wigwam extension", + "description": "We recommend pinning Wigwam 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." + } + } + }, + "talisman": { "extension": { "step1": { diff --git a/packages/rainbowkit/src/types/utils.ts b/packages/rainbowkit/src/types/utils.ts index 464ad80b67..bac7c16aca 100644 --- a/packages/rainbowkit/src/types/utils.ts +++ b/packages/rainbowkit/src/types/utils.ts @@ -61,6 +61,7 @@ export type WalletProviderFlags = | 'isMEWwallet' | 'isSafeheron' | 'isSafePal' + | 'isWigwam' | '__seif'; export type WalletProvider = Evaluate< diff --git a/packages/rainbowkit/src/wallets/walletConnectors/index.ts b/packages/rainbowkit/src/wallets/walletConnectors/index.ts index 0cfec14626..5cc31ce6ab 100644 --- a/packages/rainbowkit/src/wallets/walletConnectors/index.ts +++ b/packages/rainbowkit/src/wallets/walletConnectors/index.ts @@ -56,6 +56,7 @@ import { trustWallet } from './trustWallet/trustWallet'; import { uniswapWallet } from './uniswapWallet/uniswapWallet'; import { valoraWallet } from './valoraWallet/valoraWallet'; import { walletConnectWallet } from './walletConnectWallet/walletConnectWallet'; +import { wigwamWallet } from './wigwamWallet/wigwamWallet'; import { xdefiWallet } from './xdefiWallet/xdefiWallet'; import { zealWallet } from './zealWallet/zealWallet'; import { zerionWallet } from './zerionWallet/zerionWallet'; @@ -119,6 +120,7 @@ export { uniswapWallet, valoraWallet, walletConnectWallet, + wigwamWallet, xdefiWallet, zealWallet, zerionWallet, diff --git a/packages/rainbowkit/src/wallets/walletConnectors/wigwamWallet/wigwamWallet.svg b/packages/rainbowkit/src/wallets/walletConnectors/wigwamWallet/wigwamWallet.svg new file mode 100644 index 0000000000..b98e3eca8e --- /dev/null +++ b/packages/rainbowkit/src/wallets/walletConnectors/wigwamWallet/wigwamWallet.svg @@ -0,0 +1,9 @@ + + + + + diff --git a/packages/rainbowkit/src/wallets/walletConnectors/wigwamWallet/wigwamWallet.ts b/packages/rainbowkit/src/wallets/walletConnectors/wigwamWallet/wigwamWallet.ts new file mode 100644 index 0000000000..c1f2f00f13 --- /dev/null +++ b/packages/rainbowkit/src/wallets/walletConnectors/wigwamWallet/wigwamWallet.ts @@ -0,0 +1,49 @@ +import type { Wallet } from '../../Wallet'; +import { + getInjectedConnector, + hasInjectedProvider, +} from '../../getInjectedConnector'; + +export const wigwamWallet = (): Wallet => { + return { + id: 'wigwam', + name: 'Wigwam', + iconBackground: '#80EF6E', + iconUrl: async () => (await import('./wigwamWallet.svg')).default, + downloadUrls: { + chrome: + 'https://chromewebstore.google.com/detail/wigwam-%E2%80%94-web3-wallet/lccbohhgfkdikahanoclbdmaolidjdfl', + browserExtension: 'https://wigwam.app', + }, + installed: hasInjectedProvider({ + namespace: 'wigwamEthereum', + flag: 'isWigwam', + }), + extension: { + instructions: { + learnMoreUrl: 'https://wigwam.app/', + steps: [ + { + description: 'wallet_connectors.wigwam.extension.step1.description', + step: 'install', + title: 'wallet_connectors.wigwam.extension.step1.title', + }, + { + description: 'wallet_connectors.wigwam.extension.step2.description', + step: 'create', + title: 'wallet_connectors.wigwam.extension.step2.title', + }, + { + description: 'wallet_connectors.wigwam.extension.step3.description', + step: 'refresh', + title: 'wallet_connectors.wigwam.extension.step3.title', + }, + ], + }, + }, + createConnector: getInjectedConnector({ + namespace: 'wigwamEthereum', + flag: 'isWigwam', + }), + }; +}; diff --git a/site/data/en-US/docs/custom-wallet-list.mdx b/site/data/en-US/docs/custom-wallet-list.mdx index 0563882ec6..8c47281cef 100644 --- a/site/data/en-US/docs/custom-wallet-list.mdx +++ b/site/data/en-US/docs/custom-wallet-list.mdx @@ -409,6 +409,12 @@ import { xdefiWallet } from '@rainbow-me/rainbowkit/wallets'; import { zerionWallet } from '@rainbow-me/rainbowkit/wallets'; ``` +#### Wigwam + +```tsx +import { wigwamWallet } from '@rainbow-me/rainbowkit/wallets'; +``` + ### Examples #### Ordering