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

fix: 4.2.0 bug fixes #2234

Merged
merged 34 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ef53e1f
fix: add 6492 verification support to lab by using viem + hexlify et…
tomiir May 9, 2024
a23f8a0
fix: siwe preferred account type (#2230)
tomiir May 9, 2024
ba6e915
chore: refactor siwe prompt handler (#2231)
tomiir May 9, 2024
f300b2a
refactor/swap improvements (#2229)
enesozturk May 9, 2024
101f779
refactor: add replace option to tx router stack object (#2233)
enesozturk May 9, 2024
aa7e9bc
fix: remove back on connecting siwe screen (#2232)
tomiir May 9, 2024
5da2fc1
Fix/send bugs (#2236)
svenvoskamp May 10, 2024
529218c
fix: ethers email defaults mainnet (#2238)
tomiir May 10, 2024
6870786
fix: siwe global import (#2240)
tomiir May 10, 2024
d024c26
wip
svenvoskamp May 10, 2024
697e4d7
remove log
svenvoskamp May 10, 2024
18f7a2f
fix: swap tests (#2241)
tomiir May 10, 2024
b228066
fix: remove wallet image on disconnect (#2243)
tomiir May 10, 2024
8ef100e
fix: close modal on siwe cancel (#2247)
tomiir May 10, 2024
f9bb2a8
fix: client preferred account sync (#2244)
tomiir May 10, 2024
7eed4c9
fix: iframe positioning on mobile view (#2245)
enesozturk May 10, 2024
448f7f4
Styling issues ios (#2246)
svenvoskamp May 10, 2024
8aa0308
fix: add extension for locale import from dayjs (#2252)
enesozturk May 13, 2024
9dbdd73
chore: replace alpha wc connector (#2254)
tomiir May 13, 2024
03e4f4a
fix: signature validation fail causes open modal (#2253)
tomiir May 13, 2024
47d26a8
chore: canary version changes (#2248)
enesozturk May 13, 2024
474177c
chore: bump to 4.2.0-03e4f4a8.1 (#2261)
tomiir May 13, 2024
c8419dd
fix: siwe tests (#2262)
tomiir May 13, 2024
e127642
feat: siwe + SA tests (#2263)
tomiir May 13, 2024
0e0cdc9
chore: update to 4.2.0-alpha.0 (#2264)
tomiir May 13, 2024
32fc8f6
Merge branch 'V4' of github.com:WalletConnect/web3modal into fix/4.2.…
tomiir May 14, 2024
4bab515
Merge branch 'fix/4.2.0-bug-fixes' of github.com:WalletConnect/web3mo…
tomiir May 14, 2024
26b43d8
fix: remove unused variable from merge
tomiir May 14, 2024
f7060a1
Merge branch 'V4' into fix/4.2.0-bug-fixes
tomiir May 14, 2024
2d7ee46
Merge branch 'V4' into fix/4.2.0-bug-fixes
enesozturk May 14, 2024
f2d0047
chore: update wagmi versions in examples
tomiir May 14, 2024
ff536e6
Merge branch 'fix/4.2.0-bug-fixes' of github.com:WalletConnect/web3mo…
tomiir May 14, 2024
115019f
chore: update lock
tomiir May 14, 2024
c50f506
fix: 1CA disconnect issues (#2268)
tomiir May 14, 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
29 changes: 29 additions & 0 deletions apps/demo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# @apps/demo

## 4.2.0-alpha.0

### Patch Changes

- feat: 4.2.0-alpha release

- Updated dependencies []:
- @web3modal/[email protected]

## 4.2.0-03e4f4a8.2

### Patch Changes

- fix: Issue with SIWE + Wagmi sign out. Fixes issue where signature verification fail resulted in empty open modal'

- Updated dependencies []:
- @web3modal/[email protected]

## 4.2.0-448f7f4.1

### Minor Changes

- refactor: improvements to all features (siwe, send, swaps, ui and ux)

### Patch Changes

- Updated dependencies []:
- @web3modal/[email protected]

## 4.1.12-910a844.0

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apps/demo",
"version": "4.1.12-910a844.0",
"version": "4.2.0-alpha.0",
"private": true,
"scripts": {
"dev:demo": "next dev",
Expand All @@ -11,7 +11,7 @@
"dependencies": {
"@radix-ui/react-switch": "1.0.3",
"@tanstack/react-query": "5.24.8",
"@web3modal/wagmi": "4.1.12-910a844.0",
"@web3modal/wagmi": "4.2.0-alpha.0",
"clsx": "2.1.0",
"framer-motion": "11.0.8",
"next": "14.1.1",
Expand All @@ -20,8 +20,8 @@
"sonner": "1.4.3",
"tailwind-merge": "2.2.1",
"vaul": "0.9.0",
"viem": "2.7.19",
"wagmi": "2.5.19",
"viem": "2.10.3",
"wagmi": "2.8.7",
"zustand": "4.5.2"
},
"devDependencies": {
Expand Down
32 changes: 32 additions & 0 deletions apps/gallery/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# @apps/gallery

## 4.2.0-alpha.0

### Patch Changes

- feat: 4.2.0-alpha release

- Updated dependencies []:
- @web3modal/[email protected]
- @web3modal/[email protected]

## 4.2.0-03e4f4a8.2

### Patch Changes

- fix: Issue with SIWE + Wagmi sign out. Fixes issue where signature verification fail resulted in empty open modal'

- Updated dependencies []:
- @web3modal/[email protected]
- @web3modal/[email protected]

## 4.2.0-448f7f4.1

### Minor Changes

- refactor: improvements to all features (siwe, send, swaps, ui and ux)

### Patch Changes

- Updated dependencies []:
- @web3modal/[email protected]
- @web3modal/[email protected]

## 4.1.12-910a844.0

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions apps/gallery/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apps/gallery",
"version": "4.1.12-910a844.0",
"version": "4.2.0-alpha.0",
"private": true,
"main": "index.js",
"scripts": {
Expand All @@ -9,8 +9,8 @@
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@web3modal/common": "4.1.12-910a844.0",
"@web3modal/ui": "4.1.12-910a844.0",
"@web3modal/common": "4.2.0-alpha.0",
"@web3modal/ui": "4.2.0-alpha.0",
"lit": "3.1.0",
"storybook": "7.6.7"
},
Expand Down
38 changes: 38 additions & 0 deletions apps/laboratory/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# @apps/laboratory

## 4.2.0-alpha.0

### Patch Changes

- feat: 4.2.0-alpha release

- Updated dependencies []:
- @web3modal/[email protected]
- @web3modal/[email protected]
- @web3modal/[email protected]
- @web3modal/[email protected]

## 4.2.0-03e4f4a8.2

### Patch Changes

- fix: Issue with SIWE + Wagmi sign out. Fixes issue where signature verification fail resulted in empty open modal'

- Updated dependencies []:
- @web3modal/[email protected]
- @web3modal/[email protected]
- @web3modal/[email protected]
- @web3modal/[email protected]

## 4.2.0-448f7f4.1

### Minor Changes

- refactor: improvements to all features (siwe, send, swaps, ui and ux)

### Patch Changes

- Updated dependencies []:
- @web3modal/[email protected]
- @web3modal/[email protected]
- @web3modal/[email protected]
- @web3modal/[email protected]

## 4.1.12-910a844.0

### Patch Changes
Expand Down
16 changes: 9 additions & 7 deletions apps/laboratory/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apps/laboratory",
"version": "4.1.12-910a844.0",
"version": "4.2.0-alpha.0",
"private": true,
"scripts": {
"dev:laboratory": "next dev",
Expand All @@ -14,13 +14,15 @@
"playwright:test:email": "playwright test --grep 'email.spec.ts'",
"playwright:test:siwe": "playwright test --grep siwe.spec.ts",
"playwright:test:siwe-email": "playwright test --grep siwe-email.spec.ts",
"playwright:test:siwe-sa": "playwright test --grep siwe-smart-account.spec.ts",
"playwright:test:sa": "playwright test --grep smart-account.spec.ts",
"playwright:test:canary": "playwright test --retries=0 --grep canary.spec.ts --project='Desktop Chrome/wagmi'",
"playwright:debug": "npm run playwright:test -- --debug",
"playwright:debug:wallet": "npm run playwright:test:wallet -- --debug",
"playwright:debug:email": "npm run playwright:test:email -- --debug",
"playwright:debug:siwe": "npm run playwright:test:siwe -- --debug",
"playwright:debug:siwe-email": "npm run playwright:test:siwe-email -- --debug",
"playwright:debug:siwe-sa": "npm run playwright:test:siwe-smart-account -- --debug",
"playwright:debug:sa": "npm run playwright:test:sa -- --debug",
"playwright:debug:canary": "npm run playwright:test:canary -- --debug"
},
Expand All @@ -33,19 +35,19 @@
"@sentry/react": "7.92.0",
"@solana/web3.js": "1.87.6",
"@tanstack/react-query": "5.24.8",
"@web3modal/ethers": "4.1.12-910a844.0",
"@web3modal/siwe": "4.1.12-910a844.0",
"@web3modal/solana": "4.1.12-910a844.0",
"@web3modal/wagmi": "4.1.12-910a844.0",
"@web3modal/ethers": "4.2.0-alpha.0",
"@web3modal/siwe": "4.2.0-alpha.0",
"@web3modal/solana": "4.2.0-alpha.0",
"@web3modal/wagmi": "4.2.0-alpha.0",
"ethers": "6.9.0",
"framer-motion": "10.17.9",
"next": "14.0.4",
"next-auth": "4.24.5",
"react-icons": "4.12.0",
"@walletconnect/utils": "2.12.0",
"valtio": "1.11.2",
"viem": "2.9.3",
"wagmi": "2.5.19"
"viem": "2.10.3",
"wagmi": "2.8.7"
},
"devDependencies": {
"@aws-sdk/client-cloudwatch": "3.509.0",
Expand Down
16 changes: 8 additions & 8 deletions apps/laboratory/src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import type { NextApiRequest, NextApiResponse } from 'next'
import nextAuth from 'next-auth'
import credentialsProvider from 'next-auth/providers/credentials'
import {
type SIWESession,
verifySignature,
getChainIdFromMessage,
getAddressFromMessage
} from '@web3modal/siwe'
import { type SIWESession, getChainIdFromMessage, getAddressFromMessage } from '@web3modal/siwe'
import { verifySignature } from '../../../utils/SignatureUtil'

declare module 'next-auth' {
interface Session extends SIWESession {
Expand Down Expand Up @@ -51,8 +47,12 @@ export default async function auth(req: NextApiRequest, res: NextApiResponse) {
const { message, signature } = credentials
const address = getAddressFromMessage(message)
const chainId = getChainIdFromMessage(message)

const isValid = await verifySignature({ address, message, signature, chainId, projectId })
const isValid = await verifySignature({
address,
message,
signature,
chainId: Number(chainId.split(':')[1])
})

if (isValid) {
return {
Expand Down
31 changes: 31 additions & 0 deletions apps/laboratory/src/utils/SignatureUtil.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { createPublicClient, http } from 'viem'

function getTransport({ chainId }: { chainId: number }) {
const RPC_URL = 'https://rpc.walletconnect.com'

return http(
`${RPC_URL}/v1/?chainId=eip155:${chainId}&projectId=${process.env['NEXT_PUBLIC_PROJECT_ID']}`
)
}

export async function verifySignature({
address,
message,
signature,
chainId
}: {
address: string
message: string
signature: string
chainId: number
}) {
const publicClient = createPublicClient({
transport: getTransport({ chainId })
})

return publicClient.verifyMessage({
message,
address: address as `0x${string}`,
signature: signature as `0x${string}`
})
}
9 changes: 6 additions & 3 deletions apps/laboratory/tests/shared/utils/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ const customProjectProperties: CustomProjectProperties = {
useOptions: braveOptions
},
'Desktop Brave/wagmi': {
testIgnore: /(?:email\.spec\.ts|smart-account\.spec\.ts|siwe-email\.spec\.ts).*$/u,
testIgnore:
/(?:email\.spec\.ts|smart-account\.spec\.ts|siwe-email\.spec\.ts|siwe-smart-account\.spec\.ts).*$/u,
useOptions: braveOptions
},
'Desktop Chrome/wagmi': {
testIgnore: /(?:email\.spec\.ts|smart-account\.spec\.ts|siwe-email\.spec\.ts).*$/u
testIgnore:
/(?:email\.spec\.ts|smart-account\.spec\.ts|siwe-email\.spec\.ts|siwe-smart-account\.spec\.ts).*$/u
},
'Desktop Firefox/wagmi': {
testIgnore: /(?:email\.spec\.ts|smart-account\.spec\.ts|siwe-email\.spec\.ts).*$/u
testIgnore:
/(?:email\.spec\.ts|smart-account\.spec\.ts|siwe-email\.spec\.ts|siwe-smart-account\.spec\.ts).*$/u
},
// Exclude email.spec.ts, siwe.spec.ts, and canary.spec.ts from solana, not yet implemented
'Desktop Chrome/solana': {
Expand Down
20 changes: 5 additions & 15 deletions apps/laboratory/tests/shared/validators/ModalValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@ import { expect } from '@playwright/test'
import type { Page } from '@playwright/test'
import { ConstantsUtil } from '../../../src/utils/ConstantsUtil'
import { getMaximumWaitConnections } from '../utils/timeouts'
import { createPublicClient, http } from 'viem'

function getTransport({ chainId }: { chainId: number }) {
const RPC_URL = 'https://rpc.walletconnect.com'

return http(
`${RPC_URL}/v1/?chainId=eip155:${chainId}&projectId=${process.env['NEXT_PUBLIC_PROJECT_ID']}`
)
}
import { verifySignature } from '../../../src/utils/SignatureUtil'

const MAX_WAIT = getMaximumWaitConnections()

Expand Down Expand Up @@ -102,13 +94,11 @@ export class ModalValidator {
}

async expectValidSignature(signature: `0x${string}`, address: `0x${string}`, chainId: number) {
const publicClient = createPublicClient({
transport: getTransport({ chainId })
})
const isVerified = await publicClient.verifyMessage({
message: 'Hello Web3Modal!',
const isVerified = await verifySignature({
address,
signature
message: 'Hello Web3Modal!',
signature,
chainId
})

expect(isVerified).toBe(true)
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
@@ -1,5 +1,5 @@
import { testMEmailSiwe } from './shared/fixtures/w3m-email-fixture'
import type { ModalWalletPage } from './shared/pages/ModalWalletPage'
import { ModalWalletPage } from './shared/pages/ModalWalletPage'
import { ModalWalletValidator } from './shared/validators/ModalWalletValidator'

testMEmailSiwe.beforeEach(async ({ modalValidator }) => {
Expand Down
Loading
Loading