Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable wallet features by default #2382

Merged
merged 33 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ae6407f
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp May 15, 2024
9888c89
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp May 15, 2024
4362254
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp May 16, 2024
fa858a4
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp May 16, 2024
2920ef4
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp May 27, 2024
e7fc41b
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Jun 3, 2024
c7ed29e
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Jun 5, 2024
987d806
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Jun 10, 2024
0eeae25
feat: add cdn package
enesozturk Jun 10, 2024
6e5496a
chore: update package versions
enesozturk Jun 10, 2024
c2277a0
make walletfeatures part of auth parameter
svenvoskamp Jun 10, 2024
6fc640f
refactor: update scripts
enesozturk Jun 10, 2024
8a92f8f
adjust tests
svenvoskamp Jun 10, 2024
2362e10
adjust test
svenvoskamp Jun 10, 2024
7623606
adjust tests
svenvoskamp Jun 10, 2024
48694df
adjust tests
svenvoskamp Jun 10, 2024
7bb27f2
fix tests
svenvoskamp Jun 10, 2024
a5efba1
adjust test
svenvoskamp Jun 10, 2024
059d58a
use modalwalletvalidator for email spec
svenvoskamp Jun 10, 2024
79c1289
remove modalvalidator
svenvoskamp Jun 10, 2024
7769812
fix conflicts
svenvoskamp Jun 11, 2024
938513e
remove wagmi wallet
svenvoskamp Jun 11, 2024
4ec9cc1
Merge branch 'feat/cdn-package' of github.com:WalletConnect/web3modal…
svenvoskamp Jun 11, 2024
550c3af
refactor: update turborepo and cdn configs
enesozturk Jun 11, 2024
2af03b8
refactor: update vite configs
enesozturk Jun 11, 2024
bf808ae
Merge branch 'V4' into feat/cdn-package
enesozturk Jun 11, 2024
fb9ee10
chore: make the build script persistent
enesozturk Jun 11, 2024
b8f9000
Merge branch 'V4' into chore/enable-wallet-features
svenvoskamp Jun 11, 2024
a81c707
Merge branch 'V4' into feat/cdn-package
enesozturk Jun 11, 2024
fbca152
Merge branch 'chore/enable-wallet-features' of github.com:WalletConne…
svenvoskamp Jun 11, 2024
22d5e79
Merge branch 'feat/cdn-package' of github.com:WalletConnect/web3modal…
svenvoskamp Jun 11, 2024
3479e2a
fix build
svenvoskamp Jun 11, 2024
da11634
Merge branch 'V4' into chore/enable-wallet-features
svenvoskamp Jun 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"tailwind-merge": "2.2.1",
"vaul": "0.9.0",
"viem": "2.10.3",
"wagmi": "2.9.9",
"wagmi": "2.9.10",
"zustand": "4.5.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/laboratory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@walletconnect/utils": "2.13.1",
"valtio": "1.11.2",
"viem": "2.10.3",
"wagmi": "2.9.9",
"wagmi": "2.9.10",
"@wagmi/connectors": "5.0.8"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions apps/laboratory/src/pages/library/ethers-all.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const modal = createWeb3Modal({
privacyPolicyUrl: 'https://walletconnect.com/privacy',
siweConfig,
enableOnramp: true,
customWallets: ConstantsUtil.CustomWallets,
enableWalletFeatures: true
customWallets: ConstantsUtil.CustomWallets
})

ThemeStore.setModal(modal)
Expand Down
39 changes: 0 additions & 39 deletions apps/laboratory/src/pages/library/ethers-wallet.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions apps/laboratory/src/pages/library/wagmi-all.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const modal = createWeb3Modal({
privacyPolicyUrl: 'https://walletconnect.com/privacy',
siweConfig,
enableOnramp: true,
customWallets: ConstantsUtil.CustomWallets,
enableWalletFeatures: true
customWallets: ConstantsUtil.CustomWallets
})

ThemeStore.setModal(modal)
Expand Down
46 changes: 0 additions & 46 deletions apps/laboratory/src/pages/library/wagmi-wallet.tsx

This file was deleted.

18 changes: 4 additions & 14 deletions apps/laboratory/src/utils/DataUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,9 @@ export const wagmiSdkOptions = [
description: 'Configuration using wagmi and implementing sign in with ethereum'
},
{
title: 'Email',
title: 'Email & Social',
link: '/library/wagmi-email/',
description: 'Configuration using wagmi and implementing email login'
},
{
title: 'Wallet',
link: '/library/wagmi-wallet/',
description: 'Configuration using wagmi and implementing social wallet'
description: 'Configuration using wagmi and implementing email and social login'
}
]

Expand All @@ -53,14 +48,9 @@ export const ethersSdkOptions = [
description: 'Configuration using ethers and implementing sign in with ethereum'
},
{
title: 'Email',
title: 'Email and Social',
link: '/library/ethers-email/',
description: 'Configuration using ethers and implementing email login'
},
{
title: 'Wallet',
link: '/library/ethers-wallet/',
description: 'Configuration using ethers and implementing social wallet'
description: 'Configuration using ethers and implementing email and social login'
}
]

Expand Down
40 changes: 26 additions & 14 deletions apps/laboratory/tests/email.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { expect } from '@playwright/test'
import { testMEmail } from './shared/fixtures/w3m-email-fixture'
import { SECURE_WEBSITE_URL } from './shared/constants'
import type { ModalWalletPage } from './shared/pages/ModalWalletPage'
import type { ModalWalletValidator } from './shared/validators/ModalWalletValidator'

