-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
237 additions
and
0 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,39 @@ | ||
import { EthersTests } from '../../components/Ethers/EthersTests' | ||
import { AppKitButtons } from '../../components/AppKitButtons' | ||
import { createWeb3Modal, defaultConfig } from '@web3modal/ethers/react' | ||
import { ThemeStore } from '../../utils/StoreUtil' | ||
import { EthersConstants } from '../../utils/EthersConstants' | ||
import { ConstantsUtil } from '../../utils/ConstantsUtil' | ||
import { EthersModalInfo } from '../../components/Ethers/EthersModalInfo' | ||
|
||
const modal = createWeb3Modal({ | ||
ethersConfig: defaultConfig({ | ||
metadata: ConstantsUtil.Metadata, | ||
defaultChainId: 1, | ||
chains: EthersConstants.chains, | ||
coinbasePreference: 'smartWalletOnly', | ||
auth: { | ||
email: true, | ||
socials: [] | ||
} | ||
}), | ||
chains: EthersConstants.chains, | ||
projectId: ConstantsUtil.ProjectId, | ||
enableAnalytics: true, | ||
metadata: ConstantsUtil.Metadata, | ||
termsConditionsUrl: 'https://walletconnect.com/terms', | ||
privacyPolicyUrl: 'https://walletconnect.com/privacy', | ||
customWallets: ConstantsUtil.CustomWallets | ||
}) | ||
|
||
ThemeStore.setModal(modal) | ||
|
||
export default function Ethers() { | ||
return ( | ||
<> | ||
<AppKitButtons /> | ||
<EthersModalInfo /> | ||
<EthersTests /> | ||
</> | ||
) | ||
} |
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,42 @@ | ||
import { createWeb3Modal, defaultConfig } from '@web3modal/ethers5/react' | ||
import { ThemeStore } from '../../utils/StoreUtil' | ||
import { EthersConstants } from '../../utils/EthersConstants' | ||
import { ConstantsUtil } from '../../utils/ConstantsUtil' | ||
import { AppKitButtons } from '../../components/AppKitButtons' | ||
import { siweConfig } from '../../utils/SiweUtils' | ||
import { SiweData } from '../../components/Siwe/SiweData' | ||
import { Ethers5Tests } from '../../components/Ethers/Ethers5Tests' | ||
import { Ethers5ModalInfo } from '../../components/Ethers/Ethers5ModalInfo' | ||
|
||
const modal = createWeb3Modal({ | ||
ethersConfig: defaultConfig({ | ||
metadata: ConstantsUtil.Metadata, | ||
defaultChainId: 1, | ||
auth: { | ||
email: true, | ||
socials: [] | ||
}, | ||
coinbasePreference: 'smartWalletOnly' | ||
}), | ||
chains: EthersConstants.chains, | ||
projectId: ConstantsUtil.ProjectId, | ||
enableAnalytics: true, | ||
metadata: ConstantsUtil.Metadata, | ||
termsConditionsUrl: 'https://walletconnect.com/terms', | ||
privacyPolicyUrl: 'https://walletconnect.com/privacy', | ||
siweConfig, | ||
customWallets: ConstantsUtil.CustomWallets | ||
}) | ||
|
||
ThemeStore.setModal(modal) | ||
|
||
export default function Ethers() { | ||
return ( | ||
<> | ||
<AppKitButtons /> | ||
<Ethers5ModalInfo /> | ||
<SiweData /> | ||
<Ethers5Tests /> | ||
</> | ||
) | ||
} |
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,45 @@ | ||
import { createWeb3Modal, defaultSolanaConfig } from '@web3modal/solana/react' | ||
|
||
import { ThemeStore } from '../../utils/StoreUtil' | ||
import { solana, solanaDevnet, solanaTestnet } from '../../utils/ChainsUtil' | ||
import { AppKitButtons } from '../../components/AppKitButtons' | ||
import { ConstantsUtil } from '../../utils/ConstantsUtil' | ||
import { SolanaTests } from '../../components/Solana/SolanaTests' | ||
import { SolflareWalletAdapter } from '@solana/wallet-adapter-wallets' | ||
|
||
const chains = [solana, solanaTestnet, solanaDevnet] | ||
|
||
export const solanaConfig = defaultSolanaConfig({ | ||
chains, | ||
projectId: ConstantsUtil.ProjectId, | ||
metadata: ConstantsUtil.Metadata, | ||
auth: { | ||
email: true, | ||
socials: [] | ||
} | ||
}) | ||
|
||
const modal = createWeb3Modal({ | ||
solanaConfig, | ||
projectId: ConstantsUtil.ProjectId, | ||
metadata: ConstantsUtil.Metadata, | ||
defaultChain: solana, | ||
chains, | ||
enableAnalytics: false, | ||
termsConditionsUrl: 'https://walletconnect.com/terms', | ||
privacyPolicyUrl: 'https://walletconnect.com/privacy', | ||
customWallets: ConstantsUtil.CustomWallets, | ||
enableSwaps: false, | ||
wallets: [new SolflareWalletAdapter()] | ||
}) | ||
|
||
ThemeStore.setModal(modal) | ||
|
||
export default function Solana() { | ||
return ( | ||
<> | ||
<AppKitButtons /> | ||
<SolanaTests /> | ||
</> | ||
) | ||
} |
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,37 @@ | ||
import { createWeb3Modal } from '@web3modal/wagmi/react' | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query' | ||
import { WagmiProvider } from 'wagmi' | ||
import { AppKitButtons } from '../../components/AppKitButtons' | ||
import { WagmiTests } from '../../components/Wagmi/WagmiTests' | ||
import { ThemeStore } from '../../utils/StoreUtil' | ||
import { getWagmiConfig } from '../../utils/WagmiConstants' | ||
import { ConstantsUtil } from '../../utils/ConstantsUtil' | ||
import { WagmiModalInfo } from '../../components/Wagmi/WagmiModalInfo' | ||
|
||
const queryClient = new QueryClient() | ||
|
||
const wagmiConfig = getWagmiConfig('default', { auth: { email: true, socials: [] } }) | ||
|
||
const modal = createWeb3Modal({ | ||
wagmiConfig, | ||
projectId: ConstantsUtil.ProjectId, | ||
enableAnalytics: true, | ||
metadata: ConstantsUtil.Metadata, | ||
termsConditionsUrl: 'https://walletconnect.com/terms', | ||
privacyPolicyUrl: 'https://walletconnect.com/privacy', | ||
customWallets: ConstantsUtil.CustomWallets | ||
}) | ||
|
||
ThemeStore.setModal(modal) | ||
|
||
export default function Wagmi() { | ||
return ( | ||
<WagmiProvider config={wagmiConfig}> | ||
<QueryClientProvider client={queryClient}> | ||
<AppKitButtons /> | ||
<WagmiModalInfo /> | ||
<WagmiTests /> | ||
</QueryClientProvider> | ||
</WagmiProvider> | ||
) | ||
} |
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,37 @@ | ||
import { test, type BrowserContext } from '@playwright/test' | ||
import { ModalPage } from './shared/pages/ModalPage' | ||
import { ModalValidator } from './shared/validators/ModalValidator' | ||
|
||
/* eslint-disable init-declarations */ | ||
let modalPage: ModalPage | ||
let modalValidator: ModalValidator | ||
let context: BrowserContext | ||
|
||
// -- Setup -------------------------------------------------------------------- | ||
const noSocialsTest = test.extend<{ library: string }>({ | ||
library: ['wagmi', { option: true }] | ||
}) | ||
|
||
noSocialsTest.beforeAll(async ({ browser, library }) => { | ||
context = await browser.newContext() | ||
const browserPage = await context.newPage() | ||
|
||
modalPage = new ModalPage(browserPage, library, 'no-socials') | ||
modalValidator = new ModalValidator(browserPage) | ||
|
||
await modalPage.load() | ||
await modalPage.openConnectModal() | ||
}) | ||
|
||
noSocialsTest.afterAll(async () => { | ||
await modalPage.page.close() | ||
}) | ||
|
||
// -- Tests -------------------------------------------------------------------- | ||
noSocialsTest('should not display any socials', () => { | ||
modalValidator.expectNoSocials() | ||
}) | ||
|
||
noSocialsTest('should show email login', () => { | ||
modalValidator.expectEmailLogin() | ||
}) |
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