diff --git a/.github/workflows/ui_tests.yml b/.github/workflows/ui_tests.yml
index a87210ff2d..5e02c4bcbe 100644
--- a/.github/workflows/ui_tests.yml
+++ b/.github/workflows/ui_tests.yml
@@ -36,6 +36,10 @@ on:
secrets:
NEXT_PUBLIC_PROJECT_ID:
required: true
+ RELEASE_TOKEN_V2:
+ required: true
+ TFC_INFRA_TOKEN:
+ required: true
TESTS_NEXTAUTH_SECRET:
required: false
TESTS_MAILSAC_API_KEY:
@@ -46,10 +50,20 @@ on:
required: false
jobs:
+ setup_playwright_runners:
+ uses: WalletConnect/gh-actions-runners/.github/workflows/setup-runners.yml@main
+ with:
+ cpu: 16384
+ memory: 65536
+ labels: playwright
+ count: 5
+ secrets:
+ GITHUB_PAT: ${{ secrets.RELEASE_TOKEN_V2 }}
+ TF_API_TOKEN: ${{ secrets.TFC_INFRA_TOKEN }}
+
ui_tests:
name: 'Playwright Tests'
- runs-on:
- group: ubuntu-runners
+ runs-on: [self-hosted, playwright]
strategy:
fail-fast: false
matrix:
@@ -57,8 +71,10 @@ jobs:
shardTotal: [5]
timeout-minutes: 20
steps:
- - name: Tune GitHub-hosted runner network
- uses: smorimoto/tune-github-hosted-runner-network@v1
+ # Possibly this helps with GitHub-hosted runner network issues, but it's not confirmed
+ # It's not supported in self-hosted runners, however, so commenting it out for now
+ # - name: Tune GitHub-hosted runner network
+ # uses: smorimoto/tune-github-hosted-runner-network@v1
- name: checkout
uses: actions/checkout@v4
@@ -75,17 +91,18 @@ jobs:
node-version: 18.x
cache: 'pnpm'
- - name: Get installed Playwright version
- id: playwright-version
- run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').packages['apps/laboratory']['devDependencies']['@playwright/test'])")" >> $GITHUB_ENV
+ # - name: Get installed Playwright version
+ # id: playwright-version
+ # run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').packages['apps/laboratory']['devDependencies']['@playwright/test'])")" >> $GITHUB_ENV
- - name: Cache playwright binaries
- uses: actions/cache@v4
- id: playwright-cache
- with:
- path: |
- ~/.cache/ms-playwright
- key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}-${{ hashFiles('apps/laboratory/tests/shared/constants/devices.ts') }}
+ # This cache causes weird errors on retry runs when using the self-hosted runners, disabling for now
+ # - name: Cache playwright binaries
+ # uses: actions/cache@v4
+ # id: playwright-cache
+ # with:
+ # path: |
+ # ~/.cache/ms-playwright
+ # key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}-${{ hashFiles('apps/laboratory/tests/shared/constants/devices.ts') }}
- name: Install dependencies
run: pnpm install
diff --git a/apps/demo/CHANGELOG.md b/apps/demo/CHANGELOG.md
index 1854d0ebbf..560b9ef8b4 100644
--- a/apps/demo/CHANGELOG.md
+++ b/apps/demo/CHANGELOG.md
@@ -1,5 +1,89 @@
# @apps/demo
+## 5.1.8
+
+### Patch Changes
+
+- - chore: changed RN links to wildcards by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2839
+ - feat: solana send transaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2802
+ - Feat/solana onramp by @phoenixVS in https://github.com/WalletConnect/web3modal/pull/2525
+ - chore: update assetlinks.json by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2838
+ - Chore/add base sepolia by @tomiir in https://github.com/WalletConnect/web3modal/pull/2840
+ - fix: solana default chain logic by @zoruka in https://github.com/WalletConnect/web3modal/pull/2849
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.8
+
+## 5.1.7
+
+### Patch Changes
+
+- - chore: version bump for 5.1.6 by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2797
+ - fix(deps): update walletconnect to v2.15.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2722
+ - chore: fix public URL by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2806
+ - fix: RPC requests causing modal to close by @tomiir in https://github.com/WalletConnect/web3modal/pull/2799
+ - chore: use apiVersion v2 on names endpoint by @tomiir in https://github.com/WalletConnect/web3modal/pull/2805
+ - fix: import valtio from vanilla path by @jd1378 in https://github.com/WalletConnect/web3modal/pull/2810
+ - chore: use shared gh token by @tomiir in https://github.com/WalletConnect/web3modal/pull/2809
+ - chore: add input secrets to setup workflow by @tomiir in https://github.com/WalletConnect/web3modal/pull/2822
+ - fix: remove deprecated params from sign transaction wc rpc request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2816
+ - chore: changed android and ios links for react native sample apps by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2825
+ - chore: changed order of links by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2826
+ - fix(siwe): fix undefined SIWE chainId by @Cali93 in https://github.com/WalletConnect/web3modal/pull/2820
+ - chore: update monorepo deps to 2.16.1 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2829
+ - fix: don't capitalize first character of email field on mobile by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2815
+ - chore(deps): update dependency ethers to v6.13.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2434
+ - chore(deps): update wagmi by @renovate in https://github.com/WalletConnect/web3modal/pull/2711
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.7
+
+## 5.1.6
+
+### Patch Changes
+
+- fix: update CSP by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2775
+- fix: ethers5 adapter import in exports by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2754
+- fix/missing action functions exports from clients by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2778
+- fix: logics to set default chain by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2787
+- Implement actions using userOpBuilder service instead of permissionless.js by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2758
+- chore: run Playwright on self-hosted runners by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2788
+- chore: add NEXT_PUBLIC_SECURE_SITE_SDK_URL to CSP by @tomiir in https://github.com/WalletConnect/web3modal/pull/2791
+- chore: enable verify tests by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2774
+- fix: social login shows `undefined` by @magiziz in https://github.com/WalletConnect/web3modal/pull/2783
+
+* Updated dependencies []:
+ - @web3modal/wagmi@5.1.6
+
+## 5.1.5
+
+### Patch Changes
+
+- - chore: add safety for localstorage by @zoruka in https://github.com/WalletConnect/web3modal/pull/2770
+ - fix: impossible to press on send placeholder input on mobile by @magiziz in https://github.com/WalletConnect/web3modal/pull/2771
+ - feat: solana sign all transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2772
+ - chore: change universal provider relay url and move to constants file by @zoruka in https://github.com/WalletConnect/web3modal/pull/2776
+ - chore: remove coinbase SDK de-duplication by @tomiir in https://github.com/WalletConnect/web3modal/pull/2768
+ - fix: add missing chainId param for transactions request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2779
+ - fix: remove coming message from solana transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2780
+
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.5
+
+## 5.1.4
+
+### Patch Changes
+
+- - Added entries on assetlinks for flutter wallet by @quetool in https://github.com/WalletConnect/web3modal/pull/2746
+ - chore: only upgrade ethers v6 by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2741
+ - chore: fix wagmi not disconnecting and add adapter tests by @magiziz in https://github.com/WalletConnect/web3modal/pull/2751
+ - Added more fingerprints to Flutter apps by @quetool in https://github.com/WalletConnect/web3modal/pull/2748
+ - fix: remove auth connector from ethers and check for socials length by @tomiir in https://github.com/WalletConnect/web3modal/pull/2715
+ - chore: make all socials enabled by default by @tomiir in https://github.com/WalletConnect/web3modal/pull/2747
+ - fix: social logins not working in laboratory by @magiziz in https://github.com/WalletConnect/web3modal/pull/2765
+ - chore: expose solana provider type by @zoruka in https://github.com/WalletConnect/web3modal/pull/2756
+ - fix: Connector image mismatch by @tomiir in https://github.com/WalletConnect/web3modal/pull/2745
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.4
+
## 5.1.3
### Patch Changes
diff --git a/apps/demo/package.json b/apps/demo/package.json
index f84b37fdb1..28dfc40637 100644
--- a/apps/demo/package.json
+++ b/apps/demo/package.json
@@ -1,6 +1,6 @@
{
"name": "@apps/demo",
- "version": "5.1.3",
+ "version": "5.1.8",
"private": true,
"scripts": {
"dev": "next dev",
@@ -20,8 +20,8 @@
"sonner": "1.4.3",
"tailwind-merge": "2.2.1",
"vaul": "0.9.0",
- "viem": "2.19.6",
- "wagmi": "2.12.5",
+ "viem": "2.21.4",
+ "wagmi": "2.12.9",
"zustand": "4.5.2"
},
"devDependencies": {
diff --git a/apps/gallery/CHANGELOG.md b/apps/gallery/CHANGELOG.md
index af2028e084..473cf942e7 100644
--- a/apps/gallery/CHANGELOG.md
+++ b/apps/gallery/CHANGELOG.md
@@ -1,5 +1,94 @@
# @apps/gallery
+## 5.1.8
+
+### Patch Changes
+
+- - chore: changed RN links to wildcards by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2839
+ - feat: solana send transaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2802
+ - Feat/solana onramp by @phoenixVS in https://github.com/WalletConnect/web3modal/pull/2525
+ - chore: update assetlinks.json by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2838
+ - Chore/add base sepolia by @tomiir in https://github.com/WalletConnect/web3modal/pull/2840
+ - fix: solana default chain logic by @zoruka in https://github.com/WalletConnect/web3modal/pull/2849
+- Updated dependencies []:
+ - @web3modal/common@5.1.8
+ - @web3modal/ui@5.1.8
+
+## 5.1.7
+
+### Patch Changes
+
+- - chore: version bump for 5.1.6 by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2797
+ - fix(deps): update walletconnect to v2.15.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2722
+ - chore: fix public URL by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2806
+ - fix: RPC requests causing modal to close by @tomiir in https://github.com/WalletConnect/web3modal/pull/2799
+ - chore: use apiVersion v2 on names endpoint by @tomiir in https://github.com/WalletConnect/web3modal/pull/2805
+ - fix: import valtio from vanilla path by @jd1378 in https://github.com/WalletConnect/web3modal/pull/2810
+ - chore: use shared gh token by @tomiir in https://github.com/WalletConnect/web3modal/pull/2809
+ - chore: add input secrets to setup workflow by @tomiir in https://github.com/WalletConnect/web3modal/pull/2822
+ - fix: remove deprecated params from sign transaction wc rpc request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2816
+ - chore: changed android and ios links for react native sample apps by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2825
+ - chore: changed order of links by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2826
+ - fix(siwe): fix undefined SIWE chainId by @Cali93 in https://github.com/WalletConnect/web3modal/pull/2820
+ - chore: update monorepo deps to 2.16.1 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2829
+ - fix: don't capitalize first character of email field on mobile by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2815
+ - chore(deps): update dependency ethers to v6.13.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2434
+ - chore(deps): update wagmi by @renovate in https://github.com/WalletConnect/web3modal/pull/2711
+- Updated dependencies []:
+ - @web3modal/common@5.1.7
+ - @web3modal/ui@5.1.7
+
+## 5.1.6
+
+### Patch Changes
+
+- fix: update CSP by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2775
+- fix: ethers5 adapter import in exports by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2754
+- fix/missing action functions exports from clients by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2778
+- fix: logics to set default chain by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2787
+- Implement actions using userOpBuilder service instead of permissionless.js by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2758
+- chore: run Playwright on self-hosted runners by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2788
+- chore: add NEXT_PUBLIC_SECURE_SITE_SDK_URL to CSP by @tomiir in https://github.com/WalletConnect/web3modal/pull/2791
+- chore: enable verify tests by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2774
+- fix: social login shows `undefined` by @magiziz in https://github.com/WalletConnect/web3modal/pull/2783
+
+* Updated dependencies []:
+ - @web3modal/common@5.1.6
+ - @web3modal/ui@5.1.6
+
+## 5.1.5
+
+### Patch Changes
+
+- - chore: add safety for localstorage by @zoruka in https://github.com/WalletConnect/web3modal/pull/2770
+ - fix: impossible to press on send placeholder input on mobile by @magiziz in https://github.com/WalletConnect/web3modal/pull/2771
+ - feat: solana sign all transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2772
+ - chore: change universal provider relay url and move to constants file by @zoruka in https://github.com/WalletConnect/web3modal/pull/2776
+ - chore: remove coinbase SDK de-duplication by @tomiir in https://github.com/WalletConnect/web3modal/pull/2768
+ - fix: add missing chainId param for transactions request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2779
+ - fix: remove coming message from solana transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2780
+
+- Updated dependencies []:
+ - @web3modal/common@5.1.5
+ - @web3modal/ui@5.1.5
+
+## 5.1.4
+
+### Patch Changes
+
+- - Added entries on assetlinks for flutter wallet by @quetool in https://github.com/WalletConnect/web3modal/pull/2746
+ - chore: only upgrade ethers v6 by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2741
+ - chore: fix wagmi not disconnecting and add adapter tests by @magiziz in https://github.com/WalletConnect/web3modal/pull/2751
+ - Added more fingerprints to Flutter apps by @quetool in https://github.com/WalletConnect/web3modal/pull/2748
+ - fix: remove auth connector from ethers and check for socials length by @tomiir in https://github.com/WalletConnect/web3modal/pull/2715
+ - chore: make all socials enabled by default by @tomiir in https://github.com/WalletConnect/web3modal/pull/2747
+ - fix: social logins not working in laboratory by @magiziz in https://github.com/WalletConnect/web3modal/pull/2765
+ - chore: expose solana provider type by @zoruka in https://github.com/WalletConnect/web3modal/pull/2756
+ - fix: Connector image mismatch by @tomiir in https://github.com/WalletConnect/web3modal/pull/2745
+- Updated dependencies []:
+ - @web3modal/common@5.1.4
+ - @web3modal/ui@5.1.4
+
## 5.1.3
### Patch Changes
diff --git a/apps/gallery/package.json b/apps/gallery/package.json
index 873f54876e..0d1e0a0d2a 100644
--- a/apps/gallery/package.json
+++ b/apps/gallery/package.json
@@ -1,6 +1,6 @@
{
"name": "@apps/gallery",
- "version": "5.1.3",
+ "version": "5.1.8",
"private": true,
"main": "index.js",
"scripts": {
diff --git a/apps/laboratory/CHANGELOG.md b/apps/laboratory/CHANGELOG.md
index 147e2c326a..010cdbaade 100644
--- a/apps/laboratory/CHANGELOG.md
+++ b/apps/laboratory/CHANGELOG.md
@@ -1,5 +1,119 @@
# @apps/laboratory
+## 5.1.8
+
+### Patch Changes
+
+- - chore: changed RN links to wildcards by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2839
+ - feat: solana send transaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2802
+ - Feat/solana onramp by @phoenixVS in https://github.com/WalletConnect/web3modal/pull/2525
+ - chore: update assetlinks.json by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2838
+ - Chore/add base sepolia by @tomiir in https://github.com/WalletConnect/web3modal/pull/2840
+ - fix: solana default chain logic by @zoruka in https://github.com/WalletConnect/web3modal/pull/2849
+- Updated dependencies []:
+ - @web3modal/base@5.1.8
+ - @web3modal/ethers@5.1.8
+ - @web3modal/ethers5@5.1.8
+ - @web3modal/siwe@5.1.8
+ - @web3modal/solana@5.1.8
+ - @web3modal/wagmi@5.1.8
+ - @web3modal/wallet@5.1.8
+
+## 5.1.7
+
+### Patch Changes
+
+- - chore: version bump for 5.1.6 by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2797
+ - fix(deps): update walletconnect to v2.15.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2722
+ - chore: fix public URL by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2806
+ - fix: RPC requests causing modal to close by @tomiir in https://github.com/WalletConnect/web3modal/pull/2799
+ - chore: use apiVersion v2 on names endpoint by @tomiir in https://github.com/WalletConnect/web3modal/pull/2805
+ - fix: import valtio from vanilla path by @jd1378 in https://github.com/WalletConnect/web3modal/pull/2810
+ - chore: use shared gh token by @tomiir in https://github.com/WalletConnect/web3modal/pull/2809
+ - chore: add input secrets to setup workflow by @tomiir in https://github.com/WalletConnect/web3modal/pull/2822
+ - fix: remove deprecated params from sign transaction wc rpc request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2816
+ - chore: changed android and ios links for react native sample apps by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2825
+ - chore: changed order of links by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2826
+ - fix(siwe): fix undefined SIWE chainId by @Cali93 in https://github.com/WalletConnect/web3modal/pull/2820
+ - chore: update monorepo deps to 2.16.1 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2829
+ - fix: don't capitalize first character of email field on mobile by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2815
+ - chore(deps): update dependency ethers to v6.13.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2434
+ - chore(deps): update wagmi by @renovate in https://github.com/WalletConnect/web3modal/pull/2711
+- Updated dependencies []:
+ - @web3modal/base@5.1.7
+ - @web3modal/ethers@5.1.7
+ - @web3modal/ethers5@5.1.7
+ - @web3modal/siwe@5.1.7
+ - @web3modal/solana@5.1.7
+ - @web3modal/wagmi@5.1.7
+ - @web3modal/wallet@5.1.7
+
+## 5.1.6
+
+### Patch Changes
+
+- fix: update CSP by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2775
+- fix: ethers5 adapter import in exports by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2754
+- fix/missing action functions exports from clients by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2778
+- fix: logics to set default chain by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2787
+- Implement actions using userOpBuilder service instead of permissionless.js by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2758
+- chore: run Playwright on self-hosted runners by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2788
+- chore: add NEXT_PUBLIC_SECURE_SITE_SDK_URL to CSP by @tomiir in https://github.com/WalletConnect/web3modal/pull/2791
+- chore: enable verify tests by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2774
+- fix: social login shows `undefined` by @magiziz in https://github.com/WalletConnect/web3modal/pull/2783
+
+* Updated dependencies []:
+ - @web3modal/base@5.1.6
+ - @web3modal/ethers@5.1.6
+ - @web3modal/ethers5@5.1.6
+ - @web3modal/siwe@5.1.6
+ - @web3modal/solana@5.1.6
+ - @web3modal/wagmi@5.1.6
+ - @web3modal/wallet@5.1.6
+
+## 5.1.5
+
+### Patch Changes
+
+- - chore: add safety for localstorage by @zoruka in https://github.com/WalletConnect/web3modal/pull/2770
+ - fix: impossible to press on send placeholder input on mobile by @magiziz in https://github.com/WalletConnect/web3modal/pull/2771
+ - feat: solana sign all transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2772
+ - chore: change universal provider relay url and move to constants file by @zoruka in https://github.com/WalletConnect/web3modal/pull/2776
+ - chore: remove coinbase SDK de-duplication by @tomiir in https://github.com/WalletConnect/web3modal/pull/2768
+ - fix: add missing chainId param for transactions request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2779
+ - fix: remove coming message from solana transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2780
+
+- Updated dependencies []:
+ - @web3modal/base@5.1.5
+ - @web3modal/ethers@5.1.5
+ - @web3modal/ethers5@5.1.5
+ - @web3modal/siwe@5.1.5
+ - @web3modal/solana@5.1.5
+ - @web3modal/wagmi@5.1.5
+ - @web3modal/wallet@5.1.5
+
+## 5.1.4
+
+### Patch Changes
+
+- - Added entries on assetlinks for flutter wallet by @quetool in https://github.com/WalletConnect/web3modal/pull/2746
+ - chore: only upgrade ethers v6 by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2741
+ - chore: fix wagmi not disconnecting and add adapter tests by @magiziz in https://github.com/WalletConnect/web3modal/pull/2751
+ - Added more fingerprints to Flutter apps by @quetool in https://github.com/WalletConnect/web3modal/pull/2748
+ - fix: remove auth connector from ethers and check for socials length by @tomiir in https://github.com/WalletConnect/web3modal/pull/2715
+ - chore: make all socials enabled by default by @tomiir in https://github.com/WalletConnect/web3modal/pull/2747
+ - fix: social logins not working in laboratory by @magiziz in https://github.com/WalletConnect/web3modal/pull/2765
+ - chore: expose solana provider type by @zoruka in https://github.com/WalletConnect/web3modal/pull/2756
+ - fix: Connector image mismatch by @tomiir in https://github.com/WalletConnect/web3modal/pull/2745
+- Updated dependencies []:
+ - @web3modal/base@5.1.4
+ - @web3modal/ethers@5.1.4
+ - @web3modal/ethers5@5.1.4
+ - @web3modal/siwe@5.1.4
+ - @web3modal/solana@5.1.4
+ - @web3modal/wagmi@5.1.4
+ - @web3modal/wallet@5.1.4
+
## 5.1.3
### Patch Changes
diff --git a/apps/laboratory/next.config.mjs b/apps/laboratory/next.config.mjs
index 306fb5045b..81435953fb 100644
--- a/apps/laboratory/next.config.mjs
+++ b/apps/laboratory/next.config.mjs
@@ -1,13 +1,20 @@
/** @type {import('next').NextConfig} */
-// Keep in-sync with https://docs.walletconnect.com/advanced/security/content-security-policy
+const SHAKRA_UI = `'sha256-e7MRMmTzLsLQvIy1iizO1lXf7VWYoQ6ysj5fuUzvRwE='`
+/*
+ * Keep in-sync with https://docs.walletconnect.com/advanced/security/content-security-policy
+ * DO NOT use `unsafe-inline` or `unsafe-eval` for `script-src` or `default-src` in production as this
+ * is against CSP best practices
+ */
const cspHeader = `
default-src 'self';
- script-src 'self' 'unsafe-inline' ${process.env.NODE_ENV === 'production' ? '' : "'unsafe-eval'"};
+ script-src 'self' ${SHAKRA_UI} ${process.env.NODE_ENV === 'production' ? '' : "'unsafe-eval'"};
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
- img-src 'self' data: blob: https://walletconnect.org https://walletconnect.com https://secure.walletconnect.com https://secure.walletconnect.org https://tokens-data.1inch.io https://tokens.1inch.io https://ipfs.io https://lab.web3modal.com;
+ img-src * 'self' data: blob: https://walletconnect.org https://walletconnect.com https://secure.walletconnect.com https://secure.walletconnect.org https://tokens-data.1inch.io https://tokens.1inch.io https://ipfs.io https://lab.web3modal.com;
font-src 'self' https://fonts.gstatic.com;
- connect-src 'self' https://rpc.walletconnect.com https://rpc.walletconnect.org https://explorer.walletconnect.com https://explorer.walletconnect.org https://relay.walletconnect.com https://relay.walletconnect.org wss://relay.walletconnect.com wss://relay.walletconnect.org https://pulse.walletconnect.com https://pulse.walletconnect.org https://api.web3modal.com https://api.web3modal.org wss://www.walletlink.org https://o1095249.ingest.sentry.io;
- frame-src 'self' https://verify.walletconnect.com https://verify.walletconnect.org https://secure.walletconnect.com https://secure.walletconnect.org;
+ connect-src 'self' https://react-wallet.walletconnect.com https://rpc.walletconnect.com https://rpc.walletconnect.org https://relay.walletconnect.com https://relay.walletconnect.org wss://relay.walletconnect.com wss://relay.walletconnect.org https://pulse.walletconnect.com https://pulse.walletconnect.org https://api.web3modal.com https://api.web3modal.org wss://www.walletlink.org https://o1095249.ingest.sentry.io https://quote-api.jup.ag;
+ frame-src 'self' https://verify.walletconnect.com https://verify.walletconnect.org https://secure.walletconnect.com https://secure.walletconnect.org ${
+ process.env.NEXT_PUBLIC_SECURE_SITE_SDK_URL || ''
+ };
object-src 'none';
base-uri 'self';
form-action 'self';
@@ -39,7 +46,7 @@ const nextConfig = {
source: '/:path*',
headers: [
{
- key: 'Content-Security-Policy-Report-Only',
+ key: 'Content-Security-Policy',
value: cspHeader.replace(/\n/g, ' ').trim()
},
{
diff --git a/apps/laboratory/package.json b/apps/laboratory/package.json
index f6fab7a3b8..71fefb97bb 100644
--- a/apps/laboratory/package.json
+++ b/apps/laboratory/package.json
@@ -1,7 +1,7 @@
{
"name": "@apps/laboratory",
"type": "module",
- "version": "5.1.3",
+ "version": "5.1.8",
"private": true,
"scripts": {
"dev": "next dev",
@@ -15,6 +15,8 @@
"playwright:test:metamask": "playwright test --grep 'metamask.spec.ts'",
"playwright:test:basic": "playwright test --grep 'basic-tests.spec.ts'",
"playwright:test:wallet": "playwright test --grep 'wallet.spec.ts'",
+ "playwright:test:no-email": "playwright test --grep 'no-email.spec.ts'",
+ "playwright:test:no-socials": "playwright test --grep 'no-socials.spec.ts'",
"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",
@@ -27,6 +29,8 @@
"playwright:debug:metamask": "pnpm playwright:test:metamask --debug",
"playwright:debug:basic": "pnpm playwright:test:basic --debug",
"playwright:debug:wallet": "pnpm playwright:test:wallet --debug",
+ "playwright:debug:no-email": "pnpm playwright:test:no-email --debug",
+ "playwright:debug:no-socials": "pnpm playwright:test:no-socials --debug",
"playwright:debug:email": "pnpm playwright:test:email --debug",
"playwright:debug:siwe": "pnpm playwright:test:siwe --debug",
"playwright:debug:siwe-email": "pnpm playwright:test:siwe-email --debug",
@@ -46,10 +50,10 @@
"@solana/wallet-adapter-wallets": "0.19.32",
"@solana/web3.js": "1.95.2",
"@tanstack/react-query": "5.24.8",
- "@wagmi/connectors": "5.1.5",
+ "@wagmi/connectors": "5.1.9",
"@wagmi/core": "2.13.4",
- "@walletconnect/ethereum-provider": "2.15.1",
- "@walletconnect/utils": "2.15.1",
+ "@walletconnect/ethereum-provider": "2.16.1",
+ "@walletconnect/utils": "2.16.1",
"@web3modal/base": "workspace:*",
"@web3modal/ethers": "workspace:*",
"@web3modal/ethers5": "workspace:*",
@@ -59,19 +63,18 @@
"@web3modal/wallet": "workspace:*",
"axios": "1.7.2",
"bs58": "6.0.0",
- "ethers": "6.13.0",
+ "ethers": "6.13.2",
"ethers5": "npm:ethers@5.7.2",
"framer-motion": "10.17.9",
"next": "14.2.3",
"next-auth": "4.24.5",
- "permissionless": "0.1.31",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-icons": "4.12.0",
"rpc-websockets": "7.11.0",
"valtio": "1.11.2",
- "viem": "2.19.6",
- "wagmi": "2.12.5",
+ "viem": "2.21.4",
+ "wagmi": "2.12.9",
"webauthn-p256": "0.0.2"
},
"devDependencies": {
diff --git a/apps/laboratory/public/.well-known/apple-app-site-association b/apps/laboratory/public/.well-known/apple-app-site-association
index 2205860cfb..478d30bca6 100644
--- a/apps/laboratory/public/.well-known/apple-app-site-association
+++ b/apps/laboratory/public/.well-known/apple-app-site-association
@@ -21,27 +21,27 @@
]
},
{
- "appID": "W5R8AG9K22.com.walletconnect.web3modal.rnsample",
+ "appID": "W5R8AG9K22.com.walletconnect.web3modal.rnsample.internal",
"paths": [
- "/rn_appkit*"
+ "/rn_appkit_internal/*"
]
},
{
- "appID": "W5R8AG9K22.com.walletconnect.web3modal.rnsample.internal",
+ "appID": "W5R8AG9K22.com.walletconnect.web3modal.rnsample",
"paths": [
- "/rn_appkit*"
+ "/rn_appkit/*"
]
},
{
- "appID": "W5R8AG9K22.com.walletconnect.web3wallet.rnsample",
+ "appID": "W5R8AG9K22.com.walletconnect.web3wallet.rnsample.internal",
"paths": [
- "/rn_walletkit*"
+ "/rn_walletkit_internal/*"
]
},
{
- "appID": "W5R8AG9K22.com.walletconnect.web3wallet.rnsample.internal",
+ "appID": "W5R8AG9K22.com.walletconnect.web3wallet.rnsample",
"paths": [
- "/rn_walletkit*"
+ "/rn_walletkit/*"
]
},
{
diff --git a/apps/laboratory/public/.well-known/assetlinks.json b/apps/laboratory/public/.well-known/assetlinks.json
index 581907bb14..b823385c0b 100644
--- a/apps/laboratory/public/.well-known/assetlinks.json
+++ b/apps/laboratory/public/.well-known/assetlinks.json
@@ -109,6 +109,16 @@
]
}
},
+ {
+ "relation": ["delegate_permission/common.handle_all_urls"],
+ "target": {
+ "namespace": "android_app",
+ "package_name": "com.walletconnect.web3wallet.rnsample.debug",
+ "sha256_cert_fingerprints": [
+ "3D:87:31:1C:66:8B:A0:CB:F9:F1:D5:28:3B:DF:2E:4F:CB:19:EA:AB:B4:B7:CE:C4:D9:E1:E0:6D:32:FB:C6:56"
+ ]
+ }
+ },
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
@@ -129,6 +139,16 @@
]
}
},
+ {
+ "relation": ["delegate_permission/common.handle_all_urls"],
+ "target": {
+ "namespace": "android_app",
+ "package_name": "com.walletconnect.web3modal.rnsample.debug",
+ "sha256_cert_fingerprints": [
+ "3D:87:31:1C:66:8B:A0:CB:F9:F1:D5:28:3B:DF:2E:4F:CB:19:EA:AB:B4:B7:CE:C4:D9:E1:E0:6D:32:FB:C6:56"
+ ]
+ }
+ },
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
@@ -145,7 +165,7 @@
"namespace": "android_app",
"package_name": "com.walletconnect.flutterdapp.internal",
"sha256_cert_fingerprints": [
- "AF:8B:CA:2C:90:FD:E7:18:AF:CA:67:ED:BA:6D:28:D5:08:B3:66:18:3A:D9:40:8C:B7:53:3D:25:E4:41:EB:29"
+ "89:50:0B:F7:C3:14:A5:D7:20:33:54:37:96:88:82:67:CB:E5:48:52:47:5B:81:F7:38:63:48:67:6D:BF:CA:1D"
]
}
},
@@ -165,7 +185,97 @@
"namespace": "android_app",
"package_name": "com.walletconnect.flutterwallet.internal",
"sha256_cert_fingerprints": [
- "AF:8B:CA:2C:90:FD:E7:18:AF:CA:67:ED:BA:6D:28:D5:08:B3:66:18:3A:D9:40:8C:B7:53:3D:25:E4:41:EB:29"
+ "89:50:0B:F7:C3:14:A5:D7:20:33:54:37:96:88:82:67:CB:E5:48:52:47:5B:81:F7:38:63:48:67:6D:BF:CA:1D"
+ ]
+ }
+ },
+ {
+ "relation": ["delegate_permission/common.handle_all_urls"],
+ "target": {
+ "namespace": "android_app",
+ "package_name": "com.reown.sample.wallet.debug",
+ "sha256_cert_fingerprints": [
+ "7C:C6:21:5C:4A:8A:DB:D1:D5:56:D3:59:5C:DD:17:39:6C:05:E8:AF:B4:01:E0:58:DF:F0:10:44:4E:A3:AD:80"
+ ]
+ }
+ },
+ {
+ "relation": ["delegate_permission/common.handle_all_urls"],
+ "target": {
+ "namespace": "android_app",
+ "package_name": "com.reown.sample.dapp.debug",
+ "sha256_cert_fingerprints": [
+ "7C:C6:21:5C:4A:8A:DB:D1:D5:56:D3:59:5C:DD:17:39:6C:05:E8:AF:B4:01:E0:58:DF:F0:10:44:4E:A3:AD:80"
+ ]
+ }
+ },
+ {
+ "relation": ["delegate_permission/common.handle_all_urls"],
+ "target": {
+ "namespace": "android_app",
+ "package_name": "com.reown.sample.modal.debug",
+ "sha256_cert_fingerprints": [
+ "7C:C6:21:5C:4A:8A:DB:D1:D5:56:D3:59:5C:DD:17:39:6C:05:E8:AF:B4:01:E0:58:DF:F0:10:44:4E:A3:AD:80"
+ ]
+ }
+ },
+ {
+ "relation": ["delegate_permission/common.handle_all_urls"],
+ "target": {
+ "namespace": "android_app",
+ "package_name": "com.reown.sample.wallet.internal",
+ "sha256_cert_fingerprints": [
+ "32:B1:53:5A:18:86:9B:4E:AD:A2:B2:B5:2E:7B:BB:FB:4B:39:2F:B1:02:0A:4D:D7:17:1A:F7:C6:F6:04:EB:1B"
+ ]
+ }
+ },
+ {
+ "relation": ["delegate_permission/common.handle_all_urls"],
+ "target": {
+ "namespace": "android_app",
+ "package_name": "com.reown.sample.dapp.internal",
+ "sha256_cert_fingerprints": [
+ "32:B1:53:5A:18:86:9B:4E:AD:A2:B2:B5:2E:7B:BB:FB:4B:39:2F:B1:02:0A:4D:D7:17:1A:F7:C6:F6:04:EB:1B"
+ ]
+ }
+ },
+ {
+ "relation": ["delegate_permission/common.handle_all_urls"],
+ "target": {
+ "namespace": "android_app",
+ "package_name": "com.reown.sample.modal.internal",
+ "sha256_cert_fingerprints": [
+ "32:B1:53:5A:18:86:9B:4E:AD:A2:B2:B5:2E:7B:BB:FB:4B:39:2F:B1:02:0A:4D:D7:17:1A:F7:C6:F6:04:EB:1B"
+ ]
+ }
+ },
+ {
+ "relation": ["delegate_permission/common.handle_all_urls"],
+ "target": {
+ "namespace": "android_app",
+ "package_name": "com.reown.sample.wallet",
+ "sha256_cert_fingerprints": [
+ "9D:62:1A:04:A7:E9:28:5A:D2:4D:AA:11:74:E5:FB:6A:50:AC:B7:8B:1F:95:5B:90:9B:91:43:C2:5E:0A:27:D0"
+ ]
+ }
+ },
+ {
+ "relation": ["delegate_permission/common.handle_all_urls"],
+ "target": {
+ "namespace": "android_app",
+ "package_name": "com.reown.sample.dapp",
+ "sha256_cert_fingerprints": [
+ "9D:62:1A:04:A7:E9:28:5A:D2:4D:AA:11:74:E5:FB:6A:50:AC:B7:8B:1F:95:5B:90:9B:91:43:C2:5E:0A:27:D0"
+ ]
+ }
+ },
+ {
+ "relation": ["delegate_permission/common.handle_all_urls"],
+ "target": {
+ "namespace": "android_app",
+ "package_name": "com.reown.sample.modal",
+ "sha256_cert_fingerprints": [
+ "9D:62:1A:04:A7:E9:28:5A:D2:4D:AA:11:74:E5:FB:6A:50:AC:B7:8B:1F:95:5B:90:9B:91:43:C2:5E:0A:27:D0"
]
}
}
diff --git a/apps/laboratory/src/components/AppKitButtons.tsx b/apps/laboratory/src/components/AppKitButtons.tsx
index eaa440aedb..e3acf27b44 100644
--- a/apps/laboratory/src/components/AppKitButtons.tsx
+++ b/apps/laboratory/src/components/AppKitButtons.tsx
@@ -58,7 +58,7 @@ export function AppKitButtons() {
Hooks Interactions
-
-
-
-
- Solana Faucet
-
-
)
}
diff --git a/apps/laboratory/src/components/Solana/SolanaTests.tsx b/apps/laboratory/src/components/Solana/SolanaTests.tsx
index b940c1d24b..844a6e12c9 100644
--- a/apps/laboratory/src/components/Solana/SolanaTests.tsx
+++ b/apps/laboratory/src/components/Solana/SolanaTests.tsx
@@ -17,6 +17,8 @@ import { SolanaSignMessageTest } from './SolanaSignMessageTest'
import { SolanaWriteContractTest } from './SolanaWriteContractTest'
import { solana, solanaDevnet, solanaTestnet } from '../../utils/ChainsUtil'
import { SolanaSignAndSendTransaction } from './SolanaSignAndSendTransactionTest'
+import { SolanaSignAllTransactionsTest } from './SolanaSignAllTransactionsTest'
+import { SolanaSignJupiterSwapTest } from './SolanaSignJupiterSwapTest'
export function SolanaTests() {
const { isConnected, currentChain } = useWeb3ModalAccount()
@@ -48,6 +50,18 @@ export function SolanaTests() {
+
+
+ Sign All Transactions
+
+
+ ℹ️
+
+
+
+
+
+
Sign and Send Transaction (Dapp)
@@ -70,6 +84,19 @@ export function SolanaTests() {
+
+
+
+ Sign Jupiter Swap Transaction
+
+
+ ℹ️
+
+
+
+
+
+
{(currentChain?.chainId === solanaTestnet.chainId ||
currentChain?.chainId === solanaDevnet.chainId) && (
} spacing="4">
diff --git a/apps/laboratory/src/components/Wagmi/WagmiCreatePasskeySignerTest.tsx b/apps/laboratory/src/components/Wagmi/WagmiCreatePasskeySignerTest.tsx
index 2927920823..9f6e64ec6d 100644
--- a/apps/laboratory/src/components/Wagmi/WagmiCreatePasskeySignerTest.tsx
+++ b/apps/laboratory/src/components/Wagmi/WagmiCreatePasskeySignerTest.tsx
@@ -2,12 +2,12 @@ import { useEffect } from 'react'
import { Button, Stack } from '@chakra-ui/react'
import { privateKeyToAccount } from 'viem/accounts'
import { useChakraToast } from '../Toast'
-import { LOCAL_SIGNER_KEY, getItem } from '../../utils/LocalStorage'
+import { LOCAL_SIGNER_KEY, getLocalStorageItem } from '../../utils/LocalStorage'
import { createCredential } from 'webauthn-p256'
-import { useWagmiPermissionsSync } from '../../context/WagmiPermissionsSyncContext'
+import { usePasskey } from '../../context/PasskeyContext'
export function WagmiCreatePasskeySignerTest() {
- const { isPasskeyAvailable, setPasskey, passkeyId } = useWagmiPermissionsSync()
+ const { isPasskeyAvailable, setPasskey, passkeyId } = usePasskey()
const toast = useChakraToast()
async function handleCreatePasskey() {
@@ -31,7 +31,7 @@ export function WagmiCreatePasskeySignerTest() {
}
useEffect(() => {
- const storedLocalSignerPrivateKey = getItem(LOCAL_SIGNER_KEY)
+ const storedLocalSignerPrivateKey = getLocalStorageItem(LOCAL_SIGNER_KEY)
if (storedLocalSignerPrivateKey) {
privateKeyToAccount(storedLocalSignerPrivateKey as `0x${string}`)
}
diff --git a/apps/laboratory/src/components/Wagmi/WagmiPurchaseDonutAsyncPermissionsTest.tsx b/apps/laboratory/src/components/Wagmi/WagmiPurchaseDonutAsyncPermissionsTest.tsx
index 3b7ff7dd20..fb26dc97f0 100644
--- a/apps/laboratory/src/components/Wagmi/WagmiPurchaseDonutAsyncPermissionsTest.tsx
+++ b/apps/laboratory/src/components/Wagmi/WagmiPurchaseDonutAsyncPermissionsTest.tsx
@@ -5,17 +5,14 @@ import { useChakraToast } from '../Toast'
import { encodeFunctionData, parseEther } from 'viem'
import { abi as donutContractAbi, address as donutContractaddress } from '../../utils/DonutContract'
import { sepolia } from 'viem/chains'
-import { useWagmiPermissionsAsync } from '../../context/WagmiPermissionsAsyncContext'
-import { useERC7715PermissionsAsync } from '../../hooks/useERC7715PermissionsAsync'
+import { useLocalEcdsaKey } from '../../context/LocalEcdsaKeyContext'
+import { useERC7715Permissions } from '../../hooks/useERC7715Permissions'
+import { executeActionsWithECDSAAndCosignerPermissions } from '../../utils/ERC7715Utils'
export function WagmiPurchaseDonutAsyncPermissionsTest() {
- const { grantedPermissions, wcCosignerData, privateKey, projectId } = useWagmiPermissionsAsync()
+ const { privateKey } = useLocalEcdsaKey()
- const { executeActionsWithECDSAAndCosignerPermissions } = useERC7715PermissionsAsync({
- chain: sepolia,
- permissions: grantedPermissions,
- projectId
- })
+ const { grantedPermissions, pci } = useERC7715Permissions()
const {
data: donutsOwned,
@@ -35,13 +32,15 @@ export function WagmiPurchaseDonutAsyncPermissionsTest() {
async function onPurchaseDonutWithPermissions() {
setTransactionPending(true)
try {
- if (!wcCosignerData) {
- throw Error('No wc-cosigner data available')
- }
-
if (!privateKey) {
throw new Error(`Unable to get dApp private key`)
}
+ if (!grantedPermissions) {
+ throw Error('No permissions available')
+ }
+ if (!pci) {
+ throw Error('No WC cosigner data(PCI) available')
+ }
const purchaseDonutCallData = encodeFunctionData({
abi: donutContractAbi,
functionName: 'purchase',
@@ -49,26 +48,27 @@ export function WagmiPurchaseDonutAsyncPermissionsTest() {
})
const purchaseDonutCallDataExecution = [
{
- target: donutContractaddress as `0x${string}`,
+ to: donutContractaddress as `0x${string}`,
value: parseEther('0.0001'),
- callData: purchaseDonutCallData
+ data: purchaseDonutCallData
}
]
const txHash = await executeActionsWithECDSAAndCosignerPermissions({
actions: purchaseDonutCallDataExecution,
chain: sepolia,
- ecdsaPrivateKey: privateKey as `0x${string}`
+ ecdsaPrivateKey: privateKey as `0x${string}`,
+ permissions: grantedPermissions,
+ pci
})
if (txHash) {
toast({
- title: 'Transaction success',
- description: txHash,
+ title: 'UserOp submitted successfully',
+ description: `UserOp Hash: ${txHash}`,
type: 'success'
})
await fetchDonutsOwned()
}
} catch (error) {
- // Console.log(error)
toast({
title: 'Transaction Failed',
description: `${error}`,
diff --git a/apps/laboratory/src/components/Wagmi/WagmiPurchaseDonutSyncPermissionsTest.tsx b/apps/laboratory/src/components/Wagmi/WagmiPurchaseDonutSyncPermissionsTest.tsx
index d97f8f6d60..5ec66a05e0 100644
--- a/apps/laboratory/src/components/Wagmi/WagmiPurchaseDonutSyncPermissionsTest.tsx
+++ b/apps/laboratory/src/components/Wagmi/WagmiPurchaseDonutSyncPermissionsTest.tsx
@@ -4,17 +4,14 @@ import { useState } from 'react'
import { useChakraToast } from '../Toast'
import { encodeFunctionData, parseEther } from 'viem'
import { abi as donutContractAbi, address as donutContractaddress } from '../../utils/DonutContract'
-import { useERC7715PermissionsSync } from '../../hooks/useERC7715PermissionsSync'
-import { useWagmiPermissionsSync } from '../../context/WagmiPermissionsSyncContext'
+import { useERC7715Permissions } from '../../hooks/useERC7715Permissions'
+import { usePasskey } from '../../context/PasskeyContext'
import { sepolia } from 'viem/chains'
+import { executeActionsWithPasskeyAndCosignerPermissions } from '../../utils/ERC7715Utils'
export function WagmiPurchaseDonutSyncPermissionsTest() {
- const { grantedPermissions, wcCosignerData, passkeyId, projectId } = useWagmiPermissionsSync()
- const { executeActionsWithPasskeyAndCosignerPermissions } = useERC7715PermissionsSync({
- chain: sepolia,
- permissions: grantedPermissions,
- projectId
- })
+ const { passkeyId } = usePasskey()
+ const { grantedPermissions, pci } = useERC7715Permissions()
const {
data: donutsOwned,
@@ -37,8 +34,8 @@ export function WagmiPurchaseDonutSyncPermissionsTest() {
if (!grantedPermissions) {
throw Error('No permissions available')
}
- if (!wcCosignerData) {
- throw Error('No wc-cosigner data available')
+ if (!pci) {
+ throw Error('No WC cosigner data(PCI) available')
}
const purchaseDonutCallData = encodeFunctionData({
@@ -48,20 +45,22 @@ export function WagmiPurchaseDonutSyncPermissionsTest() {
})
const purchaseDonutCallDataExecution = [
{
- target: donutContractaddress as `0x${string}`,
+ to: donutContractaddress as `0x${string}`,
value: parseEther('0.0001'),
- callData: purchaseDonutCallData
+ data: purchaseDonutCallData
}
]
const txHash = await executeActionsWithPasskeyAndCosignerPermissions({
actions: purchaseDonutCallDataExecution,
+ chain: sepolia,
passkeyId,
- wcCosignerData
+ permissions: grantedPermissions,
+ pci
})
if (txHash) {
toast({
- title: 'Transaction success',
- description: txHash,
+ title: 'UserOp submitted successfully',
+ description: `UserOp Hash: ${txHash}`,
type: 'success'
})
await fetchDonutsOwned()
diff --git a/apps/laboratory/src/components/Wagmi/WagmiRequestPermissionsAsyncTest.tsx b/apps/laboratory/src/components/Wagmi/WagmiRequestPermissionsAsyncTest.tsx
index 2eb7919111..12db6bf0cb 100644
--- a/apps/laboratory/src/components/Wagmi/WagmiRequestPermissionsAsyncTest.tsx
+++ b/apps/laboratory/src/components/Wagmi/WagmiRequestPermissionsAsyncTest.tsx
@@ -3,134 +3,102 @@ import { useAccount } from 'wagmi'
import { walletActionsErc7715 } from 'viem/experimental'
import { useCallback, useState } from 'react'
import { useChakraToast } from '../Toast'
-import { createPublicClient, custom } from 'viem'
+import { createWalletClient, custom, type Address, type Chain } from 'viem'
import { EIP_7715_RPC_METHODS } from '../../utils/EIP5792Utils'
-import { useWalletConnectCosigner } from '../../hooks/useWalletConnectCosigner'
-import { useWagmiAvailableCapabilities } from '../../hooks/useWagmiActiveCapabilities'
-import { useWagmiPermissionsAsync } from '../../context/WagmiPermissionsAsyncContext'
import {
- decodeUncompressedPublicKey,
- encodePublicKeyToDID,
- hexStringToBase64
-} from '../../utils/EncodingUtils'
+ useWagmiAvailableCapabilities,
+ type Provider
+} from '../../hooks/useWagmiActiveCapabilities'
+import { useLocalEcdsaKey } from '../../context/LocalEcdsaKeyContext'
import { bigIntReplacer } from '../../utils/CommonUtils'
-import { getSampleAsyncPermissions } from '../../utils/ERC7715Utils'
+import { useERC7715Permissions } from '../../hooks/useERC7715Permissions'
+import { getPurchaseDonutPermissions } from '../../utils/ERC7715Utils'
+import { KeyTypes } from '../../utils/EncodingUtils'
export function WagmiRequestPermissionsAsyncTest() {
const { provider, supported } = useWagmiAvailableCapabilities({
method: EIP_7715_RPC_METHODS.WALLET_GRANT_PERMISSIONS
})
const { chain, address, isConnected } = useAccount()
- const caip10Address = `eip155:${chain?.id}:${address}`
- const {
- projectId,
- signer,
- grantedPermissions,
- clearGrantedPermissions,
- setGrantedPermissions,
- setWCCosignerData
- } = useWagmiPermissionsAsync()
+ if (!isConnected || !provider || !address || !chain) {
+ return (
+
+ Wallet not connected
+
+ )
+ }
+ if (!supported) {
+ return (
+
+ Wallet does not support wallet_grantPermissions rpc method
+
+ )
+ }
+
+ return
+}
+
+function ConnectedTestContent({
+ chain,
+ provider,
+ address
+}: {
+ chain: Chain
+ provider: Provider
+ address: Address
+}) {
+ const { grantedPermissions, clearGrantedPermissions, grantPermissions } = useERC7715Permissions()
+ const { signer } = useLocalEcdsaKey()
const [isRequestPermissionLoading, setRequestPermissionLoading] = useState(false)
- const { addPermission, updatePermissionsContext } = useWalletConnectCosigner(
- caip10Address,
- projectId
- )
const toast = useChakraToast()
const onRequestPermissions = useCallback(async () => {
setRequestPermissionLoading(true)
-
- if (!signer) {
- throw new Error('PrivateKey signer not available')
- }
- if (!provider) {
- throw new Error('No Provider available, Please connect your wallet.')
- }
try {
- const addPermissionResponse = await addPermission({
- permissionType: 'donut-purchase',
- data: '',
- onChainValidated: false,
- required: true
- })
- setWCCosignerData(addPermissionResponse)
- const cosignerPublicKey = decodeUncompressedPublicKey(addPermissionResponse.key)
-
- const dAppECDSAPublicKey = signer.publicKey
- const dAppSecp256k1DID = encodePublicKeyToDID(dAppECDSAPublicKey, 'secp256k1')
- const coSignerSecp256k1DID = encodePublicKeyToDID(cosignerPublicKey, 'secp256k1')
+ if (!signer) {
+ throw new Error('PrivateKey signer not available')
+ }
+ if (!provider) {
+ throw new Error('No Provider available, Please connect your wallet.')
+ }
- const publicClient = createPublicClient({
+ const walletClient = createWalletClient({
+ account: address,
chain,
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
transport: custom(provider)
}).extend(walletActionsErc7715())
- const samplePermissions = getSampleAsyncPermissions([coSignerSecp256k1DID, dAppSecp256k1DID])
- const approvedPermissions = await publicClient.grantPermissions(samplePermissions)
- if (approvedPermissions) {
- await updatePermissionsContext({
- pci: addPermissionResponse.pci,
- context: {
- expiry: approvedPermissions.expiry,
- signer: {
- type: 'donut-purchase',
- data: {
- ids: [addPermissionResponse.key, hexStringToBase64(dAppECDSAPublicKey)]
- }
- },
- signerData: {
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
- userOpBuilder: approvedPermissions.signerData?.userOpBuilder!
- },
- permissionsContext: approvedPermissions.permissionsContext,
- factory: approvedPermissions.factory || '',
- factoryData: approvedPermissions.factoryData || ''
- }
- })
- setGrantedPermissions(approvedPermissions)
- setRequestPermissionLoading(false)
- toast({
- type: 'success',
- title: 'Permissions Granted',
- description: JSON.stringify(approvedPermissions, bigIntReplacer)
- })
- return
- }
- toast({ title: 'Error', description: 'Failed to obtain permissions' })
+ const purchaseDonutPermissions = getPurchaseDonutPermissions()
+ const response = await grantPermissions(walletClient, {
+ permissions: purchaseDonutPermissions,
+ signerKey: {
+ key: signer.publicKey,
+ type: KeyTypes.secp256k1
+ }
+ })
+ toast({
+ type: 'success',
+ title: 'Permissions Granted',
+ description: JSON.stringify(response.approvedPermissions, bigIntReplacer)
+ })
} catch (error) {
toast({
type: 'error',
- title: 'Permissions Erros',
- description: error instanceof Error ? error.message : 'Some error occurred'
+ title: 'Request Permissions Errors',
+ description: error instanceof Error ? error.message : 'Unknown Error'
})
+ } finally {
+ setRequestPermissionLoading(false)
}
- setRequestPermissionLoading(false)
- }, [signer, provider])
- if (!isConnected || !provider || !address) {
- return (
-
- Wallet not connected
-
- )
- }
- if (!supported) {
- return (
-
- Wallet does not support wallet_grantPermissions rpc method
-
- )
- }
+ }, [signer, provider, address, chain, grantPermissions, toast])
return (
Request Permissions
diff --git a/apps/laboratory/src/components/Wagmi/WagmiRequestPermissionsSyncTest.tsx b/apps/laboratory/src/components/Wagmi/WagmiRequestPermissionsSyncTest.tsx
index 994461f080..734c4b6e1a 100644
--- a/apps/laboratory/src/components/Wagmi/WagmiRequestPermissionsSyncTest.tsx
+++ b/apps/laboratory/src/components/Wagmi/WagmiRequestPermissionsSyncTest.tsx
@@ -3,145 +3,112 @@ import { useAccount } from 'wagmi'
import { walletActionsErc7715 } from 'viem/experimental'
import { useCallback, useState } from 'react'
import { useChakraToast } from '../Toast'
-import { createPublicClient, custom } from 'viem'
+import { createWalletClient, custom, type Address, type Chain } from 'viem'
import { EIP_7715_RPC_METHODS } from '../../utils/EIP5792Utils'
+import { usePasskey } from '../../context/PasskeyContext'
+import {
+ useWagmiAvailableCapabilities,
+ type Provider
+} from '../../hooks/useWagmiActiveCapabilities'
+import { useERC7715Permissions } from '../../hooks/useERC7715Permissions'
import { bigIntReplacer } from '../../utils/CommonUtils'
-import { useWagmiPermissionsSync } from '../../context/WagmiPermissionsSyncContext'
+import { getPurchaseDonutPermissions } from '../../utils/ERC7715Utils'
import { serializePublicKey, type P256Credential } from 'webauthn-p256'
-import { useWalletConnectCosigner } from '../../hooks/useWalletConnectCosigner'
-import { useWagmiAvailableCapabilities } from '../../hooks/useWagmiActiveCapabilities'
-import {
- decodeUncompressedPublicKey,
- encodePublicKeyToDID,
- hexStringToBase64
-} from '../../utils/EncodingUtils'
-import { getSampleSyncPermissions } from '../../utils/ERC7715Utils'
+import { KeyTypes } from '../../utils/EncodingUtils'
export function WagmiRequestPermissionsSyncTest() {
- const [isRequestPermissionLoading, setRequestPermissionLoading] = useState(false)
const { provider, supported } = useWagmiAvailableCapabilities({
method: EIP_7715_RPC_METHODS.WALLET_GRANT_PERMISSIONS
})
const { chain, address, isConnected } = useAccount()
- const caip10Address = `eip155:${chain?.id}:${address}`
- const {
- projectId,
- passkey,
- grantedPermissions,
- clearGrantedPermissions,
- setGrantedPermissions,
- setWCCosignerData
- } = useWagmiPermissionsSync()
- const { addPermission, updatePermissionsContext } = useWalletConnectCosigner(
- caip10Address,
- projectId
- )
+ if (!isConnected || !provider || !address || !chain) {
+ return (
+
+ Wallet not connected
+
+ )
+ }
+ if (!supported) {
+ return (
+
+ Wallet does not support wallet_grantPermissions rpc method
+
+ )
+ }
+
+ return
+}
+
+function ConnectedTestContent({
+ chain,
+ provider,
+ address
+}: {
+ chain: Chain
+ provider: Provider
+ address: Address
+}) {
+ const [isRequestPermissionLoading, setRequestPermissionLoading] = useState(false)
+ const { passkey } = usePasskey()
+ const { grantedPermissions, clearGrantedPermissions, grantPermissions } = useERC7715Permissions()
const toast = useChakraToast()
const onRequestPermissions = useCallback(async () => {
setRequestPermissionLoading(true)
-
- if (!passkey) {
- throw new Error('Passkey not available')
- }
- if (!provider) {
- throw new Error('No Provider available, Please connect your wallet.')
- }
try {
- const addPermissionResponse = await addPermission({
- permissionType: 'donut-purchase',
- data: '',
- onChainValidated: false,
- required: true
- })
-
- setWCCosignerData(addPermissionResponse)
- const cosignerPublicKey = decodeUncompressedPublicKey(addPermissionResponse.key)
- let p = passkey as P256Credential
- p = {
- ...p,
- publicKey: {
- prefix: p.publicKey.prefix,
- x: BigInt(p.publicKey.x),
- y: BigInt(p.publicKey.y)
- }
+ if (!passkey) {
+ throw new Error('Passkey not available')
}
- const passkeyPublicKey = serializePublicKey(p.publicKey, { to: 'hex' })
- const passkeyDID = encodePublicKeyToDID(passkeyPublicKey, 'secp256r1')
- const secp256k1DID = encodePublicKeyToDID(cosignerPublicKey, 'secp256k1')
-
- const publicClient = createPublicClient({
+ if (!provider) {
+ throw new Error('No Provider available, Please connect your wallet.')
+ }
+ const walletClient = createWalletClient({
+ account: address,
chain,
transport: custom(provider)
}).extend(walletActionsErc7715())
-
- const samplePermissions = getSampleSyncPermissions(secp256k1DID, passkeyDID)
- const approvedPermissions = await publicClient.grantPermissions(samplePermissions)
- if (approvedPermissions) {
- await updatePermissionsContext({
- pci: addPermissionResponse.pci,
- context: {
- expiry: approvedPermissions.expiry,
- signer: {
- type: 'donut-purchase',
- data: {
- ids: [addPermissionResponse.key, hexStringToBase64(passkeyPublicKey)]
- }
- },
- signerData: {
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
- userOpBuilder: approvedPermissions.signerData?.userOpBuilder!
- },
- permissionsContext: approvedPermissions.permissionsContext,
- factory: approvedPermissions.factory || '',
- factoryData: approvedPermissions.factoryData || ''
- }
- })
- setGrantedPermissions(approvedPermissions)
- setRequestPermissionLoading(false)
- toast({
- type: 'success',
- title: 'Permissions Granted',
- description: JSON.stringify(approvedPermissions, bigIntReplacer)
- })
-
- return
+ let p256Credential = passkey as P256Credential
+ p256Credential = {
+ ...p256Credential,
+ publicKey: {
+ prefix: p256Credential.publicKey.prefix,
+ x: BigInt(p256Credential.publicKey.x),
+ y: BigInt(p256Credential.publicKey.y)
+ }
}
- toast({ title: 'Error', description: 'Failed to obtain permissions' })
+ const passkeyPublicKey = serializePublicKey(p256Credential.publicKey, { to: 'hex' })
+
+ const purchaseDonutPermissions = getPurchaseDonutPermissions()
+ const response = await grantPermissions(walletClient, {
+ permissions: purchaseDonutPermissions,
+ signerKey: {
+ key: passkeyPublicKey,
+ type: KeyTypes.secp256r1
+ }
+ })
+ toast({
+ type: 'success',
+ title: 'Permissions Granted',
+ description: JSON.stringify(response.approvedPermissions, bigIntReplacer)
+ })
} catch (error) {
toast({
type: 'error',
- title: 'Request Permissions Erros',
- description: error instanceof Error ? error.message : 'Some error occurred'
+ title: 'Request Permissions Errors',
+ description: error instanceof Error ? error.message : 'Unknown Error'
})
+ } finally {
+ setRequestPermissionLoading(false)
}
- setRequestPermissionLoading(false)
- }, [passkey, provider])
-
- if (!isConnected || !provider || !address) {
- return (
-
- Wallet not connected
-
- )
- }
- if (!supported) {
- return (
-
- Wallet does not support wallet_grantPermissions rpc method
-
- )
- }
+ }, [passkey, provider, address, chain, grantPermissions, toast])
return (
Request Permissions
diff --git a/apps/laboratory/src/context/ERC7715PermissionsContext.tsx b/apps/laboratory/src/context/ERC7715PermissionsContext.tsx
new file mode 100644
index 0000000000..cde5a545de
--- /dev/null
+++ b/apps/laboratory/src/context/ERC7715PermissionsContext.tsx
@@ -0,0 +1,69 @@
+import React, { type ReactNode } from 'react'
+import { createContext } from 'react'
+import {
+ GRANTED_PERMISSIONS_KEY,
+ removeLocalStorageItem,
+ WC_COSIGNER_DATA
+} from '../utils/LocalStorage'
+import { useLocalStorageState } from '../hooks/useLocalStorageState'
+import type { GrantPermissionsReturnType } from 'viem/experimental'
+import type { AddPermissionResponse } from '../utils/WalletConnectCosignerUtils'
+
+export type ERC7715PermissionsContextType = {
+ projectId: string
+ grantedPermissions: GrantPermissionsReturnType | undefined
+ setGrantedPermissions: React.Dispatch<
+ React.SetStateAction
+ >
+ wcCosignerData: AddPermissionResponse | undefined
+ setWCCosignerData: React.Dispatch>
+ clearGrantedPermissions: () => void
+}
+function noop() {
+ console.warn('WagmiPermissionsAsyncContext used outside of provider')
+}
+export const ERC7715PermissionsContext = createContext({
+ projectId: '',
+ grantedPermissions: undefined,
+ wcCosignerData: undefined,
+ setGrantedPermissions: noop,
+ setWCCosignerData: noop,
+ clearGrantedPermissions: noop
+})
+
+interface ERC7715PermissionsProviderProps {
+ children: ReactNode
+}
+
+export function ERC7715PermissionsProvider({ children }: ERC7715PermissionsProviderProps) {
+ const projectId = process.env['NEXT_PUBLIC_PROJECT_ID']
+ if (!projectId) {
+ throw new Error('NEXT_PUBLIC_PROJECT_ID is not set')
+ }
+ const [grantedPermissions, setGrantedPermissions] = useLocalStorageState<
+ GrantPermissionsReturnType | undefined
+ >(GRANTED_PERMISSIONS_KEY, undefined)
+ const [wcCosignerData, setWCCosignerData] = useLocalStorageState<
+ AddPermissionResponse | undefined
+ >(WC_COSIGNER_DATA, undefined)
+
+ function clearGrantedPermissions() {
+ removeLocalStorageItem(GRANTED_PERMISSIONS_KEY)
+ setGrantedPermissions(undefined)
+ }
+
+ return (
+
+ {children}
+
+ )
+}
diff --git a/apps/laboratory/src/context/LocalEcdsaKeyContext.tsx b/apps/laboratory/src/context/LocalEcdsaKeyContext.tsx
new file mode 100644
index 0000000000..21739b64a1
--- /dev/null
+++ b/apps/laboratory/src/context/LocalEcdsaKeyContext.tsx
@@ -0,0 +1,72 @@
+import type { ReactNode } from 'react'
+import { createContext, useContext, useEffect, useState } from 'react'
+import { getLocalStorageItem, LOCAL_SIGNER_KEY } from '../utils/LocalStorage'
+import { generatePrivateKey, privateKeyToAccount, type PrivateKeyAccount } from 'viem/accounts'
+import { useChakraToast } from '../components/Toast'
+import { useLocalStorageState } from '../hooks/useLocalStorageState'
+
+type LocalEcdsaKeyContextType = {
+ privateKey: string | undefined
+ signer: PrivateKeyAccount | undefined
+}
+
+export const LocalEcdsaKeyContext = createContext({
+ privateKey: undefined,
+ signer: undefined
+})
+
+interface LocalEcdsaKeyProviderProps {
+ children: ReactNode
+}
+
+export function LocalEcdsaKeyProvider({ children }: LocalEcdsaKeyProviderProps) {
+ const toast = useChakraToast()
+ const projectId = process.env['NEXT_PUBLIC_PROJECT_ID']
+ if (!projectId) {
+ throw new Error('NEXT_PUBLIC_PROJECT_ID is not set')
+ }
+ const [privateKey, setPrivateKey] = useLocalStorageState(
+ LOCAL_SIGNER_KEY,
+ undefined
+ )
+
+ const [signer, setSigner] = useState()
+
+ useEffect(() => {
+ try {
+ let storedPrivateKey = getLocalStorageItem(LOCAL_SIGNER_KEY)
+ if (!storedPrivateKey) {
+ const newPrivateKey = generatePrivateKey()
+ setPrivateKey(newPrivateKey)
+ storedPrivateKey = newPrivateKey
+ }
+ const accountSigner = privateKeyToAccount(storedPrivateKey as `0x${string}`)
+ setSigner(accountSigner)
+ } catch {
+ toast({
+ title: 'Failure',
+ description: 'No private key available',
+ type: 'error'
+ })
+ }
+ }, [])
+
+ return (
+
+ {children}
+
+ )
+}
+export function useLocalEcdsaKey() {
+ const context = useContext(LocalEcdsaKeyContext)
+ if (context === undefined) {
+ throw new Error('useLocalEcdsaKey must be used within a LocalEcdsaKeyProvider')
+ }
+
+ return context
+}
diff --git a/apps/laboratory/src/context/PasskeyContext.tsx b/apps/laboratory/src/context/PasskeyContext.tsx
new file mode 100644
index 0000000000..10b1330dc9
--- /dev/null
+++ b/apps/laboratory/src/context/PasskeyContext.tsx
@@ -0,0 +1,73 @@
+import type { ReactNode } from 'react'
+import { createContext, useContext, useEffect, useState } from 'react'
+import {
+ PASSKEY_LOCALSTORAGE_KEY,
+ setLocalStorageItem,
+ type PasskeyLocalStorageFormat
+} from '../utils/LocalStorage'
+import { useLocalStorageState } from '../hooks/useLocalStorageState'
+import type { P256Credential } from 'webauthn-p256'
+
+export type PasskeyStorageType = P256Credential | PasskeyLocalStorageFormat | undefined
+type PasskeyContextType = {
+ passkey: PasskeyStorageType
+ isPasskeyAvailable: boolean
+ passkeyId: string
+ setPasskey: (value: PasskeyStorageType) => void
+}
+
+function noop() {
+ console.warn('PasskeyContext used outside of provider')
+}
+export const PasskeyContext = createContext({
+ passkey: undefined,
+ isPasskeyAvailable: false,
+ passkeyId: '',
+ setPasskey: noop
+})
+
+interface PasskeyProviderProps {
+ children: ReactNode
+}
+
+export function PasskeyProvider({ children }: PasskeyProviderProps) {
+ const [passkey, setPasskey] = useLocalStorageState(
+ PASSKEY_LOCALSTORAGE_KEY,
+ undefined
+ )
+ const [isPasskeyAvailable, setIsPasskeyAvailable] = useState(false)
+ const [passkeyId, setPasskeyId] = useState('')
+ function setNewPasskey(value: PasskeyStorageType) {
+ setLocalStorageItem(PASSKEY_LOCALSTORAGE_KEY, '')
+ setPasskey(value)
+ setIsPasskeyAvailable(false)
+ }
+
+ useEffect(() => {
+ if (passkey) {
+ setIsPasskeyAvailable(true)
+ setPasskeyId((passkey as P256Credential).id)
+ }
+ }, [passkey])
+
+ return (
+
+ {children}
+
+ )
+}
+export function usePasskey() {
+ const context = useContext(PasskeyContext)
+ if (!context) {
+ throw new Error('usePasskey must be used within a PasskeyContext')
+ }
+
+ return context
+}
diff --git a/apps/laboratory/src/context/WagmiPermissionsAsyncContext.tsx b/apps/laboratory/src/context/WagmiPermissionsAsyncContext.tsx
deleted file mode 100644
index 458fea930d..0000000000
--- a/apps/laboratory/src/context/WagmiPermissionsAsyncContext.tsx
+++ /dev/null
@@ -1,112 +0,0 @@
-import type { ReactNode } from 'react'
-import { createContext, useContext, useEffect, useState } from 'react'
-import {
- GRANTED_PERMISSIONS_KEY,
- LOCAL_SIGNER_KEY,
- removeItem,
- WC_COSIGNER_DATA
-} from '../utils/LocalStorage'
-import { useLocalStorageState } from '../hooks/useLocalStorageState'
-import type { GrantPermissionsReturnType } from 'viem/experimental'
-import type { AddPermissionResponse } from '../hooks/useWalletConnectCosigner'
-import { generatePrivateKey, privateKeyToAccount, type PrivateKeyAccount } from 'viem/accounts'
-import { useChakraToast } from '../components/Toast'
-
-interface WagmiPermissionsAsyncContextType {
- projectId: string
- privateKey: string | undefined
- signer: PrivateKeyAccount | undefined
- grantedPermissions: GrantPermissionsReturnType | undefined
- setGrantedPermissions: React.Dispatch<
- React.SetStateAction
- >
- wcCosignerData: AddPermissionResponse | undefined
- setWCCosignerData: React.Dispatch>
- clearGrantedPermissions: () => void
-}
-function noop() {
- console.warn('WagmiPermissionsAsyncContext used outside of provider')
-}
-export const WagmiPermissionsAsyncContext = createContext({
- projectId: '',
- privateKey: undefined,
- signer: undefined,
- grantedPermissions: undefined,
- wcCosignerData: undefined,
- setGrantedPermissions: noop,
- setWCCosignerData: noop,
- clearGrantedPermissions: noop
-})
-
-interface WagmiPermissionsAsyncProviderProps {
- children: ReactNode
-}
-
-export function WagmiPermissionsAsyncProvider({ children }: WagmiPermissionsAsyncProviderProps) {
- const toast = useChakraToast()
- const projectId = process.env['NEXT_PUBLIC_PROJECT_ID']
- if (!projectId) {
- throw new Error('NEXT_PUBLIC_PROJECT_ID is not set')
- }
- const [privateKey, setPrivateKey] = useLocalStorageState(
- LOCAL_SIGNER_KEY,
- undefined
- )
- const [grantedPermissions, setGrantedPermissions] = useLocalStorageState<
- GrantPermissionsReturnType | undefined
- >(GRANTED_PERMISSIONS_KEY, undefined)
- const [wcCosignerData, setWCCosignerData] = useLocalStorageState<
- AddPermissionResponse | undefined
- >(WC_COSIGNER_DATA, undefined)
-
- const [signer, setSigner] = useState()
-
- function clearGrantedPermissions() {
- removeItem(GRANTED_PERMISSIONS_KEY)
- setGrantedPermissions(undefined)
- }
-
- useEffect(() => {
- try {
- let storedPrivateKey = localStorage.getItem(LOCAL_SIGNER_KEY)
- if (!storedPrivateKey) {
- const newPrivateKey = generatePrivateKey()
- setPrivateKey(newPrivateKey)
- storedPrivateKey = newPrivateKey
- }
- const accountSigner = privateKeyToAccount(storedPrivateKey as `0x${string}`)
- setSigner(accountSigner)
- } catch {
- toast({
- title: 'Failure',
- description: 'No private key available',
- type: 'error'
- })
- }
- }, [])
-
- return (
-
- {children}
-
- )
-}
-export function useWagmiPermissionsAsync() {
- const context = useContext(WagmiPermissionsAsyncContext)
- if (context === undefined) {
- throw new Error('useWagmiPermissionsAsync must be used within a GrantedPermissionsProvider')
- }
-
- return context
-}
diff --git a/apps/laboratory/src/context/WagmiPermissionsSyncContext.tsx b/apps/laboratory/src/context/WagmiPermissionsSyncContext.tsx
deleted file mode 100644
index aad7770e48..0000000000
--- a/apps/laboratory/src/context/WagmiPermissionsSyncContext.tsx
+++ /dev/null
@@ -1,112 +0,0 @@
-import type { ReactNode } from 'react'
-import { createContext, useContext, useEffect, useState } from 'react'
-import {
- GRANTED_PERMISSIONS_KEY,
- PASSKEY_LOCALSTORAGE_KEY,
- removeItem,
- setItem,
- WC_COSIGNER_DATA,
- type PasskeyLocalStorageFormat
-} from '../utils/LocalStorage'
-import { useLocalStorageState } from '../hooks/useLocalStorageState'
-import type { GrantPermissionsReturnType } from 'viem/experimental'
-import type { AddPermissionResponse } from '../hooks/useWalletConnectCosigner'
-import type { P256Credential } from 'webauthn-p256'
-
-type PasskeyStorageType = P256Credential | PasskeyLocalStorageFormat | undefined
-interface WagmiPermissionsSyncContextType {
- projectId: string
- passkey: PasskeyStorageType
- isPasskeyAvailable: boolean
- passkeyId: string
- grantedPermissions: GrantPermissionsReturnType | undefined
- wcCosignerData: AddPermissionResponse | undefined
- setGrantedPermissions: React.Dispatch<
- React.SetStateAction
- >
- setWCCosignerData: React.Dispatch>
- setPasskey: (value: PasskeyStorageType) => void
- clearGrantedPermissions: () => void
-}
-function noop() {
- console.warn('WagmiPermissionsSyncContext used outside of provider')
-}
-export const WagmiPermissionsSyncContext = createContext({
- projectId: '',
- passkey: undefined,
- isPasskeyAvailable: false,
- passkeyId: '',
- grantedPermissions: undefined,
- wcCosignerData: undefined,
- setGrantedPermissions: noop,
- setWCCosignerData: noop,
- setPasskey: noop,
- clearGrantedPermissions: noop
-})
-
-interface WagmiPermissionsSyncProviderProps {
- children: ReactNode
-}
-
-export function WagmiPermissionsSyncProvider({ children }: WagmiPermissionsSyncProviderProps) {
- const projectId = process.env['NEXT_PUBLIC_PROJECT_ID']
- if (!projectId) {
- throw new Error('NEXT_PUBLIC_PROJECT_ID is not set')
- }
- const [passkey, setPasskey] = useLocalStorageState(
- PASSKEY_LOCALSTORAGE_KEY,
- undefined
- )
- const [grantedPermissions, setGrantedPermissions] = useLocalStorageState<
- GrantPermissionsReturnType | undefined
- >(GRANTED_PERMISSIONS_KEY, undefined)
- const [wcCosignerData, setWCCosignerData] = useLocalStorageState<
- AddPermissionResponse | undefined
- >(WC_COSIGNER_DATA, undefined)
-
- const [isPasskeyAvailable, setIsPasskeyAvailable] = useState(false)
- const [passkeyId, setPasskeyId] = useState('')
- function setNewPasskey(value: PasskeyStorageType) {
- setItem(PASSKEY_LOCALSTORAGE_KEY, '')
- setPasskey(value)
- setIsPasskeyAvailable(false)
- }
- function clearGrantedPermissions() {
- removeItem(GRANTED_PERMISSIONS_KEY)
- setGrantedPermissions(undefined)
- }
-
- useEffect(() => {
- if (passkey) {
- setIsPasskeyAvailable(true)
- setPasskeyId((passkey as P256Credential).id)
- }
- }, [passkey])
-
- return (
-
- {children}
-
- )
-}
-export function useWagmiPermissionsSync() {
- const context = useContext(WagmiPermissionsSyncContext)
- if (!context) {
- throw new Error('useWagmiPermissions must be used within a WagmiPermissionsSyncContext')
- }
-
- return context
-}
diff --git a/apps/laboratory/src/hooks/useERC7715Permissions.ts b/apps/laboratory/src/hooks/useERC7715Permissions.ts
new file mode 100644
index 0000000000..d22077280e
--- /dev/null
+++ b/apps/laboratory/src/hooks/useERC7715Permissions.ts
@@ -0,0 +1,108 @@
+import { type Hex, type WalletClient } from 'viem'
+import { useContext } from 'react'
+import { ERC7715PermissionsContext } from '../context/ERC7715PermissionsContext'
+import {
+ decodeUncompressedPublicKey,
+ encodePublicKeyToDID,
+ hexStringToBase64,
+ KeyTypes
+} from '../utils/EncodingUtils'
+import {
+ type GrantPermissionsParameters,
+ type GrantPermissionsReturnType,
+ type WalletActionsErc7715
+} from 'viem/experimental'
+import { WalletConnectCosigner } from '../utils/WalletConnectCosignerUtils'
+
+type RequestPermissionsReturnType = {
+ approvedPermissions: GrantPermissionsReturnType
+}
+
+export function useERC7715Permissions() {
+ const context = useContext(ERC7715PermissionsContext)
+
+ if (context === undefined) {
+ throw new Error('useERC7715Permissions must be used within a ERC7715PermissionsProvider')
+ }
+
+ const {
+ grantedPermissions,
+ wcCosignerData,
+ setWCCosignerData,
+ setGrantedPermissions,
+ clearGrantedPermissions
+ } = context
+
+ async function grantPermissions(
+ walletClient: WalletClient & WalletActionsErc7715,
+ args: {
+ permissions: GrantPermissionsParameters
+ signerKey: {
+ key: Hex
+ type: KeyTypes
+ }
+ }
+ ): Promise {
+ const { permissions, signerKey } = args
+ const accountAddress = walletClient.account?.address
+ if (!accountAddress) {
+ throw new Error('Account address not available')
+ }
+ const chain = walletClient.chain
+ if (!chain) {
+ throw new Error('Chain not available')
+ }
+ if (!signerKey) {
+ throw new Error('Invalid signer data')
+ }
+ const dAppKeyDID = encodePublicKeyToDID(signerKey.key, signerKey.type)
+
+ const caip10Address = `eip155:${chain.id}:${accountAddress}`
+ const walletConnectCosigner = new WalletConnectCosigner()
+ const addPermissionResponse = await walletConnectCosigner.addPermission(caip10Address, {
+ permissionType: 'donut-purchase',
+ data: '',
+ onChainValidated: false,
+ required: true
+ })
+
+ setWCCosignerData(addPermissionResponse)
+ const cosignerPublicKey = decodeUncompressedPublicKey(addPermissionResponse.key)
+ const cosignerKeyDID = encodePublicKeyToDID(cosignerPublicKey, KeyTypes.secp256k1)
+ permissions.signer = {
+ type: 'keys',
+ data: {
+ ids: [cosignerKeyDID, dAppKeyDID]
+ }
+ }
+ const approvedPermissions = await walletClient.grantPermissions(permissions)
+ await walletConnectCosigner.updatePermissionsContext(caip10Address, {
+ pci: addPermissionResponse.pci,
+ context: {
+ expiry: approvedPermissions.expiry,
+ signer: {
+ type: 'donut-purchase',
+ data: {
+ ids: [addPermissionResponse.key, hexStringToBase64(signerKey.key)]
+ }
+ },
+ signerData: {
+ userOpBuilder: approvedPermissions.signerData?.userOpBuilder || ''
+ },
+ permissionsContext: approvedPermissions.permissionsContext,
+ factory: approvedPermissions.factory || '',
+ factoryData: approvedPermissions.factoryData || ''
+ }
+ })
+ setGrantedPermissions(approvedPermissions)
+
+ return { approvedPermissions }
+ }
+
+ return {
+ grantedPermissions,
+ pci: wcCosignerData?.pci,
+ clearGrantedPermissions,
+ grantPermissions
+ }
+}
diff --git a/apps/laboratory/src/hooks/useERC7715PermissionsAsync.ts b/apps/laboratory/src/hooks/useERC7715PermissionsAsync.ts
deleted file mode 100644
index 2262323e40..0000000000
--- a/apps/laboratory/src/hooks/useERC7715PermissionsAsync.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-import { type GrantPermissionsReturnType } from 'viem/experimental'
-import { ENTRYPOINT_ADDRESS_V07, getUserOperationHash } from 'permissionless'
-import { type UserOperation } from 'permissionless/types'
-import { type PublicClient } from 'viem'
-import { type Chain } from 'wagmi/chains'
-import { useUserOpBuilder, type Execution } from './useUserOpBuilder'
-import { bigIntReplacer } from '../utils/CommonUtils'
-import { createClients } from '../utils/PermissionsUtils'
-import { useWalletConnectCosigner } from './useWalletConnectCosigner'
-import { signMessage } from 'viem/accounts'
-import { useWagmiPermissionsAsync } from '../context/WagmiPermissionsAsyncContext'
-
-export function useERC7715PermissionsAsync(params: {
- projectId: string
- permissions: GrantPermissionsReturnType | undefined
- chain: Chain
-}) {
- const { projectId, permissions, chain } = params
- const { getCallDataWithContext, getNonceWithContext } = useUserOpBuilder()
- const { wcCosignerData } = useWagmiPermissionsAsync()
- const accountAddress = permissions?.signerData?.submitToAddress
- const caip10Address = `eip155:${chain?.id}:${accountAddress}`
- const { coSignUserOperation } = useWalletConnectCosigner(caip10Address, projectId)
-
- async function prepareUserOperationWithPermissions(
- publicClient: PublicClient,
- actions: Execution[]
- ): Promise> {
- if (!permissions) {
- throw new Error('No permissions available')
- }
- const { factory, factoryData, signerData, permissionsContext } = permissions
-
- if (!signerData?.userOpBuilder || !signerData.submitToAddress || !permissionsContext) {
- throw new Error(`Invalid permissions ${JSON.stringify(permissions, bigIntReplacer)}`)
- }
-
- const nonce = await getNonceWithContext(publicClient, {
- userOpBuilderAddress: signerData.userOpBuilder,
- sender: signerData.submitToAddress,
- permissionsContext: permissionsContext as `0x${string}`
- })
-
- const callData = await getCallDataWithContext(publicClient, {
- userOpBuilderAddress: signerData.userOpBuilder,
- sender: signerData.submitToAddress,
- permissionsContext: permissionsContext as `0x${string}`,
- actions
- })
-
- const userOp: UserOperation<'v0.7'> = {
- sender: signerData.submitToAddress,
- factory,
- factoryData: factoryData ? (factoryData as `0x${string}`) : undefined,
- nonce,
- callData,
- callGasLimit: BigInt(2000000),
- verificationGasLimit: BigInt(2000000),
- preVerificationGas: BigInt(2000000),
- maxFeePerGas: BigInt(0),
- maxPriorityFeePerGas: BigInt(0),
- signature: '0x'
- }
-
- return userOp
- }
-
- async function signUserOperationWithECDSAKey(args: {
- ecdsaPrivateKey: `0x${string}`
- userOp: UserOperation<'v0.7'>
- }): Promise<`0x${string}`> {
- const { ecdsaPrivateKey, userOp } = args
- if (!permissions) {
- throw new Error('No permissions available')
- }
- const { signerData, permissionsContext } = permissions
-
- if (!signerData?.userOpBuilder || !signerData.submitToAddress || !permissionsContext) {
- throw new Error(`Invalid permissions ${JSON.stringify(permissions, bigIntReplacer)}`)
- }
- const userOpHash = getUserOperationHash({
- userOperation: userOp,
- entryPoint: ENTRYPOINT_ADDRESS_V07,
- chainId: chain.id
- })
- const dappSignatureOnUserOp = await signMessage({
- privateKey: ecdsaPrivateKey,
- message: { raw: userOpHash }
- })
-
- return dappSignatureOnUserOp
- }
-
- async function executeActionsWithECDSAAndCosignerPermissions(args: {
- ecdsaPrivateKey: `0x${string}`
- actions: Execution[]
- chain: Chain
- }): Promise<`0x${string}`> {
- const { ecdsaPrivateKey, actions } = args
- const { publicClient, bundlerClient } = createClients(chain)
-
- if (!accountAddress) {
- throw new Error(`Unable to get account details from granted permission`)
- }
-
- if (!wcCosignerData) {
- throw new Error('No WC_COSIGNER data available')
- }
-
- const userOp = await prepareUserOperationWithPermissions(publicClient, actions)
-
- const gasPrice = await bundlerClient.getUserOperationGasPrice()
- userOp.maxFeePerGas = gasPrice.fast.maxFeePerGas
- userOp.maxPriorityFeePerGas = gasPrice.fast.maxPriorityFeePerGas
-
- const signature = await signUserOperationWithECDSAKey({
- ecdsaPrivateKey,
- userOp
- })
-
- userOp.signature = signature
- const txHash = await coSignUserOperation({
- pci: wcCosignerData.pci,
- userOp
- })
-
- const userOpReceipt = await bundlerClient.waitForUserOperationReceipt({
- hash: txHash.userOperationTxHash as `0x${string}`
- })
-
- return userOpReceipt.receipt.transactionHash
- }
-
- return {
- executeActionsWithECDSAAndCosignerPermissions
- }
-}
diff --git a/apps/laboratory/src/hooks/useERC7715PermissionsSync.ts b/apps/laboratory/src/hooks/useERC7715PermissionsSync.ts
deleted file mode 100644
index 870891ae0c..0000000000
--- a/apps/laboratory/src/hooks/useERC7715PermissionsSync.ts
+++ /dev/null
@@ -1,158 +0,0 @@
-import { type GrantPermissionsReturnType } from 'viem/experimental'
-import { ENTRYPOINT_ADDRESS_V07, getUserOperationHash } from 'permissionless'
-import { type UserOperation } from 'permissionless/types'
-import { encodeAbiParameters, hashMessage, type PublicClient } from 'viem'
-import { sign as signWithPasskey } from 'webauthn-p256'
-import { type Chain } from 'wagmi/chains'
-import { useUserOpBuilder, type Execution } from './useUserOpBuilder'
-import { bigIntReplacer } from '../utils/CommonUtils'
-import { createClients } from '../utils/PermissionsUtils'
-import { useWalletConnectCosigner, type AddPermissionResponse } from './useWalletConnectCosigner'
-
-export function useERC7715PermissionsSync(params: {
- projectId: string
- permissions: GrantPermissionsReturnType | undefined
- chain: Chain
-}) {
- const { projectId, permissions, chain } = params
- const { getCallDataWithContext, getNonceWithContext } = useUserOpBuilder()
- const accountAddress = permissions?.signerData?.submitToAddress
- const caip10Address = `eip155:${chain?.id}:${accountAddress}`
- const { coSignUserOperation } = useWalletConnectCosigner(caip10Address, projectId)
-
- async function prepareUserOperationWithPermissions(
- publicClient: PublicClient,
-
- actions: Execution[]
- ): Promise> {
- if (!permissions) {
- throw new Error('No permissions available')
- }
- const { factory, factoryData, signerData, permissionsContext } = permissions
-
- if (!signerData?.userOpBuilder || !signerData.submitToAddress || !permissionsContext) {
- throw new Error(`Invalid permissions ${JSON.stringify(permissions, bigIntReplacer)}`)
- }
-
- const nonce = await getNonceWithContext(publicClient, {
- userOpBuilderAddress: signerData.userOpBuilder,
- sender: signerData.submitToAddress,
- permissionsContext: permissionsContext as `0x${string}`
- })
-
- const callData = await getCallDataWithContext(publicClient, {
- userOpBuilderAddress: signerData.userOpBuilder,
- sender: signerData.submitToAddress,
- permissionsContext: permissionsContext as `0x${string}`,
- actions
- })
-
- const userOp: UserOperation<'v0.7'> = {
- sender: signerData.submitToAddress,
- factory,
- factoryData: factoryData ? (factoryData as `0x${string}`) : undefined,
- nonce,
- callData,
- callGasLimit: BigInt(2000000),
- verificationGasLimit: BigInt(2000000),
- preVerificationGas: BigInt(2000000),
- maxFeePerGas: BigInt(0),
- maxPriorityFeePerGas: BigInt(0),
- signature: '0x'
- }
-
- return userOp
- }
-
- async function signUserOperationWithPasskey(args: {
- userOp: UserOperation<'v0.7'>
- passkeyId: string
- }): Promise<`0x${string}`> {
- const { userOp, passkeyId } = args
- if (!permissions) {
- throw new Error('No permissions available')
- }
- const { signerData, permissionsContext } = permissions
-
- if (!signerData?.userOpBuilder || !signerData.submitToAddress || !permissionsContext) {
- throw new Error(`Invalid permissions ${JSON.stringify(permissions, bigIntReplacer)}`)
- }
- const userOpHash = getUserOperationHash({
- userOperation: {
- ...userOp
- },
- entryPoint: ENTRYPOINT_ADDRESS_V07,
- chainId: chain.id
- })
- const ethMessageUserOpHash = hashMessage({ raw: userOpHash })
- const usersPasskeySignature = await signWithPasskey({
- credentialId: passkeyId,
- hash: ethMessageUserOpHash
- })
-
- const authenticatorData = usersPasskeySignature.webauthn.authenticatorData
- const clientDataJSON = usersPasskeySignature.webauthn.clientDataJSON
- const responseTypeLocation = usersPasskeySignature.webauthn.typeIndex
- // Const userVerificationRequired = usersPasskeySignature.webauthn.userVerificationRequired
- const r = usersPasskeySignature.signature.r
- const s = usersPasskeySignature.signature.s
-
- const passkeySignature = encodeAbiParameters(
- [
- { type: 'bytes' },
- { type: 'string' },
- { type: 'uint256' },
- { type: 'uint256' },
- { type: 'uint256' },
- { type: 'bool' }
- ],
- [authenticatorData, clientDataJSON, responseTypeLocation, r, s, false]
- )
-
- return passkeySignature
- }
-
- async function executeActionsWithPasskeyAndCosignerPermissions(args: {
- actions: Execution[]
- passkeyId: string
- wcCosignerData: AddPermissionResponse
- }): Promise<`0x${string}`> {
- const { actions, passkeyId, wcCosignerData } = args
- const { publicClient, bundlerClient } = createClients(chain)
-
- if (!accountAddress) {
- throw new Error(`Unable to get account details from granted permission`)
- }
-
- if (!wcCosignerData) {
- throw new Error('No WC_COSIGNER data available')
- }
-
- const userOp = await prepareUserOperationWithPermissions(publicClient, actions)
-
- const gasPrice = await bundlerClient.getUserOperationGasPrice()
- userOp.maxFeePerGas = gasPrice.fast.maxFeePerGas
- userOp.maxPriorityFeePerGas = gasPrice.fast.maxPriorityFeePerGas
-
- const signature = await signUserOperationWithPasskey({
- userOp,
- passkeyId
- })
-
- userOp.signature = signature
- const txHash = await coSignUserOperation({
- pci: wcCosignerData.pci,
- userOp
- })
-
- const userOpReceipt = await bundlerClient.waitForUserOperationReceipt({
- hash: txHash.userOperationTxHash as `0x${string}`
- })
-
- return userOpReceipt.receipt.transactionHash
- }
-
- return {
- executeActionsWithPasskeyAndCosignerPermissions
- }
-}
diff --git a/apps/laboratory/src/hooks/useLocalStorageState.ts b/apps/laboratory/src/hooks/useLocalStorageState.ts
index 4f740a521d..1fb3b45d2f 100644
--- a/apps/laboratory/src/hooks/useLocalStorageState.ts
+++ b/apps/laboratory/src/hooks/useLocalStorageState.ts
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react'
-import { getItem, setItem } from '../utils/LocalStorage'
+import { getLocalStorageItem, setLocalStorageItem } from '../utils/LocalStorage'
/**
* Custom hook that manages state in local storage.
@@ -16,7 +16,7 @@ function useLocalStorageState(
const [state, setState] = useState(initialValue)
useEffect(() => {
- const storedValue = getItem(key)
+ const storedValue = getLocalStorageItem(key)
// This naive hook might write 'undefined' or 'null' to local storage as a string
if (storedValue && storedValue !== 'undefined' && storedValue !== 'null') {
@@ -30,7 +30,7 @@ function useLocalStorageState(
useEffect(() => {
if (state) {
- setItem(key, state)
+ setLocalStorageItem(key, state)
}
}, [key, state])
diff --git a/apps/laboratory/src/hooks/useUserOpBuilder.ts b/apps/laboratory/src/hooks/useUserOpBuilder.ts
deleted file mode 100644
index 0956c282f1..0000000000
--- a/apps/laboratory/src/hooks/useUserOpBuilder.ts
+++ /dev/null
@@ -1,312 +0,0 @@
-import type { PackedUserOperation } from 'permissionless/types'
-import { publicActions, type Address, type Client, type Hex } from 'viem'
-
-export type UserOpBuilderGetDummySignatureArguments = {
- sender: Address
- userOpBuilderAddress: Address
- actions: Execution[]
- permissionsContext: `0x${string}`
-}
-export type UserOpBuilderGetSignatureArguments = {
- sender: Address
- userOpBuilderAddress: Address
- userOperation: PackedUserOperation
- permissionsContext: `0x${string}`
-}
-export type UserOpBuilderGetNonceArguments = {
- sender: Address
- userOpBuilderAddress: Address
- permissionsContext: `0x${string}`
-}
-export type UserOpBuilderGetCallDataArguments = {
- sender: Address
- userOpBuilderAddress: Address
- permissionsContext: `0x${string}`
- actions: Execution[]
-}
-
-export type Execution = {
- target: Hex
- value: bigint
- callData: Hex
-}
-export const getNonceAbi = [
- {
- type: 'function',
- name: 'getNonce',
- inputs: [
- {
- name: 'smartAccount',
- type: 'address',
- internalType: 'address'
- },
- {
- name: 'permissionsContext',
- type: 'bytes',
- internalType: 'bytes'
- }
- ],
- outputs: [
- {
- name: 'nonce',
- type: 'uint256',
- internalType: 'uint256'
- }
- ],
- stateMutability: 'view'
- }
-] as const
-
-export const getCallDataAbi = [
- {
- type: 'function',
- name: 'getCallData',
- inputs: [
- {
- name: 'smartAccount',
- type: 'address',
- internalType: 'address'
- },
- {
- name: 'executions',
- type: 'tuple[]',
- internalType: 'struct Execution[]',
- components: [
- {
- name: 'target',
- type: 'address',
- internalType: 'address'
- },
- {
- name: 'value',
- type: 'uint256',
- internalType: 'uint256'
- },
- {
- name: 'callData',
- type: 'bytes',
- internalType: 'bytes'
- }
- ]
- },
- {
- name: 'permissionsContext',
- type: 'bytes',
- internalType: 'bytes'
- }
- ],
- outputs: [
- {
- name: 'callData',
- type: 'bytes',
- internalType: 'bytes'
- }
- ],
- stateMutability: 'view'
- }
-] as const
-
-export const formatSignatureAbi = [
- {
- type: 'function',
- name: 'formatSignature',
- inputs: [
- {
- name: 'smartAccount',
- type: 'address',
- internalType: 'address'
- },
- {
- name: 'userOp',
- type: 'tuple',
- internalType: 'struct PackedUserOperation',
- components: [
- {
- name: 'sender',
- type: 'address',
- internalType: 'address'
- },
- {
- name: 'nonce',
- type: 'uint256',
- internalType: 'uint256'
- },
- {
- name: 'initCode',
- type: 'bytes',
- internalType: 'bytes'
- },
- {
- name: 'callData',
- type: 'bytes',
- internalType: 'bytes'
- },
- {
- name: 'accountGasLimits',
- type: 'bytes32',
- internalType: 'bytes32'
- },
- {
- name: 'preVerificationGas',
- type: 'uint256',
- internalType: 'uint256'
- },
- {
- name: 'gasFees',
- type: 'bytes32',
- internalType: 'bytes32'
- },
- {
- name: 'paymasterAndData',
- type: 'bytes',
- internalType: 'bytes'
- },
- {
- name: 'signature',
- type: 'bytes',
- internalType: 'bytes'
- }
- ]
- },
- {
- name: 'permissionsContext',
- type: 'bytes',
- internalType: 'bytes'
- }
- ],
- outputs: [
- {
- name: 'signature',
- type: 'bytes',
- internalType: 'bytes'
- }
- ],
- stateMutability: 'view'
- }
-] as const
-export const getDummySignatureAbi = [
- {
- type: 'function',
- name: 'getDummySignature',
- inputs: [
- {
- name: 'smartAccount',
- type: 'address',
- internalType: 'address'
- },
- {
- name: 'executions',
- type: 'tuple[]',
- internalType: 'struct Execution[]',
- components: [
- {
- name: 'target',
- type: 'address',
- internalType: 'address'
- },
- {
- name: 'value',
- type: 'uint256',
- internalType: 'uint256'
- },
- {
- name: 'callData',
- type: 'bytes',
- internalType: 'bytes'
- }
- ]
- },
- {
- name: 'permissionsContext',
- type: 'bytes',
- internalType: 'bytes'
- }
- ],
- outputs: [
- {
- name: 'signature',
- type: 'bytes',
- internalType: 'bytes'
- }
- ],
- stateMutability: 'view'
- }
-] as const
-
-export function useUserOpBuilder() {
- async function getNonceWithContext(client: Client, args: UserOpBuilderGetNonceArguments) {
- const { sender, permissionsContext, userOpBuilderAddress } = args
- const publicClient = client.extend(publicActions)
- if (!userOpBuilderAddress) {
- throw new Error('no userOpBuilder address provided.')
- }
-
- return await publicClient.readContract({
- address: userOpBuilderAddress,
- abi: getNonceAbi,
- functionName: 'getNonce',
- args: [sender, permissionsContext]
- })
- }
-
- async function getCallDataWithContext(client: Client, args: UserOpBuilderGetCallDataArguments) {
- const { sender, actions, permissionsContext, userOpBuilderAddress } = args
- const publicClient = client.extend(publicActions)
- if (!userOpBuilderAddress) {
- throw new Error('no userOpBuilder address provided.')
- }
-
- const callDataFromUserOpBuilder = await publicClient.readContract({
- address: userOpBuilderAddress,
- abi: getCallDataAbi,
- functionName: 'getCallData',
- args: [sender, actions, permissionsContext]
- })
-
- return callDataFromUserOpBuilder
- }
-
- async function getSignatureWithContext(client: Client, args: UserOpBuilderGetSignatureArguments) {
- const { sender, permissionsContext, userOpBuilderAddress, userOperation } = args
- const publicClient = client.extend(publicActions)
- if (!userOpBuilderAddress) {
- throw new Error('no userOpBuilder address provided.')
- }
-
- const sig = await publicClient.readContract({
- address: userOpBuilderAddress,
- abi: formatSignatureAbi,
- functionName: 'formatSignature',
- args: [sender, userOperation, permissionsContext]
- })
-
- return sig
- }
-
- async function getDummySignatureWithContext(
- client: Client,
- args: UserOpBuilderGetDummySignatureArguments
- ) {
- const { sender, permissionsContext, userOpBuilderAddress, actions } = args
- const publicClient = client.extend(publicActions)
- if (!userOpBuilderAddress) {
- throw new Error('no userOpBuilder address provided.')
- }
-
- const sig = await publicClient.readContract({
- address: userOpBuilderAddress,
- abi: getDummySignatureAbi,
- functionName: 'getDummySignature',
- args: [sender, actions, permissionsContext]
- })
-
- return sig
- }
-
- return {
- getNonceWithContext,
- getCallDataWithContext,
- getSignatureWithContext,
- getDummySignatureWithContext
- }
-}
diff --git a/apps/laboratory/src/hooks/useWagmiActiveCapabilities.ts b/apps/laboratory/src/hooks/useWagmiActiveCapabilities.ts
index 99c983a95d..53c0435a2a 100644
--- a/apps/laboratory/src/hooks/useWagmiActiveCapabilities.ts
+++ b/apps/laboratory/src/hooks/useWagmiActiveCapabilities.ts
@@ -60,16 +60,16 @@ export function useWagmiAvailableCapabilities({
connectedConnector: Connector,
connectedChain: Chain
) {
- const connectedProvider = await connectedConnector.getProvider?.({
+ const connectedProvider = (await connectedConnector.getProvider?.({
chainId: connectedChain.id
- })
- if (connectedProvider instanceof EthereumProvider) {
+ })) as Provider
+ if (connectedProvider instanceof W3mFrameProvider) {
+ const walletCapabilities = await connectedProvider.getCapabilities()
setProvider(connectedProvider)
- const walletCapabilities = getProviderCachedCapabilities(connectedAccount, connectedProvider)
setAvailableCapabilities(walletCapabilities)
- } else if (connectedProvider instanceof W3mFrameProvider) {
- const walletCapabilities = await connectedProvider.getCapabilities()
+ } else if (connectedProvider) {
setProvider(connectedProvider)
+ const walletCapabilities = getProviderCachedCapabilities(connectedAccount, connectedProvider)
setAvailableCapabilities(walletCapabilities)
}
}
diff --git a/apps/laboratory/src/hooks/useWalletConnectCosigner.ts b/apps/laboratory/src/hooks/useWalletConnectCosigner.ts
deleted file mode 100644
index 2b873ae7f6..0000000000
--- a/apps/laboratory/src/hooks/useWalletConnectCosigner.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-import axios, { AxiosError } from 'axios'
-import { bigIntReplacer } from '../utils/CommonUtils'
-import type { UserOperation } from 'permissionless'
-
-// Define types for the request and response
-type AddPermission = {
- permissionType: string
- data: string
- required: boolean
- onChainValidated: boolean
-}
-
-type AddPermissionRequest = {
- permission: AddPermission
-}
-
-export type AddPermissionResponse = {
- pci: string
- key: string
-}
-
-type Signer = {
- type: string
- data: {
- ids: string[]
- }
-}
-
-type SignerData = {
- userOpBuilder: string
-}
-
-type PermissionsContext = {
- signer: Signer
- expiry: number
- signerData: SignerData
- factory?: string
- factoryData?: string
- permissionsContext: string
-}
-
-type UpdatePermissionsContextRequest = {
- pci: string
- signature?: string
- context: PermissionsContext
-}
-
-type RevokePermissionRequest = {
- pci: string
- signature: string
-}
-
-type CoSignRequest = {
- pci: string
- userOp: UserOperation<'v0.7'>
-}
-
-type CoSignResponse = {
- userOperationTxHash: string
-}
-
-// Define a custom error type
-export class CoSignerApiError extends Error {
- constructor(
- public status: number,
- message: string
- ) {
- super(message)
- this.name = 'CoSignerApiError'
- }
-}
-
-async function sendCoSignerRequest(args: {
- url: string
- data: TRequest
- projectId: string
- headers: Record
- transformRequest?: (data: TRequest) => unknown
-}) {
- const { url, data, projectId, headers, transformRequest } = args
- const transformedData = transformRequest ? transformRequest(data) : data
- try {
- return await axios.post(url, transformedData, {
- params: { projectId },
- headers
- })
- } catch (error) {
- if (axios.isAxiosError(error)) {
- const axiosError = error as AxiosError
- if (axiosError.response) {
- throw new CoSignerApiError(axiosError.response.status, axiosError.response.data as string)
- } else {
- throw new CoSignerApiError(500, 'Network error')
- }
- }
- // Re-throw if it's not an Axios error
- throw error
- }
-}
-/**
- * Provides a set of functions to interact with the WalletConnect CoSigner API.
- * @param address - CAIP-10 address format
- * @param projectId - The project identifier
- */
-export function useWalletConnectCosigner(address: string, projectId: string) {
- const baseUrl = 'https://rpc.walletconnect.com/v1/sessions'
- if (!projectId) {
- throw new Error('NEXT_PUBLIC_PROJECT_ID is not set')
- }
- if (!address) {
- throw new Error('CAIP-10 address is not set or invalid')
- }
-
- /**
- * Adds a new permission session for the account.
- *
- * @param permission - The permission details
- * @returns A promise that resolves to the new permission details
- * @throws {CoSignerApiError} If the API request fails
- */
- async function addPermission(permission: AddPermission): Promise {
- const url = `${baseUrl}/${encodeURIComponent(address)}`
-
- const response = await sendCoSignerRequest({
- url,
- data: { permission },
- projectId,
- headers: { 'Content-Type': 'application/json' }
- })
-
- return response.data
- }
-
- /**
- * Updates permissions context for a certain permission identifier.
- *
- * @param updateData - The update data including pci, signature, and context
- * @returns A promise that resolves when the update is successful
- * @throws {CoSignerApiError} If the API request fails
- */
- async function updatePermissionsContext(
- updateData: UpdatePermissionsContextRequest
- ): Promise {
- const url = `${baseUrl}/${encodeURIComponent(address)}/context`
-
- await sendCoSignerRequest({
- url,
- data: updateData,
- projectId,
- headers: { 'Content-Type': 'application/json' }
- })
- }
-
- /**
- * Revokes a permission from account sessions.
- *
- * @param revokeData - The revoke data including pci and signature
- * @returns A promise that resolves when the revocation is successful
- * @throws {CoSignerApiError} If the API request fails
- */
- async function revokePermission(revokeData: RevokePermissionRequest): Promise {
- const url = `${baseUrl}/${encodeURIComponent(address)}/revoke`
- await sendCoSignerRequest({
- url,
- data: revokeData,
- projectId,
- headers: { 'Content-Type': 'application/json' }
- })
- }
- /**
- * Sends a co-signing request for a user operation.
- *
- * @param coSignData - The co-sign data including pci and userOp
- * @returns A promise that resolves to the user operation receipt
- * @throws {CoSignerApiError} If the API request fails
- */
- async function coSignUserOperation(coSignData: CoSignRequest): Promise {
- const url = `${baseUrl}/${encodeURIComponent(address)}/sign`
-
- const response = await sendCoSignerRequest({
- url,
- data: coSignData,
- projectId,
- headers: { 'Content-Type': 'application/json' },
- transformRequest: (value: CoSignRequest) => JSON.stringify(value, bigIntReplacer)
- })
-
- return response.data
- }
-
- return {
- addPermission,
- updatePermissionsContext,
- revokePermission,
- coSignUserOperation
- }
-}
diff --git a/apps/laboratory/src/layout/CustomWallet.tsx b/apps/laboratory/src/layout/CustomWallet.tsx
index 1e0e454d31..a56e48a4a1 100644
--- a/apps/laboratory/src/layout/CustomWallet.tsx
+++ b/apps/laboratory/src/layout/CustomWallet.tsx
@@ -14,6 +14,7 @@ import {
} from '@chakra-ui/react'
import { useState, type ChangeEvent } from 'react'
import { CUSTOM_WALLET } from '../utils/ConstantsUtil'
+import { setLocalStorageItem } from '../utils/LocalStorage'
interface Props {
controls: ReturnType
@@ -30,7 +31,7 @@ export function CustomWallet({ controls }: Props) {
})
function handleCustomWallet() {
- localStorage.setItem(CUSTOM_WALLET, JSON.stringify(customWallet))
+ setLocalStorageItem(CUSTOM_WALLET, JSON.stringify(customWallet))
location.reload()
}
diff --git a/apps/laboratory/src/pages/library/ethers-no-email.tsx b/apps/laboratory/src/pages/library/ethers-no-email.tsx
new file mode 100644
index 0000000000..f526269a4b
--- /dev/null
+++ b/apps/laboratory/src/pages/library/ethers-no-email.tsx
@@ -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: false,
+ 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 (
+ <>
+
+
+
+ >
+ )
+}
diff --git a/apps/laboratory/src/pages/library/ethers-email.tsx b/apps/laboratory/src/pages/library/ethers-no-socials.tsx
similarity index 90%
rename from apps/laboratory/src/pages/library/ethers-email.tsx
rename to apps/laboratory/src/pages/library/ethers-no-socials.tsx
index ad5272fbd1..2fd4689a55 100644
--- a/apps/laboratory/src/pages/library/ethers-email.tsx
+++ b/apps/laboratory/src/pages/library/ethers-no-socials.tsx
@@ -1,17 +1,20 @@
+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 { EthersTests } from '../../components/Ethers/EthersTests'
-import { AppKitButtons } from '../../components/AppKitButtons'
import { EthersModalInfo } from '../../components/Ethers/EthersModalInfo'
const modal = createWeb3Modal({
ethersConfig: defaultConfig({
metadata: ConstantsUtil.Metadata,
defaultChainId: 1,
+ chains: EthersConstants.chains,
+ coinbasePreference: 'smartWalletOnly',
auth: {
- socials: ['google', 'x', 'discord', 'farcaster', 'github', 'apple', 'facebook']
+ email: true,
+ socials: []
}
}),
chains: EthersConstants.chains,
diff --git a/apps/laboratory/src/pages/library/ethers5-email.tsx b/apps/laboratory/src/pages/library/ethers5-no-socials.tsx
similarity index 82%
rename from apps/laboratory/src/pages/library/ethers5-email.tsx
rename to apps/laboratory/src/pages/library/ethers5-no-socials.tsx
index 26f5669a19..8b90886600 100644
--- a/apps/laboratory/src/pages/library/ethers5-email.tsx
+++ b/apps/laboratory/src/pages/library/ethers5-no-socials.tsx
@@ -3,16 +3,20 @@ import { ThemeStore } from '../../utils/StoreUtil'
import { EthersConstants } from '../../utils/EthersConstants'
import { ConstantsUtil } from '../../utils/ConstantsUtil'
import { AppKitButtons } from '../../components/AppKitButtons'
-import { Ethers5ModalInfo } from '../../components/Ethers/Ethers5ModalInfo'
+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: {
- socials: ['google', 'x', 'discord', 'farcaster', 'github', 'apple', 'facebook']
- }
+ email: true,
+ socials: []
+ },
+ coinbasePreference: 'smartWalletOnly'
}),
chains: EthersConstants.chains,
projectId: ConstantsUtil.ProjectId,
@@ -20,6 +24,7 @@ const modal = createWeb3Modal({
metadata: ConstantsUtil.Metadata,
termsConditionsUrl: 'https://walletconnect.com/terms',
privacyPolicyUrl: 'https://walletconnect.com/privacy',
+ siweConfig,
customWallets: ConstantsUtil.CustomWallets
})
@@ -30,6 +35,7 @@ export default function Ethers() {
<>
+
>
)
diff --git a/apps/laboratory/src/pages/library/solana-no-email.tsx b/apps/laboratory/src/pages/library/solana-no-email.tsx
new file mode 100644
index 0000000000..948898de61
--- /dev/null
+++ b/apps/laboratory/src/pages/library/solana-no-email.tsx
@@ -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: false,
+ 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 (
+ <>
+
+
+ >
+ )
+}
diff --git a/apps/laboratory/src/pages/library/solana-email.tsx b/apps/laboratory/src/pages/library/solana-no-socials.tsx
similarity index 90%
rename from apps/laboratory/src/pages/library/solana-email.tsx
rename to apps/laboratory/src/pages/library/solana-no-socials.tsx
index 5b4779363a..49de15a2d2 100644
--- a/apps/laboratory/src/pages/library/solana-email.tsx
+++ b/apps/laboratory/src/pages/library/solana-no-socials.tsx
@@ -15,9 +15,7 @@ export const solanaConfig = defaultSolanaConfig({
metadata: ConstantsUtil.Metadata,
auth: {
email: true,
- socials: ['google', 'x', 'discord', 'farcaster', 'github', 'apple', 'facebook'],
- walletFeatures: true,
- showWallets: true
+ socials: []
}
})
@@ -25,6 +23,7 @@ const modal = createWeb3Modal({
solanaConfig,
projectId: ConstantsUtil.ProjectId,
metadata: ConstantsUtil.Metadata,
+ defaultChain: solana,
chains,
enableAnalytics: false,
termsConditionsUrl: 'https://walletconnect.com/terms',
diff --git a/apps/laboratory/src/pages/library/solana.tsx b/apps/laboratory/src/pages/library/solana.tsx
index a932d9b084..137fc71bff 100644
--- a/apps/laboratory/src/pages/library/solana.tsx
+++ b/apps/laboratory/src/pages/library/solana.tsx
@@ -19,7 +19,6 @@ const modal = createWeb3Modal({
solanaConfig,
projectId: ConstantsUtil.ProjectId,
metadata: ConstantsUtil.Metadata,
- defaultChain: solana,
chains,
enableAnalytics: false,
termsConditionsUrl: 'https://walletconnect.com/terms',
diff --git a/apps/laboratory/src/pages/library/wagmi-email.tsx b/apps/laboratory/src/pages/library/wagmi-no-email.tsx
similarity index 84%
rename from apps/laboratory/src/pages/library/wagmi-email.tsx
rename to apps/laboratory/src/pages/library/wagmi-no-email.tsx
index ca08b9aad1..0f4a87169e 100644
--- a/apps/laboratory/src/pages/library/wagmi-email.tsx
+++ b/apps/laboratory/src/pages/library/wagmi-no-email.tsx
@@ -1,17 +1,16 @@
import { createWeb3Modal } from '@web3modal/wagmi/react'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
-import { useEffect, useState } from 'react'
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'
-import { getWagmiConfig } from '../../utils/WagmiConstants'
const queryClient = new QueryClient()
-const wagmiConfig = getWagmiConfig('email')
+const wagmiConfig = getWagmiConfig('default', { auth: { email: false, socials: [] } })
const modal = createWeb3Modal({
wagmiConfig,
@@ -26,13 +25,7 @@ const modal = createWeb3Modal({
ThemeStore.setModal(modal)
export default function Wagmi() {
- const [ready, setReady] = useState(false)
-
- useEffect(() => {
- setReady(true)
- }, [])
-
- return ready ? (
+ return (
@@ -40,5 +33,5 @@ export default function Wagmi() {
- ) : null
+ )
}
diff --git a/apps/laboratory/src/pages/library/wagmi-no-socials.tsx b/apps/laboratory/src/pages/library/wagmi-no-socials.tsx
new file mode 100644
index 0000000000..e5dc8e07f4
--- /dev/null
+++ b/apps/laboratory/src/pages/library/wagmi-no-socials.tsx
@@ -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 (
+
+
+
+
+
+
+
+ )
+}
diff --git a/apps/laboratory/src/pages/library/wagmi-permissions-async.tsx b/apps/laboratory/src/pages/library/wagmi-permissions-async.tsx
index 88f9bfe1f6..55396e7b11 100644
--- a/apps/laboratory/src/pages/library/wagmi-permissions-async.tsx
+++ b/apps/laboratory/src/pages/library/wagmi-permissions-async.tsx
@@ -5,10 +5,11 @@ import { AppKitButtons } from '../../components/AppKitButtons'
import { ThemeStore } from '../../utils/StoreUtil'
import { ConstantsUtil } from '../../utils/ConstantsUtil'
import { getWagmiConfig } from '../../utils/WagmiConstants'
-import { WagmiPermissionsAsyncProvider } from '../../context/WagmiPermissionsAsyncContext'
+import { ERC7715PermissionsProvider } from '../../context/ERC7715PermissionsContext'
import { walletConnect } from '@wagmi/connectors'
import { OPTIONAL_METHODS } from '@walletconnect/ethereum-provider'
import { WagmiPermissionsAsyncTest } from '../../components/Wagmi/WagmiPermissionsAsyncTest'
+import { LocalEcdsaKeyProvider } from '../../context/LocalEcdsaKeyContext'
const queryClient = new QueryClient()
const connectors = [
@@ -36,10 +37,12 @@ export default function Wagmi() {
return (
-
-
-
-
+
+
+
+
+
+
)
diff --git a/apps/laboratory/src/pages/library/wagmi-permissions-sync.tsx b/apps/laboratory/src/pages/library/wagmi-permissions-sync.tsx
index d320566bab..6a715725b9 100644
--- a/apps/laboratory/src/pages/library/wagmi-permissions-sync.tsx
+++ b/apps/laboratory/src/pages/library/wagmi-permissions-sync.tsx
@@ -5,10 +5,11 @@ import { AppKitButtons } from '../../components/AppKitButtons'
import { ThemeStore } from '../../utils/StoreUtil'
import { ConstantsUtil } from '../../utils/ConstantsUtil'
import { getWagmiConfig } from '../../utils/WagmiConstants'
-import { WagmiPermissionsSyncProvider } from '../../context/WagmiPermissionsSyncContext'
+import { PasskeyProvider } from '../../context/PasskeyContext'
import { walletConnect } from '@wagmi/connectors'
import { OPTIONAL_METHODS } from '@walletconnect/ethereum-provider'
import { WagmiPermissionsSyncTest } from '../../components/Wagmi/WagmiPermissionsSyncTest'
+import { ERC7715PermissionsProvider } from '../../context/ERC7715PermissionsContext'
const queryClient = new QueryClient()
const connectors = [
@@ -36,10 +37,12 @@ export default function Wagmi() {
return (
-
-
-
-
+
+
+
+
+
+
)
diff --git a/apps/laboratory/src/utils/ConstantsUtil.ts b/apps/laboratory/src/utils/ConstantsUtil.ts
index 7323c95760..99ee2824f4 100644
--- a/apps/laboratory/src/utils/ConstantsUtil.ts
+++ b/apps/laboratory/src/utils/ConstantsUtil.ts
@@ -1,9 +1,19 @@
+import { getLocalStorageItem } from './LocalStorage'
+
const projectId = process.env['NEXT_PUBLIC_PROJECT_ID']
if (!projectId) {
throw new Error('NEXT_PUBLIC_PROJECT_ID is not set')
}
export const WALLET_URL = process.env['WALLET_URL'] || 'https://react-wallet.walletconnect.com/'
+export const WC_COSIGNER_BASE_URL = 'https://rpc.walletconnect.org/v1/sessions'
+export const USEROP_BUILDER_SERVICE_BASE_URL = 'https://react-wallet.walletconnect.com/api'
+
export function getPublicUrl() {
+ const publicUrl = process.env['NEXT_PUBLIC_PUBLIC_URL']
+ if (publicUrl) {
+ return publicUrl
+ }
+
const vercelUrl = process.env['NEXT_PUBLIC_VERCEL_URL']
if (vercelUrl) {
return `https://${vercelUrl}`
@@ -17,7 +27,7 @@ export const CUSTOM_WALLET = 'wc:custom_wallet'
// eslint-disable-next-line init-declarations
let storedCustomWallet
if (typeof window !== 'undefined') {
- storedCustomWallet = localStorage.getItem(CUSTOM_WALLET)
+ storedCustomWallet = getLocalStorageItem(CUSTOM_WALLET)
}
const customWallet = storedCustomWallet ? [JSON.parse(storedCustomWallet)] : []
diff --git a/apps/laboratory/src/utils/DataUtil.ts b/apps/laboratory/src/utils/DataUtil.ts
index 0df89c101b..786d658ca0 100644
--- a/apps/laboratory/src/utils/DataUtil.ts
+++ b/apps/laboratory/src/utils/DataUtil.ts
@@ -30,9 +30,14 @@ export const wagmiSdkOptions = [
description: 'Configuration using wagmi and implementing sign in with ethereum'
},
{
- title: 'Email & Social',
- link: '/library/wagmi-email/',
- description: 'Configuration using wagmi and implementing email and social login'
+ title: 'Without Email',
+ link: '/library/wagmi-no-email/',
+ description: 'Configuration using wagmi without email'
+ },
+ {
+ title: 'Without Socials',
+ link: '/library/wagmi-no-socials/',
+ description: 'Configuration using wagmi without socials'
},
{
title: 'Permissions(Sync)',
@@ -58,9 +63,14 @@ export const ethersSdkOptions = [
description: 'Configuration using ethers and implementing sign in with ethereum'
},
{
- title: 'Email and Social',
- link: '/library/ethers-email/',
- description: 'Configuration using ethers and implementing email and social login'
+ title: 'Without Email',
+ link: '/library/ethers-no-email/',
+ description: 'Configuration using ethers without email'
+ },
+ {
+ title: 'Without Socials',
+ link: '/library/ethers-no-socials/',
+ description: 'Configuration using ethers without socials'
}
]
@@ -76,9 +86,9 @@ export const ethers5SdkOptions = [
description: 'Configuration using ethers and implementing sign in with ethereum'
},
{
- title: 'Email and Social',
- link: '/library/ethers5-email/',
- description: 'Configuration using ethers and implementing email and social login'
+ title: 'Without Socials',
+ link: '/library/ethers5-no-socials/',
+ description: 'Configuration using ethers without socials'
}
]
@@ -89,8 +99,13 @@ export const solanaSdkOptions = [
description: 'Basic configuration using solana as a driving library'
},
{
- title: 'Email and Social',
- link: '/library/solana-email/',
- description: 'Configuration using solana and implementing email and social login'
+ title: 'Without Email',
+ link: '/library/solana-no-email/',
+ description: 'Configuration using solana without email'
+ },
+ {
+ title: 'Without Socials',
+ link: '/library/solana-no-socials/',
+ description: 'Configuration using ethers without socials'
}
]
diff --git a/apps/laboratory/src/utils/ERC7715Utils.ts b/apps/laboratory/src/utils/ERC7715Utils.ts
index 2b7ffdee15..1ab32e0c6e 100644
--- a/apps/laboratory/src/utils/ERC7715Utils.ts
+++ b/apps/laboratory/src/utils/ERC7715Utils.ts
@@ -1,37 +1,20 @@
-import type { GrantPermissionsParameters } from 'viem/experimental'
+import type { GrantPermissionsParameters, GrantPermissionsReturnType } from 'viem/experimental'
import { abi as donutContractAbi, address as donutContractAddress } from './DonutContract'
-import { parseEther } from 'viem'
+import { encodeAbiParameters, hashMessage, parseEther, type Chain } from 'viem'
+import { WalletConnectCosigner } from './WalletConnectCosignerUtils'
+import { buildUserOp, type Call, type FillUserOpResponse } from './UserOpBuilderServiceUtils'
+import { signMessage } from 'viem/accounts'
+import { bigIntReplacer } from './CommonUtils'
+import { sign as signWithPasskey } from 'webauthn-p256'
-export function getSampleSyncPermissions(
- secp256k1DID: string,
- passkeyDID: string
-): GrantPermissionsParameters {
- return {
- expiry: Date.now() + 24 * 60 * 60,
- permissions: [
- {
- type: {
- custom: 'donut-purchase'
- },
- data: {
- target: donutContractAddress,
- abi: donutContractAbi,
- valueLimit: parseEther('10').toString(),
- functionName: 'function purchase()'
- },
- policies: []
- }
- ],
- signer: {
- type: 'keys',
- data: {
- ids: [secp256k1DID, passkeyDID]
- }
- }
+export type MultikeySigner = {
+ type: 'keys'
+ data: {
+ ids: string[]
}
}
-export function getSampleAsyncPermissions(keys: string[]): GrantPermissionsParameters {
+export function getPurchaseDonutPermissions(): GrantPermissionsParameters {
return {
expiry: Date.now() + 24 * 60 * 60,
permissions: [
@@ -47,12 +30,181 @@ export function getSampleAsyncPermissions(keys: string[]): GrantPermissionsParam
},
policies: []
}
+ ]
+ }
+}
+
+async function prepareUserOperationWithPermissions(args: {
+ actions: Call[]
+ chain: Chain
+ permissions: GrantPermissionsReturnType
+}): Promise {
+ const { actions, chain, permissions } = args
+ if (!permissions) {
+ throw new Error('No permissions available')
+ }
+ const { signerData, permissionsContext } = permissions
+
+ if (!signerData?.userOpBuilder || !signerData.submitToAddress || !permissionsContext) {
+ throw new Error(`Invalid permissions ${JSON.stringify(permissions, bigIntReplacer)}`)
+ }
+
+ const filledUserOp = await buildUserOp({
+ account: signerData.submitToAddress,
+ chainId: chain.id,
+ calls: actions,
+ capabilities: {
+ permissions: { context: permissionsContext as `0x${string}` }
+ }
+ })
+
+ return filledUserOp
+}
+
+async function signUserOperationWithPasskey(args: {
+ passkeyId: string
+ userOpHash: `0x${string}`
+}): Promise<`0x${string}`> {
+ const { userOpHash, passkeyId } = args
+
+ const ethMessageUserOpHash = hashMessage({ raw: userOpHash })
+ const usersPasskeySignature = await signWithPasskey({
+ credentialId: passkeyId,
+ hash: ethMessageUserOpHash
+ })
+
+ const authenticatorData = usersPasskeySignature.webauthn.authenticatorData
+ const clientDataJSON = usersPasskeySignature.webauthn.clientDataJSON
+ const responseTypeLocation = usersPasskeySignature.webauthn.typeIndex
+ // Const userVerificationRequired = usersPasskeySignature.webauthn.userVerificationRequired
+ const r = usersPasskeySignature.signature.r
+ const s = usersPasskeySignature.signature.s
+
+ const passkeySignature = encodeAbiParameters(
+ [
+ { type: 'bytes' },
+ { type: 'string' },
+ { type: 'uint256' },
+ { type: 'uint256' },
+ { type: 'uint256' },
+ { type: 'bool' }
],
- signer: {
- type: 'keys',
- data: {
- ids: keys
- }
+ [authenticatorData, clientDataJSON, responseTypeLocation, r, s, false]
+ )
+
+ return passkeySignature
+}
+
+async function signUserOperationWithECDSAKey(args: {
+ ecdsaPrivateKey: `0x${string}`
+ userOpHash: `0x${string}`
+}): Promise<`0x${string}`> {
+ const { ecdsaPrivateKey, userOpHash } = args
+
+ const dappSignatureOnUserOp = await signMessage({
+ privateKey: ecdsaPrivateKey,
+ message: { raw: userOpHash }
+ })
+
+ return dappSignatureOnUserOp
+}
+
+export async function executeActionsWithPasskeyAndCosignerPermissions(args: {
+ actions: Call[]
+ passkeyId: string
+ chain: Chain
+ permissions: GrantPermissionsReturnType
+ pci: string
+}): Promise<`0x${string}`> {
+ const { actions, passkeyId, chain, permissions, pci } = args
+ const accountAddress = permissions?.signerData?.submitToAddress
+ if (!accountAddress) {
+ throw new Error(`Unable to get account details from granted permission`)
+ }
+
+ if (!pci) {
+ throw new Error('No WC_COSIGNER PCI data available')
+ }
+ const caip10Address = `eip155:${chain?.id}:${accountAddress}`
+ const filledUserOp = await prepareUserOperationWithPermissions({
+ actions,
+ chain,
+ permissions
+ })
+ const userOp = filledUserOp.userOp
+ const signature = await signUserOperationWithPasskey({
+ passkeyId,
+ userOpHash: filledUserOp.hash
+ })
+
+ userOp.signature = signature
+
+ const walletConnectCosigner = new WalletConnectCosigner()
+ const cosignResponse = await walletConnectCosigner.coSignUserOperation(caip10Address, {
+ pci,
+ userOp: {
+ ...userOp,
+ callData: userOp.callData,
+ callGasLimit: BigInt(userOp.callGasLimit),
+ nonce: BigInt(userOp.nonce),
+ preVerificationGas: BigInt(userOp.preVerificationGas),
+ verificationGasLimit: BigInt(userOp.verificationGasLimit),
+ sender: userOp.sender,
+ signature: userOp.signature,
+ maxFeePerGas: BigInt(userOp.maxFeePerGas),
+ maxPriorityFeePerGas: BigInt(userOp.maxPriorityFeePerGas)
}
+ })
+
+ return cosignResponse.receipt as `0x${string}`
+}
+
+export async function executeActionsWithECDSAAndCosignerPermissions(args: {
+ actions: Call[]
+ ecdsaPrivateKey: `0x${string}`
+ chain: Chain
+ permissions: GrantPermissionsReturnType
+ pci: string
+}): Promise<`0x${string}`> {
+ const { ecdsaPrivateKey, actions, chain, permissions, pci } = args
+ const accountAddress = permissions?.signerData?.submitToAddress
+ if (!accountAddress) {
+ throw new Error(`Unable to get account details from granted permission`)
}
+
+ if (!pci) {
+ throw new Error('No WC_COSIGNER PCI data available')
+ }
+ const caip10Address = `eip155:${chain?.id}:${accountAddress}`
+ const filledUserOp = await prepareUserOperationWithPermissions({
+ actions,
+ chain,
+ permissions
+ })
+ const userOp = filledUserOp.userOp
+
+ const dappSignature = await signUserOperationWithECDSAKey({
+ ecdsaPrivateKey,
+ userOpHash: filledUserOp.hash
+ })
+
+ userOp.signature = dappSignature
+ const walletConnectCosigner = new WalletConnectCosigner()
+ const cosignResponse = await walletConnectCosigner.coSignUserOperation(caip10Address, {
+ pci,
+ userOp: {
+ ...userOp,
+ callData: userOp.callData,
+ callGasLimit: BigInt(userOp.callGasLimit),
+ nonce: BigInt(userOp.nonce),
+ preVerificationGas: BigInt(userOp.preVerificationGas),
+ verificationGasLimit: BigInt(userOp.verificationGasLimit),
+ sender: userOp.sender,
+ signature: userOp.signature,
+ maxFeePerGas: BigInt(userOp.maxFeePerGas),
+ maxPriorityFeePerGas: BigInt(userOp.maxPriorityFeePerGas)
+ }
+ })
+
+ return cosignResponse.receipt as `0x${string}`
}
diff --git a/apps/laboratory/src/utils/EncodingUtils.ts b/apps/laboratory/src/utils/EncodingUtils.ts
index 56b32b3abe..e8c8a7bf19 100644
--- a/apps/laboratory/src/utils/EncodingUtils.ts
+++ b/apps/laboratory/src/utils/EncodingUtils.ts
@@ -3,6 +3,12 @@ import bs58 from 'bs58'
const PUBLIC_KEY_PREFIX = 0x04
const PUBLIC_KEY_LENGTH = 65
+// eslint-disable-next-line no-shadow
+export enum KeyTypes {
+ secp256k1 = 'secp256k1',
+ secp256r1 = 'secp256r1'
+}
+
export function encodePublicKeyToDID(publicKey: string, keyType: string): string {
// Define the key type to DID prefix mapping
const keyTypeToDIDPrefix: Record = {
@@ -31,6 +37,43 @@ export function encodePublicKeyToDID(publicKey: string, keyType: string): string
return `${didPrefix}${encodedPublicKey}`
}
+export function decodeDIDToPublicKey(did: string): {
+ key: `0x${string}`
+ keyType: KeyTypes
+} {
+ // Define the DID prefix to key type mapping
+ const didPrefixToKeyType: Record = {
+ 'did:key:zQ3s': KeyTypes.secp256k1,
+ 'did:key:zDn': KeyTypes.secp256r1
+ }
+
+ // Find the matching key type prefix
+ const matchingPrefix = Object.keys(didPrefixToKeyType).find(prefix => did.startsWith(prefix))
+
+ if (!matchingPrefix) {
+ throw new Error('Invalid DID format. Unsupported key type.')
+ }
+
+ // Extract the Base58 encoded part
+ const encodedPart = did.slice(matchingPrefix.length)
+
+ // Decode the Base58 string
+ const decodedBuffer = bs58.decode(encodedPart)
+
+ // Convert the Buffer to a hex string
+ const publicKey = Buffer.from(decodedBuffer).toString('hex')
+
+ // Add the '0x' prefix
+ const formattedPublicKey = `0x${publicKey}`
+
+ const keyType = didPrefixToKeyType[matchingPrefix]
+
+ return {
+ key: formattedPublicKey as `0x${string}`,
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ keyType: keyType!
+ }
+}
export function decodeUncompressedPublicKey(uncompressedPublicKey: string): `0x${string}` {
const uncompressedPublicKeyBuffer = Buffer.from(uncompressedPublicKey, 'base64')
diff --git a/apps/laboratory/src/utils/LocalStorage.ts b/apps/laboratory/src/utils/LocalStorage.ts
index b75d0e6cad..7e529cca9b 100644
--- a/apps/laboratory/src/utils/LocalStorage.ts
+++ b/apps/laboratory/src/utils/LocalStorage.ts
@@ -11,12 +11,14 @@ export const WC_COSIGNER_DATA = 'wc_cosignerData'
* @param value - The value to be stored. It will be converted to a string using JSON.stringify.
* @template T - The type of the value being stored.
*/
-function setItem(key: string, value: T) {
- // To prevent silly mistakes with double stringifying
- if (typeof value === 'string') {
- localStorage.setItem(key, value)
- } else {
- localStorage?.setItem(key, JSON.stringify(value, bigIntReplacer))
+function setLocalStorageItem(key: string, value: T) {
+ if (typeof window !== 'undefined') {
+ // To prevent silly mistakes with double stringifying
+ if (typeof value === 'string') {
+ window.localStorage.setItem(key, value)
+ } else {
+ window.localStorage.setItem(key, JSON.stringify(value, bigIntReplacer))
+ }
}
}
@@ -26,12 +28,18 @@ function setItem(key: string, value: T) {
* @param key - The key of the item to retrieve.
* @returns The value associated with the key, or null if the key does not exist.
*/
-function getItem(key: string): string | null {
- return localStorage.getItem(key)
+function getLocalStorageItem(key: string): string | null {
+ if (typeof window !== 'undefined') {
+ return window.localStorage.getItem(key)
+ }
+
+ return null
}
-function removeItem(key: string) {
- localStorage.removeItem(key)
+function removeLocalStorageItem(key: string) {
+ if (typeof window !== 'undefined') {
+ window.localStorage.removeItem(key)
+ }
}
export type PasskeyLocalStorageFormat = {
@@ -41,4 +49,4 @@ export type PasskeyLocalStorageFormat = {
y: string
}
}
-export { setItem, getItem, removeItem }
+export { setLocalStorageItem, getLocalStorageItem, removeLocalStorageItem }
diff --git a/apps/laboratory/src/utils/PermissionsUtils.ts b/apps/laboratory/src/utils/PermissionsUtils.ts
deleted file mode 100644
index cb1e68fffa..0000000000
--- a/apps/laboratory/src/utils/PermissionsUtils.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import { ENTRYPOINT_ADDRESS_V07, createBundlerClient } from 'permissionless'
-import { pimlicoBundlerActions, pimlicoPaymasterActions } from 'permissionless/actions/pimlico'
-import { createPimlicoPaymasterClient } from 'permissionless/clients/pimlico'
-import { createPublicClient, http, type Chain } from 'viem'
-
-export function getPublicClientUrl(): string {
- const localPublicClientUrl = process.env['NEXT_PUBLIC_LOCAL_CLIENT_URL']
- if (localPublicClientUrl) {
- return localPublicClientUrl
- }
-
- return ''
-}
-
-export function getBundlerUrl(): string {
- const localBundlerUrl = process.env['NEXT_PUBLIC_LOCAL_BUNDLER_URL']
- if (localBundlerUrl) {
- return localBundlerUrl
- }
- const apiKey = process.env['NEXT_PUBLIC_PIMLICO_KEY']
- if (!apiKey) {
- throw new Error('env NEXT_PUBLIC_PIMLICO_KEY missing.')
- }
-
- return `https://api.pimlico.io/v2/sepolia/rpc?apikey=${apiKey}`
-}
-
-export function getPaymasterUrl(): string {
- const localPaymasterUrl = process.env['NEXT_PUBLIC_LOCAL_PAYMASTER_URL']
- if (localPaymasterUrl) {
- return localPaymasterUrl
- }
- const apiKey = process.env['NEXT_PUBLIC_PIMLICO_KEY']
- if (!apiKey) {
- throw new Error('env NEXT_PUBLIC_PIMLICO_KEY missing.')
- }
-
- return `https://api.pimlico.io/v2/sepolia/rpc?apikey=${apiKey}`
-}
-
-export function createClients(chain: Chain) {
- const publicClientUrl = getPublicClientUrl()
- const bundlerUrl = getBundlerUrl()
- const paymasterUrl = getPaymasterUrl()
- const publicClient = createPublicClient({
- transport: http(publicClientUrl),
- chain
- })
-
- const bundlerClient = createBundlerClient({
- transport: http(bundlerUrl, {
- timeout: 30000
- }),
- entryPoint: ENTRYPOINT_ADDRESS_V07,
- chain
- })
- .extend(pimlicoBundlerActions(ENTRYPOINT_ADDRESS_V07))
- .extend(pimlicoPaymasterActions(ENTRYPOINT_ADDRESS_V07))
-
- const pimlicoPaymasterClient = createPimlicoPaymasterClient({
- transport: http(paymasterUrl),
- entryPoint: ENTRYPOINT_ADDRESS_V07,
- chain
- })
-
- return { publicClient, bundlerClient, pimlicoPaymasterClient }
-}
diff --git a/apps/laboratory/src/utils/UserOpBuilderServiceUtils.ts b/apps/laboratory/src/utils/UserOpBuilderServiceUtils.ts
new file mode 100644
index 0000000000..fb0f4933f1
--- /dev/null
+++ b/apps/laboratory/src/utils/UserOpBuilderServiceUtils.ts
@@ -0,0 +1,141 @@
+import axios, { AxiosError } from 'axios'
+import { bigIntReplacer } from '../utils/CommonUtils'
+import type { Address, Hex } from 'viem'
+import { USEROP_BUILDER_SERVICE_BASE_URL } from './ConstantsUtil'
+
+export type Call = { to: Address; value: bigint; data: Hex }
+
+export type BuildUserOpRequestArguments = {
+ account: Address
+ chainId: number
+ calls: Call[]
+ capabilities: {
+ paymasterService?: { url: string }
+ permissions?: { context: Hex }
+ }
+}
+/**
+ * UserOperation v0.7
+ */
+export type UserOperation = {
+ sender: Address
+ nonce: bigint
+ factory?: Address
+ factoryData?: Hex
+ callData: Hex
+ callGasLimit: bigint
+ verificationGasLimit: bigint
+ preVerificationGas: bigint
+ maxFeePerGas: bigint
+ maxPriorityFeePerGas: bigint
+ paymaster?: Address
+ paymasterVerificationGasLimit?: bigint
+ paymasterPostOpGasLimit?: bigint
+ paymasterData?: Hex
+ signature: Hex
+ initCode?: never
+ paymasterAndData?: never
+}
+
+export type FillUserOpResponse = {
+ userOp: UserOperation
+ hash: Hex
+}
+
+export type ErrorResponse = {
+ message: string
+ error: string
+}
+
+export type SendUserOpWithSignatureParams = {
+ chainId: number
+ userOp: UserOperation
+ signature: Hex
+ permissionsContext?: Hex
+}
+export type SendUserOpWithSignatureResponse = {
+ receipt: Hex
+}
+
+// Define a custom error type
+export class UserOpBuilderApiError extends Error {
+ constructor(
+ public status: number,
+ message: string
+ ) {
+ super(message)
+ this.name = 'UserOpBuilderApiError'
+ }
+}
+
+// Function to send requests to the CoSigner API
+async function sendUserOpBuilderRequest<
+ TRequest,
+ TResponse extends object,
+ TQueryParams extends Record = Record
+>(args: {
+ url: string
+ headers: Record
+ data: TRequest
+ queryParams?: TQueryParams
+ transformRequest?: (data: TRequest) => unknown
+}): Promise {
+ const { url, data, queryParams, headers, transformRequest } = args
+ const transformedData = transformRequest ? transformRequest(data) : data
+
+ try {
+ const response = await axios.post(url, transformedData, {
+ params: queryParams,
+ headers
+ })
+
+ if ('error' in response.data) {
+ throw new Error(response.data.error)
+ }
+
+ return response.data
+ } catch (error) {
+ if (axios.isAxiosError(error)) {
+ const axiosError = error as AxiosError
+ if (axiosError.response) {
+ throw new UserOpBuilderApiError(
+ axiosError.response.status,
+ JSON.stringify(axiosError.response.data)
+ )
+ } else {
+ throw new UserOpBuilderApiError(500, 'Network error')
+ }
+ }
+ // Re-throw if it's not an Axios error
+ throw error
+ }
+}
+
+export async function buildUserOp(args: BuildUserOpRequestArguments): Promise {
+ const response = await sendUserOpBuilderRequest({
+ url: `${USEROP_BUILDER_SERVICE_BASE_URL}/build`,
+ data: args,
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ transformRequest: data => JSON.stringify(data, bigIntReplacer)
+ })
+
+ return response
+}
+
+export async function sendUserOp(args: SendUserOpWithSignatureParams) {
+ const response = await sendUserOpBuilderRequest<
+ SendUserOpWithSignatureParams,
+ SendUserOpWithSignatureResponse
+ >({
+ url: `${USEROP_BUILDER_SERVICE_BASE_URL}/sendUserOp`,
+ data: args,
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ transformRequest: data => JSON.stringify(data, bigIntReplacer)
+ })
+
+ return response
+}
diff --git a/apps/laboratory/src/utils/WalletConnectCosignerUtils.ts b/apps/laboratory/src/utils/WalletConnectCosignerUtils.ts
new file mode 100644
index 0000000000..f244534fb3
--- /dev/null
+++ b/apps/laboratory/src/utils/WalletConnectCosignerUtils.ts
@@ -0,0 +1,177 @@
+/* eslint-disable max-classes-per-file */
+import axios, { AxiosError } from 'axios'
+import { bigIntReplacer } from './CommonUtils'
+import type { UserOperation } from './UserOpBuilderServiceUtils'
+import { WC_COSIGNER_BASE_URL } from './ConstantsUtil'
+
+// Define types for the request and response
+type AddPermission = {
+ permissionType: string
+ data: string
+ required: boolean
+ onChainValidated: boolean
+}
+
+type AddPermissionRequest = {
+ permission: AddPermission
+}
+
+export type AddPermissionResponse = {
+ pci: string
+ key: string
+}
+
+type Signer = {
+ type: string
+ data: {
+ ids: string[]
+ }
+}
+
+type SignerData = {
+ userOpBuilder: string
+}
+
+type PermissionsContext = {
+ signer: Signer
+ expiry: number
+ signerData: SignerData
+ factory?: string
+ factoryData?: string
+ permissionsContext: string
+}
+
+type UpdatePermissionsContextRequest = {
+ pci: string
+ signature?: string
+ context: PermissionsContext
+}
+
+type RevokePermissionRequest = {
+ pci: string
+ signature: string
+}
+
+type CoSignRequest = {
+ pci: string
+ userOp: UserOperation
+}
+
+type CoSignResponse = {
+ receipt: string
+}
+
+// Define a custom error type
+export class CoSignerApiError extends Error {
+ constructor(
+ public status: number,
+ message: string
+ ) {
+ super(message)
+ this.name = 'CoSignerApiError'
+ }
+}
+
+// Function to send requests to the CoSigner API
+async function sendCoSignerRequest<
+ TRequest,
+ TResponse,
+ TQueryParams extends Record = Record
+>(args: {
+ url: string
+ data: TRequest
+ queryParams?: TQueryParams
+ headers: Record
+ transformRequest?: (data: TRequest) => unknown
+}): Promise {
+ const { url, data, queryParams = {}, headers, transformRequest } = args
+ const transformedData = transformRequest ? transformRequest(data) : data
+
+ try {
+ const response = await axios.post(url, transformedData, {
+ params: queryParams,
+ headers
+ })
+
+ return response.data
+ } catch (error) {
+ if (axios.isAxiosError(error)) {
+ const axiosError = error as AxiosError
+ if (axiosError.response) {
+ throw new CoSignerApiError(
+ axiosError.response.status,
+ JSON.stringify(axiosError.response.data)
+ )
+ } else {
+ throw new CoSignerApiError(500, 'Network error')
+ }
+ }
+ // Re-throw if it's not an Axios error
+ throw error
+ }
+}
+
+// Class to interact with the WalletConnect CoSigner API
+export class WalletConnectCosigner {
+ private baseUrl: string
+ private projectId: string
+
+ constructor() {
+ this.baseUrl = WC_COSIGNER_BASE_URL
+ const projectId = process.env['NEXT_PUBLIC_PROJECT_ID']
+ if (!projectId) {
+ throw new Error('NEXT_PUBLIC_PROJECT_ID is not set')
+ }
+ this.projectId = projectId
+ }
+
+ async addPermission(address: string, permission: AddPermission): Promise {
+ const url = `${this.baseUrl}/${encodeURIComponent(address)}`
+
+ return await sendCoSignerRequest<
+ AddPermissionRequest,
+ AddPermissionResponse,
+ { projectId: string }
+ >({
+ url,
+ data: { permission },
+ queryParams: { projectId: this.projectId },
+ headers: { 'Content-Type': 'application/json' }
+ })
+ }
+
+ async updatePermissionsContext(
+ address: string,
+ updateData: UpdatePermissionsContextRequest
+ ): Promise {
+ const url = `${this.baseUrl}/${encodeURIComponent(address)}/context`
+ await sendCoSignerRequest({
+ url,
+ data: updateData,
+ queryParams: { projectId: this.projectId },
+ headers: { 'Content-Type': 'application/json' }
+ })
+ }
+
+ async revokePermission(address: string, revokeData: RevokePermissionRequest): Promise {
+ const url = `${this.baseUrl}/${encodeURIComponent(address)}/revoke`
+ await sendCoSignerRequest({
+ url,
+ data: revokeData,
+ queryParams: { projectId: this.projectId },
+ headers: { 'Content-Type': 'application/json' }
+ })
+ }
+
+ async coSignUserOperation(address: string, coSignData: CoSignRequest): Promise {
+ const url = `${this.baseUrl}/${encodeURIComponent(address)}/sign`
+
+ return await sendCoSignerRequest({
+ url,
+ data: coSignData,
+ queryParams: { projectId: this.projectId },
+ headers: { 'Content-Type': 'application/json' },
+ transformRequest: (value: CoSignRequest) => JSON.stringify(value, bigIntReplacer)
+ })
+ }
+}
diff --git a/apps/laboratory/tests/basic-tests.spec.ts b/apps/laboratory/tests/basic-tests.spec.ts
index ebf7fc8187..1c1c4d0a27 100644
--- a/apps/laboratory/tests/basic-tests.spec.ts
+++ b/apps/laboratory/tests/basic-tests.spec.ts
@@ -13,6 +13,12 @@ testM.describe('Modal only tests', () => {
await openHookButton.click()
await expect(modalPage.page.getByTestId('all-wallets')).toBeVisible()
})
+
+ testM('Should show socials enabled by default', async ({ modalPage }) => {
+ const modalValidator = new ModalValidator(modalPage.page)
+ await modalPage.page.getByTestId('connect-button').click()
+ await modalValidator.expectSocialsVisible()
+ })
})
testMExternal.describe('External connectors tests', () => {
diff --git a/apps/laboratory/tests/email.spec.ts b/apps/laboratory/tests/email.spec.ts
index 124b2f246c..e9acc7d284 100644
--- a/apps/laboratory/tests/email.spec.ts
+++ b/apps/laboratory/tests/email.spec.ts
@@ -19,11 +19,11 @@ const emailTest = test.extend<{ library: string }>({
emailTest.describe.configure({ mode: 'serial' })
emailTest.beforeAll(async ({ browser, library }) => {
- emailTest.setTimeout(180000)
+ emailTest.setTimeout(300000)
context = await browser.newContext()
browserPage = await context.newPage()
- page = new ModalWalletPage(browserPage, library, 'email')
+ page = new ModalWalletPage(browserPage, library, 'default')
validator = new ModalWalletValidator(browserPage)
await page.load()
@@ -63,14 +63,10 @@ emailTest('it should reject sign', async () => {
await validator.expectRejectedSign()
})
-emailTest('it should switch network and sign', async ({ library }) => {
+emailTest('it should switch network and sign', async () => {
let targetChain = 'Polygon'
await page.goToSettings()
await page.switchNetwork(targetChain)
- if (library === 'wagmi') {
- // In wagmi, after switching network, it closes the modal
- await page.goToSettings()
- }
await validator.expectSwitchedNetwork(targetChain)
await page.closeModal()
await page.sign()
@@ -80,10 +76,6 @@ emailTest('it should switch network and sign', async ({ library }) => {
targetChain = 'Ethereum'
await page.goToSettings()
await page.switchNetwork(targetChain)
- if (library === 'wagmi') {
- // In wagmi, after switching network, it closes the modal
- await page.goToSettings()
- }
await validator.expectSwitchedNetwork(targetChain)
await page.closeModal()
await page.sign()
diff --git a/apps/laboratory/tests/no-email.spec.ts b/apps/laboratory/tests/no-email.spec.ts
new file mode 100644
index 0000000000..d454f52480
--- /dev/null
+++ b/apps/laboratory/tests/no-email.spec.ts
@@ -0,0 +1,33 @@
+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
+/* eslint-enable init-declarations */
+
+// -- Setup --------------------------------------------------------------------
+const noEmailTest = test.extend<{ library: string }>({
+ library: ['wagmi', { option: true }]
+})
+
+noEmailTest.beforeAll(async ({ browser, library }) => {
+ context = await browser.newContext()
+ const browserPage = await context.newPage()
+
+ modalPage = new ModalPage(browserPage, library, 'no-email')
+ modalValidator = new ModalValidator(browserPage)
+
+ await modalPage.load()
+})
+
+noEmailTest.afterAll(async () => {
+ await modalPage.page.close()
+})
+
+// -- Tests --------------------------------------------------------------------
+noEmailTest('secure site iframe should not be present', () => {
+ modalValidator.expectSecureSiteFrameNotInjected()
+})
diff --git a/apps/laboratory/tests/no-socials.spec.ts b/apps/laboratory/tests/no-socials.spec.ts
new file mode 100644
index 0000000000..4788c610ee
--- /dev/null
+++ b/apps/laboratory/tests/no-socials.spec.ts
@@ -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', async () => {
+ await modalValidator.expectNoSocials()
+})
+
+noSocialsTest('should show email login', async () => {
+ await modalValidator.expectEmailLogin()
+})
diff --git a/apps/laboratory/tests/shared/fixtures/w3m-fixture.ts b/apps/laboratory/tests/shared/fixtures/w3m-fixture.ts
index 2ae08d7c79..886b56f0c5 100644
--- a/apps/laboratory/tests/shared/fixtures/w3m-fixture.ts
+++ b/apps/laboratory/tests/shared/fixtures/w3m-fixture.ts
@@ -27,7 +27,7 @@ export const testM = timingFixture.extend({
export const testMSiwe = timingFixture.extend({
library: ['wagmi', { option: true }],
modalPage: async ({ page, library }, use) => {
- const modalPage = new ModalPage(page, library, 'siwe')
+ const modalPage = new ModalPage(page, library, 'all')
await modalPage.load()
await use(modalPage)
}
diff --git a/apps/laboratory/tests/shared/fixtures/w3m-social-fixture.ts b/apps/laboratory/tests/shared/fixtures/w3m-social-fixture.ts
index 0f2269a915..a545913764 100644
--- a/apps/laboratory/tests/shared/fixtures/w3m-social-fixture.ts
+++ b/apps/laboratory/tests/shared/fixtures/w3m-social-fixture.ts
@@ -10,7 +10,7 @@ export const testMSocial = timingFixture.extend<
library: ['wagmi', { option: true }],
social: ['github'],
modalPage: async ({ page, library }, use) => {
- const modalPage = new ModalPage(page, library, 'email')
+ const modalPage = new ModalPage(page, library, 'default')
await modalPage.load()
const socialMail = process.env['SOCIAL_TEST_EMAIL']
diff --git a/apps/laboratory/tests/shared/pages/ModalPage.ts b/apps/laboratory/tests/shared/pages/ModalPage.ts
index 0d002d6de6..05c1567997 100644
--- a/apps/laboratory/tests/shared/pages/ModalPage.ts
+++ b/apps/laboratory/tests/shared/pages/ModalPage.ts
@@ -14,13 +14,12 @@ const maliciousUrl = 'https://malicious-app-verify-simulation.vercel.app'
export type ModalFlavor =
| 'default'
- | 'siwe'
- | 'email'
- | 'wallet'
| 'external'
| 'verify-valid'
| 'verify-domain-mismatch'
| 'verify-evil'
+ | 'no-email'
+ | 'no-socials'
| 'all'
function getUrlByFlavor(baseUrl: string, library: string, flavor: ModalFlavor) {
@@ -325,6 +324,10 @@ export class ModalPage {
await this.page.getByTestId('account-button').click()
}
+ async openConnectModal() {
+ await this.page.getByTestId('connect-button').click()
+ }
+
async closeModal() {
await this.page.getByTestId('w3m-header-close')?.click?.()
// Wait for the modal fade out animation
diff --git a/apps/laboratory/tests/shared/pages/ModalWalletPage.ts b/apps/laboratory/tests/shared/pages/ModalWalletPage.ts
index 15c7f20339..69e62811a4 100644
--- a/apps/laboratory/tests/shared/pages/ModalWalletPage.ts
+++ b/apps/laboratory/tests/shared/pages/ModalWalletPage.ts
@@ -7,7 +7,7 @@ export class ModalWalletPage extends ModalPage {
constructor(
public override readonly page: Page,
public override readonly library: string,
- public override readonly flavor: 'email' | 'all' = 'email'
+ public override readonly flavor: 'default' | 'all'
) {
super(page, library, flavor)
}
@@ -36,7 +36,8 @@ export class ModalWalletPage extends ModalPage {
override async switchNetwork(network: string) {
await this.page.getByTestId('account-switch-network-button').click()
- await this.page.getByTestId(`w3m-network-switch-${network}`).click()
+ const networkToSwitchButton = this.page.getByTestId(`w3m-network-switch-${network}`)
+ await networkToSwitchButton.click()
}
async togglePreferredAccountType() {
diff --git a/apps/laboratory/tests/shared/utils/email.ts b/apps/laboratory/tests/shared/utils/email.ts
index 54b2efd1b2..89b82f1f39 100644
--- a/apps/laboratory/tests/shared/utils/email.ts
+++ b/apps/laboratory/tests/shared/utils/email.ts
@@ -1,6 +1,6 @@
import { Mailsac } from '@mailsac/api'
const EMAIL_CHECK_INTERVAL = 2500
-const MAX_EMAIL_CHECK = 48
+const MAX_EMAIL_CHECK = 96
const EMAIL_APPROVE_BUTTON_TEXT = 'Approve this login'
const APPROVE_URL_REGEX = /https:\/\/register.*/u
const OTP_CODE_REGEX = /\d{3}\s?\d{3}/u
diff --git a/apps/laboratory/tests/shared/utils/project.ts b/apps/laboratory/tests/shared/utils/project.ts
index b1f0d57cf1..1838a2bfec 100644
--- a/apps/laboratory/tests/shared/utils/project.ts
+++ b/apps/laboratory/tests/shared/utils/project.ts
@@ -42,20 +42,23 @@ const SOLANA_DISABLED_TESTS = [
'siwe-sa.spec.ts',
'smart-account.spec.ts',
'wallet-features.spec.ts',
+ 'metamask.spec.ts'
+]
+const WAGMI_DISABLED_TESTS = ['metamask.spec.ts']
+const ETHERS_DISABLED_TESTS = ['metamask.spec.ts']
+const ETHERS5_DISABLED_TESTS = [
'metamask.spec.ts',
- 'verify.spec.ts'
+ 'email.spec.ts',
+ 'wallet-features.spec.ts',
+ 'smart-account.spec.ts',
+ 'siwe-email.spec.ts',
+ 'siwe-sa.spec.ts'
]
-const WAGMI_DISABLED_TESTS = ['metamask.spec.ts', 'smart-account.spec.ts', 'verify.spec.ts']
-const ETHERS_DISABLED_TESTS = ['metamask.spec.ts', 'verify.spec.ts']
-const ETHERS5_DISABLED_TESTS = ['metamask.spec.ts', 'verify.spec.ts', 'smart-account.spec.ts']
const ETHERS_EMAIL_BASED_REGEX = new RegExp(ETHERS_DISABLED_TESTS.join('|'), 'u')
const ETHERS5_EMAIL_BASED_REGEX = new RegExp(ETHERS5_DISABLED_TESTS.join('|'), 'u')
const WAGMI_DISABLED_TESTS_REGEX = new RegExp(WAGMI_DISABLED_TESTS.join('|'), 'u')
-const WAGMI_DISABLED_TESTS_REGEX_FF = new RegExp(
- [...WAGMI_DISABLED_TESTS, 'metamask.spec.ts'].join('|'),
- 'u'
-)
+const WAGMI_DISABLED_TESTS_REGEX_FF = new RegExp([...WAGMI_DISABLED_TESTS].join('|'), 'u')
const SOLANA_DISABLED_TESTS_REGEX = new RegExp(SOLANA_DISABLED_TESTS.join('|'), 'u')
const customProjectProperties: CustomProjectProperties = {
diff --git a/apps/laboratory/tests/shared/validators/ModalValidator.ts b/apps/laboratory/tests/shared/validators/ModalValidator.ts
index aa516b8436..260f1ca1ff 100644
--- a/apps/laboratory/tests/shared/validators/ModalValidator.ts
+++ b/apps/laboratory/tests/shared/validators/ModalValidator.ts
@@ -97,6 +97,21 @@ export class ModalValidator {
await expect(switchNetworkButton).toHaveAttribute('active-network', network)
}
+ expectSecureSiteFrameNotInjected() {
+ const secureSiteIframe = this.page.frame({ name: 'w3m-secure-iframe' })
+ expect(secureSiteIframe).toBeNull()
+ }
+
+ async expectNoSocials() {
+ const socialList = this.page.getByTestId('wui-list-social')
+ await expect(socialList).toBeHidden()
+ }
+
+ async expectEmailLogin() {
+ const emailInput = this.page.getByTestId('wui-email-input')
+ await expect(emailInput).toBeVisible()
+ }
+
async expectValidSignature(signature: `0x${string}`, address: `0x${string}`, chainId: number) {
const isVerified = await verifySignature({
address,
@@ -140,13 +155,9 @@ export class ModalValidator {
await expect(switchNetworkButton).toBeVisible()
}
- async expectOnrampButton(library: string) {
+ async expectOnrampButton(_library: string) {
const onrampButton = this.page.getByTestId('w3m-account-default-onramp-button')
- if (library === 'solana') {
- await expect(onrampButton).toBeHidden()
- } else {
- await expect(onrampButton).toBeVisible()
- }
+ await expect(onrampButton).toBeVisible()
}
async expectAccountNameFound(name: string) {
@@ -188,4 +199,9 @@ export class ModalValidator {
const address = this.page.getByTestId('w3m-address')
await expect(address).not.toHaveText(oldAddress)
}
+
+ async expectSocialsVisible() {
+ const socials = this.page.getByTestId('w3m-social-login-widget')
+ await expect(socials).toBeVisible()
+ }
}
diff --git a/apps/laboratory/tests/siwe-email.spec.ts b/apps/laboratory/tests/siwe-email.spec.ts
index fc85e3f867..f8f8db8823 100644
--- a/apps/laboratory/tests/siwe-email.spec.ts
+++ b/apps/laboratory/tests/siwe-email.spec.ts
@@ -18,7 +18,7 @@ const emailSiweTest = test.extend<{ library: string }>({
emailSiweTest.describe.configure({ mode: 'serial' })
emailSiweTest.beforeAll(async ({ browser, library }) => {
- emailSiweTest.setTimeout(180000)
+ emailSiweTest.setTimeout(300000)
context = await browser.newContext()
const browserPage = await context.newPage()
@@ -65,15 +65,12 @@ emailSiweTest('it should reject sign', async () => {
await validator.expectRejectedSign()
})
-emailSiweTest('it should switch network and sign', async ({ library }) => {
+emailSiweTest('it should switch network and sign', async () => {
let targetChain = 'Polygon'
await page.goToSettings()
await page.switchNetwork(targetChain)
await page.promptSiwe()
await page.approveSign()
- if (library === 'wagmi') {
- await page.goToSettings()
- }
await validator.expectSwitchedNetwork(targetChain)
await page.closeModal()
await page.sign()
@@ -85,9 +82,6 @@ emailSiweTest('it should switch network and sign', async ({ library }) => {
await page.switchNetwork(targetChain)
await page.promptSiwe()
await page.approveSign()
- if (library === 'wagmi') {
- await page.goToSettings()
- }
await validator.expectSwitchedNetwork(targetChain)
await page.closeModal()
await page.sign()
diff --git a/apps/laboratory/tests/siwe-sa.spec.ts b/apps/laboratory/tests/siwe-sa.spec.ts
index a6bd41720c..4def107de1 100644
--- a/apps/laboratory/tests/siwe-sa.spec.ts
+++ b/apps/laboratory/tests/siwe-sa.spec.ts
@@ -18,7 +18,7 @@ const smartAccountSiweTest = test.extend<{ library: string }>({
smartAccountSiweTest.describe.configure({ mode: 'serial' })
smartAccountSiweTest.beforeAll(async ({ browser, library }) => {
- smartAccountSiweTest.setTimeout(180000)
+ smartAccountSiweTest.setTimeout(300000)
context = await browser.newContext()
const browserPage = await context.newPage()
@@ -64,24 +64,18 @@ smartAccountSiweTest('it should upgrade wallet', async () => {
await page.closeModal()
})
-smartAccountSiweTest(
- 'it should switch to a smart account enabled network and sign',
- async ({ library }) => {
- const targetChain = 'Sepolia'
- await page.goToSettings()
- await page.switchNetwork(targetChain)
- await page.promptSiwe()
- await page.approveSign()
- if (library === 'wagmi') {
- await page.goToSettings()
- }
- await validator.expectSwitchedNetwork(targetChain)
- await page.closeModal()
- await page.sign()
- await page.approveSign()
- await validator.expectAcceptedSign()
- }
-)
+smartAccountSiweTest('it should switch to a smart account enabled network and sign', async () => {
+ const targetChain = 'Sepolia'
+ await page.goToSettings()
+ await page.switchNetwork(targetChain)
+ await page.promptSiwe()
+ await page.approveSign()
+ await validator.expectSwitchedNetwork(targetChain)
+ await page.closeModal()
+ await page.sign()
+ await page.approveSign()
+ await validator.expectAcceptedSign()
+})
/**
* After switching to Etherum, the signing the SIWE throws the following Magic error:
diff --git a/apps/laboratory/tests/siwe.spec.ts b/apps/laboratory/tests/siwe.spec.ts
index 02772a7a7c..e2025b14a5 100644
--- a/apps/laboratory/tests/siwe.spec.ts
+++ b/apps/laboratory/tests/siwe.spec.ts
@@ -21,7 +21,7 @@ siweWalletTest.beforeAll(async ({ browser, library }) => {
context = await browser.newContext()
const browserPage = await context.newPage()
- modalPage = new ModalPage(browserPage, library, 'siwe')
+ modalPage = new ModalPage(browserPage, library, 'all')
walletPage = new WalletPage(await context.newPage())
modalValidator = new ModalValidator(browserPage)
diff --git a/apps/laboratory/tests/smart-account.spec.ts b/apps/laboratory/tests/smart-account.spec.ts
index b0485c4f9c..15f4bd2be1 100644
--- a/apps/laboratory/tests/smart-account.spec.ts
+++ b/apps/laboratory/tests/smart-account.spec.ts
@@ -17,11 +17,11 @@ const smartAccountTest = test.extend<{ library: string }>({
smartAccountTest.describe.configure({ mode: 'serial' })
smartAccountTest.beforeAll(async ({ browser, library }) => {
- smartAccountTest.setTimeout(180000)
+ smartAccountTest.setTimeout(300000)
context = await browser.newContext()
const browserPage = await context.newPage()
- page = new ModalWalletPage(browserPage, library)
+ page = new ModalWalletPage(browserPage, library, 'default')
validator = new ModalWalletValidator(browserPage)
await page.load()
@@ -72,9 +72,7 @@ smartAccountTest('it should switch to a not enabled network and sign with EOA',
const targetChain = 'Ethereum'
await page.goToSettings()
await page.switchNetwork(targetChain)
-
- await page.page.waitForTimeout(2000)
- await page.goToSettings()
+ await validator.expectSwitchedNetwork(targetChain)
await validator.expectTogglePreferredTypeVisible(false)
await page.closeModal()
@@ -88,12 +86,13 @@ smartAccountTest('it should switch to smart account and sign', async () => {
await page.goToSettings()
await page.switchNetwork(targetChain)
await validator.expectSwitchedNetwork(targetChain)
-
await page.togglePreferredAccountType()
- await page.goToSettings()
await validator.expectChangePreferredAccountToShow(EOA)
await page.closeModal()
+ // Need some time for Lab UI to refresh state
+ await page.page.waitForTimeout(1000)
+
await page.sign()
await page.approveSign()
await validator.expectAcceptedSign()
@@ -108,10 +107,12 @@ smartAccountTest('it should switch to smart account and sign', async () => {
smartAccountTest('it should switch to eoa and sign', async () => {
await page.goToSettings()
await page.togglePreferredAccountType()
- await page.goToSettings()
await validator.expectChangePreferredAccountToShow(SMART_ACCOUNT)
await page.closeModal()
+ // Need some time for Lab UI to refresh state
+ await page.page.waitForTimeout(1000)
+
await page.sign()
await page.approveSign()
await validator.expectAcceptedSign()
diff --git a/apps/laboratory/tests/verify.spec.ts b/apps/laboratory/tests/verify.spec.ts
index 4452f33ec2..7f68b5f3af 100644
--- a/apps/laboratory/tests/verify.spec.ts
+++ b/apps/laboratory/tests/verify.spec.ts
@@ -11,6 +11,10 @@ import { expect } from '@playwright/test'
testM(
'connection and signature requests from non-verified project should show as cannot verify',
async ({ modalPage, context }) => {
+ if (modalPage.library === 'solana') {
+ return
+ }
+
const modalValidator = new ModalValidator(modalPage.page)
const walletPage = new WalletPage(await context.newPage())
await walletPage.load()
@@ -39,6 +43,10 @@ testM(
testMVerifyValid(
'connection and signature requests from non-scam verified domain should show as domain match',
async ({ modalPage, context }) => {
+ if (modalPage.library === 'solana') {
+ return
+ }
+
const modalValidator = new ModalValidator(modalPage.page)
const walletPage = new WalletPage(await context.newPage())
await walletPage.load()
@@ -67,6 +75,10 @@ testMVerifyValid(
testMVerifyDomainMismatch(
'connection and signature requests from non-scam verified domain but on localhost should show as invalid domain',
async ({ modalPage, context }) => {
+ if (modalPage.library === 'solana') {
+ return
+ }
+
const modalValidator = new ModalValidator(modalPage.page)
const walletPage = new WalletPage(await context.newPage())
await walletPage.load()
@@ -95,6 +107,10 @@ testMVerifyDomainMismatch(
testMVerifyEvil(
'connection and signature requests from scam verified domain should show as scam domain',
async ({ modalPage, context }) => {
+ if (modalPage.library === 'solana') {
+ return
+ }
+
const modalValidator = new ModalValidator(modalPage.page)
const walletPage = new WalletPage(await context.newPage())
await walletPage.load()
diff --git a/apps/laboratory/tests/wallet-features.spec.ts b/apps/laboratory/tests/wallet-features.spec.ts
index 88a2e746bb..6226e74cb7 100644
--- a/apps/laboratory/tests/wallet-features.spec.ts
+++ b/apps/laboratory/tests/wallet-features.spec.ts
@@ -17,11 +17,11 @@ const walletFeaturesTest = test.extend<{ library: string }>({
walletFeaturesTest.describe.configure({ mode: 'serial' })
walletFeaturesTest.beforeAll(async ({ browser, library }) => {
- walletFeaturesTest.setTimeout(180000)
+ walletFeaturesTest.setTimeout(300000)
context = await browser.newContext()
const browserPage = await context.newPage()
- page = new ModalWalletPage(browserPage, library, 'email')
+ page = new ModalWalletPage(browserPage, library, 'default')
validator = new ModalWalletValidator(browserPage)
await page.load()
@@ -65,12 +65,9 @@ walletFeaturesTest('it should initialize onramp as expected', async () => {
await page.closeModal()
})
-walletFeaturesTest('it should find account name as expected', async ({ library }) => {
+walletFeaturesTest('it should find account name as expected', async () => {
await page.goToSettings()
await page.switchNetwork('Polygon')
- if (library === 'wagmi') {
- await page.goToSettings()
- }
await validator.expectSwitchedNetwork('Polygon')
await page.openChooseNameIntro()
diff --git a/dangerfile.ts b/dangerfile.ts
index 915fef1aca..c0de08ef16 100644
--- a/dangerfile.ts
+++ b/dangerfile.ts
@@ -284,13 +284,15 @@ async function checkScaffoldHtmlPackage() {
checkScaffoldHtmlPackage()
// -- Client(s) Package Checks ----------------------------------------------------
+
// -- Helper functions
-const isRelativeImport = (addition: string | undefined) => {
+function isRelativeImport(addition: string | undefined) {
const sameDir = addition?.includes(RELATIVE_IMPORT_SAME_DIR)
const parentDir = addition?.includes(RELATIVE_IMPORT_PARENT_DIR)
+
return sameDir || parentDir
}
-const containsRelativeImportWithoutJSExtension = (addition: string | undefined) => {
+function containsRelativeImportWithoutJSExtension(addition: string | undefined) {
const hasImportStatement = addition?.includes('import')
const lacksJSExtension = !addition?.includes(RELATIVE_IMPORT_EXTENSION)
const hasRelativePath = isRelativeImport(addition)
@@ -352,6 +354,15 @@ async function checkLaboratory() {
warn('Testing spec changed')
}
}
+
+ // Check that no .only is present in tests
+ const test_files = lab_files.filter(f => f.includes('.spec.ts'))
+ for (const f of test_files) {
+ const fileContent = await danger.github.utils.fileContents(f)
+ if (fileContent.includes('.only')) {
+ fail(`${f} contains .only, please remove it`)
+ }
+ }
}
checkLaboratory()
diff --git a/examples/html-ethers/CHANGELOG.md b/examples/html-ethers/CHANGELOG.md
new file mode 100644
index 0000000000..05a754c887
--- /dev/null
+++ b/examples/html-ethers/CHANGELOG.md
@@ -0,0 +1,743 @@
+# @examples/html-ethers5
+
+## 5.1.7
+
+### Patch Changes
+
+- - chore: changed RN links to wildcards by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2839
+ - feat: solana send transaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2802
+ - Feat/solana onramp by @phoenixVS in https://github.com/WalletConnect/web3modal/pull/2525
+ - chore: update assetlinks.json by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2838
+ - Chore/add base sepolia by @tomiir in https://github.com/WalletConnect/web3modal/pull/2840
+ - fix: solana default chain logic by @zoruka in https://github.com/WalletConnect/web3modal/pull/2849
+- Updated dependencies []:
+ - @web3modal/ethers@5.1.8
+
+## 5.1.6
+
+### Patch Changes
+
+- - chore: version bump for 5.1.6 by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2797
+ - fix(deps): update walletconnect to v2.15.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2722
+ - chore: fix public URL by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2806
+ - fix: RPC requests causing modal to close by @tomiir in https://github.com/WalletConnect/web3modal/pull/2799
+ - chore: use apiVersion v2 on names endpoint by @tomiir in https://github.com/WalletConnect/web3modal/pull/2805
+ - fix: import valtio from vanilla path by @jd1378 in https://github.com/WalletConnect/web3modal/pull/2810
+ - chore: use shared gh token by @tomiir in https://github.com/WalletConnect/web3modal/pull/2809
+ - chore: add input secrets to setup workflow by @tomiir in https://github.com/WalletConnect/web3modal/pull/2822
+ - fix: remove deprecated params from sign transaction wc rpc request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2816
+ - chore: changed android and ios links for react native sample apps by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2825
+ - chore: changed order of links by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2826
+ - fix(siwe): fix undefined SIWE chainId by @Cali93 in https://github.com/WalletConnect/web3modal/pull/2820
+ - chore: update monorepo deps to 2.16.1 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2829
+ - fix: don't capitalize first character of email field on mobile by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2815
+ - chore(deps): update dependency ethers to v6.13.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2434
+ - chore(deps): update wagmi by @renovate in https://github.com/WalletConnect/web3modal/pull/2711
+- Updated dependencies []:
+ - @web3modal/ethers@5.1.7
+
+## 5.1.5
+
+### Patch Changes
+
+- fix: update CSP by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2775
+- fix: ethers5 adapter import in exports by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2754
+- fix/missing action functions exports from clients by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2778
+- fix: logics to set default chain by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2787
+- Implement actions using userOpBuilder service instead of permissionless.js by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2758
+- chore: run Playwright on self-hosted runners by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2788
+- chore: add NEXT_PUBLIC_SECURE_SITE_SDK_URL to CSP by @tomiir in https://github.com/WalletConnect/web3modal/pull/2791
+- chore: enable verify tests by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2774
+- fix: social login shows `undefined` by @magiziz in https://github.com/WalletConnect/web3modal/pull/2783
+
+* Updated dependencies []:
+ - @web3modal/ethers@5.1.6
+
+## 5.1.4
+
+### Patch Changes
+
+- - Added entries on assetlinks for flutter wallet by @quetool in https://github.com/WalletConnect/web3modal/pull/2746
+ - chore: only upgrade ethers v6 by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2741
+ - chore: fix wagmi not disconnecting and add adapter tests by @magiziz in https://github.com/WalletConnect/web3modal/pull/2751
+ - Added more fingerprints to Flutter apps by @quetool in https://github.com/WalletConnect/web3modal/pull/2748
+ - fix: remove auth connector from ethers and check for socials length by @tomiir in https://github.com/WalletConnect/web3modal/pull/2715
+ - chore: make all socials enabled by default by @tomiir in https://github.com/WalletConnect/web3modal/pull/2747
+ - fix: social logins not working in laboratory by @magiziz in https://github.com/WalletConnect/web3modal/pull/2765
+ - chore: expose solana provider type by @zoruka in https://github.com/WalletConnect/web3modal/pull/2756
+ - fix: Connector image mismatch by @tomiir in https://github.com/WalletConnect/web3modal/pull/2745
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.4
+
+## 5.1.3
+
+### Patch Changes
+
+- refactor: defaultChain ts mismatch, custom hooks, separation of dependencies
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.3
+
+## 5.1.2
+
+### Patch Changes
+
+- Added Solana Auth Provider types and schemas
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.2
+
+## 5.1.1
+
+### Patch Changes
+
+- Update EthProvider to v 2.15.1
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.1
+
+## 5.1.0
+
+### Minor Changes
+
+Enhanced compatibility, performance, developer experience, and user interface updates across various features
+
+- fix: remove limitation on sending versioned tx by @tomiir in https://github.com/WalletConnect/web3modal/pull/2638
+- refactor: fix missing ens screens by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2639
+- chore: remove non-Blockchain API RPCs by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2640
+- chore: update wagmi dependencies to latest version by @tomiir in https://github.com/WalletConnect/web3modal/pull/2642
+- chore: dynamic metadata URL by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2628
+- add icons and wallets by @glitch-txs in https://github.com/WalletConnect/web3modal/pull/2637
+- chore: fix playwright tests by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2633
+- chore: more renovate by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2619
+- chore: test single retry in tests by @tomiir in https://github.com/WalletConnect/web3modal/pull/2648
+- feat/automated tests with metamask by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2636
+- fix: import types from the package root in partials by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2650
+- feat: add support for eip5792 getCapabilities and sendCalls by @tomiir in https://github.com/WalletConnect/web3modal/pull/2576
+- chore: ID allocation service by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2574
+- refactor: solana sign and send transaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2646
+- chore: renovate updates by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2673
+- fix(solana): injected connectors not detected by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2656
+- chore: fix renovate includePaths by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2674
+- chore: update lab names & images by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2653
+- chore: fix typo by @riyueguang in https://github.com/WalletConnect/web3modal/pull/2600
+- refactor: handle balance and balanceSymbol fetch to update w3m-button by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2433
+- added filter transactions by chain by @glitch-txs in https://github.com/WalletConnect/web3modal/pull/1834
+- refactor/wallet card item with image optimization by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2572
+- fix: small balance format by @imlonghao in https://github.com/WalletConnect/web3modal/pull/2651
+- feat: add git hooks with husky and add pre-push hook by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2558
+- fix: add getApprovedCaipNetworks implementation by @tomiir in https://github.com/WalletConnect/web3modal/pull/2644
+- chore: update vitest to v2 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2678
+- feat: add sender to identity and reverse resolution by @tomiir in https://github.com/WalletConnect/web3modal/pull/2649
+- refactor: solana walletconnect rpc interface by @zoruka in https://github.com/WalletConnect/web3modal/pull/2677
+- Wagmi: Erc7715 permissions with Appkit embedded wallet by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2615
+- fix issue with modal not closing by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2680
+- fix: wagmi not showing loading indicator on email reconnection by @tomiir in https://github.com/WalletConnect/web3modal/pull/2682
+- fix: ethers disconnection error by @tomiir in https://github.com/WalletConnect/web3modal/pull/2683
+- fix: Wagmi Switch To by @tomiir in https://github.com/WalletConnect/web3modal/pull/2679
+- refactor: improvements to siwe flow and modal animations by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2672
+- chore: added rn samples in apple file by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2687
+- chore: Web3Modal -> AppKit by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2686
+- chore: fix metadata icon by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2685
+- fix(multi-account): account switch on wagmi by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2689
+- Added Flutter universal links by @quetool in https://github.com/WalletConnect/web3modal/pull/2695
+- feat: add bundle size check by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2694
+- chore: remove unnecessary window.postMessage for W3mFrame by @zoruka in https://github.com/WalletConnect/web3modal/pull/2658
+- refactor: standardize solana provider adapters by @zoruka in https://github.com/WalletConnect/web3modal/pull/2690
+- fix: bring back old parameters for RPC call on solana_signTransaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2692
+- refactor: export missing type defs from siwe package by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2703
+- fix: solana qa round by @zoruka in https://github.com/WalletConnect/web3modal/pull/2704
+- chore: update with latest V5 changes by @svenvoskamp in https://github.com/WalletConnect/web3modal/pull/2635
+- fix(deps): update walletconnect to v2.15.0 by @renovate in https://github.com/WalletConnect/web3modal/pull/2675
+- chore(deps): update wagmi by @renovate in https://github.com/WalletConnect/web3modal/pull/2676
+- chore: URL on lab pages by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2702
+- chore: update vite-size to 0.0.5 by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2700
+- chore: change chainId type to accept string and its dependencies by @zoruka in https://github.com/WalletConnect/web3modal/pull/2632
+- fix(deps): update dependency @solana/web3.js to v1.95.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2312
+
+### New Contributors
+
+- @riyueguang made their first contribution in https://github.com/WalletConnect/web3modal/pull/2600
+- @imlonghao made their first contribution in https://github.com/WalletConnect/web3modal/pull/2651
+- @quetool made their first contribution in https://github.com/WalletConnect/web3modal/pull/2695
+
+**Full Changelog**: https://github.com/WalletConnect/web3modal/compare/5.0.11...5.1.0
+
+### Patch Changes
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.0
+
+## 5.0.11
+
+### Patch Changes
+
+- - Hotfix to prevent loading state with QR code
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.0.11
+
+## 5.0.10
+
+- chore: update with v5 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2612
+- fix: move the wagmi state mutation to outside of 1-click auth flow by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2585
+- :hotfix fix svg error when requesting farcaster qr code by @svenvoskamp in https://github.com/WalletConnect/web3modal/pull/2621
+
+**Full Changelog**: https://github.com/WalletConnect/web3modal/compare/5.0.9...5.0.10
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.0.10
+
+## 5.0.9
+
+### Patch Changes
+
+- - chore: refine link names by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2588
+ - hotfix change secure site origin domain to .org by @svenvoskamp in https://github.com/WalletConnect/web3modal/pull/2603
+
+**Full Changelog**: https://github.com/WalletConnect/web3modal/compare/5.0.8...5.0.9
+
+## 5.0.8
+
+### Patch Changes
+
+- - chore: lab loading indicator by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2548
+ - fix: not allow multiple account syncs for same caip address by @zoruka in https://github.com/WalletConnect/web3modal/pull/2547
+ - fix: missing network not supported modal on wallet network switch by @zoruka in https://github.com/WalletConnect/web3modal/pull/2565
+ - chore: add clientId to BlockchainAPI requests by @tomiir in https://github.com/WalletConnect/web3modal/pull/2521
+ - Chore/split internal external testing by @svenvoskamp in https://github.com/WalletConnect/web3modal/pull/2563
+ - fix: remove 200ms QR delay by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2567
+ - [TDW] move from npm to pnpm by @segunadebayo in https://github.com/WalletConnect/web3modal/pull/2545
+ - feat: enableSwaps option by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2573
+ - build: fix dockerfile and bring back turbo by @segunadebayo in https://github.com/WalletConnect/web3modal/pull/2582
+ - chore: updates providers to `2.14` by @ganchoradkov in https://github.com/WalletConnect/web3modal/pull/2557
+ - fix: gets chains from approved accounts by @ganchoradkov in https://github.com/WalletConnect/web3modal/pull/2562
+ - :fix show right icon for multi-address account by @svenvoskamp in https://github.com/WalletConnect/web3modal/pull/2560
+ - feat: add wallet features and socials github tests by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2571
+ - fix: multiple account syncs on wagmi by @zoruka in https://github.com/WalletConnect/web3modal/pull/2575
+ - feat: apply RPC refactor and EIP5792 schema changes by @tomiir in https://github.com/WalletConnect/web3modal/pull/2580
+ - refactor: turbo pipeline by @segunadebayo in https://github.com/WalletConnect/web3modal/pull/2587
+
+ **Full Changelog**: https://github.com/WalletConnect/web3modal/compare/5.0.7...5.0.8
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.0.8
+
+## 5.0.7
+
+### Patch Changes
+
+- - feat: multi address by @ganchoradkov in https://github.com/WalletConnect/web3modal/pull/2286
+ - feat: feat: added vue for exports in solana by @phoenixVS in https://github.com/WalletConnect/web3modal/pull/2449
+ - fix: wagmi authConnector connectExternal resolving issue and enable wagmi email tests by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2504
+ - chore: configures report-only CSP for lab by @bkrem in https://github.com/WalletConnect/web3modal/pull/2388
+ - fix: settings btn styling by @ganchoradkov in https://github.com/WalletConnect/web3modal/pull/2523
+ - Add Wallet Standard to AppKit + Solana by @glitch-txs in https://github.com/WalletConnect/web3modal/pull/2482
+ - chore: remove onramp widget from labs by @tomiir in https://github.com/WalletConnect/web3modal/pull/2526
+ - feat: support custom connectors by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2119
+ - fix: disconnect logic for EIP6963 & Injected provider types for @web3modal/ethers by @hmzakhalid in https://github.com/WalletConnect/web3modal/pull/2289
+ - Feat ERC7715 grant_permissions support on lab by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2500
+ - update chain on network change by @glitch-txs in https://github.com/WalletConnect/web3modal/pull/2497
+ - fix: make accounts optional in social response by @tomiir in https://github.com/WalletConnect/web3modal/pull/2520
+ - chore: SA Tests switch network before flow by @tomiir in https://github.com/WalletConnect/web3modal/pull/2529
+ - chore: changed react native universal links by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2535
+ - chore: change labs' ethers rpc urls to walletconnect.org by @tomiir in https://github.com/WalletConnect/web3modal/pull/2530
+ - chore: remove 'no-cache' from API requests by @tomiir in https://github.com/WalletConnect/web3modal/pull/2538
+ - fix: makes `getMessageParams` siwe client method optional by @ganchoradkov in https://github.com/WalletConnect/web3modal/pull/2305
+ - chore: update secure site url to org domain by @tomiir in https://github.com/WalletConnect/web3modal/pull/2537
+ - fix: multiple name by @tomiir in https://github.com/WalletConnect/web3modal/pull/2410
+ - refactor(common): utils by @Simon-He95 in https://github.com/WalletConnect/web3modal/pull/2447
+ - fix: reorder chains to have current chain Id as main message by @tomiir in https://github.com/WalletConnect/web3modal/pull/2423
+ - refactor: change solana testnet and devnet rpcs to wc by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2541
+ - refactor: laboratory wagmi tests by @zoruka in https://github.com/WalletConnect/web3modal/pull/2552
+ - fix: sync accounts in wagmi and subscribe to account change by @tomiir in https://github.com/WalletConnect/web3modal/pull/2544
+- Updated dependencies []:
+ - @web3modal/ethers5@5.0.7
+
+## 5.0.6
+
+### Patch Changes
+
+- fix: Social Login illegal invocation issue. Wagmi tests
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.0.6
+
+## 5.0.5
+
+### Patch Changes
+
+- feat: universal link internal flag. Add kotlin assetlinks. Fix email truncation'
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.0.5
+
+## 5.0.4
+
+### Patch Changes
+
+- fix: wcPromise incompatibility issues
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.0.4
+
+## 5.0.3
+
+### Patch Changes
+
+- fix: ethers5 coinbase issues. Turbo build issues. Upate cb connector.
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.0.3
+
+## 5.0.2
+
+### Patch Changes
+
+- fix: siwe signOutOnNetwork change issue. fix: wallets filtered by rdns matched from explorer api. fix: solana network id issue
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.0.2
+
+## 5.0.1
+
+### Patch Changes
+
+- fix: remove walletconnect restriction on names
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.0.1
+
+## 5.0.0
+
+### Major Changes
+
+- Release V5
+
+### Patch Changes
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.0.0
+
+## 5.0.0-cn-v5.0
+
+### Major Changes
+
+- Test V5
+
+### Patch Changes
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.0.0-cn-v5.0
+
+## 4.2.3
+
+### Patch Changes
+
+- feat: - feat: restricted ens names. fix: iat set automatically if not present in messageParams. Adds siwe config handlers
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.2.3
+
+## 4.2.3-alpha.0
+
+### Patch Changes
+
+- feat: add support for coinbase smart accounts
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.2.3-alpha.0
+
+## 4.2.2
+
+### Patch Changes
+
+- feat: social login refactor. wagmi sendCalls support. refactor theme variables
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.2.2
+
+## 4.2.1
+
+### Patch Changes
+
+- Hotfix to support injected and announced wallets in in app browsers
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.2.1
+
+## 4.2.0
+
+### Patch Changes
+
+- release: 4.2.0 version release
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.2.0
+
+## 4.2.0-alpha.0
+
+### Patch Changes
+
+- feat: 4.2.0-alpha release
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.2.0-alpha.0
+
+## 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/ethers5@4.2.0-03e4f4a8.2
+
+## 4.2.0-448f7f4.1
+
+### Minor Changes
+
+- refactor: improvements to all features (siwe, send, swaps, ui and ux)
+
+### Patch Changes
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.2.0-448f7f4.1
+
+## 4.1.12-910a844.0
+
+### Patch Changes
+
+- refactor: sync theme with secure site
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.12-910a844.0
+
+## 4.1.11
+
+### Patch Changes
+
+- refactor: Solana exported helper methods and proram instruction improvements
+- refactor: email and smart account improvements
+- refactor: unit test CI check improvements
+- feat: convert
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.11
+
+## 4.1.10
+
+### Patch Changes
+
+- Fix activity list styling issue
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.10
+
+## 4.1.9
+
+### Patch Changes
+
+- Blockchain API fix
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.9
+
+## 4.1.8
+
+### Patch Changes
+
+- Hotfix for redundant tokenbalance calls
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.8
+
+## 4.1.7
+
+### Patch Changes
+
+- Hotfix for inccorect state of w3m-button when email is enabled
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.7
+
+## 4.1.6
+
+### Patch Changes
+
+- Fix modal default height. Fix ethers email connection lag. Fix ethers + rc relay disconnect issue. Adds new wui-components for secure site.
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.6
+
+## 4.1.6-a0733f5.0
+
+### Patch Changes
+
+- chore: canary release for siwe dependency
+
+- Updated dependencies []:
+ - @web3modal/ethers@4.1.6-a0733f5.0
+ - @web3modal/siwe@4.1.6-a0733f5.0
+ - @web3modal/solana@4.1.6-a0733f5.0
+ - @web3modal/wagmi@4.1.6-a0733f5.0
+
+## 4.1.5
+
+### Patch Changes
+
+- release: v4.1.5
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.5
+
+## 4.1.5-93c81127.0
+
+### Patch Changes
+
+- fix: polyfill process in wallet package
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.5-93c81127.0
+
+## 4.1.4
+
+### Patch Changes
+
+- feat: wallet info hook
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.4
+
+## 4.1.3
+
+### Patch Changes
+
+- feat: wallet info hook
+
+- feat: reset version to 4.1.3
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.3
+
+## 4.1.3-5f2ae345.1
+
+### Patch Changes
+
+- canary: test imports
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.3-5f2ae345.1
+
+## 4.1.3-8e039e.0
+
+### Patch Changes
+
+- feat: update optional dependencies
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.3-8e039e.0
+
+## 4.1.2
+
+### Patch Changes
+
+- 4.1.2 release
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.2
+
+## 4.2.0-4b5257b4.1
+
+### Minor Changes
+
+- [#2052](https://github.com/WalletConnect/web3modal/pull/2052) [`1b90376`](https://github.com/WalletConnect/web3modal/commit/1b903765a675f0f1b9ea0a44bcf84e2dad6b4436) Thanks [@enesozturk](https://github.com/enesozturk)! - refactor: add missing extensions on imports
+
+- feat: export solana chains from the solana package
+
+- [#2052](https://github.com/WalletConnect/web3modal/pull/2052) [`729313f`](https://github.com/WalletConnect/web3modal/commit/729313fe9dfb402ca694cbd77f49cc61895e2d07) Thanks [@enesozturk](https://github.com/enesozturk)! - chore: new solana canary release
+
+### Patch Changes
+
+- Updated dependencies [[`1b90376`](https://github.com/WalletConnect/web3modal/commit/1b903765a675f0f1b9ea0a44bcf84e2dad6b4436), [`729313f`](https://github.com/WalletConnect/web3modal/commit/729313fe9dfb402ca694cbd77f49cc61895e2d07)]:
+ - @web3modal/ethers5@4.2.0-4b5257b4.1
+
+## 4.2.0-dbbd8c44.0
+
+### Minor Changes
+
+- refactor: add missing extensions on imports
+
+### Patch Changes
+
+- Updated dependencies []:
+ - @web3modal/ui@4.2.0-dbbd8c44.0
+ - @web3modal/common@4.2.0-dbbd8c44.0
+
+## 4.2.0-500a38.0
+
+### Minor Changes
+
+- feat: solana integration
+
+### Patch Changes
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.2.0-500a38.0
+
+## 4.1.1
+
+### Patch Changes
+
+- Fix siwe version
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.1
+
+## 4.1.0
+
+### Minor Changes
+
+- Email Stable release
+
+### Patch Changes
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.1.0
+
+## 4.0.13
+
+### Patch Changes
+
+- Fix secure site url
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.0.13
+
+## 4.0.12
+
+### Patch Changes
+
+- [#2014](https://github.com/WalletConnect/web3modal/pull/2014) [`95b35e1`](https://github.com/WalletConnect/web3modal/commit/95b35e1ebaf261a56a29cd9254d85b7c1430bfc0) Thanks [@tomiir](https://github.com/tomiir)! - Smart Account RPC handler canary
+
+- Smart Account initialization and feature flag
+
+- Updated dependencies [[`95b35e1`](https://github.com/WalletConnect/web3modal/commit/95b35e1ebaf261a56a29cd9254d85b7c1430bfc0)]:
+ - @web3modal/ethers5@4.0.12
+
+## 4.0.12-0c59f84f.0
+
+### Patch Changes
+
+- Smart Account RPC handler canary
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.0.12-0c59f84f.0
+
+## 4.0.11
+
+### Patch Changes
+
+- Analytics connection event improvements. Unsupported chain flag. Siwe package refactor. RPC improvements. UI improvements'
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.0.11
+
+## 4.0.10
+
+### Patch Changes
+
+- Add error state to wui-chip composite
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.0.10
+
+## 4.0.9
+
+### Patch Changes
+
+- Add all rpc methods + auto reject when modal closes
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.0.9
+
+## 4.0.8
+
+### Patch Changes
+
+- [#1954](https://github.com/WalletConnect/web3modal/pull/1954) [`c3366e7`](https://github.com/WalletConnect/web3modal/commit/c3366e7211dba2f5c6d3377c9d9a77da5a52c0d8) Thanks [@tomiir](https://github.com/tomiir)! - Add support for eth_getBlockByNumber
+
+- Updated dependencies [[`c3366e7`](https://github.com/WalletConnect/web3modal/commit/c3366e7211dba2f5c6d3377c9d9a77da5a52c0d8)]:
+ - @web3modal/ethers5@4.0.8
+
+## 4.0.8-f1845392.0
+
+### Patch Changes
+
+- [#1954](https://github.com/WalletConnect/web3modal/pull/1954) [`4755109`](https://github.com/WalletConnect/web3modal/commit/475510962a92ea9f4388db1d08c979d99da18e54) Thanks [@tomiir](https://github.com/tomiir)! - Add support for eth_getBlockByNumber
+
+- Updated dependencies [[`4755109`](https://github.com/WalletConnect/web3modal/commit/475510962a92ea9f4388db1d08c979d99da18e54)]:
+ - @web3modal/ethers5@4.0.8-f1845392.0
+
+## 4.0.7
+
+### Patch Changes
+
+- Add eth_getBalance to list of allowed methods
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.0.7
+
+## 4.0.6
+
+### Patch Changes
+
+- Email stability fixes
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.0.6
+
+## 4.0.5
+
+### Patch Changes
+
+- [#1917](https://github.com/WalletConnect/web3modal/pull/1917) [`f79566c`](https://github.com/WalletConnect/web3modal/commit/f79566ca5119fa12795dd49fce01aea8e1a05d97) Thanks [@tomiir](https://github.com/tomiir)! - Replaces public url with blockchain api for supported networks
+
+- Updated dependencies [[`f79566c`](https://github.com/WalletConnect/web3modal/commit/f79566ca5119fa12795dd49fce01aea8e1a05d97)]:
+ - @web3modal/ethers5@4.0.5
+
+## 4.0.4
+
+### Patch Changes
+
+- Fix theming issue for email
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.0.4
+
+## 4.0.3
+
+### Patch Changes
+
+- Tag email beta, Sync Theme For Secure Wallet, Use manual version in constants
+
+- Updated dependencies []:
+ - @web3modal/ethers5@4.0.3
+
+## 4.0.2
+
+### Patch Changes
+
+- [#1899](https://github.com/WalletConnect/web3modal/pull/1899) [`42e97a0`](https://github.com/WalletConnect/web3modal/commit/42e97a04eb60090a821019ae80d62acacf35fc66) Thanks [@xzilja](https://github.com/xzilja)! - Reverted change that removed email update flow from account view
+
+- Updated dependencies [[`42e97a0`](https://github.com/WalletConnect/web3modal/commit/42e97a04eb60090a821019ae80d62acacf35fc66)]:
+ - @web3modal/ethers5@4.0.2
+
+## 4.0.1
+
+### Patch Changes
+
+- [#1879](https://github.com/WalletConnect/web3modal/pull/1879) [`e3fa353`](https://github.com/WalletConnect/web3modal/commit/e3fa35396e3d2b1153d12bfaf92738bc67b46640) Thanks [@svenvoskamp](https://github.com/svenvoskamp)! - Fix various issues on ethers/ethers5 package
+
+- Updated dependencies [[`e3fa353`](https://github.com/WalletConnect/web3modal/commit/e3fa35396e3d2b1153d12bfaf92738bc67b46640)]:
+ - @web3modal/ethers5@4.0.1
diff --git a/examples/html-ethers/index.html b/examples/html-ethers/index.html
new file mode 100644
index 0000000000..ef66874131
--- /dev/null
+++ b/examples/html-ethers/index.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+ Html ethers5 Example
+
+
+
+
+ Open Modal
+ Open Networks
+
+
+
+
Methods
+
getAddress
+
+
getChainId
+
+
getIsConnected
+
+
getError
+
+
getWalletProvider
+
+
getWalletProviderType
+
+
subscribeProvider
+
+
+
+
+
diff --git a/examples/html-ethers/package.json b/examples/html-ethers/package.json
new file mode 100644
index 0000000000..c3ab3e3994
--- /dev/null
+++ b/examples/html-ethers/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "@examples/html-ethers",
+ "private": true,
+ "version": "5.1.7",
+ "scripts": {
+ "dev": "vite --port 3011",
+ "build": "vite build"
+ },
+ "dependencies": {
+ "@web3modal/ethers": "workspace:*",
+ "ethers": "6.13.2"
+ },
+ "devDependencies": {
+ "vite": "5.2.11"
+ }
+}
diff --git a/examples/html-ethers/src/main.js b/examples/html-ethers/src/main.js
new file mode 100644
index 0000000000..ec848ba013
--- /dev/null
+++ b/examples/html-ethers/src/main.js
@@ -0,0 +1,83 @@
+import { createWeb3Modal, defaultConfig } from '@web3modal/ethers'
+
+// @ts-expect-error 1. Get projectId
+const projectId = import.meta.env.VITE_PROJECT_ID
+if (!projectId) {
+ throw new Error('VITE_PROJECT_ID is not set')
+}
+
+function getBlockchainApiRpcUrl(chainId) {
+ return `https://rpc.walletconnect.org/v1/?chainId=eip155:${chainId}&projectId=${projectId}`
+}
+
+// 2. Create wagmiConfig
+const chains = [
+ {
+ chainId: 1,
+ name: 'Ethereum',
+ currency: 'ETH',
+ explorerUrl: 'https://etherscan.io',
+ rpcUrl: getBlockchainApiRpcUrl(1)
+ },
+ {
+ chainId: 42161,
+ name: 'Arbitrum',
+ currency: 'ETH',
+ explorerUrl: 'https://arbiscan.io',
+ rpcUrl: getBlockchainApiRpcUrl(42161)
+ }
+]
+
+const metadata = {
+ name: 'AppKit',
+ description: 'AppKit HTML + Ethers Example',
+ url: 'https://lab.web3modal.com',
+ icons: ['https://avatars.githubusercontent.com/u/37784886']
+}
+
+const ethersConfig = defaultConfig({
+ metadata,
+ chains,
+ defaultChainId: 1
+})
+
+// 3. Create modal
+const modal = createWeb3Modal({
+ ethersConfig: { ...ethersConfig, email: true },
+ projectId,
+ metadata,
+ chains,
+ themeMode: 'light'
+})
+
+// 4. Trigger modal programaticaly
+const openConnectModalBtn = document.getElementById('open-connect-modal')
+const openNetworkModalBtn = document.getElementById('open-network-modal')
+
+openConnectModalBtn.addEventListener('click', () => modal.open())
+openNetworkModalBtn.addEventListener('click', () => modal.open({ view: 'Networks' }))
+
+const updateElement = (id, content) => {
+ const element = document.getElementById(id)
+ if (element) {
+ element.innerHTML = content
+ }
+}
+
+const intervalId = setInterval(() => {
+ updateElement('getError', JSON.stringify(modal.getError(), null, 2))
+ updateElement('getChainId', JSON.stringify(modal.getChainId(), null, 2))
+ updateElement('getAddress', JSON.stringify(modal.getAddress(), null, 2))
+ updateElement('switchNetwork', JSON.stringify(modal.switchNetwork(), null, 2))
+ updateElement('getIsConnected', JSON.stringify(modal.getIsConnected(), null, 2))
+ updateElement('getWalletProvider', JSON.stringify(modal.getWalletProvider(), null, 2))
+ updateElement('getWalletProviderType', JSON.stringify(modal.getWalletProviderType(), null, 2))
+}, 2000)
+
+window.addEventListener('beforeunload', () => {
+ clearInterval(intervalId)
+})
+
+modal.subscribeProvider(state => {
+ updateElement('subscribeProvider', JSON.stringify(state, null, 2))
+})
diff --git a/examples/html-ethers5/CHANGELOG.md b/examples/html-ethers5/CHANGELOG.md
index 0100df09aa..6252732ece 100644
--- a/examples/html-ethers5/CHANGELOG.md
+++ b/examples/html-ethers5/CHANGELOG.md
@@ -1,5 +1,89 @@
# @examples/html-ethers5
+## 5.1.8
+
+### Patch Changes
+
+- - chore: changed RN links to wildcards by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2839
+ - feat: solana send transaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2802
+ - Feat/solana onramp by @phoenixVS in https://github.com/WalletConnect/web3modal/pull/2525
+ - chore: update assetlinks.json by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2838
+ - Chore/add base sepolia by @tomiir in https://github.com/WalletConnect/web3modal/pull/2840
+ - fix: solana default chain logic by @zoruka in https://github.com/WalletConnect/web3modal/pull/2849
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.8
+
+## 5.1.7
+
+### Patch Changes
+
+- - chore: version bump for 5.1.6 by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2797
+ - fix(deps): update walletconnect to v2.15.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2722
+ - chore: fix public URL by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2806
+ - fix: RPC requests causing modal to close by @tomiir in https://github.com/WalletConnect/web3modal/pull/2799
+ - chore: use apiVersion v2 on names endpoint by @tomiir in https://github.com/WalletConnect/web3modal/pull/2805
+ - fix: import valtio from vanilla path by @jd1378 in https://github.com/WalletConnect/web3modal/pull/2810
+ - chore: use shared gh token by @tomiir in https://github.com/WalletConnect/web3modal/pull/2809
+ - chore: add input secrets to setup workflow by @tomiir in https://github.com/WalletConnect/web3modal/pull/2822
+ - fix: remove deprecated params from sign transaction wc rpc request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2816
+ - chore: changed android and ios links for react native sample apps by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2825
+ - chore: changed order of links by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2826
+ - fix(siwe): fix undefined SIWE chainId by @Cali93 in https://github.com/WalletConnect/web3modal/pull/2820
+ - chore: update monorepo deps to 2.16.1 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2829
+ - fix: don't capitalize first character of email field on mobile by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2815
+ - chore(deps): update dependency ethers to v6.13.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2434
+ - chore(deps): update wagmi by @renovate in https://github.com/WalletConnect/web3modal/pull/2711
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.7
+
+## 5.1.6
+
+### Patch Changes
+
+- fix: update CSP by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2775
+- fix: ethers5 adapter import in exports by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2754
+- fix/missing action functions exports from clients by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2778
+- fix: logics to set default chain by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2787
+- Implement actions using userOpBuilder service instead of permissionless.js by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2758
+- chore: run Playwright on self-hosted runners by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2788
+- chore: add NEXT_PUBLIC_SECURE_SITE_SDK_URL to CSP by @tomiir in https://github.com/WalletConnect/web3modal/pull/2791
+- chore: enable verify tests by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2774
+- fix: social login shows `undefined` by @magiziz in https://github.com/WalletConnect/web3modal/pull/2783
+
+* Updated dependencies []:
+ - @web3modal/ethers5@5.1.6
+
+## 5.1.5
+
+### Patch Changes
+
+- - chore: add safety for localstorage by @zoruka in https://github.com/WalletConnect/web3modal/pull/2770
+ - fix: impossible to press on send placeholder input on mobile by @magiziz in https://github.com/WalletConnect/web3modal/pull/2771
+ - feat: solana sign all transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2772
+ - chore: change universal provider relay url and move to constants file by @zoruka in https://github.com/WalletConnect/web3modal/pull/2776
+ - chore: remove coinbase SDK de-duplication by @tomiir in https://github.com/WalletConnect/web3modal/pull/2768
+ - fix: add missing chainId param for transactions request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2779
+ - fix: remove coming message from solana transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2780
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.5
+
+## 5.1.4
+
+### Patch Changes
+
+- - Added entries on assetlinks for flutter wallet by @quetool in https://github.com/WalletConnect/web3modal/pull/2746
+ - chore: only upgrade ethers v6 by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2741
+ - chore: fix wagmi not disconnecting and add adapter tests by @magiziz in https://github.com/WalletConnect/web3modal/pull/2751
+ - Added more fingerprints to Flutter apps by @quetool in https://github.com/WalletConnect/web3modal/pull/2748
+ - fix: remove auth connector from ethers and check for socials length by @tomiir in https://github.com/WalletConnect/web3modal/pull/2715
+ - chore: make all socials enabled by default by @tomiir in https://github.com/WalletConnect/web3modal/pull/2747
+ - fix: social logins not working in laboratory by @magiziz in https://github.com/WalletConnect/web3modal/pull/2765
+ - chore: expose solana provider type by @zoruka in https://github.com/WalletConnect/web3modal/pull/2756
+ - fix: Connector image mismatch by @tomiir in https://github.com/WalletConnect/web3modal/pull/2745
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.4
+
## 5.1.3
### Patch Changes
diff --git a/examples/html-ethers5/index.html b/examples/html-ethers5/index.html
index 0205fb4d50..ef66874131 100644
--- a/examples/html-ethers5/index.html
+++ b/examples/html-ethers5/index.html
@@ -5,12 +5,29 @@
Html ethers5 Example
+
Open ModalOpen Networks
-
+
+
+
Methods
+
getAddress
+
+
getChainId
+
+
getIsConnected
+
+
getError
+
+
getWalletProvider
+
+
getWalletProviderType
+
+
subscribeProvider
+
diff --git a/examples/html-ethers5/package.json b/examples/html-ethers5/package.json
index 94f7dee997..7ddb008717 100644
--- a/examples/html-ethers5/package.json
+++ b/examples/html-ethers5/package.json
@@ -1,7 +1,7 @@
{
"name": "@examples/html-ethers5",
"private": true,
- "version": "5.1.3",
+ "version": "5.1.8",
"scripts": {
"dev": "vite --port 3011",
"build": "vite build"
diff --git a/examples/html-ethers5/src/main.js b/examples/html-ethers5/src/main.js
index 5289ad65f8..4eb28afd54 100644
--- a/examples/html-ethers5/src/main.js
+++ b/examples/html-ethers5/src/main.js
@@ -28,13 +28,16 @@ const chains = [
}
]
+const metadata = {
+ name: 'AppKit',
+ description: 'AppKit HTML + Ethers5 Example',
+ url: 'https://lab.web3modal.com',
+ icons: ['https://avatars.githubusercontent.com/u/37784886']
+}
+
const ethersConfig = defaultConfig({
- metadata: {
- name: 'AppKit',
- description: 'AppKit Laboratory',
- url: 'https://example.com',
- icons: ['https://avatars.githubusercontent.com/u/37784886']
- },
+ metadata,
+ chains,
defaultChainId: 1
})
@@ -42,6 +45,7 @@ const ethersConfig = defaultConfig({
const modal = createWeb3Modal({
ethersConfig: { ...ethersConfig, email: true },
projectId,
+ metadata,
chains,
themeMode: 'light'
})
@@ -53,4 +57,27 @@ const openNetworkModalBtn = document.getElementById('open-network-modal')
openConnectModalBtn.addEventListener('click', () => modal.open())
openNetworkModalBtn.addEventListener('click', () => modal.open({ view: 'Networks' }))
-// 5. Alternatively use w3m component buttons (see index.html)
+const updateElement = (id, content) => {
+ const element = document.getElementById(id)
+ if (element) {
+ element.innerHTML = content
+ }
+}
+
+const intervalId = setInterval(() => {
+ updateElement('getError', JSON.stringify(modal.getError(), null, 2))
+ updateElement('getChainId', JSON.stringify(modal.getChainId(), null, 2))
+ updateElement('getAddress', JSON.stringify(modal.getAddress(), null, 2))
+ updateElement('switchNetwork', JSON.stringify(modal.switchNetwork(), null, 2))
+ updateElement('getIsConnected', JSON.stringify(modal.getIsConnected(), null, 2))
+ updateElement('getWalletProvider', JSON.stringify(modal.getWalletProvider(), null, 2))
+ updateElement('getWalletProviderType', JSON.stringify(modal.getWalletProviderType(), null, 2))
+}, 2000)
+
+window.addEventListener('beforeunload', () => {
+ clearInterval(intervalId)
+})
+
+modal.subscribeProvider(state => {
+ updateElement('subscribeProvider', JSON.stringify(state, null, 2))
+})
diff --git a/examples/html-wagmi/CHANGELOG.md b/examples/html-wagmi/CHANGELOG.md
index 3b70fe3973..0163f74c35 100644
--- a/examples/html-wagmi/CHANGELOG.md
+++ b/examples/html-wagmi/CHANGELOG.md
@@ -1,5 +1,89 @@
# @examples/html-wagmi
+## 5.1.8
+
+### Patch Changes
+
+- - chore: changed RN links to wildcards by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2839
+ - feat: solana send transaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2802
+ - Feat/solana onramp by @phoenixVS in https://github.com/WalletConnect/web3modal/pull/2525
+ - chore: update assetlinks.json by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2838
+ - Chore/add base sepolia by @tomiir in https://github.com/WalletConnect/web3modal/pull/2840
+ - fix: solana default chain logic by @zoruka in https://github.com/WalletConnect/web3modal/pull/2849
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.8
+
+## 5.1.7
+
+### Patch Changes
+
+- - chore: version bump for 5.1.6 by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2797
+ - fix(deps): update walletconnect to v2.15.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2722
+ - chore: fix public URL by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2806
+ - fix: RPC requests causing modal to close by @tomiir in https://github.com/WalletConnect/web3modal/pull/2799
+ - chore: use apiVersion v2 on names endpoint by @tomiir in https://github.com/WalletConnect/web3modal/pull/2805
+ - fix: import valtio from vanilla path by @jd1378 in https://github.com/WalletConnect/web3modal/pull/2810
+ - chore: use shared gh token by @tomiir in https://github.com/WalletConnect/web3modal/pull/2809
+ - chore: add input secrets to setup workflow by @tomiir in https://github.com/WalletConnect/web3modal/pull/2822
+ - fix: remove deprecated params from sign transaction wc rpc request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2816
+ - chore: changed android and ios links for react native sample apps by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2825
+ - chore: changed order of links by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2826
+ - fix(siwe): fix undefined SIWE chainId by @Cali93 in https://github.com/WalletConnect/web3modal/pull/2820
+ - chore: update monorepo deps to 2.16.1 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2829
+ - fix: don't capitalize first character of email field on mobile by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2815
+ - chore(deps): update dependency ethers to v6.13.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2434
+ - chore(deps): update wagmi by @renovate in https://github.com/WalletConnect/web3modal/pull/2711
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.7
+
+## 5.1.6
+
+### Patch Changes
+
+- fix: update CSP by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2775
+- fix: ethers5 adapter import in exports by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2754
+- fix/missing action functions exports from clients by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2778
+- fix: logics to set default chain by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2787
+- Implement actions using userOpBuilder service instead of permissionless.js by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2758
+- chore: run Playwright on self-hosted runners by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2788
+- chore: add NEXT_PUBLIC_SECURE_SITE_SDK_URL to CSP by @tomiir in https://github.com/WalletConnect/web3modal/pull/2791
+- chore: enable verify tests by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2774
+- fix: social login shows `undefined` by @magiziz in https://github.com/WalletConnect/web3modal/pull/2783
+
+* Updated dependencies []:
+ - @web3modal/wagmi@5.1.6
+
+## 5.1.5
+
+### Patch Changes
+
+- - chore: add safety for localstorage by @zoruka in https://github.com/WalletConnect/web3modal/pull/2770
+ - fix: impossible to press on send placeholder input on mobile by @magiziz in https://github.com/WalletConnect/web3modal/pull/2771
+ - feat: solana sign all transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2772
+ - chore: change universal provider relay url and move to constants file by @zoruka in https://github.com/WalletConnect/web3modal/pull/2776
+ - chore: remove coinbase SDK de-duplication by @tomiir in https://github.com/WalletConnect/web3modal/pull/2768
+ - fix: add missing chainId param for transactions request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2779
+ - fix: remove coming message from solana transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2780
+
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.5
+
+## 5.1.4
+
+### Patch Changes
+
+- - Added entries on assetlinks for flutter wallet by @quetool in https://github.com/WalletConnect/web3modal/pull/2746
+ - chore: only upgrade ethers v6 by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2741
+ - chore: fix wagmi not disconnecting and add adapter tests by @magiziz in https://github.com/WalletConnect/web3modal/pull/2751
+ - Added more fingerprints to Flutter apps by @quetool in https://github.com/WalletConnect/web3modal/pull/2748
+ - fix: remove auth connector from ethers and check for socials length by @tomiir in https://github.com/WalletConnect/web3modal/pull/2715
+ - chore: make all socials enabled by default by @tomiir in https://github.com/WalletConnect/web3modal/pull/2747
+ - fix: social logins not working in laboratory by @magiziz in https://github.com/WalletConnect/web3modal/pull/2765
+ - chore: expose solana provider type by @zoruka in https://github.com/WalletConnect/web3modal/pull/2756
+ - fix: Connector image mismatch by @tomiir in https://github.com/WalletConnect/web3modal/pull/2745
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.4
+
## 5.1.3
### Patch Changes
diff --git a/examples/html-wagmi/package.json b/examples/html-wagmi/package.json
index aba0b710c1..c54e073af2 100644
--- a/examples/html-wagmi/package.json
+++ b/examples/html-wagmi/package.json
@@ -1,13 +1,13 @@
{
"name": "@examples/html-wagmi",
"private": true,
- "version": "5.1.3",
+ "version": "5.1.8",
"scripts": {
"dev": "vite --port 3001",
"build": "vite build"
},
"dependencies": {
- "@wagmi/connectors": "5.1.5",
+ "@wagmi/connectors": "5.1.9",
"@wagmi/core": "2.13.4",
"@web3modal/wagmi": "workspace:*",
"react": "18.2.0",
diff --git a/examples/next-ethers/next-env.d.ts b/examples/next-ethers/next-env.d.ts
new file mode 100644
index 0000000000..4f11a03dc6
--- /dev/null
+++ b/examples/next-ethers/next-env.d.ts
@@ -0,0 +1,5 @@
+///
+///
+
+// NOTE: This file should not be edited
+// see https://nextjs.org/docs/basic-features/typescript for more information.
diff --git a/examples/next-wagmi/CHANGELOG.md b/examples/next-wagmi/CHANGELOG.md
index 4e0d7fff34..6cba2effec 100644
--- a/examples/next-wagmi/CHANGELOG.md
+++ b/examples/next-wagmi/CHANGELOG.md
@@ -1,5 +1,89 @@
# @examples/next-wagmi
+## 5.1.8
+
+### Patch Changes
+
+- - chore: changed RN links to wildcards by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2839
+ - feat: solana send transaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2802
+ - Feat/solana onramp by @phoenixVS in https://github.com/WalletConnect/web3modal/pull/2525
+ - chore: update assetlinks.json by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2838
+ - Chore/add base sepolia by @tomiir in https://github.com/WalletConnect/web3modal/pull/2840
+ - fix: solana default chain logic by @zoruka in https://github.com/WalletConnect/web3modal/pull/2849
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.8
+
+## 5.1.7
+
+### Patch Changes
+
+- - chore: version bump for 5.1.6 by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2797
+ - fix(deps): update walletconnect to v2.15.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2722
+ - chore: fix public URL by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2806
+ - fix: RPC requests causing modal to close by @tomiir in https://github.com/WalletConnect/web3modal/pull/2799
+ - chore: use apiVersion v2 on names endpoint by @tomiir in https://github.com/WalletConnect/web3modal/pull/2805
+ - fix: import valtio from vanilla path by @jd1378 in https://github.com/WalletConnect/web3modal/pull/2810
+ - chore: use shared gh token by @tomiir in https://github.com/WalletConnect/web3modal/pull/2809
+ - chore: add input secrets to setup workflow by @tomiir in https://github.com/WalletConnect/web3modal/pull/2822
+ - fix: remove deprecated params from sign transaction wc rpc request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2816
+ - chore: changed android and ios links for react native sample apps by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2825
+ - chore: changed order of links by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2826
+ - fix(siwe): fix undefined SIWE chainId by @Cali93 in https://github.com/WalletConnect/web3modal/pull/2820
+ - chore: update monorepo deps to 2.16.1 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2829
+ - fix: don't capitalize first character of email field on mobile by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2815
+ - chore(deps): update dependency ethers to v6.13.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2434
+ - chore(deps): update wagmi by @renovate in https://github.com/WalletConnect/web3modal/pull/2711
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.7
+
+## 5.1.6
+
+### Patch Changes
+
+- fix: update CSP by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2775
+- fix: ethers5 adapter import in exports by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2754
+- fix/missing action functions exports from clients by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2778
+- fix: logics to set default chain by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2787
+- Implement actions using userOpBuilder service instead of permissionless.js by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2758
+- chore: run Playwright on self-hosted runners by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2788
+- chore: add NEXT_PUBLIC_SECURE_SITE_SDK_URL to CSP by @tomiir in https://github.com/WalletConnect/web3modal/pull/2791
+- chore: enable verify tests by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2774
+- fix: social login shows `undefined` by @magiziz in https://github.com/WalletConnect/web3modal/pull/2783
+
+* Updated dependencies []:
+ - @web3modal/wagmi@5.1.6
+
+## 5.1.5
+
+### Patch Changes
+
+- - chore: add safety for localstorage by @zoruka in https://github.com/WalletConnect/web3modal/pull/2770
+ - fix: impossible to press on send placeholder input on mobile by @magiziz in https://github.com/WalletConnect/web3modal/pull/2771
+ - feat: solana sign all transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2772
+ - chore: change universal provider relay url and move to constants file by @zoruka in https://github.com/WalletConnect/web3modal/pull/2776
+ - chore: remove coinbase SDK de-duplication by @tomiir in https://github.com/WalletConnect/web3modal/pull/2768
+ - fix: add missing chainId param for transactions request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2779
+ - fix: remove coming message from solana transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2780
+
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.5
+
+## 5.1.4
+
+### Patch Changes
+
+- - Added entries on assetlinks for flutter wallet by @quetool in https://github.com/WalletConnect/web3modal/pull/2746
+ - chore: only upgrade ethers v6 by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2741
+ - chore: fix wagmi not disconnecting and add adapter tests by @magiziz in https://github.com/WalletConnect/web3modal/pull/2751
+ - Added more fingerprints to Flutter apps by @quetool in https://github.com/WalletConnect/web3modal/pull/2748
+ - fix: remove auth connector from ethers and check for socials length by @tomiir in https://github.com/WalletConnect/web3modal/pull/2715
+ - chore: make all socials enabled by default by @tomiir in https://github.com/WalletConnect/web3modal/pull/2747
+ - fix: social logins not working in laboratory by @magiziz in https://github.com/WalletConnect/web3modal/pull/2765
+ - chore: expose solana provider type by @zoruka in https://github.com/WalletConnect/web3modal/pull/2756
+ - fix: Connector image mismatch by @tomiir in https://github.com/WalletConnect/web3modal/pull/2745
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.4
+
## 5.1.3
### Patch Changes
diff --git a/examples/next-wagmi/package.json b/examples/next-wagmi/package.json
index 7b6d591558..cbd9600485 100644
--- a/examples/next-wagmi/package.json
+++ b/examples/next-wagmi/package.json
@@ -1,6 +1,6 @@
{
"name": "@examples/next-wagmi",
- "version": "5.1.3",
+ "version": "5.1.8",
"private": true,
"scripts": {
"dev": "next dev",
@@ -14,8 +14,8 @@
"next": "14.2.3",
"react": "18.2.0",
"react-dom": "18.2.0",
- "viem": "2.19.6",
- "wagmi": "2.12.5"
+ "viem": "2.21.4",
+ "wagmi": "2.12.9"
},
"devDependencies": {
"@types/react": "18.2.62",
diff --git a/examples/react-ethers/CHANGELOG.md b/examples/react-ethers/CHANGELOG.md
index f922207f67..7684d2d20f 100644
--- a/examples/react-ethers/CHANGELOG.md
+++ b/examples/react-ethers/CHANGELOG.md
@@ -1,5 +1,89 @@
# @examples/react-ethers5
+## 5.1.8
+
+### Patch Changes
+
+- - chore: changed RN links to wildcards by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2839
+ - feat: solana send transaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2802
+ - Feat/solana onramp by @phoenixVS in https://github.com/WalletConnect/web3modal/pull/2525
+ - chore: update assetlinks.json by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2838
+ - Chore/add base sepolia by @tomiir in https://github.com/WalletConnect/web3modal/pull/2840
+ - fix: solana default chain logic by @zoruka in https://github.com/WalletConnect/web3modal/pull/2849
+- Updated dependencies []:
+ - @web3modal/ethers@5.1.8
+
+## 5.1.7
+
+### Patch Changes
+
+- - chore: version bump for 5.1.6 by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2797
+ - fix(deps): update walletconnect to v2.15.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2722
+ - chore: fix public URL by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2806
+ - fix: RPC requests causing modal to close by @tomiir in https://github.com/WalletConnect/web3modal/pull/2799
+ - chore: use apiVersion v2 on names endpoint by @tomiir in https://github.com/WalletConnect/web3modal/pull/2805
+ - fix: import valtio from vanilla path by @jd1378 in https://github.com/WalletConnect/web3modal/pull/2810
+ - chore: use shared gh token by @tomiir in https://github.com/WalletConnect/web3modal/pull/2809
+ - chore: add input secrets to setup workflow by @tomiir in https://github.com/WalletConnect/web3modal/pull/2822
+ - fix: remove deprecated params from sign transaction wc rpc request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2816
+ - chore: changed android and ios links for react native sample apps by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2825
+ - chore: changed order of links by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2826
+ - fix(siwe): fix undefined SIWE chainId by @Cali93 in https://github.com/WalletConnect/web3modal/pull/2820
+ - chore: update monorepo deps to 2.16.1 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2829
+ - fix: don't capitalize first character of email field on mobile by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2815
+ - chore(deps): update dependency ethers to v6.13.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2434
+ - chore(deps): update wagmi by @renovate in https://github.com/WalletConnect/web3modal/pull/2711
+- Updated dependencies []:
+ - @web3modal/ethers@5.1.7
+
+## 5.1.6
+
+### Patch Changes
+
+- fix: update CSP by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2775
+- fix: ethers5 adapter import in exports by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2754
+- fix/missing action functions exports from clients by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2778
+- fix: logics to set default chain by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2787
+- Implement actions using userOpBuilder service instead of permissionless.js by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2758
+- chore: run Playwright on self-hosted runners by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2788
+- chore: add NEXT_PUBLIC_SECURE_SITE_SDK_URL to CSP by @tomiir in https://github.com/WalletConnect/web3modal/pull/2791
+- chore: enable verify tests by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2774
+- fix: social login shows `undefined` by @magiziz in https://github.com/WalletConnect/web3modal/pull/2783
+
+* Updated dependencies []:
+ - @web3modal/ethers@5.1.6
+
+## 5.1.5
+
+### Patch Changes
+
+- - chore: add safety for localstorage by @zoruka in https://github.com/WalletConnect/web3modal/pull/2770
+ - fix: impossible to press on send placeholder input on mobile by @magiziz in https://github.com/WalletConnect/web3modal/pull/2771
+ - feat: solana sign all transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2772
+ - chore: change universal provider relay url and move to constants file by @zoruka in https://github.com/WalletConnect/web3modal/pull/2776
+ - chore: remove coinbase SDK de-duplication by @tomiir in https://github.com/WalletConnect/web3modal/pull/2768
+ - fix: add missing chainId param for transactions request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2779
+ - fix: remove coming message from solana transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2780
+
+- Updated dependencies []:
+ - @web3modal/ethers@5.1.5
+
+## 5.1.4
+
+### Patch Changes
+
+- - Added entries on assetlinks for flutter wallet by @quetool in https://github.com/WalletConnect/web3modal/pull/2746
+ - chore: only upgrade ethers v6 by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2741
+ - chore: fix wagmi not disconnecting and add adapter tests by @magiziz in https://github.com/WalletConnect/web3modal/pull/2751
+ - Added more fingerprints to Flutter apps by @quetool in https://github.com/WalletConnect/web3modal/pull/2748
+ - fix: remove auth connector from ethers and check for socials length by @tomiir in https://github.com/WalletConnect/web3modal/pull/2715
+ - chore: make all socials enabled by default by @tomiir in https://github.com/WalletConnect/web3modal/pull/2747
+ - fix: social logins not working in laboratory by @magiziz in https://github.com/WalletConnect/web3modal/pull/2765
+ - chore: expose solana provider type by @zoruka in https://github.com/WalletConnect/web3modal/pull/2756
+ - fix: Connector image mismatch by @tomiir in https://github.com/WalletConnect/web3modal/pull/2745
+- Updated dependencies []:
+ - @web3modal/ethers@5.1.4
+
## 5.1.3
### Patch Changes
diff --git a/examples/react-ethers/package.json b/examples/react-ethers/package.json
index 30f3defed2..68854d304a 100644
--- a/examples/react-ethers/package.json
+++ b/examples/react-ethers/package.json
@@ -1,14 +1,14 @@
{
"name": "@examples/react-ethers",
"private": true,
- "version": "5.1.3",
+ "version": "5.1.8",
"scripts": {
"dev": "vite --port 3012",
"build": "vite build"
},
"dependencies": {
"@web3modal/ethers": "workspace:*",
- "ethers": "6.9.0",
+ "ethers": "6.13.2",
"react": "18.2.0",
"react-dom": "18.2.0"
},
diff --git a/examples/react-ethers5/CHANGELOG.md b/examples/react-ethers5/CHANGELOG.md
index 968a97713c..6b1b766747 100644
--- a/examples/react-ethers5/CHANGELOG.md
+++ b/examples/react-ethers5/CHANGELOG.md
@@ -1,5 +1,89 @@
# @examples/react-ethers5
+## 5.1.8
+
+### Patch Changes
+
+- - chore: changed RN links to wildcards by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2839
+ - feat: solana send transaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2802
+ - Feat/solana onramp by @phoenixVS in https://github.com/WalletConnect/web3modal/pull/2525
+ - chore: update assetlinks.json by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2838
+ - Chore/add base sepolia by @tomiir in https://github.com/WalletConnect/web3modal/pull/2840
+ - fix: solana default chain logic by @zoruka in https://github.com/WalletConnect/web3modal/pull/2849
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.8
+
+## 5.1.7
+
+### Patch Changes
+
+- - chore: version bump for 5.1.6 by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2797
+ - fix(deps): update walletconnect to v2.15.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2722
+ - chore: fix public URL by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2806
+ - fix: RPC requests causing modal to close by @tomiir in https://github.com/WalletConnect/web3modal/pull/2799
+ - chore: use apiVersion v2 on names endpoint by @tomiir in https://github.com/WalletConnect/web3modal/pull/2805
+ - fix: import valtio from vanilla path by @jd1378 in https://github.com/WalletConnect/web3modal/pull/2810
+ - chore: use shared gh token by @tomiir in https://github.com/WalletConnect/web3modal/pull/2809
+ - chore: add input secrets to setup workflow by @tomiir in https://github.com/WalletConnect/web3modal/pull/2822
+ - fix: remove deprecated params from sign transaction wc rpc request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2816
+ - chore: changed android and ios links for react native sample apps by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2825
+ - chore: changed order of links by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2826
+ - fix(siwe): fix undefined SIWE chainId by @Cali93 in https://github.com/WalletConnect/web3modal/pull/2820
+ - chore: update monorepo deps to 2.16.1 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2829
+ - fix: don't capitalize first character of email field on mobile by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2815
+ - chore(deps): update dependency ethers to v6.13.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2434
+ - chore(deps): update wagmi by @renovate in https://github.com/WalletConnect/web3modal/pull/2711
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.7
+
+## 5.1.6
+
+### Patch Changes
+
+- fix: update CSP by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2775
+- fix: ethers5 adapter import in exports by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2754
+- fix/missing action functions exports from clients by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2778
+- fix: logics to set default chain by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2787
+- Implement actions using userOpBuilder service instead of permissionless.js by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2758
+- chore: run Playwright on self-hosted runners by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2788
+- chore: add NEXT_PUBLIC_SECURE_SITE_SDK_URL to CSP by @tomiir in https://github.com/WalletConnect/web3modal/pull/2791
+- chore: enable verify tests by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2774
+- fix: social login shows `undefined` by @magiziz in https://github.com/WalletConnect/web3modal/pull/2783
+
+* Updated dependencies []:
+ - @web3modal/ethers5@5.1.6
+
+## 5.1.5
+
+### Patch Changes
+
+- - chore: add safety for localstorage by @zoruka in https://github.com/WalletConnect/web3modal/pull/2770
+ - fix: impossible to press on send placeholder input on mobile by @magiziz in https://github.com/WalletConnect/web3modal/pull/2771
+ - feat: solana sign all transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2772
+ - chore: change universal provider relay url and move to constants file by @zoruka in https://github.com/WalletConnect/web3modal/pull/2776
+ - chore: remove coinbase SDK de-duplication by @tomiir in https://github.com/WalletConnect/web3modal/pull/2768
+ - fix: add missing chainId param for transactions request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2779
+ - fix: remove coming message from solana transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2780
+
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.5
+
+## 5.1.4
+
+### Patch Changes
+
+- - Added entries on assetlinks for flutter wallet by @quetool in https://github.com/WalletConnect/web3modal/pull/2746
+ - chore: only upgrade ethers v6 by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2741
+ - chore: fix wagmi not disconnecting and add adapter tests by @magiziz in https://github.com/WalletConnect/web3modal/pull/2751
+ - Added more fingerprints to Flutter apps by @quetool in https://github.com/WalletConnect/web3modal/pull/2748
+ - fix: remove auth connector from ethers and check for socials length by @tomiir in https://github.com/WalletConnect/web3modal/pull/2715
+ - chore: make all socials enabled by default by @tomiir in https://github.com/WalletConnect/web3modal/pull/2747
+ - fix: social logins not working in laboratory by @magiziz in https://github.com/WalletConnect/web3modal/pull/2765
+ - chore: expose solana provider type by @zoruka in https://github.com/WalletConnect/web3modal/pull/2756
+ - fix: Connector image mismatch by @tomiir in https://github.com/WalletConnect/web3modal/pull/2745
+- Updated dependencies []:
+ - @web3modal/ethers5@5.1.4
+
## 5.1.3
### Patch Changes
diff --git a/examples/react-ethers5/package.json b/examples/react-ethers5/package.json
index 57d35b6348..3796158771 100644
--- a/examples/react-ethers5/package.json
+++ b/examples/react-ethers5/package.json
@@ -1,7 +1,7 @@
{
"name": "@examples/react-ethers5",
"private": true,
- "version": "5.1.3",
+ "version": "5.1.8",
"scripts": {
"dev": "vite --port 3012",
"build": "vite build"
diff --git a/examples/react-ethers5/src/App.tsx b/examples/react-ethers5/src/App.tsx
index bc79c788c2..85eec94819 100644
--- a/examples/react-ethers5/src/App.tsx
+++ b/examples/react-ethers5/src/App.tsx
@@ -49,6 +49,7 @@ const ethersConfig = defaultConfig({
createWeb3Modal({
ethersConfig,
chains,
+ defaultChain: chains[1],
projectId,
enableAnalytics: true,
themeMode: 'light',
diff --git a/examples/react-solana/CHANGELOG.md b/examples/react-solana/CHANGELOG.md
index 50ed8bad6b..b50a569d34 100644
--- a/examples/react-solana/CHANGELOG.md
+++ b/examples/react-solana/CHANGELOG.md
@@ -1,5 +1,89 @@
# @examples/react-wagmi
+## 5.1.8
+
+### Patch Changes
+
+- - chore: changed RN links to wildcards by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2839
+ - feat: solana send transaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2802
+ - Feat/solana onramp by @phoenixVS in https://github.com/WalletConnect/web3modal/pull/2525
+ - chore: update assetlinks.json by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2838
+ - Chore/add base sepolia by @tomiir in https://github.com/WalletConnect/web3modal/pull/2840
+ - fix: solana default chain logic by @zoruka in https://github.com/WalletConnect/web3modal/pull/2849
+- Updated dependencies []:
+ - @web3modal/solana@5.1.8
+
+## 5.1.7
+
+### Patch Changes
+
+- - chore: version bump for 5.1.6 by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2797
+ - fix(deps): update walletconnect to v2.15.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2722
+ - chore: fix public URL by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2806
+ - fix: RPC requests causing modal to close by @tomiir in https://github.com/WalletConnect/web3modal/pull/2799
+ - chore: use apiVersion v2 on names endpoint by @tomiir in https://github.com/WalletConnect/web3modal/pull/2805
+ - fix: import valtio from vanilla path by @jd1378 in https://github.com/WalletConnect/web3modal/pull/2810
+ - chore: use shared gh token by @tomiir in https://github.com/WalletConnect/web3modal/pull/2809
+ - chore: add input secrets to setup workflow by @tomiir in https://github.com/WalletConnect/web3modal/pull/2822
+ - fix: remove deprecated params from sign transaction wc rpc request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2816
+ - chore: changed android and ios links for react native sample apps by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2825
+ - chore: changed order of links by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2826
+ - fix(siwe): fix undefined SIWE chainId by @Cali93 in https://github.com/WalletConnect/web3modal/pull/2820
+ - chore: update monorepo deps to 2.16.1 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2829
+ - fix: don't capitalize first character of email field on mobile by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2815
+ - chore(deps): update dependency ethers to v6.13.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2434
+ - chore(deps): update wagmi by @renovate in https://github.com/WalletConnect/web3modal/pull/2711
+- Updated dependencies []:
+ - @web3modal/solana@5.1.7
+
+## 5.1.6
+
+### Patch Changes
+
+- fix: update CSP by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2775
+- fix: ethers5 adapter import in exports by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2754
+- fix/missing action functions exports from clients by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2778
+- fix: logics to set default chain by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2787
+- Implement actions using userOpBuilder service instead of permissionless.js by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2758
+- chore: run Playwright on self-hosted runners by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2788
+- chore: add NEXT_PUBLIC_SECURE_SITE_SDK_URL to CSP by @tomiir in https://github.com/WalletConnect/web3modal/pull/2791
+- chore: enable verify tests by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2774
+- fix: social login shows `undefined` by @magiziz in https://github.com/WalletConnect/web3modal/pull/2783
+
+* Updated dependencies []:
+ - @web3modal/solana@5.1.6
+
+## 5.1.5
+
+### Patch Changes
+
+- - chore: add safety for localstorage by @zoruka in https://github.com/WalletConnect/web3modal/pull/2770
+ - fix: impossible to press on send placeholder input on mobile by @magiziz in https://github.com/WalletConnect/web3modal/pull/2771
+ - feat: solana sign all transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2772
+ - chore: change universal provider relay url and move to constants file by @zoruka in https://github.com/WalletConnect/web3modal/pull/2776
+ - chore: remove coinbase SDK de-duplication by @tomiir in https://github.com/WalletConnect/web3modal/pull/2768
+ - fix: add missing chainId param for transactions request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2779
+ - fix: remove coming message from solana transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2780
+
+- Updated dependencies []:
+ - @web3modal/solana@5.1.5
+
+## 5.1.4
+
+### Patch Changes
+
+- - Added entries on assetlinks for flutter wallet by @quetool in https://github.com/WalletConnect/web3modal/pull/2746
+ - chore: only upgrade ethers v6 by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2741
+ - chore: fix wagmi not disconnecting and add adapter tests by @magiziz in https://github.com/WalletConnect/web3modal/pull/2751
+ - Added more fingerprints to Flutter apps by @quetool in https://github.com/WalletConnect/web3modal/pull/2748
+ - fix: remove auth connector from ethers and check for socials length by @tomiir in https://github.com/WalletConnect/web3modal/pull/2715
+ - chore: make all socials enabled by default by @tomiir in https://github.com/WalletConnect/web3modal/pull/2747
+ - fix: social logins not working in laboratory by @magiziz in https://github.com/WalletConnect/web3modal/pull/2765
+ - chore: expose solana provider type by @zoruka in https://github.com/WalletConnect/web3modal/pull/2756
+ - fix: Connector image mismatch by @tomiir in https://github.com/WalletConnect/web3modal/pull/2745
+- Updated dependencies []:
+ - @web3modal/solana@5.1.4
+
## 5.1.3
### Patch Changes
diff --git a/examples/react-solana/package.json b/examples/react-solana/package.json
index a4ca35f548..cdb0ded251 100644
--- a/examples/react-solana/package.json
+++ b/examples/react-solana/package.json
@@ -1,7 +1,7 @@
{
"name": "@examples/react-solana",
"private": true,
- "version": "5.1.3",
+ "version": "5.1.8",
"scripts": {
"dev": "vite --port 3002",
"build": "vite build"
diff --git a/examples/react-solana/src/App.tsx b/examples/react-solana/src/App.tsx
index 201cd2739c..3677e4754f 100644
--- a/examples/react-solana/src/App.tsx
+++ b/examples/react-solana/src/App.tsx
@@ -60,6 +60,7 @@ createWeb3Modal({
solanaConfig,
projectId,
themeMode: 'light',
+ defaultChain: chains[2],
chains,
wallets: [
new HuobiWalletAdapter(),
diff --git a/examples/react-wagmi/CHANGELOG.md b/examples/react-wagmi/CHANGELOG.md
index 90732234f0..7c0814d4ca 100644
--- a/examples/react-wagmi/CHANGELOG.md
+++ b/examples/react-wagmi/CHANGELOG.md
@@ -1,5 +1,89 @@
# @examples/react-wagmi
+## 5.1.8
+
+### Patch Changes
+
+- - chore: changed RN links to wildcards by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2839
+ - feat: solana send transaction by @zoruka in https://github.com/WalletConnect/web3modal/pull/2802
+ - Feat/solana onramp by @phoenixVS in https://github.com/WalletConnect/web3modal/pull/2525
+ - chore: update assetlinks.json by @lukaisailovic in https://github.com/WalletConnect/web3modal/pull/2838
+ - Chore/add base sepolia by @tomiir in https://github.com/WalletConnect/web3modal/pull/2840
+ - fix: solana default chain logic by @zoruka in https://github.com/WalletConnect/web3modal/pull/2849
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.8
+
+## 5.1.7
+
+### Patch Changes
+
+- - chore: version bump for 5.1.6 by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2797
+ - fix(deps): update walletconnect to v2.15.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2722
+ - chore: fix public URL by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2806
+ - fix: RPC requests causing modal to close by @tomiir in https://github.com/WalletConnect/web3modal/pull/2799
+ - chore: use apiVersion v2 on names endpoint by @tomiir in https://github.com/WalletConnect/web3modal/pull/2805
+ - fix: import valtio from vanilla path by @jd1378 in https://github.com/WalletConnect/web3modal/pull/2810
+ - chore: use shared gh token by @tomiir in https://github.com/WalletConnect/web3modal/pull/2809
+ - chore: add input secrets to setup workflow by @tomiir in https://github.com/WalletConnect/web3modal/pull/2822
+ - fix: remove deprecated params from sign transaction wc rpc request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2816
+ - chore: changed android and ios links for react native sample apps by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2825
+ - chore: changed order of links by @ignaciosantise in https://github.com/WalletConnect/web3modal/pull/2826
+ - fix(siwe): fix undefined SIWE chainId by @Cali93 in https://github.com/WalletConnect/web3modal/pull/2820
+ - chore: update monorepo deps to 2.16.1 by @tomiir in https://github.com/WalletConnect/web3modal/pull/2829
+ - fix: don't capitalize first character of email field on mobile by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2815
+ - chore(deps): update dependency ethers to v6.13.2 by @renovate in https://github.com/WalletConnect/web3modal/pull/2434
+ - chore(deps): update wagmi by @renovate in https://github.com/WalletConnect/web3modal/pull/2711
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.7
+
+## 5.1.6
+
+### Patch Changes
+
+- fix: update CSP by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2775
+- fix: ethers5 adapter import in exports by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2754
+- fix/missing action functions exports from clients by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2778
+- fix: logics to set default chain by @enesozturk in https://github.com/WalletConnect/web3modal/pull/2787
+- Implement actions using userOpBuilder service instead of permissionless.js by @KannuSingh in https://github.com/WalletConnect/web3modal/pull/2758
+- chore: run Playwright on self-hosted runners by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2788
+- chore: add NEXT_PUBLIC_SECURE_SITE_SDK_URL to CSP by @tomiir in https://github.com/WalletConnect/web3modal/pull/2791
+- chore: enable verify tests by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2774
+- fix: social login shows `undefined` by @magiziz in https://github.com/WalletConnect/web3modal/pull/2783
+
+* Updated dependencies []:
+ - @web3modal/wagmi@5.1.6
+
+## 5.1.5
+
+### Patch Changes
+
+- - chore: add safety for localstorage by @zoruka in https://github.com/WalletConnect/web3modal/pull/2770
+ - fix: impossible to press on send placeholder input on mobile by @magiziz in https://github.com/WalletConnect/web3modal/pull/2771
+ - feat: solana sign all transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2772
+ - chore: change universal provider relay url and move to constants file by @zoruka in https://github.com/WalletConnect/web3modal/pull/2776
+ - chore: remove coinbase SDK de-duplication by @tomiir in https://github.com/WalletConnect/web3modal/pull/2768
+ - fix: add missing chainId param for transactions request by @zoruka in https://github.com/WalletConnect/web3modal/pull/2779
+ - fix: remove coming message from solana transactions by @zoruka in https://github.com/WalletConnect/web3modal/pull/2780
+
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.5
+
+## 5.1.4
+
+### Patch Changes
+
+- - Added entries on assetlinks for flutter wallet by @quetool in https://github.com/WalletConnect/web3modal/pull/2746
+ - chore: only upgrade ethers v6 by @chris13524 in https://github.com/WalletConnect/web3modal/pull/2741
+ - chore: fix wagmi not disconnecting and add adapter tests by @magiziz in https://github.com/WalletConnect/web3modal/pull/2751
+ - Added more fingerprints to Flutter apps by @quetool in https://github.com/WalletConnect/web3modal/pull/2748
+ - fix: remove auth connector from ethers and check for socials length by @tomiir in https://github.com/WalletConnect/web3modal/pull/2715
+ - chore: make all socials enabled by default by @tomiir in https://github.com/WalletConnect/web3modal/pull/2747
+ - fix: social logins not working in laboratory by @magiziz in https://github.com/WalletConnect/web3modal/pull/2765
+ - chore: expose solana provider type by @zoruka in https://github.com/WalletConnect/web3modal/pull/2756
+ - fix: Connector image mismatch by @tomiir in https://github.com/WalletConnect/web3modal/pull/2745
+- Updated dependencies []:
+ - @web3modal/wagmi@5.1.4
+
## 5.1.3
### Patch Changes
diff --git a/examples/react-wagmi/package.json b/examples/react-wagmi/package.json
index 5d24deb820..77d58b804b 100644
--- a/examples/react-wagmi/package.json
+++ b/examples/react-wagmi/package.json
@@ -1,7 +1,7 @@
{
"name": "@examples/react-wagmi",
"private": true,
- "version": "5.1.3",
+ "version": "5.1.8",
"scripts": {
"dev": "vite --port 3002",
"build": "vite build",
@@ -12,9 +12,9 @@
"@web3modal/wagmi": "workspace:*",
"react": "18.2.0",
"react-dom": "18.2.0",
- "viem": "2.19.6",
+ "viem": "2.21.4",
"vite": "5.2.11",
- "wagmi": "2.12.5"
+ "wagmi": "2.12.9"
},
"devDependencies": {
"@types/react": "18.2.62",
diff --git a/examples/react-wagmi/src/App.tsx b/examples/react-wagmi/src/App.tsx
index b7be969417..be57ef6a8a 100644
--- a/examples/react-wagmi/src/App.tsx
+++ b/examples/react-wagmi/src/App.tsx
@@ -7,8 +7,9 @@ import {
useWeb3ModalTheme
} from '@web3modal/wagmi/react'
import { WagmiProvider } from 'wagmi'
-import { arbitrum, mainnet } from 'wagmi/chains'
+import { arbitrum, mainnet, polygon } from 'wagmi/chains'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import { WagmiHooks } from './WagmiHooks'
// 0. Setup queryClient for WAGMIv2
const queryClient = new QueryClient()
@@ -21,11 +22,11 @@ if (!projectId) {
// 2. Create wagmiConfig
const wagmiConfig = defaultWagmiConfig({
- chains: [mainnet, arbitrum],
+ chains: [mainnet, polygon, arbitrum],
projectId,
metadata: {
- name: 'AppKit React Example',
- description: 'AppKit React Example',
+ name: 'AppKit',
+ description: 'AppKit React Wagmi Example',
url: '',
icons: []
}
@@ -35,6 +36,7 @@ const wagmiConfig = defaultWagmiConfig({
createWeb3Modal({
wagmiConfig,
projectId,
+ defaultChain: polygon,
themeMode: 'light',
themeVariables: {
'--w3m-color-mix': '#00DCFF',
@@ -62,6 +64,7 @@ export default function App() {
setThemeMode(themeMode === 'dark' ? 'light' : 'dark')}>
Toggle Theme Mode
+