From b472123172dc8ec223b0c60fba82ce81da096dc4 Mon Sep 17 00:00:00 2001 From: ndoherty Date: Sun, 15 Oct 2023 18:38:37 -0600 Subject: [PATCH] add zerion extension support (#307) --- packages/connectkit/src/utils/wallets.ts | 10 ++++++++++ packages/connectkit/src/wallets/connectors/zerion.tsx | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/packages/connectkit/src/utils/wallets.ts b/packages/connectkit/src/utils/wallets.ts index ecfecaf0..970efe01 100644 --- a/packages/connectkit/src/utils/wallets.ts +++ b/packages/connectkit/src/utils/wallets.ts @@ -129,3 +129,13 @@ export const isRainbow = () => { ethereum?.providers.find((provider) => provider.isRainbow)) ); }; + +export const isZerion = () => { + if (typeof window === 'undefined') return false; + const { ethereum } = window; + return !!( + ethereum?.isZerion || + (ethereum?.providers && + ethereum?.providers.find((provider) => provider.isZerion)) + ); +}; diff --git a/packages/connectkit/src/wallets/connectors/zerion.tsx b/packages/connectkit/src/wallets/connectors/zerion.tsx index 183e0ad5..58eda2e0 100644 --- a/packages/connectkit/src/wallets/connectors/zerion.tsx +++ b/packages/connectkit/src/wallets/connectors/zerion.tsx @@ -2,8 +2,11 @@ import { WalletProps } from './../wallet'; import { isAndroid } from '../../utils'; import Logos from './../../assets/logos'; +import { isZerion } from '../../utils/wallets'; export const zerion = (): WalletProps => { + const isInstalled = isZerion(); + return { id: 'zerion', name: 'Zerion', @@ -24,5 +27,6 @@ export const zerion = (): WalletProps => { ? uri : `https://app.zerion.io/wc?uri=${encodeURIComponent(uri)}`; }, + installed: isInstalled, }; };