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/send bugs #2235

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4c49f3b
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Mar 18, 2024
7f6e739
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Mar 27, 2024
b8eb024
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Mar 28, 2024
7618a2b
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Apr 9, 2024
4fde66d
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Apr 11, 2024
cbc1869
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Apr 11, 2024
dccb3f0
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Apr 15, 2024
56babc9
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Apr 16, 2024
aff052a
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Apr 16, 2024
1c37b73
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Apr 19, 2024
06e91a8
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Apr 19, 2024
5c01dcb
wip
svenvoskamp Apr 22, 2024
6a26900
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Apr 23, 2024
bba303b
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Apr 23, 2024
75f572c
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Apr 24, 2024
f657df5
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp Apr 26, 2024
8794a29
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp May 6, 2024
4d42433
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp May 7, 2024
a27d42b
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp May 7, 2024
8c13382
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp May 8, 2024
ce546a5
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp May 8, 2024
faaada7
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp May 8, 2024
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
2f316a8
Merge branch 'V4' of github.com:WalletConnect/web3modal into V4
svenvoskamp May 10, 2024
f54864f
wip
svenvoskamp May 10, 2024
fdc5eb8
Merge branch 'fix/4.2.0-bug-fixes' of github.com:WalletConnect/web3mo…
svenvoskamp May 10, 2024
9c34bfd
addres various bug fixes
svenvoskamp May 10, 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
4 changes: 2 additions & 2 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.4",
"zustand": "4.5.2"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions apps/laboratory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"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.4"
},
"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}`
})
}
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
4 changes: 2 additions & 2 deletions examples/html-wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"build:examples": "vite build"
},
"dependencies": {
"@wagmi/connectors": "4.1.25",
"@wagmi/core": "2.6.16",
"@wagmi/connectors": "4.3.6",
"@wagmi/core": "2.9.4",
"@web3modal/wagmi": "4.1.12-910a844.0",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/next-wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"next": "14.1.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"viem": "2.7.13",
"wagmi": "2.5.19"
"viem": "2.10.3",
"wagmi": "2.8.4"
},
"devDependencies": {
"@types/node": "20.11.5",
Expand Down
4 changes: 2 additions & 2 deletions examples/react-wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"vite": "5.0.12",
"viem": "2.7.13",
"wagmi": "2.5.19"
"viem": "2.10.3",
"wagmi": "2.8.4"
},
"devDependencies": {
"@vitejs/plugin-react": "4.2.1",
Expand Down
4 changes: 2 additions & 2 deletions examples/vue-wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"build:examples": "vite build"
},
"dependencies": {
"@wagmi/connectors": "4.1.25",
"@wagmi/core": "2.6.16",
"@wagmi/connectors": "4.3.6",
"@wagmi/core": "2.9.4",
"@web3modal/wagmi": "4.1.12-910a844.0"
},
"devDependencies": {
Expand Down
Loading
Loading