From 7b00be59cce9a9035c2d8f932e1b1b693f9c882a Mon Sep 17 00:00:00 2001 From: dot-haechi <145320482+dot-haechi@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:03:37 +0900 Subject: [PATCH] feat: seif wallet support (#2028) --- .changeset/tiny-houses-breathe.md | 5 ++++ packages/rainbowkit/src/types/utils.ts | 3 ++- .../src/wallets/walletConnectors/index.ts | 2 ++ .../metaMaskWallet/metaMaskWallet.ts | 1 + .../seifWallet/seifWallet.svg | 12 +++++++++ .../walletConnectors/seifWallet/seifWallet.ts | 26 +++++++++++++++++++ 6 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .changeset/tiny-houses-breathe.md create mode 100644 packages/rainbowkit/src/wallets/walletConnectors/seifWallet/seifWallet.svg create mode 100644 packages/rainbowkit/src/wallets/walletConnectors/seifWallet/seifWallet.ts diff --git a/.changeset/tiny-houses-breathe.md b/.changeset/tiny-houses-breathe.md new file mode 100644 index 0000000000..c490f61242 --- /dev/null +++ b/.changeset/tiny-houses-breathe.md @@ -0,0 +1,5 @@ +--- +"@rainbow-me/rainbowkit": patch +--- + +Addes Seif Wallet support with `seifWallet` wallet connector diff --git a/packages/rainbowkit/src/types/utils.ts b/packages/rainbowkit/src/types/utils.ts index f9574c4f72..1f8d968d85 100644 --- a/packages/rainbowkit/src/types/utils.ts +++ b/packages/rainbowkit/src/types/utils.ts @@ -60,7 +60,8 @@ export type WalletProviderFlags = | 'isCoin98' | 'isMEWwallet' | 'isSafeheron' - | 'isSafePal'; + | 'isSafePal' + | '__seif'; export type WalletProvider = Evaluate< EIP1193Provider & { diff --git a/packages/rainbowkit/src/wallets/walletConnectors/index.ts b/packages/rainbowkit/src/wallets/walletConnectors/index.ts index 4167b3e2e1..299c771803 100644 --- a/packages/rainbowkit/src/wallets/walletConnectors/index.ts +++ b/packages/rainbowkit/src/wallets/walletConnectors/index.ts @@ -41,6 +41,7 @@ import { roninWallet } from './roninWallet/roninWallet'; import { safeWallet } from './safeWallet/safeWallet'; import { safeheronWallet } from './safeheronWallet/safeheronWallet'; import { safepalWallet } from './safepalWallet/safepalWallet'; +import { seifWallet } from './seifWallet/seifWallet'; import { subWallet } from './subWallet/subWallet'; import { tahoWallet } from './tahoWallet/tahoWallet'; import { talismanWallet } from './talismanWallet/talismanWallet'; @@ -97,6 +98,7 @@ export { safeWallet, safeheronWallet, safepalWallet, + seifWallet, subWallet, tahoWallet, talismanWallet, diff --git a/packages/rainbowkit/src/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.ts b/packages/rainbowkit/src/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.ts index 331a629bb4..84af7d8664 100644 --- a/packages/rainbowkit/src/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.ts +++ b/packages/rainbowkit/src/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.ts @@ -53,6 +53,7 @@ function isMetaMask(ethereum?: WindowProvider['ethereum']): boolean { if (ethereum.isXDEFI) return false; if (ethereum.isZeal) return false; if (ethereum.isZerion) return false; + if (ethereum.__seif) return false; return true; } diff --git a/packages/rainbowkit/src/wallets/walletConnectors/seifWallet/seifWallet.svg b/packages/rainbowkit/src/wallets/walletConnectors/seifWallet/seifWallet.svg new file mode 100644 index 0000000000..05d0f118e0 --- /dev/null +++ b/packages/rainbowkit/src/wallets/walletConnectors/seifWallet/seifWallet.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/packages/rainbowkit/src/wallets/walletConnectors/seifWallet/seifWallet.ts b/packages/rainbowkit/src/wallets/walletConnectors/seifWallet/seifWallet.ts new file mode 100644 index 0000000000..eeefcb3e12 --- /dev/null +++ b/packages/rainbowkit/src/wallets/walletConnectors/seifWallet/seifWallet.ts @@ -0,0 +1,26 @@ +import { Wallet } from '../../Wallet'; +import { + getInjectedConnector, + hasInjectedProvider, +} from '../../getInjectedConnector'; + +export function seifWallet(): Wallet { + const injectedProvider = hasInjectedProvider({ + namespace: '__seif', + }); + return { + id: 'seif', + name: 'Seif', + installed: !!injectedProvider, + iconUrl: async () => (await import('./seifWallet.svg')).default, + iconBackground: '#fff', + downloadUrls: { + chrome: + 'https://chromewebstore.google.com/detail/seif/albakdmmdafeafbehmcpoejenbeojejl', + }, + createConnector: getInjectedConnector({ + namespace: '__seif', + }), + rdns: 'com.passkeywallet.seif', + }; +}