testMEmail.beforeEach(async ({ modalValidator }) => {
await modalValidator.expectConnected()
Expand All @@ -26,23 +28,33 @@ testMEmail('it should reject sign', async ({ modalPage, modalValidator }) => {

testMEmail('it should switch network and sign', async ({ modalPage, modalValidator }) => {
let targetChain = 'Polygon'
await modalPage.switchNetwork(targetChain)
await modalValidator.expectSwitchedNetwork(targetChain)
await modalPage.closeModal()
await modalPage.sign()
await modalPage.approveSign()
await modalValidator.expectAcceptedSign()
const walletModalPage = modalPage as ModalWalletPage
const walletModalValidator = modalValidator as ModalWalletValidator
await walletModalPage.openAccount()
await walletModalPage.openSettings()
await walletModalPage.switchNetwork(targetChain)
await walletModalValidator.expectSwitchedNetwork(targetChain)
await walletModalPage.closeModal()
await walletModalPage.sign()
await walletModalPage.approveSign()
await walletModalValidator.expectAcceptedSign()

targetChain = 'Ethereum'
await modalPage.switchNetwork(targetChain)
await modalValidator.expectSwitchedNetwork(targetChain)
await modalPage.closeModal()
await modalPage.sign()
await modalPage.approveSign()
await modalValidator.expectAcceptedSign()
await walletModalPage.openAccount()
await walletModalPage.openSettings()
await walletModalPage.switchNetwork(targetChain)
await walletModalValidator.expectSwitchedNetwork(targetChain)
await walletModalPage.closeModal()
await walletModalPage.sign()
await walletModalPage.approveSign()
await walletModalValidator.expectAcceptedSign()
})

testMEmail('it should disconnect correctly', async ({ modalPage, modalValidator }) => {
await modalPage.disconnect()
await modalValidator.expectDisconnected()
const walletModalPage = modalPage as ModalWalletPage
const walletModalValidator = modalValidator as ModalWalletValidator
await walletModalPage.openAccount()
await walletModalPage.openSettings()
await walletModalPage.disconnect()
await walletModalValidator.expectDisconnected()
})
6 changes: 2 additions & 4 deletions apps/laboratory/tests/shared/fixtures/w3m-email-fixture.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type { ModalFixture } from './w3m-fixture'
import { ModalPage } from '../pages/ModalPage'
import { ModalValidator } from '../validators/ModalValidator'
import { Email } from '../utils/email'
import { ModalWalletValidator } from '../validators/ModalWalletValidator'
import { timingFixture } from './timing-fixture'
Expand All @@ -9,7 +7,7 @@ import { ModalWalletPage } from '../pages/ModalWalletPage'
export const testMEmail = timingFixture.extend<ModalFixture>({
library: ['wagmi', { option: true }],
modalPage: async ({ page, library, context }, use, testInfo) => {
const modalPage = new ModalPage(page, library, 'email')
const modalPage = new ModalWalletPage(page, library, 'email')
await modalPage.load()

const mailsacApiKey = process.env['MAILSAC_API_KEY']
Expand All @@ -23,7 +21,7 @@ export const testMEmail = timingFixture.extend<ModalFixture>({
await use(modalPage)
},
modalValidator: async ({ modalPage }, use) => {
const modalValidator = new ModalValidator(modalPage.page)
const modalValidator = new ModalWalletValidator(modalPage.page)
await use(modalValidator)
}
})
Expand Down
2 changes: 2 additions & 0 deletions apps/laboratory/tests/shared/pages/ModalPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ export class ModalPage {

async clickWalletUpgradeCard(context: BrowserContext) {
await this.page.getByTestId('account-button').click()

await this.page.getByTestId('w3m-profile-button').click()
await this.page.getByTestId('w3m-wallet-upgrade-card').click()

const page = await doActionAndWaitForNewPage(
Expand Down
2 changes: 1 addition & 1 deletion apps/laboratory/tests/shared/pages/ModalWalletPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class ModalWalletPage extends ModalPage {
constructor(
public override readonly page: Page,
public override readonly library: string,
public override readonly flavor: 'wallet' | 'all' = 'wallet'
public override readonly flavor: 'email' | 'all' = 'email'
) {
super(page, library, flavor)
}
Expand Down
1 change: 0 additions & 1 deletion apps/laboratory/tests/shared/validators/ModalValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export class ModalValidator {
// We use Chakra Toast and it's not quite straightforward to set the `data-testid` attribute on the toast element.
await expect(this.page.getByText(ConstantsUtil.SigningFailedToastTitle)).toBeVisible()
}

async expectSwitchedNetwork(network: string) {
const switchNetworkButton = this.page.getByTestId('w3m-account-select-network')
await expect(switchNetworkButton).toBeVisible()
Expand Down
2 changes: 1 addition & 1 deletion apps/laboratory/tests/siwe-email.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ testMEmailSiwe('it should switch network and sign', async ({ modalPage, modalVal
await modalWalletPage.switchNetwork(targetChain)
await modalWalletPage.promptSiwe()
await modalWalletPage.approveSign()
await modalWalletValidator.expectSwitchedNetwork(targetChain)
await modalWalletValidator.expectSwitchedNetwork(targetChain, true)
await modalWalletPage.closeModal()

await modalWalletPage.sign()
Expand Down
2 changes: 1 addition & 1 deletion examples/next-wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"viem": "2.10.3",
"wagmi": "2.9.9"
"wagmi": "2.9.10"
},
"devDependencies": {
"@types/node": "20.11.5",
Expand Down
2 changes: 1 addition & 1 deletion examples/react-wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"react-dom": "18.2.0",
"vite": "5.2.11",
"viem": "2.10.3",
"wagmi": "2.9.9"
"wagmi": "2.9.10"
},
"devDependencies": {
"@vitejs/plugin-react": "4.2.1",
Expand Down
Loading
Loading