-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding immutable to default connectors
- Loading branch information
1 parent
3bb6bba
commit 2519401
Showing
3 changed files
with
162 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters