From fb84f2ac81f8b182b91bf4e8b4241d216e53c961 Mon Sep 17 00:00:00 2001 From: samuelea Date: Tue, 12 Nov 2024 19:08:59 -0500 Subject: [PATCH] moved to connectors folder --- packages/connectors/src/defaultConnectors.ts | 155 ------------------ .../connectors/immutable/ImmutableLogo.tsx | 0 .../src/connectors/immutable/immutable.ts | 2 +- .../src/connectors/immutable/index.ts | 0 4 files changed, 1 insertion(+), 156 deletions(-) delete mode 100644 packages/connectors/src/defaultConnectors.ts rename packages/{connectors => kit}/src/connectors/immutable/ImmutableLogo.tsx (100%) rename packages/{connectors => kit}/src/connectors/immutable/immutable.ts (95%) rename packages/{connectors => kit}/src/connectors/immutable/index.ts (100%) diff --git a/packages/connectors/src/defaultConnectors.ts b/packages/connectors/src/defaultConnectors.ts deleted file mode 100644 index 8cee9e98..00000000 --- a/packages/connectors/src/defaultConnectors.ts +++ /dev/null @@ -1,155 +0,0 @@ -import { getKitConnectWallets } from '@0xsequence/kit' -import { CreateConnectorFn } from 'wagmi' - -import { apple } from './connectors/apple' -import { appleWaas } from './connectors/apple/appleWaas' -import { coinbaseWallet } from './connectors/coinbaseWallet' -import { email } from './connectors/email' -import { emailWaas } from './connectors/email/emailWaas' -import { facebook } from './connectors/facebook' -import { google } from './connectors/google' -import { googleWaas } from './connectors/google/googleWaas' -import { immutable } from './connectors/immutable' -import { metamask } from './connectors/metamask' -import { sequence } from './connectors/sequence' -import { twitch } from './connectors/twitch' -import { walletConnect } from './connectors/walletConnect' - -interface GetDefaultConnectors { - walletConnectProjectId: string - projectAccessKey: string - appName: string - defaultChainId?: number -} - -export const getDefaultConnectors = ({ - walletConnectProjectId, - defaultChainId, - projectAccessKey, - appName -}: GetDefaultConnectors): CreateConnectorFn[] => { - const connectors = getKitConnectWallets(projectAccessKey, [ - immutable({}), - email({ - defaultNetwork: defaultChainId, - connect: { - app: appName - } - }), - google({ - defaultNetwork: defaultChainId, - connect: { - app: appName - } - }), - facebook({ - defaultNetwork: defaultChainId, - connect: { - app: appName - } - }), - twitch({ - defaultNetwork: defaultChainId, - connect: { - app: appName - } - }), - apple({ - defaultNetwork: defaultChainId, - connect: { - app: appName - } - }), - sequence({ - defaultNetwork: defaultChainId, - connect: { - app: appName - } - }), - walletConnect({ - projectId: walletConnectProjectId - }), - metamask() - // coinbaseWallet({ - // appName - // }) - ]) - - return connectors -} - -interface GetDefaultWaasConnectors { - projectAccessKey: string - waasConfigKey: string - googleClientId?: string - appleClientId?: string - appleRedirectURI?: string - - walletConnectProjectId: string - - appName: string - defaultChainId?: number - - enableConfirmationModal?: boolean - - isDev?: boolean -} - -export const getDefaultWaasConnectors = ({ - projectAccessKey, - waasConfigKey, - googleClientId, - appleClientId, - appleRedirectURI, - walletConnectProjectId, - appName, - defaultChainId, - enableConfirmationModal, - isDev = false -}: GetDefaultWaasConnectors): CreateConnectorFn[] => { - const wallets: any[] = [ - emailWaas({ - projectAccessKey, - waasConfigKey, - enableConfirmationModal, - network: defaultChainId, - isDev - }), - coinbaseWallet({ - appName - }), - metamask(), - walletConnect({ - projectId: walletConnectProjectId - }) - ] - if (googleClientId) { - wallets.push( - googleWaas({ - projectAccessKey, - googleClientId, - waasConfigKey, - enableConfirmationModal, - network: defaultChainId, - isDev - }) - ) - } - if (appleClientId && appleRedirectURI) { - wallets.push( - appleWaas({ - projectAccessKey, - appleClientId, - appleRedirectURI, - waasConfigKey, - enableConfirmationModal, - network: defaultChainId, - isDev - }) - ) - } - - const connectors = getKitConnectWallets(projectAccessKey, wallets) - - return connectors -} diff --git a/packages/connectors/src/connectors/immutable/ImmutableLogo.tsx b/packages/kit/src/connectors/immutable/ImmutableLogo.tsx similarity index 100% rename from packages/connectors/src/connectors/immutable/ImmutableLogo.tsx rename to packages/kit/src/connectors/immutable/ImmutableLogo.tsx diff --git a/packages/connectors/src/connectors/immutable/immutable.ts b/packages/kit/src/connectors/immutable/immutable.ts similarity index 95% rename from packages/connectors/src/connectors/immutable/immutable.ts rename to packages/kit/src/connectors/immutable/immutable.ts index ee9b684c..3e166214 100644 --- a/packages/connectors/src/connectors/immutable/immutable.ts +++ b/packages/kit/src/connectors/immutable/immutable.ts @@ -11,7 +11,7 @@ export const immutable = (options: ImmutableOptions): Wallet => ({ isSequenceBased: false, logoDark: ImmutableLogo, logoLight: ImmutableLogo, - name: 'Sequence', + name: 'Immutable', createConnector: () => { const connector = immutableConnector({ ...options diff --git a/packages/connectors/src/connectors/immutable/index.ts b/packages/kit/src/connectors/immutable/index.ts similarity index 100% rename from packages/connectors/src/connectors/immutable/index.ts rename to packages/kit/src/connectors/immutable/index.ts