From 292acbf9779410804180dbea239574b6dc527afa Mon Sep 17 00:00:00 2001 From: tomiir Date: Tue, 13 Feb 2024 10:50:28 -0600 Subject: [PATCH 1/6] fix: use short date instead of time from current date (#1910) --- package-lock.json | 23 +++++++++++-------- .../views/w3m-onramp-activity-view/index.ts | 3 ++- .../wui-onramp-activity-item/index.ts | 1 + 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3447b37420..36c95d203b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16762,17 +16762,20 @@ } }, "node_modules/define-data-property": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.2.tgz", - "integrity": "sha512-SRtsSqsDbgpJBbW3pABMCOt6rQyeM8s8RiyeSN8jYG8sYmt/kGJejbydttUsnDs1tadr19tvhT4ShwMyoqAm4g==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.3.tgz", + "integrity": "sha512-h3GBouC+RPtNX2N0hHVLo2ZwPYurq8mLmXpOLTsw71gr7lHt5VaI4vVkDUNOfiWmm48JEXe3VM7PmLX45AMmmg==", "dependencies": { "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.2", + "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/define-lazy-prop": { @@ -17098,9 +17101,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.665", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.665.tgz", - "integrity": "sha512-UpyCWObBoD+nSZgOC2ToaIdZB0r9GhqT2WahPKiSki6ckkSuKhQNso8V2PrFcHBMleI/eqbKgVQgVC4Wni4ilw==" + "version": "1.4.666", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.666.tgz", + "integrity": "sha512-q4lkcbQrUdlzWCUOxk6fwEza6bNCfV12oi4AJph5UibguD1aTfL4uD0nuzFv9hbPANXQMuUS0MxPSHQ1gqq5dg==" }, "node_modules/elliptic": { "version": "6.5.4", @@ -21757,9 +21760,9 @@ } }, "node_modules/lazy-universal-dotenv/node_modules/dotenv": { - "version": "16.4.2", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.2.tgz", - "integrity": "sha512-rZSSFxke7d9nYQ5NeMIwp5PP+f8wXgKNljpOb7KtH6SKW1cEqcXAz9VSJYVLKe7Jhup/gUYOkaeSVyK8GJ+nBg==", + "version": "16.4.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.3.tgz", + "integrity": "sha512-II98GFrje5psQTSve0E7bnwMFybNLqT8Vu8JIFWRjsE3khyNUm/loZupuy5DVzG2IXf/ysxvrixYOQnM6mjD3A==", "engines": { "node": ">=12" }, diff --git a/packages/scaffold/src/views/w3m-onramp-activity-view/index.ts b/packages/scaffold/src/views/w3m-onramp-activity-view/index.ts index fb9ebfb5df..103ae79387 100644 --- a/packages/scaffold/src/views/w3m-onramp-activity-view/index.ts +++ b/packages/scaffold/src/views/w3m-onramp-activity-view/index.ts @@ -21,6 +21,7 @@ export class W3mOnRampActivityView extends LitElement { // -- Members ------------------------------------------- // private unsubscribe: (() => void)[] = [] + private refetchTimeout: NodeJS.Timeout | undefined = undefined // -- State & Properties -------------------------------- // @@ -63,7 +64,7 @@ export class W3mOnRampActivityView extends LitElement { // -- Private ------------------------------------------- // private templateTransactions(transactions: Transaction[]) { return transactions?.map(transaction => { - const date = DateUtil.getRelativeDateFromNow(transaction.metadata.minedAt) + const date = DateUtil.formatDate(transaction?.metadata?.minedAt) const transfer = transaction.transfers[0] const fungibleInfo = transfer?.fungible_info diff --git a/packages/ui/src/composites/wui-onramp-activity-item/index.ts b/packages/ui/src/composites/wui-onramp-activity-item/index.ts index cba18d9da6..3e5bbb0f26 100644 --- a/packages/ui/src/composites/wui-onramp-activity-item/index.ts +++ b/packages/ui/src/composites/wui-onramp-activity-item/index.ts @@ -68,6 +68,7 @@ export class WuiOnRampActivityItem extends LitElement { private async fetchTokenImage() { await ApiController._fetchTokenImage(this.purchaseCurrency) } + private statusIconTemplate() { if (this.inProgress) { return null From fa5ca37b1a47f4944abee5fd209b495bb9faa0b2 Mon Sep 17 00:00:00 2001 From: tomiir Date: Tue, 13 Feb 2024 11:16:26 -0600 Subject: [PATCH 2/6] feat: update wagmi rpc url to use wallet connect (#1917) Co-authored-by: Sven <38101365+svenvoskamp@users.noreply.github.com> --- apps/gallery/CHANGELOG.md | 10 ++ apps/gallery/package.json | 6 +- apps/laboratory/CHANGELOG.md | 11 ++ apps/laboratory/package.json | 8 +- examples/html-ethers5/CHANGELOG.md | 9 ++ examples/html-ethers5/package.json | 4 +- examples/html-wagmi/CHANGELOG.md | 9 ++ examples/html-wagmi/package.json | 4 +- examples/next-wagmi/CHANGELOG.md | 9 ++ examples/next-wagmi/package.json | 4 +- examples/react-ethers5/CHANGELOG.md | 9 ++ examples/react-ethers5/package.json | 4 +- examples/react-wagmi/CHANGELOG.md | 9 ++ examples/react-wagmi/package.json | 4 +- examples/vue-ethers5/CHANGELOG.md | 9 ++ examples/vue-ethers5/package.json | 4 +- examples/vue-wagmi/CHANGELOG.md | 9 ++ examples/vue-wagmi/package.json | 4 +- package-lock.json | 130 +++++++++--------- packages/common/CHANGELOG.md | 6 + packages/common/package.json | 2 +- packages/core/CHANGELOG.md | 10 ++ packages/core/package.json | 6 +- packages/ethers/CHANGELOG.md | 14 ++ packages/ethers/package.json | 14 +- packages/ethers5/CHANGELOG.md | 14 ++ packages/ethers5/package.json | 14 +- packages/polyfills/CHANGELOG.md | 6 + packages/polyfills/package.json | 2 +- packages/scaffold-react/CHANGELOG.md | 9 ++ packages/scaffold-react/package.json | 4 +- packages/scaffold-utils/CHANGELOG.md | 10 ++ packages/scaffold-utils/package.json | 6 +- packages/scaffold-utils/src/ConstantsUtil.ts | 2 +- packages/scaffold-vue/CHANGELOG.md | 9 ++ packages/scaffold-vue/package.json | 4 +- packages/scaffold/CHANGELOG.md | 11 ++ packages/scaffold/package.json | 10 +- packages/siwe/CHANGELOG.md | 10 ++ packages/siwe/package.json | 6 +- packages/ui/CHANGELOG.md | 6 + packages/ui/package.json | 4 +- packages/wagmi/CHANGELOG.md | 14 ++ packages/wagmi/package.json | 14 +- .../wagmi/src/utils/defaultWagmiCoreConfig.ts | 8 +- .../src/utils/defaultWagmiReactConfig.ts | 8 +- packages/wagmi/src/utils/helpers.ts | 17 ++- packages/wallet/CHANGELOG.md | 6 + packages/wallet/package.json | 2 +- 49 files changed, 367 insertions(+), 137 deletions(-) diff --git a/apps/gallery/CHANGELOG.md b/apps/gallery/CHANGELOG.md index 1bbd460f90..44ed84e4ce 100644 --- a/apps/gallery/CHANGELOG.md +++ b/apps/gallery/CHANGELOG.md @@ -1,5 +1,15 @@ # @apps/gallery +## 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/common@4.0.5 + - @web3modal/ui@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/apps/gallery/package.json b/apps/gallery/package.json index 689c24c502..9e72040567 100644 --- a/apps/gallery/package.json +++ b/apps/gallery/package.json @@ -1,6 +1,6 @@ { "name": "@apps/gallery", - "version": "4.0.4", + "version": "4.0.5", "private": true, "main": "index.js", "scripts": { @@ -9,8 +9,8 @@ "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "dependencies": { - "@web3modal/common": "4.0.4", - "@web3modal/ui": "4.0.4", + "@web3modal/common": "4.0.5", + "@web3modal/ui": "4.0.5", "lit": "3.1.0", "storybook": "7.6.7" }, diff --git a/apps/laboratory/CHANGELOG.md b/apps/laboratory/CHANGELOG.md index 3158faeae7..bd47911b52 100644 --- a/apps/laboratory/CHANGELOG.md +++ b/apps/laboratory/CHANGELOG.md @@ -1,5 +1,16 @@ # @apps/laboratory +## 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/wagmi@4.0.5 + - @web3modal/ethers@4.0.5 + - @web3modal/ethers5@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/apps/laboratory/package.json b/apps/laboratory/package.json index 4187cde6bf..5b2b304610 100644 --- a/apps/laboratory/package.json +++ b/apps/laboratory/package.json @@ -1,6 +1,6 @@ { "name": "@apps/laboratory", - "version": "4.0.4", + "version": "4.0.5", "private": true, "scripts": { "dev:laboratory": "next dev", @@ -22,9 +22,9 @@ "@sentry/browser": "7.92.0", "@sentry/react": "7.92.0", "@tanstack/react-query": "5.17.19", - "@web3modal/ethers": "4.0.4", - "@web3modal/ethers5": "4.0.4", - "@web3modal/wagmi": "4.0.4", + "@web3modal/ethers": "4.0.5", + "@web3modal/ethers5": "4.0.5", + "@web3modal/wagmi": "4.0.5", "framer-motion": "10.17.9", "next": "14.0.4", "next-auth": "4.24.5", diff --git a/examples/html-ethers5/CHANGELOG.md b/examples/html-ethers5/CHANGELOG.md index 976169dc9c..2515b30cfe 100644 --- a/examples/html-ethers5/CHANGELOG.md +++ b/examples/html-ethers5/CHANGELOG.md @@ -1,5 +1,14 @@ # @examples/html-ethers5 +## 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 diff --git a/examples/html-ethers5/package.json b/examples/html-ethers5/package.json index 3ac2c231a0..1d82943e4b 100644 --- a/examples/html-ethers5/package.json +++ b/examples/html-ethers5/package.json @@ -1,13 +1,13 @@ { "name": "@examples/html-ethers5", "private": true, - "version": "4.0.4", + "version": "4.0.5", "scripts": { "dev:example": "vite --port 3011", "build:examples": "vite build" }, "dependencies": { - "@web3modal/ethers5": "4.0.4", + "@web3modal/ethers5": "4.0.5", "ethers": "5.7.2" }, "devDependencies": { diff --git a/examples/html-wagmi/CHANGELOG.md b/examples/html-wagmi/CHANGELOG.md index 320e367780..ce66ebf26f 100644 --- a/examples/html-wagmi/CHANGELOG.md +++ b/examples/html-wagmi/CHANGELOG.md @@ -1,5 +1,14 @@ # @examples/html-wagmi +## 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/wagmi@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/examples/html-wagmi/package.json b/examples/html-wagmi/package.json index ec35e7f337..9745764635 100644 --- a/examples/html-wagmi/package.json +++ b/examples/html-wagmi/package.json @@ -1,13 +1,13 @@ { "name": "@examples/html-wagmi", "private": true, - "version": "4.0.4", + "version": "4.0.5", "scripts": { "dev:example": "vite --port 3001", "build:examples": "vite build" }, "dependencies": { - "@web3modal/wagmi": "4.0.4", + "@web3modal/wagmi": "4.0.5", "react": "18.2.0", "react-dom": "18.2.0" }, diff --git a/examples/next-wagmi/CHANGELOG.md b/examples/next-wagmi/CHANGELOG.md index 4fad200446..535eb2f1d7 100644 --- a/examples/next-wagmi/CHANGELOG.md +++ b/examples/next-wagmi/CHANGELOG.md @@ -1,5 +1,14 @@ # @examples/next-wagmi +## 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/wagmi@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/examples/next-wagmi/package.json b/examples/next-wagmi/package.json index 9847d82a9c..7e83e1842b 100644 --- a/examples/next-wagmi/package.json +++ b/examples/next-wagmi/package.json @@ -1,6 +1,6 @@ { "name": "@examples/next-wagmi", - "version": "4.0.4", + "version": "4.0.5", "private": true, "scripts": { "dev": "next dev", @@ -10,7 +10,7 @@ }, "dependencies": { "@tanstack/react-query": "5.17.19", - "@web3modal/wagmi": "4.0.4", + "@web3modal/wagmi": "4.0.5", "next": "14.1.0", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/examples/react-ethers5/CHANGELOG.md b/examples/react-ethers5/CHANGELOG.md index de79efe3e4..672f1f672d 100644 --- a/examples/react-ethers5/CHANGELOG.md +++ b/examples/react-ethers5/CHANGELOG.md @@ -1,5 +1,14 @@ # @examples/react-ethers5 +## 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 diff --git a/examples/react-ethers5/package.json b/examples/react-ethers5/package.json index b95a2544d6..9072797356 100644 --- a/examples/react-ethers5/package.json +++ b/examples/react-ethers5/package.json @@ -1,13 +1,13 @@ { "name": "@examples/react-ethers5", "private": true, - "version": "4.0.4", + "version": "4.0.5", "scripts": { "dev:example": "vite --port 3012", "build:examples": "vite build" }, "dependencies": { - "@web3modal/ethers5": "4.0.4", + "@web3modal/ethers5": "4.0.5", "ethers": "5.7.2", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/examples/react-wagmi/CHANGELOG.md b/examples/react-wagmi/CHANGELOG.md index 0aeaac6a7a..0efc2a33ad 100644 --- a/examples/react-wagmi/CHANGELOG.md +++ b/examples/react-wagmi/CHANGELOG.md @@ -1,5 +1,14 @@ # @examples/react-wagmi +## 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/wagmi@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/examples/react-wagmi/package.json b/examples/react-wagmi/package.json index 1aa26a2f28..65a41dc101 100644 --- a/examples/react-wagmi/package.json +++ b/examples/react-wagmi/package.json @@ -1,14 +1,14 @@ { "name": "@examples/react-wagmi", "private": true, - "version": "4.0.4", + "version": "4.0.5", "scripts": { "dev:example": "vite --port 3002", "build:examples": "vite build" }, "dependencies": { "@tanstack/react-query": "5.17.19", - "@web3modal/wagmi": "4.0.4", + "@web3modal/wagmi": "4.0.5", "react": "18.2.0", "react-dom": "18.2.0", "viem": "2.5.0", diff --git a/examples/vue-ethers5/CHANGELOG.md b/examples/vue-ethers5/CHANGELOG.md index 9c6a6963a7..4ce7893ec5 100644 --- a/examples/vue-ethers5/CHANGELOG.md +++ b/examples/vue-ethers5/CHANGELOG.md @@ -1,5 +1,14 @@ # @examples/vue-ethers5 +## 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 diff --git a/examples/vue-ethers5/package.json b/examples/vue-ethers5/package.json index 7445fe6d16..5e63c8a23d 100644 --- a/examples/vue-ethers5/package.json +++ b/examples/vue-ethers5/package.json @@ -1,13 +1,13 @@ { "name": "@examples/vue-ethers5", "private": true, - "version": "4.0.4", + "version": "4.0.5", "scripts": { "dev:example": "vite --port 3013", "build:examples": "vite build" }, "dependencies": { - "@web3modal/ethers5": "4.0.4", + "@web3modal/ethers5": "4.0.5", "ethers": "5.7.2" }, "devDependencies": { diff --git a/examples/vue-wagmi/CHANGELOG.md b/examples/vue-wagmi/CHANGELOG.md index d21ff02f63..84dd9cbb8c 100644 --- a/examples/vue-wagmi/CHANGELOG.md +++ b/examples/vue-wagmi/CHANGELOG.md @@ -1,5 +1,14 @@ # @examples/vue-wagmi +## 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/wagmi@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/examples/vue-wagmi/package.json b/examples/vue-wagmi/package.json index e8650e794e..ad0039fa99 100644 --- a/examples/vue-wagmi/package.json +++ b/examples/vue-wagmi/package.json @@ -1,13 +1,13 @@ { "name": "@examples/vue-wagmi", "private": true, - "version": "4.0.4", + "version": "4.0.5", "scripts": { "dev:example": "vite --port 3003", "build:examples": "vite build" }, "dependencies": { - "@web3modal/wagmi": "4.0.4" + "@web3modal/wagmi": "4.0.5" }, "devDependencies": { "@vitejs/plugin-vue": "5.0.2" diff --git a/package-lock.json b/package-lock.json index 36c95d203b..4a807d9e27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,10 +41,10 @@ }, "apps/gallery": { "name": "@apps/gallery", - "version": "4.0.4", + "version": "4.0.5", "dependencies": { - "@web3modal/common": "4.0.4", - "@web3modal/ui": "4.0.4", + "@web3modal/common": "4.0.5", + "@web3modal/ui": "4.0.5", "lit": "3.1.0", "storybook": "7.6.7" }, @@ -70,7 +70,7 @@ }, "apps/laboratory": { "name": "@apps/laboratory", - "version": "4.0.4", + "version": "4.0.5", "dependencies": { "@chakra-ui/react": "2.8.2", "@emotion/react": "11.11.3", @@ -78,9 +78,9 @@ "@sentry/browser": "7.92.0", "@sentry/react": "7.92.0", "@tanstack/react-query": "5.17.19", - "@web3modal/ethers": "4.0.4", - "@web3modal/ethers5": "4.0.4", - "@web3modal/wagmi": "4.0.4", + "@web3modal/ethers": "4.0.5", + "@web3modal/ethers5": "4.0.5", + "@web3modal/wagmi": "4.0.5", "framer-motion": "10.17.9", "next": "14.0.4", "next-auth": "4.24.5", @@ -112,9 +112,9 @@ }, "examples/html-ethers5": { "name": "@examples/html-ethers5", - "version": "4.0.4", + "version": "4.0.5", "dependencies": { - "@web3modal/ethers5": "4.0.4", + "@web3modal/ethers5": "4.0.5", "ethers": "5.7.2" }, "devDependencies": { @@ -170,9 +170,9 @@ }, "examples/html-wagmi": { "name": "@examples/html-wagmi", - "version": "4.0.4", + "version": "4.0.5", "dependencies": { - "@web3modal/wagmi": "4.0.4", + "@web3modal/wagmi": "4.0.5", "react": "18.2.0", "react-dom": "18.2.0" }, @@ -182,10 +182,10 @@ }, "examples/next-wagmi": { "name": "@examples/next-wagmi", - "version": "4.0.4", + "version": "4.0.5", "dependencies": { "@tanstack/react-query": "5.17.19", - "@web3modal/wagmi": "4.0.4", + "@web3modal/wagmi": "4.0.5", "next": "14.1.0", "react": "18.2.0", "react-dom": "18.2.0", @@ -248,9 +248,9 @@ }, "examples/react-ethers5": { "name": "@examples/react-ethers5", - "version": "4.0.4", + "version": "4.0.5", "dependencies": { - "@web3modal/ethers5": "4.0.4", + "@web3modal/ethers5": "4.0.5", "ethers": "5.7.2", "react": "18.2.0", "react-dom": "18.2.0" @@ -309,10 +309,10 @@ }, "examples/react-wagmi": { "name": "@examples/react-wagmi", - "version": "4.0.4", + "version": "4.0.5", "dependencies": { "@tanstack/react-query": "5.17.19", - "@web3modal/wagmi": "4.0.4", + "@web3modal/wagmi": "4.0.5", "react": "18.2.0", "react-dom": "18.2.0", "viem": "2.5.0", @@ -326,9 +326,9 @@ }, "examples/vue-ethers5": { "name": "@examples/vue-ethers5", - "version": "4.0.4", + "version": "4.0.5", "dependencies": { - "@web3modal/ethers5": "4.0.4", + "@web3modal/ethers5": "4.0.5", "ethers": "5.7.2" }, "devDependencies": { @@ -384,9 +384,9 @@ }, "examples/vue-wagmi": { "name": "@examples/vue-wagmi", - "version": "4.0.4", + "version": "4.0.5", "dependencies": { - "@web3modal/wagmi": "4.0.4" + "@web3modal/wagmi": "4.0.5" }, "devDependencies": { "@vitejs/plugin-vue": "5.0.2" @@ -30287,7 +30287,7 @@ }, "packages/common": { "name": "@web3modal/common", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { "dayjs": "1.11.10" @@ -30295,11 +30295,11 @@ }, "packages/core": { "name": "@web3modal/core", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { - "@web3modal/common": "4.0.4", - "@web3modal/wallet": "4.0.4", + "@web3modal/common": "4.0.5", + "@web3modal/wallet": "4.0.5", "valtio": "1.11.2" }, "devDependencies": { @@ -30308,16 +30308,16 @@ }, "packages/ethers": { "name": "@web3modal/ethers", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { "@coinbase/wallet-sdk": "3.9.1", "@walletconnect/ethereum-provider": "2.11.1", - "@web3modal/polyfills": "4.0.4", - "@web3modal/scaffold": "4.0.4", - "@web3modal/scaffold-react": "4.0.4", - "@web3modal/scaffold-utils": "4.0.4", - "@web3modal/scaffold-vue": "4.0.4", + "@web3modal/polyfills": "4.0.5", + "@web3modal/scaffold": "4.0.5", + "@web3modal/scaffold-react": "4.0.5", + "@web3modal/scaffold-utils": "4.0.5", + "@web3modal/scaffold-vue": "4.0.5", "valtio": "1.11.2" }, "devDependencies": { @@ -30328,7 +30328,7 @@ "vue": "3.4.3" }, "optionalDependencies": { - "@web3modal/siwe": "4.0.4", + "@web3modal/siwe": "4.0.5", "react": ">=17", "react-dom": ">=17", "vue": ">=3" @@ -30505,16 +30505,16 @@ }, "packages/ethers5": { "name": "@web3modal/ethers5", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { "@coinbase/wallet-sdk": "3.9.1", "@walletconnect/ethereum-provider": "2.11.1", - "@web3modal/polyfills": "4.0.4", - "@web3modal/scaffold": "4.0.4", - "@web3modal/scaffold-react": "4.0.4", - "@web3modal/scaffold-utils": "4.0.4", - "@web3modal/scaffold-vue": "4.0.4", + "@web3modal/polyfills": "4.0.5", + "@web3modal/scaffold": "4.0.5", + "@web3modal/scaffold-react": "4.0.5", + "@web3modal/scaffold-utils": "4.0.5", + "@web3modal/scaffold-vue": "4.0.5", "valtio": "1.11.2" }, "devDependencies": { @@ -30525,7 +30525,7 @@ "vue": "3.4.3" }, "optionalDependencies": { - "@web3modal/siwe": "4.0.4", + "@web3modal/siwe": "4.0.5", "react": ">=17", "react-dom": ">=17", "vue": ">=3" @@ -30750,7 +30750,7 @@ }, "packages/polyfills": { "name": "@web3modal/polyfills", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { "buffer": "6.0.3" @@ -30758,24 +30758,24 @@ }, "packages/scaffold": { "name": "@web3modal/scaffold", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { - "@web3modal/common": "4.0.4", - "@web3modal/core": "4.0.4", - "@web3modal/ui": "4.0.4", + "@web3modal/common": "4.0.5", + "@web3modal/core": "4.0.5", + "@web3modal/ui": "4.0.5", "lit": "3.1.0" }, "devDependencies": { - "@web3modal/wallet": "4.0.4" + "@web3modal/wallet": "4.0.5" } }, "packages/scaffold-react": { "name": "@web3modal/scaffold-react", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { - "@web3modal/scaffold": "4.0.4" + "@web3modal/scaffold": "4.0.5" }, "peerDependencies": { "react": ">=17", @@ -30784,20 +30784,20 @@ }, "packages/scaffold-utils": { "name": "@web3modal/scaffold-utils", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { - "@web3modal/polyfills": "4.0.4", - "@web3modal/scaffold": "4.0.4", + "@web3modal/polyfills": "4.0.5", + "@web3modal/scaffold": "4.0.5", "valtio": "1.11.2" } }, "packages/scaffold-vue": { "name": "@web3modal/scaffold-vue", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { - "@web3modal/scaffold": "4.0.4" + "@web3modal/scaffold": "4.0.5" }, "peerDependencies": { "vue": ">=3" @@ -30815,11 +30815,11 @@ }, "packages/siwe": { "name": "@web3modal/siwe", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { - "@web3modal/core": "4.0.4", - "@web3modal/scaffold-utils": "4.0.4" + "@web3modal/core": "4.0.5", + "@web3modal/scaffold-utils": "4.0.5" }, "optionalDependencies": { "react": ">=17", @@ -30845,7 +30845,7 @@ }, "packages/ui": { "name": "@web3modal/ui", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { "lit": "3.1.0", @@ -30853,7 +30853,7 @@ }, "devDependencies": { "@types/qrcode": "1.5.5", - "@web3modal/common": "4.0.4", + "@web3modal/common": "4.0.5", "eslint-plugin-lit": "1.11.0", "eslint-plugin-wc": "2.0.4" } @@ -30870,14 +30870,14 @@ }, "packages/wagmi": { "name": "@web3modal/wagmi", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { - "@web3modal/polyfills": "4.0.4", - "@web3modal/scaffold": "4.0.4", - "@web3modal/scaffold-react": "4.0.4", - "@web3modal/scaffold-utils": "4.0.4", - "@web3modal/scaffold-vue": "4.0.4" + "@web3modal/polyfills": "4.0.5", + "@web3modal/scaffold": "4.0.5", + "@web3modal/scaffold-react": "4.0.5", + "@web3modal/scaffold-utils": "4.0.5", + "@web3modal/scaffold-vue": "4.0.5" }, "devDependencies": { "@wagmi/connectors": "4.1.4", @@ -30889,7 +30889,7 @@ "vue": "3.4.3" }, "optionalDependencies": { - "@web3modal/siwe": "4.0.4", + "@web3modal/siwe": "4.0.5", "react": ">=17", "react-dom": ">=17", "vue": ">=3" @@ -31191,7 +31191,7 @@ }, "packages/wallet": { "name": "@web3modal/wallet", - "version": "4.0.4", + "version": "4.0.5", "license": "Apache-2.0", "dependencies": { "zod": "3.22.4" diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md index 26f05e0bfc..455937f0f1 100644 --- a/packages/common/CHANGELOG.md +++ b/packages/common/CHANGELOG.md @@ -1,5 +1,11 @@ # @web3modal/common +## 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 + ## 4.0.4 ### Patch Changes diff --git a/packages/common/package.json b/packages/common/package.json index 092d7ae9e4..893b5af8c2 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/common", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/index.js", "types": "./dist/types/index.d.ts", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index a8f4be5aee..386ff770d0 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,15 @@ # @web3modal/core +## 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/common@4.0.5 + - @web3modal/wallet@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 60fdb444dd..1e77f407e8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/core", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/index.js", "types": "./dist/types/index.d.ts", @@ -17,8 +17,8 @@ "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "dependencies": { - "@web3modal/common": "4.0.4", - "@web3modal/wallet": "4.0.4", + "@web3modal/common": "4.0.5", + "@web3modal/wallet": "4.0.5", "valtio": "1.11.2" }, "devDependencies": { diff --git a/packages/ethers/CHANGELOG.md b/packages/ethers/CHANGELOG.md index a9e6754c83..a479ae0a72 100644 --- a/packages/ethers/CHANGELOG.md +++ b/packages/ethers/CHANGELOG.md @@ -1,5 +1,19 @@ # @web3modal/ethers +## 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/polyfills@4.0.5 + - @web3modal/scaffold@4.0.5 + - @web3modal/scaffold-react@4.0.5 + - @web3modal/scaffold-utils@4.0.5 + - @web3modal/scaffold-vue@4.0.5 + - @web3modal/siwe@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/packages/ethers/package.json b/packages/ethers/package.json index 40f0022896..f2e71e5323 100644 --- a/packages/ethers/package.json +++ b/packages/ethers/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/ethers", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/exports/index.js", "types": "./dist/types/exports/index.d.ts", @@ -45,11 +45,11 @@ "dependencies": { "@coinbase/wallet-sdk": "3.9.1", "@walletconnect/ethereum-provider": "2.11.1", - "@web3modal/polyfills": "4.0.4", - "@web3modal/scaffold": "4.0.4", - "@web3modal/scaffold-react": "4.0.4", - "@web3modal/scaffold-utils": "4.0.4", - "@web3modal/scaffold-vue": "4.0.4", + "@web3modal/polyfills": "4.0.5", + "@web3modal/scaffold": "4.0.5", + "@web3modal/scaffold-react": "4.0.5", + "@web3modal/scaffold-utils": "4.0.5", + "@web3modal/scaffold-vue": "4.0.5", "valtio": "1.11.2" }, "peerDependencies": { @@ -81,7 +81,7 @@ } }, "optionalDependencies": { - "@web3modal/siwe": "4.0.4", + "@web3modal/siwe": "4.0.5", "react": ">=17", "react-dom": ">=17", "vue": ">=3" diff --git a/packages/ethers5/CHANGELOG.md b/packages/ethers5/CHANGELOG.md index 3b119d2411..5dc77126b9 100644 --- a/packages/ethers5/CHANGELOG.md +++ b/packages/ethers5/CHANGELOG.md @@ -1,5 +1,19 @@ # @web3modal/ethers5 +## 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/polyfills@4.0.5 + - @web3modal/scaffold@4.0.5 + - @web3modal/scaffold-react@4.0.5 + - @web3modal/scaffold-utils@4.0.5 + - @web3modal/scaffold-vue@4.0.5 + - @web3modal/siwe@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/packages/ethers5/package.json b/packages/ethers5/package.json index 0b6bc7be8c..7a2192bc0a 100644 --- a/packages/ethers5/package.json +++ b/packages/ethers5/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/ethers5", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/exports/index.js", "types": "./dist/types/exports/index.d.ts", @@ -45,11 +45,11 @@ "dependencies": { "@coinbase/wallet-sdk": "3.9.1", "@walletconnect/ethereum-provider": "2.11.1", - "@web3modal/polyfills": "4.0.4", - "@web3modal/scaffold": "4.0.4", - "@web3modal/scaffold-react": "4.0.4", - "@web3modal/scaffold-utils": "4.0.4", - "@web3modal/scaffold-vue": "4.0.4", + "@web3modal/polyfills": "4.0.5", + "@web3modal/scaffold": "4.0.5", + "@web3modal/scaffold-react": "4.0.5", + "@web3modal/scaffold-utils": "4.0.5", + "@web3modal/scaffold-vue": "4.0.5", "valtio": "1.11.2" }, "devDependencies": { @@ -81,7 +81,7 @@ } }, "optionalDependencies": { - "@web3modal/siwe": "4.0.4", + "@web3modal/siwe": "4.0.5", "react": ">=17", "react-dom": ">=17", "vue": ">=3" diff --git a/packages/polyfills/CHANGELOG.md b/packages/polyfills/CHANGELOG.md index 29b5ca7675..7a98127b11 100644 --- a/packages/polyfills/CHANGELOG.md +++ b/packages/polyfills/CHANGELOG.md @@ -1,5 +1,11 @@ # @web3modal/polyfills +## 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 + ## 4.0.4 ### Patch Changes diff --git a/packages/polyfills/package.json b/packages/polyfills/package.json index c4c291ff81..87b2bf8734 100644 --- a/packages/polyfills/package.json +++ b/packages/polyfills/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/polyfills", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/index.js", "types": "./dist/types/index.d.ts", diff --git a/packages/scaffold-react/CHANGELOG.md b/packages/scaffold-react/CHANGELOG.md index 9ef61208e7..7a32910c09 100644 --- a/packages/scaffold-react/CHANGELOG.md +++ b/packages/scaffold-react/CHANGELOG.md @@ -1,5 +1,14 @@ # @web3modal/scaffold-react +## 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/scaffold@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/packages/scaffold-react/package.json b/packages/scaffold-react/package.json index 2e1e1dca80..60acb63298 100644 --- a/packages/scaffold-react/package.json +++ b/packages/scaffold-react/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/scaffold-react", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/index.js", "types": "./dist/types/index.d.ts", @@ -16,7 +16,7 @@ "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "dependencies": { - "@web3modal/scaffold": "4.0.4" + "@web3modal/scaffold": "4.0.5" }, "peerDependencies": { "react": ">=17", diff --git a/packages/scaffold-utils/CHANGELOG.md b/packages/scaffold-utils/CHANGELOG.md index 12224b9706..bd9f453fad 100644 --- a/packages/scaffold-utils/CHANGELOG.md +++ b/packages/scaffold-utils/CHANGELOG.md @@ -1,5 +1,15 @@ # @web3modal/scaffold-utils +## 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/polyfills@4.0.5 + - @web3modal/scaffold@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/packages/scaffold-utils/package.json b/packages/scaffold-utils/package.json index 1ef151b120..d543a30b4f 100644 --- a/packages/scaffold-utils/package.json +++ b/packages/scaffold-utils/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/scaffold-utils", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/exports/index.js", "types": "./dist/types/exports/index.d.ts", @@ -35,8 +35,8 @@ "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "dependencies": { - "@web3modal/polyfills": "4.0.4", - "@web3modal/scaffold": "4.0.4", + "@web3modal/polyfills": "4.0.5", + "@web3modal/scaffold": "4.0.5", "valtio": "1.11.2" }, "keywords": [ diff --git a/packages/scaffold-utils/src/ConstantsUtil.ts b/packages/scaffold-utils/src/ConstantsUtil.ts index 0d3babcda7..b6f408f3b0 100644 --- a/packages/scaffold-utils/src/ConstantsUtil.ts +++ b/packages/scaffold-utils/src/ConstantsUtil.ts @@ -11,5 +11,5 @@ export const ConstantsUtil = { ADD_CHAIN_METHOD: 'wallet_addEthereumChain', EIP6963_ANNOUNCE_EVENT: 'eip6963:announceProvider', EIP6963_REQUEST_EVENT: 'eip6963:requestProvider', - VERSION: '4.0.4' + VERSION: '4.0.5' } diff --git a/packages/scaffold-vue/CHANGELOG.md b/packages/scaffold-vue/CHANGELOG.md index faa78cf85f..1ed6a5342b 100644 --- a/packages/scaffold-vue/CHANGELOG.md +++ b/packages/scaffold-vue/CHANGELOG.md @@ -1,5 +1,14 @@ # @web3modal/scaffold-vue +## 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/scaffold@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/packages/scaffold-vue/package.json b/packages/scaffold-vue/package.json index ae7a6a5cee..c343d852f0 100644 --- a/packages/scaffold-vue/package.json +++ b/packages/scaffold-vue/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/scaffold-vue", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/index.js", "types": "./dist/types/index.d.ts", @@ -16,7 +16,7 @@ "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "dependencies": { - "@web3modal/scaffold": "4.0.4" + "@web3modal/scaffold": "4.0.5" }, "peerDependencies": { "vue": ">=3" diff --git a/packages/scaffold/CHANGELOG.md b/packages/scaffold/CHANGELOG.md index 5f099b0fde..787e22449e 100644 --- a/packages/scaffold/CHANGELOG.md +++ b/packages/scaffold/CHANGELOG.md @@ -1,5 +1,16 @@ # @web3modal/scaffold +## 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/common@4.0.5 + - @web3modal/core@4.0.5 + - @web3modal/ui@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/packages/scaffold/package.json b/packages/scaffold/package.json index d175019c24..e8e9edfe4b 100644 --- a/packages/scaffold/package.json +++ b/packages/scaffold/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/scaffold", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/index.js", "types": "./dist/types/index.d.ts", @@ -16,13 +16,13 @@ "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "dependencies": { - "@web3modal/common": "4.0.4", - "@web3modal/core": "4.0.4", - "@web3modal/ui": "4.0.4", + "@web3modal/common": "4.0.5", + "@web3modal/core": "4.0.5", + "@web3modal/ui": "4.0.5", "lit": "3.1.0" }, "devDependencies": { - "@web3modal/wallet": "4.0.4" + "@web3modal/wallet": "4.0.5" }, "keywords": [ "web3", diff --git a/packages/siwe/CHANGELOG.md b/packages/siwe/CHANGELOG.md index 1abf406c60..2f928937c1 100644 --- a/packages/siwe/CHANGELOG.md +++ b/packages/siwe/CHANGELOG.md @@ -1,5 +1,15 @@ # @web3modal/siwe +## 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/core@4.0.5 + - @web3modal/scaffold-utils@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/packages/siwe/package.json b/packages/siwe/package.json index a962c7fcce..1df3f9222a 100644 --- a/packages/siwe/package.json +++ b/packages/siwe/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/siwe", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/exports/index.js", "types": "./dist/types/exports/index.d.ts", @@ -16,8 +16,8 @@ "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "dependencies": { - "@web3modal/core": "4.0.4", - "@web3modal/scaffold-utils": "4.0.4" + "@web3modal/core": "4.0.5", + "@web3modal/scaffold-utils": "4.0.5" }, "peerDependencies": { "react": ">=17", diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index fbafad52aa..a5916e23d5 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,11 @@ # @web3modal/ui +## 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 + ## 4.0.4 ### Patch Changes diff --git a/packages/ui/package.json b/packages/ui/package.json index ff3ea5ac74..6b096ff0a5 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/ui", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/index.js", "types": "./dist/types/index.d.ts", @@ -21,7 +21,7 @@ }, "devDependencies": { "@types/qrcode": "1.5.5", - "@web3modal/common": "4.0.4", + "@web3modal/common": "4.0.5", "eslint-plugin-lit": "1.11.0", "eslint-plugin-wc": "2.0.4" }, diff --git a/packages/wagmi/CHANGELOG.md b/packages/wagmi/CHANGELOG.md index d05dfe150b..7c1f8e5553 100644 --- a/packages/wagmi/CHANGELOG.md +++ b/packages/wagmi/CHANGELOG.md @@ -1,5 +1,19 @@ # @web3modal/wagmi +## 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/polyfills@4.0.5 + - @web3modal/scaffold@4.0.5 + - @web3modal/scaffold-react@4.0.5 + - @web3modal/scaffold-utils@4.0.5 + - @web3modal/scaffold-vue@4.0.5 + - @web3modal/siwe@4.0.5 + ## 4.0.4 ### Patch Changes diff --git a/packages/wagmi/package.json b/packages/wagmi/package.json index c658c504df..f1a9b20125 100644 --- a/packages/wagmi/package.json +++ b/packages/wagmi/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/wagmi", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/exports/index.js", "types": "./dist/types/exports/index.d.ts", @@ -51,11 +51,11 @@ "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "dependencies": { - "@web3modal/polyfills": "4.0.4", - "@web3modal/scaffold": "4.0.4", - "@web3modal/scaffold-react": "4.0.4", - "@web3modal/scaffold-utils": "4.0.4", - "@web3modal/scaffold-vue": "4.0.4" + "@web3modal/polyfills": "4.0.5", + "@web3modal/scaffold": "4.0.5", + "@web3modal/scaffold-react": "4.0.5", + "@web3modal/scaffold-utils": "4.0.5", + "@web3modal/scaffold-vue": "4.0.5" }, "devDependencies": { "@wagmi/connectors": "4.1.4", @@ -90,7 +90,7 @@ } }, "optionalDependencies": { - "@web3modal/siwe": "4.0.4", + "@web3modal/siwe": "4.0.5", "react": ">=17", "react-dom": ">=17", "vue": ">=3" diff --git a/packages/wagmi/src/utils/defaultWagmiCoreConfig.ts b/packages/wagmi/src/utils/defaultWagmiCoreConfig.ts index cc9bcdc088..19e6d22a4e 100644 --- a/packages/wagmi/src/utils/defaultWagmiCoreConfig.ts +++ b/packages/wagmi/src/utils/defaultWagmiCoreConfig.ts @@ -1,10 +1,11 @@ import '@web3modal/polyfills' import type { CreateConfigParameters, CreateConnectorFn } from '@wagmi/core' -import { createConfig, http } from '@wagmi/core' +import { createConfig } from '@wagmi/core' import { coinbaseWallet, walletConnect, injected } from '@wagmi/connectors' import { emailConnector } from '../connectors/EmailConnector.js' +import { getTransport } from './helpers.js' export type ConfigOptions = Partial & { chains: CreateConfigParameters['chains'] @@ -34,7 +35,10 @@ export function defaultWagmiConfig({ ...wagmiConfig }: ConfigOptions) { const connectors: CreateConnectorFn[] = [] - const transportsArr = chains.map(chain => [chain.id, http()]) + const transportsArr = chains.map(chain => [ + chain.id, + getTransport({ chainId: chain.id, projectId }) + ]) const transports = Object.fromEntries(transportsArr) // Enabled by default diff --git a/packages/wagmi/src/utils/defaultWagmiReactConfig.ts b/packages/wagmi/src/utils/defaultWagmiReactConfig.ts index e518e89688..a6e39f33ac 100644 --- a/packages/wagmi/src/utils/defaultWagmiReactConfig.ts +++ b/packages/wagmi/src/utils/defaultWagmiReactConfig.ts @@ -1,10 +1,11 @@ import '@web3modal/polyfills' import type { CreateConfigParameters, CreateConnectorFn, Config } from 'wagmi' -import { createConfig, http } from 'wagmi' +import { createConfig } from 'wagmi' import { coinbaseWallet, walletConnect, injected } from 'wagmi/connectors' import { emailConnector } from '../connectors/EmailConnector.js' +import { getTransport } from './helpers.js' export type ConfigOptions = Partial & { chains: CreateConfigParameters['chains'] @@ -34,7 +35,10 @@ export function defaultWagmiConfig({ ...wagmiConfig }: ConfigOptions): Config { const connectors: CreateConnectorFn[] = [] - const transportsArr = chains.map(chain => [chain.id, http()]) + const transportsArr = chains.map(chain => [ + chain.id, + getTransport({ chainId: chain.id, projectId }) + ]) const transports = Object.fromEntries(transportsArr) // Enabled by default diff --git a/packages/wagmi/src/utils/helpers.ts b/packages/wagmi/src/utils/helpers.ts index fce5520e81..55f1b0e687 100644 --- a/packages/wagmi/src/utils/helpers.ts +++ b/packages/wagmi/src/utils/helpers.ts @@ -1,7 +1,10 @@ -import type { CaipNetwork, CaipNetworkId } from '@web3modal/scaffold' -import type { Chain } from '@wagmi/core/chains' +import { CoreHelperUtil } from '@web3modal/scaffold' import { ConstantsUtil, PresetsUtil } from '@web3modal/scaffold-utils' import { EthereumProvider } from '@walletconnect/ethereum-provider' +import { http } from 'viem' + +import type { CaipNetwork, CaipNetworkId } from '@web3modal/scaffold' +import type { Chain } from '@wagmi/core/chains' import type { Connector } from '@wagmi/core' export function getCaipDefaultChain(chain?: Chain) { @@ -41,3 +44,13 @@ export function getEmailCaipNetworks() { ) as CaipNetworkId[] } } + +export function getTransport({ chainId, projectId }: { chainId: number; projectId: string }) { + const RPC_URL = CoreHelperUtil.getBlockchainApiUrl() + + if (!PresetsUtil.WalletConnectRpcChainIds.includes(chainId)) { + return http() + } + + return http(`${RPC_URL}/v1/?chainId=${ConstantsUtil.EIP155}:${chainId}&projectId=${projectId}`) +} diff --git a/packages/wallet/CHANGELOG.md b/packages/wallet/CHANGELOG.md index 2fc9beec1b..5ec7e92696 100644 --- a/packages/wallet/CHANGELOG.md +++ b/packages/wallet/CHANGELOG.md @@ -1,5 +1,11 @@ # @web3modal/wallet +## 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 + ## 4.0.4 ### Patch Changes diff --git a/packages/wallet/package.json b/packages/wallet/package.json index bdc8e6d92f..45bc4f0da0 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -1,6 +1,6 @@ { "name": "@web3modal/wallet", - "version": "4.0.4", + "version": "4.0.5", "type": "module", "main": "./dist/esm/index.js", "types": "./dist/types/index.d.ts", From 76bd130405e6bce0fd83189bc392b8cb47227b82 Mon Sep 17 00:00:00 2001 From: DOMANI Protocol <71363275+dextfprotocol@users.noreply.github.com> Date: Wed, 14 Feb 2024 19:06:58 +0800 Subject: [PATCH 3/6] Fix client.ts: reset EthersStoreUtil's error before new operation (#1921) --- packages/ethers/src/client.ts | 6 ++++++ packages/ethers5/src/client.ts | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/packages/ethers/src/client.ts b/packages/ethers/src/client.ts index 23bfd85620..bfa195107d 100644 --- a/packages/ethers/src/client.ts +++ b/packages/ethers/src/client.ts @@ -128,6 +128,7 @@ export class Web3Modal extends Web3ModalScaffold { const chainId = HelpersUtil.caipNetworkIdToNumber(caipNetwork?.id) if (chainId) { try { + EthersStoreUtil.setError(undefined) await this.switchNetwork(chainId) } catch (error) { EthersStoreUtil.setError(error) @@ -198,6 +199,7 @@ export class Web3Modal extends Web3ModalScaffold { throw new Error('connectionControllerClient:connectInjected - provider is undefined') } try { + EthersStoreUtil.setError(undefined) await InjectedProvider.request({ method: 'eth_requestAccounts' }) this.setInjectedProvider(ethersConfig) } catch (error) { @@ -205,6 +207,7 @@ export class Web3Modal extends Web3ModalScaffold { } } else if (id === ConstantsUtil.EIP6963_CONNECTOR_ID && info && provider) { try { + EthersStoreUtil.setError(undefined) await provider.request({ method: 'eth_requestAccounts' }) this.setEIP6963Provider(provider, info.name) } catch (error) { @@ -217,6 +220,7 @@ export class Web3Modal extends Web3ModalScaffold { } try { + EthersStoreUtil.setError(undefined) await CoinbaseProvider.request({ method: 'eth_requestAccounts' }) this.setCoinbaseProvider(ethersConfig) } catch (error) { @@ -395,6 +399,7 @@ export class Web3Modal extends Web3ModalScaffold { const walletConnectProvider = provider as unknown as EthereumProvider if (walletConnectProvider) { try { + EthersStoreUtil.setError(undefined) await walletConnectProvider.disconnect() } catch (error) { EthersStoreUtil.setError(error) @@ -440,6 +445,7 @@ export class Web3Modal extends Web3ModalScaffold { private async getWalletConnectProvider() { if (!this.walletConnectProvider) { try { + EthersStoreUtil.setError(undefined) await this.createProvider() } catch (error) { EthersStoreUtil.setError(error) diff --git a/packages/ethers5/src/client.ts b/packages/ethers5/src/client.ts index d0f3372f24..8e7103cd7a 100644 --- a/packages/ethers5/src/client.ts +++ b/packages/ethers5/src/client.ts @@ -118,6 +118,7 @@ export class Web3Modal extends Web3ModalScaffold { const chainId = HelpersUtil.caipNetworkIdToNumber(caipNetwork?.id) if (chainId) { try { + EthersStoreUtil.setError(undefined) await this.switchNetwork(chainId) } catch (error) { EthersStoreUtil.setError(error) @@ -188,6 +189,7 @@ export class Web3Modal extends Web3ModalScaffold { throw new Error('connectionControllerClient:connectInjected - provider is undefined') } try { + EthersStoreUtil.setError(undefined) await InjectedProvider.request({ method: 'eth_requestAccounts' }) this.setInjectedProvider(ethersConfig) } catch (error) { @@ -195,6 +197,7 @@ export class Web3Modal extends Web3ModalScaffold { } } else if (id === ConstantsUtil.EIP6963_CONNECTOR_ID && info && provider) { try { + EthersStoreUtil.setError(undefined) await provider.request({ method: 'eth_requestAccounts' }) } catch (error) { EthersStoreUtil.setError(error) @@ -207,6 +210,7 @@ export class Web3Modal extends Web3ModalScaffold { } try { + EthersStoreUtil.setError(undefined) this.setCoinbaseProvider(ethersConfig) await CoinbaseProvider.request({ method: 'eth_requestAccounts' }) } catch (error) { @@ -411,6 +415,7 @@ export class Web3Modal extends Web3ModalScaffold { private async getWalletConnectProvider() { if (!this.walletConnectProvider) { try { + EthersStoreUtil.setError(undefined) await this.createProvider() } catch (error) { EthersStoreUtil.setError(error) From 334ad12e410e3d1b1a7559e13cd42bb5632f4ffe Mon Sep 17 00:00:00 2001 From: Luka Isailovic Date: Wed, 14 Feb 2024 12:56:11 +0100 Subject: [PATCH 4/6] fix: ui tests (#1915) --- .github/workflows/ui_tests.yml | 3 +- apps/laboratory/playwright.config.ts | 14 ++-- apps/laboratory/tests/canary.spec.ts | 4 +- apps/laboratory/tests/connect.spec.ts | 67 +++++-------------- apps/laboratory/tests/email.spec.ts | 1 + .../tests/shared/constants/index.ts | 1 + .../tests/shared/constants/timeouts.ts | 1 + .../shared/fixtures/w3m-wallet-fixture.ts | 14 +--- .../tests/shared/pages/ModalPage.ts | 7 +- .../tests/shared/pages/WalletPage.ts | 26 +++---- apps/laboratory/tests/shared/utils/device.ts | 9 +++ .../laboratory/tests/shared/utils/timeouts.ts | 9 +++ .../tests/shared/validators/ModalValidator.ts | 15 ++++- .../shared/validators/WalletValidator.ts | 17 +++-- apps/laboratory/tests/siwe.spec.ts | 4 +- .../w3m-connecting-wc-qrcode/index.ts | 1 + 16 files changed, 101 insertions(+), 92 deletions(-) create mode 100644 apps/laboratory/tests/shared/constants/timeouts.ts create mode 100644 apps/laboratory/tests/shared/utils/device.ts create mode 100644 apps/laboratory/tests/shared/utils/timeouts.ts diff --git a/.github/workflows/ui_tests.yml b/.github/workflows/ui_tests.yml index d19f876b17..2ae2b32a95 100644 --- a/.github/workflows/ui_tests.yml +++ b/.github/workflows/ui_tests.yml @@ -39,7 +39,8 @@ on: jobs: ui_tests: name: 'Playwright Tests' - runs-on: ubuntu-latest + runs-on: + group: ubuntu-runners timeout-minutes: 15 steps: - name: checkout diff --git a/apps/laboratory/playwright.config.ts b/apps/laboratory/playwright.config.ts index 276a414959..b8c54932e1 100644 --- a/apps/laboratory/playwright.config.ts +++ b/apps/laboratory/playwright.config.ts @@ -3,18 +3,21 @@ import { BASE_URL } from './tests/shared/constants' import { config } from 'dotenv' import type { ModalFixture } from './tests/shared/fixtures/w3m-fixture' -import { DEVICES } from './tests/shared/constants/devices' +import { getAvailableDevices } from './tests/shared/utils/device' config({ path: './.env' }) +const availableDevices = getAvailableDevices() const LIBRARIES = ['wagmi', 'ethers'] as const -const PERMUTATIONS = DEVICES.flatMap(device => LIBRARIES.map(library => ({ device, library }))) +const PERMUTATIONS = availableDevices.flatMap(device => + LIBRARIES.map(library => ({ device, library })) +) export default defineConfig({ testDir: './tests', fullyParallel: true, - retries: 0, - workers: 1, + retries: 2, + workers: 8, reporter: process.env['CI'] ? [['list'], ['html', { open: 'never' }]] : [['list'], ['html', { host: '0.0.0.0' }]], @@ -28,6 +31,9 @@ export default defineConfig({ /* Base URL to use in actions like `await page.goto('/')`. */ baseURL: BASE_URL, + /* Take a screenshot when the test fails */ + screenshot: 'only-on-failure', + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: 'on-first-retry', diff --git a/apps/laboratory/tests/canary.spec.ts b/apps/laboratory/tests/canary.spec.ts index 953a1f8048..195a82bbda 100644 --- a/apps/laboratory/tests/canary.spec.ts +++ b/apps/laboratory/tests/canary.spec.ts @@ -14,8 +14,8 @@ testMW.beforeEach( if (browserName !== 'chromium' || modalPage.library !== 'ethers') { return } - await modalPage.copyConnectUriToClipboard() - await walletPage.connect() + const uri = await modalPage.getConnectUri() + await walletPage.connectWithUri(uri) await walletPage.handleSessionProposal(DEFAULT_SESSION_PARAMS) await modalValidator.expectConnected() await walletValidator.expectConnected() diff --git a/apps/laboratory/tests/connect.spec.ts b/apps/laboratory/tests/connect.spec.ts index 99de0ad7cb..96211163ab 100644 --- a/apps/laboratory/tests/connect.spec.ts +++ b/apps/laboratory/tests/connect.spec.ts @@ -1,57 +1,32 @@ -import { DEFAULT_SESSION_PARAMS } from './shared/constants' +import { DEFAULT_CHAIN_NAME, DEFAULT_SESSION_PARAMS } from './shared/constants' import { testMW } from './shared/fixtures/w3m-wallet-fixture' -testMW.beforeEach( - async ({ modalPage, walletPage, modalValidator, walletValidator, browserName }) => { - // Webkit cannot use clipboard. - if (browserName === 'webkit') { - return - } - await modalPage.copyConnectUriToClipboard() - await walletPage.connect() - await walletPage.handleSessionProposal(DEFAULT_SESSION_PARAMS) - await modalValidator.expectConnected() - await walletValidator.expectConnected() - } -) +testMW.beforeEach(async ({ modalPage, walletPage, modalValidator, walletValidator }) => { + const uri = await modalPage.getConnectUri() + await walletPage.connectWithUri(uri) + await walletPage.handleSessionProposal(DEFAULT_SESSION_PARAMS) + await modalValidator.expectConnected() + await walletValidator.expectConnected() +}) -testMW.afterEach(async ({ modalPage, modalValidator, walletValidator, browserName }) => { - // Webkit cannot use clipboard. - if (browserName === 'webkit') { - return - } +testMW.afterEach(async ({ modalPage, modalValidator, walletValidator }) => { await modalPage.disconnect() await modalValidator.expectDisconnected() await walletValidator.expectDisconnected() }) -testMW( - 'it should sign', - async ({ modalPage, walletPage, modalValidator, walletValidator, browserName }) => { - // Webkit cannot use clipboard. - if (browserName === 'webkit') { - testMW.skip() - - return - } - await modalPage.sign() - await walletValidator.expectReceivedSign({}) - await walletPage.handleRequest({ accept: true }) - await modalValidator.expectAcceptedSign() - } -) +testMW('it should sign', async ({ modalPage, walletPage, modalValidator, walletValidator }) => { + await modalPage.sign() + await walletValidator.expectReceivedSign({ chainName: DEFAULT_CHAIN_NAME }) + await walletPage.handleRequest({ accept: true }) + await modalValidator.expectAcceptedSign() +}) testMW( 'it should reject sign', - async ({ modalPage, walletPage, modalValidator, walletValidator, browserName }) => { - // Webkit cannot use clipboard. - if (browserName === 'webkit') { - testMW.skip() - - return - } + async ({ modalPage, walletPage, modalValidator, walletValidator }) => { await modalPage.sign() - await walletValidator.expectReceivedSign({}) + await walletValidator.expectReceivedSign({ chainName: DEFAULT_CHAIN_NAME }) await walletPage.handleRequest({ accept: false }) await modalValidator.expectRejectedSign() } @@ -59,13 +34,7 @@ testMW( testMW( 'it should switch networks and sign', - async ({ modalPage, walletPage, modalValidator, walletValidator, browserName }) => { - // Webkit cannot use clipboard. - if (browserName === 'webkit') { - testMW.skip() - - return - } + async ({ modalPage, walletPage, modalValidator, walletValidator }) => { let targetChain = 'Polygon' await modalPage.switchNetwork(targetChain) await modalPage.sign() diff --git a/apps/laboratory/tests/email.spec.ts b/apps/laboratory/tests/email.spec.ts index 7b8ab13f6a..eeb7e8052b 100644 --- a/apps/laboratory/tests/email.spec.ts +++ b/apps/laboratory/tests/email.spec.ts @@ -6,6 +6,7 @@ import { Email } from './shared/utils/email' const AVAILABLE_MAILSAC_ADDRESSES = 10 testMEmail.beforeEach(async ({ modalPage, context, modalValidator }) => { + testMEmail.skip() // Skip wagmi as it's not working if (modalPage.library === 'wagmi') { return diff --git a/apps/laboratory/tests/shared/constants/index.ts b/apps/laboratory/tests/shared/constants/index.ts index 10beedd7ac..fd5ec3badd 100644 --- a/apps/laboratory/tests/shared/constants/index.ts +++ b/apps/laboratory/tests/shared/constants/index.ts @@ -8,3 +8,4 @@ export const DEFAULT_SESSION_PARAMS: SessionParams = { optAccounts: ['1', '2'], accept: true } +export const DEFAULT_CHAIN_NAME = process.env['DEFAULT_CHAIN_NAME'] || 'Ethereum' diff --git a/apps/laboratory/tests/shared/constants/timeouts.ts b/apps/laboratory/tests/shared/constants/timeouts.ts new file mode 100644 index 0000000000..a8a4bd25ba --- /dev/null +++ b/apps/laboratory/tests/shared/constants/timeouts.ts @@ -0,0 +1 @@ +export const MAXIMUM_WAIT_CONNECTIONS = 14 * 1000 diff --git a/apps/laboratory/tests/shared/fixtures/w3m-wallet-fixture.ts b/apps/laboratory/tests/shared/fixtures/w3m-wallet-fixture.ts index e8fab9c619..bf33838eda 100644 --- a/apps/laboratory/tests/shared/fixtures/w3m-wallet-fixture.ts +++ b/apps/laboratory/tests/shared/fixtures/w3m-wallet-fixture.ts @@ -10,12 +10,7 @@ interface ModalWalletFixture { // MW -> test Modal + Wallet export const testMW = base.extend({ - walletPage: async ({ context, browserName }, use) => { - // WalletPage needs clipboard permissions with chromium to paste URI - if (browserName === 'chromium') { - await context.grantPermissions(['clipboard-read', 'clipboard-write']) - } - + walletPage: async ({ context }, use) => { // Use a new page, to open alongside the modal const walletPage = new WalletPage(await context.newPage()) await walletPage.load() @@ -27,12 +22,7 @@ export const testMW = base.extend({ } }) export const testMWSiwe = siwe.extend({ - walletPage: async ({ context, browserName }, use) => { - // WalletPage needs clipboard permissions with chromium to paste URI - if (browserName === 'chromium') { - await context.grantPermissions(['clipboard-read', 'clipboard-write']) - } - + walletPage: async ({ context }, use) => { // Use a new page, to open alongside the modal const walletPage = new WalletPage(await context.newPage()) await walletPage.load() diff --git a/apps/laboratory/tests/shared/pages/ModalPage.ts b/apps/laboratory/tests/shared/pages/ModalPage.ts index 59d6e47382..95db31f3ce 100644 --- a/apps/laboratory/tests/shared/pages/ModalPage.ts +++ b/apps/laboratory/tests/shared/pages/ModalPage.ts @@ -26,12 +26,13 @@ export class ModalPage { await this.page.goto(this.url) } - async copyConnectUriToClipboard() { + async getConnectUri(): Promise { await this.page.goto(this.url) await this.connectButton.click() await this.page.getByTestId('wallet-selector-walletconnect').click() - await this.page.waitForTimeout(2000) - await this.page.getByTestId('copy-wc2-uri').click() + await this.page.waitForTimeout(1500) + + return (await this.page.getByTestId('wui-qr-code').getAttribute('uri')) || '' } async loginWithEmail(email: string) { diff --git a/apps/laboratory/tests/shared/pages/WalletPage.ts b/apps/laboratory/tests/shared/pages/WalletPage.ts index 6197486456..a2db01763f 100644 --- a/apps/laboratory/tests/shared/pages/WalletPage.ts +++ b/apps/laboratory/tests/shared/pages/WalletPage.ts @@ -1,5 +1,5 @@ /* eslint-disable no-await-in-loop */ -import type { Locator, Page } from '@playwright/test' +import { expect, type Locator, type Page } from '@playwright/test' import { WALLET_URL } from '../constants' import type { SessionParams } from '../types' @@ -18,18 +18,16 @@ export class WalletPage { await this.page.goto(this.baseURL) } - async connect() { + /** + * Connect by inserting provided URI into the input element + */ + async connectWithUri(uri: string) { const isVercelPreview = (await this.vercelPreview.count()) > 0 if (isVercelPreview) { await this.vercelPreview.evaluate((iframe: HTMLIFrameElement) => iframe.remove()) } await this.gotoHome.click() - await this.page.getByTestId('uri-input').click() - - // Paste clipboard - const isMac = process.platform === 'darwin' - const modifier = isMac ? 'Meta' : 'Control' - await this.page.keyboard.press(`${modifier}+KeyV`) + await this.page.getByTestId('uri-input').fill(uri) await this.page.getByTestId('uri-connect-button').click() } @@ -42,16 +40,20 @@ export class WalletPage { async handleSessionProposal(opts: SessionParams) { const variant = opts.accept ? `approve` : `reject` // `.click` doesn't work here, so we use `.focus` and `Space` - await this.page.getByTestId(`session-${variant}-button`).isEnabled() - await this.page.getByTestId(`session-${variant}-button`).focus() + const btn = this.page.getByTestId(`session-${variant}-button`) + await btn.waitFor() + await expect(btn).toBeEnabled() + await btn.focus() await this.page.keyboard.press('Space') } async handleRequest({ accept }: { accept: boolean }) { const variant = accept ? `approve` : `reject` // `.click` doesn't work here, so we use `.focus` and `Space` - await this.page.getByTestId(`session-${variant}-button`).isEnabled() - await this.page.getByTestId(`session-${variant}-button`).focus() + const btn = this.page.getByTestId(`session-${variant}-button`) + await btn.waitFor() + await expect(btn).toBeEnabled() + await btn.focus() await this.page.keyboard.press('Space') } } diff --git a/apps/laboratory/tests/shared/utils/device.ts b/apps/laboratory/tests/shared/utils/device.ts new file mode 100644 index 0000000000..e0e7343c14 --- /dev/null +++ b/apps/laboratory/tests/shared/utils/device.ts @@ -0,0 +1,9 @@ +import { DEVICES } from '../constants/devices' + +export function getAvailableDevices(): string[] { + if (!process.env['CI']) { + return DEVICES + } + + return DEVICES.filter(d => d !== 'Desktop Safari') +} diff --git a/apps/laboratory/tests/shared/utils/timeouts.ts b/apps/laboratory/tests/shared/utils/timeouts.ts new file mode 100644 index 0000000000..7ae448739e --- /dev/null +++ b/apps/laboratory/tests/shared/utils/timeouts.ts @@ -0,0 +1,9 @@ +import { MAXIMUM_WAIT_CONNECTIONS } from '../constants/timeouts' + +export function getMaximumWaitConnections(): number { + if (process.env['CI']) { + return MAXIMUM_WAIT_CONNECTIONS + } + + return MAXIMUM_WAIT_CONNECTIONS * 2 +} diff --git a/apps/laboratory/tests/shared/validators/ModalValidator.ts b/apps/laboratory/tests/shared/validators/ModalValidator.ts index 5d2bf34326..d5641c4d03 100644 --- a/apps/laboratory/tests/shared/validators/ModalValidator.ts +++ b/apps/laboratory/tests/shared/validators/ModalValidator.ts @@ -1,12 +1,17 @@ import { expect } from '@playwright/test' import type { Page } from '@playwright/test' import { ConstantsUtil } from '../../../src/utils/ConstantsUtil' +import { getMaximumWaitConnections } from '../utils/timeouts' + +const MAX_WAIT = getMaximumWaitConnections() export class ModalValidator { constructor(public readonly page: Page) {} async expectConnected() { - await expect(this.page.getByTestId('account-button')).toBeVisible() + await expect(this.page.getByTestId('account-button')).toBeVisible({ + timeout: MAX_WAIT + }) } async expectAuthenticated() { @@ -24,12 +29,16 @@ export class ModalValidator { } async expectDisconnected() { - await expect(this.page.getByTestId('account-button')).not.toBeVisible() + await expect(this.page.getByTestId('account-button')).not.toBeVisible({ + timeout: MAX_WAIT + }) } async expectAcceptedSign() { // We use Chakra Toast and it's not quite straightforward to set the `data-testid` attribute on the toast element. - await expect(this.page.getByText(ConstantsUtil.SigningSucceededToastTitle)).toBeVisible() + await expect(this.page.getByText(ConstantsUtil.SigningSucceededToastTitle)).toBeVisible({ + timeout: 30 * 1000 + }) } async expectRejectedSign() { diff --git a/apps/laboratory/tests/shared/validators/WalletValidator.ts b/apps/laboratory/tests/shared/validators/WalletValidator.ts index 2f7a0305ae..dd816e40f2 100644 --- a/apps/laboratory/tests/shared/validators/WalletValidator.ts +++ b/apps/laboratory/tests/shared/validators/WalletValidator.ts @@ -1,5 +1,8 @@ import { expect } from '@playwright/test' import type { Locator, Page } from '@playwright/test' +import { getMaximumWaitConnections } from '../utils/timeouts' + +const MAX_WAIT = getMaximumWaitConnections() export class WalletValidator { private readonly gotoSessions: Locator @@ -10,16 +13,22 @@ export class WalletValidator { async expectConnected() { await this.gotoSessions.click() - await expect(this.page.getByTestId('session-card')).toBeVisible() + await expect(this.page.getByTestId('session-card')).toBeVisible({ + timeout: MAX_WAIT + }) } async expectDisconnected() { await this.gotoSessions.click() - await expect(this.page.getByTestId('session-card')).not.toBeVisible() + await expect(this.page.getByTestId('session-card')).not.toBeVisible({ + timeout: MAX_WAIT + }) } async expectReceivedSign({ chainName = 'Ethereum' }) { - await expect(this.page.getByTestId('session-approve-button')).toBeVisible() - await expect(this.page.getByTestId('request-details-chain')).toHaveText(chainName) + await expect(this.page.getByTestId('session-approve-button')).toBeVisible({ + timeout: MAX_WAIT + }) + await expect(this.page.getByTestId('request-details-chain')).toContainText(chainName) } } diff --git a/apps/laboratory/tests/siwe.spec.ts b/apps/laboratory/tests/siwe.spec.ts index 6d4d960657..bb9aab3668 100644 --- a/apps/laboratory/tests/siwe.spec.ts +++ b/apps/laboratory/tests/siwe.spec.ts @@ -6,8 +6,8 @@ testMWSiwe.beforeEach(async ({ modalPage, walletPage, browserName }) => { if (browserName === 'webkit') { return } - await modalPage.copyConnectUriToClipboard() - await walletPage.connect() + const uri = await modalPage.getConnectUri() + await walletPage.connectWithUri(uri) await walletPage.handleSessionProposal(DEFAULT_SESSION_PARAMS) }) diff --git a/packages/scaffold/src/partials/w3m-connecting-wc-qrcode/index.ts b/packages/scaffold/src/partials/w3m-connecting-wc-qrcode/index.ts index bca8744c6f..d964fe2acb 100644 --- a/packages/scaffold/src/partials/w3m-connecting-wc-qrcode/index.ts +++ b/packages/scaffold/src/partials/w3m-connecting-wc-qrcode/index.ts @@ -67,6 +67,7 @@ export class W3mConnectingWcQrcode extends W3mConnectingWidget { uri=${this.uri} imageSrc=${ifDefined(AssetUtil.getWalletImage(this.wallet))} alt=${ifDefined(alt)} + data-testid="wui-qr-code" >` } From 937edb0cd13f139b44cf2ffe20d7e808777235f3 Mon Sep 17 00:00:00 2001 From: tomiir Date: Thu, 15 Feb 2024 07:33:16 -0600 Subject: [PATCH 5/6] fix: buy in progress interval being cleared prematurely (#1925) --- .../scaffold/src/views/w3m-buy-in-progress-view/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/scaffold/src/views/w3m-buy-in-progress-view/index.ts b/packages/scaffold/src/views/w3m-buy-in-progress-view/index.ts index 3b395147dc..22455acfdc 100644 --- a/packages/scaffold/src/views/w3m-buy-in-progress-view/index.ts +++ b/packages/scaffold/src/views/w3m-buy-in-progress-view/index.ts @@ -170,13 +170,11 @@ export class W3mBuyInProgressView extends LitElement { tx => tx.metadata.status === 'ONRAMP_TRANSACTION_STATUS_IN_PROGRESS' ) - if (this.intervalId) { + if (pendingTransactions.length && this.intervalId) { clearInterval(this.intervalId) - } - - if (pendingTransactions.length) { RouterController.replace('OnRampActivity') - } else if (this.startTime && Date.now() - this.startTime >= 180_000) { + } else if (this.startTime && Date.now() - this.startTime >= 180_000 && this.intervalId) { + clearInterval(this.intervalId) this.error = true } } From f2cb5c6a18e3d6b8f685af76e29072c0b1aabe55 Mon Sep 17 00:00:00 2001 From: Chris Smith <1979423+chris13524@users.noreply.github.com> Date: Fri, 16 Feb 2024 09:40:12 -0500 Subject: [PATCH 6/6] fix: improve UI tests (#1932) --- .eslintrc.json | 3 +- .github/workflows/ci_canary.yml | 2 +- Dockerfile => Dockerfile.canary | 0 apps/laboratory/package.json | 8 +- apps/laboratory/playwright.config.ts | 2 +- apps/laboratory/tests/README.md | 5 +- apps/laboratory/tests/canary.spec.ts | 74 ++++++++----------- .../tests/shared/pages/ModalPage.ts | 14 +++- readme.md | 12 ++- 9 files changed, 57 insertions(+), 63 deletions(-) rename Dockerfile => Dockerfile.canary (100%) diff --git a/.eslintrc.json b/.eslintrc.json index 218f0cc648..d2c9f8167b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -21,7 +21,8 @@ ".turbo", "exbamples", "coverage", - ".changeset" + ".changeset", + "playwright-report" ], "rules": { // Core diff --git a/.github/workflows/ci_canary.yml b/.github/workflows/ci_canary.yml index 80830037e8..e56c6ff91d 100644 --- a/.github/workflows/ci_canary.yml +++ b/.github/workflows/ci_canary.yml @@ -49,7 +49,7 @@ jobs: IMAGE_TAG: V4 with: context: . - file: Dockerfile + file: Dockerfile.canary push: true tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} cache-from: type=local,src=/tmp/.buildx-cache diff --git a/Dockerfile b/Dockerfile.canary similarity index 100% rename from Dockerfile rename to Dockerfile.canary diff --git a/apps/laboratory/package.json b/apps/laboratory/package.json index 5b2b304610..dc560c849b 100644 --- a/apps/laboratory/package.json +++ b/apps/laboratory/package.json @@ -8,12 +8,12 @@ "lint": "eslint . --ext .js,.jsx,.ts,.tsx", "playwright:start": "npm run dev:laboratory", "playwright:install": "npx playwright install --with-deps", - "playwright:test": "npx playwright test --grep-invert canary.spec.ts", + "playwright:test": "npx playwright test", "playwright:test:wallet": "npx playwright test --grep connect.spec.ts", - "playwright:test:canary": "npx playwright test --grep canary.spec.ts", - "playwright:debug": "npx playwright test --debug --grep-invert canary.spec.ts", + "playwright:test:canary": "npx playwright test --grep canary.spec.ts --project='Desktop Chrome/wagmi'", + "playwright:debug": "npx playwright test --debug", "playwright:debug:wallet": "npx playwright test --debug --grep connect.spec.ts", - "playwright:debug:canary": "npx playwright test --debug --grep canary.spec.ts" + "playwright:debug:canary": "npx playwright test --debug --grep canary.spec.ts --project='Desktop Chrome/wagmi'" }, "dependencies": { "@chakra-ui/react": "2.8.2", diff --git a/apps/laboratory/playwright.config.ts b/apps/laboratory/playwright.config.ts index b8c54932e1..0501797eb5 100644 --- a/apps/laboratory/playwright.config.ts +++ b/apps/laboratory/playwright.config.ts @@ -4,7 +4,7 @@ import { BASE_URL } from './tests/shared/constants' import { config } from 'dotenv' import type { ModalFixture } from './tests/shared/fixtures/w3m-fixture' import { getAvailableDevices } from './tests/shared/utils/device' -config({ path: './.env' }) +config({ path: './.env.local' }) const availableDevices = getAvailableDevices() const LIBRARIES = ['wagmi', 'ethers'] as const diff --git a/apps/laboratory/tests/README.md b/apps/laboratory/tests/README.md index f33c233623..5877cd8302 100644 --- a/apps/laboratory/tests/README.md +++ b/apps/laboratory/tests/README.md @@ -7,12 +7,13 @@ We use Playwright as our functional test runner. It's configured to try multiple ## Setup -- Make sure your `.env` is set up (see `.env.example` for reference) +- Make sure your `.env.local` is set up (see `.env.example` for reference) - Run `npm run playwright:install` to install the browsers required to run the tests +- Build Web3Modal by running `npm run build` in the root directory ## Running Tests -- `npx playwright test` to run in default mode. +- `npm run playwright:test` to run in default mode. - `npm run playwright:debug` to step by step see what the tests are doing ## Debugging diff --git a/apps/laboratory/tests/canary.spec.ts b/apps/laboratory/tests/canary.spec.ts index 195a82bbda..f0d861496a 100644 --- a/apps/laboratory/tests/canary.spec.ts +++ b/apps/laboratory/tests/canary.spec.ts @@ -2,60 +2,44 @@ import { DEFAULT_SESSION_PARAMS } from './shared/constants' import { testMW } from './shared/fixtures/w3m-wallet-fixture' import { uploadCanaryResultsToCloudWatch } from './shared/utils/metrics' -const ENV = process.env['ENV'] || 'dev' +const ENV = process.env['ENVIRONMENT'] || 'dev' const REGION = process.env['REGION'] || 'eu-central-1' let startTime = 0 -testMW.beforeEach( - async ({ modalPage, walletPage, modalValidator, walletValidator, browserName }) => { - startTime = Date.now() - // Canary doesn't need all platforms - if (browserName !== 'chromium' || modalPage.library !== 'ethers') { - return - } - const uri = await modalPage.getConnectUri() - await walletPage.connectWithUri(uri) - await walletPage.handleSessionProposal(DEFAULT_SESSION_PARAMS) - await modalValidator.expectConnected() - await walletValidator.expectConnected() - } -) +testMW.beforeEach(async ({ modalPage, walletPage, modalValidator, walletValidator }) => { + // Give us extra time in a potentially slow canary deployment + testMW.setTimeout(120_000) -testMW.afterEach(async ({ modalPage, modalValidator, walletValidator, browserName }) => { - // Canary doesn't need all platforms - if (browserName !== 'chromium' || modalPage.library !== 'ethers') { - return - } + startTime = Date.now() + const uri = await modalPage.getConnectUri() + await walletPage.connectWithUri(uri) + await walletPage.handleSessionProposal(DEFAULT_SESSION_PARAMS) + await modalValidator.expectConnected() + await walletValidator.expectConnected() +}) + +testMW.afterEach(async ({ modalPage, modalValidator, walletValidator }) => { await modalPage.disconnect() await modalValidator.expectDisconnected() await walletValidator.expectDisconnected() }) -testMW( - 'it should sign', - async ({ modalPage, walletPage, modalValidator, walletValidator, browserName }) => { - // Canary doesn't need all platforms - if (browserName !== 'chromium' || modalPage.library !== 'ethers') { - testMW.skip() - - return - } - await modalPage.sign() - await walletValidator.expectReceivedSign({}) - await walletPage.handleRequest({ accept: true }) - await modalValidator.expectAcceptedSign() +testMW('it should sign', async ({ modalPage, walletPage, modalValidator, walletValidator }) => { + await modalPage.sign() + await walletValidator.expectReceivedSign({}) + await walletPage.handleRequest({ accept: true }) + await modalValidator.expectAcceptedSign() - if (ENV !== 'dev') { - const duration: number = Date.now() - startTime - await uploadCanaryResultsToCloudWatch( - ENV, - REGION, - 'https://lab.web3modal.com/', - 'HappyPath.sign', - true, - duration - ) - } + if (ENV !== 'dev') { + const duration: number = Date.now() - startTime + await uploadCanaryResultsToCloudWatch( + ENV, + REGION, + 'https://lab.web3modal.com/', + 'HappyPath.sign', + true, + duration + ) } -) +}) diff --git a/apps/laboratory/tests/shared/pages/ModalPage.ts b/apps/laboratory/tests/shared/pages/ModalPage.ts index 95db31f3ce..eb51de26ea 100644 --- a/apps/laboratory/tests/shared/pages/ModalPage.ts +++ b/apps/laboratory/tests/shared/pages/ModalPage.ts @@ -26,13 +26,23 @@ export class ModalPage { await this.page.goto(this.url) } + assertDefined(value: T | undefined | null): T { + expect(value).toBeDefined() + + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return value! + } + async getConnectUri(): Promise { await this.page.goto(this.url) await this.connectButton.click() await this.page.getByTestId('wallet-selector-walletconnect').click() - await this.page.waitForTimeout(1500) - return (await this.page.getByTestId('wui-qr-code').getAttribute('uri')) || '' + // Using getByTestId() doesn't work on my machine, I'm guessing because this element is inside of a + const qrCode = this.page.locator('wui-qr-code') + await expect(qrCode).toBeVisible() + + return this.assertDefined(await qrCode.getAttribute('uri')) } async loginWithEmail(email: string) { diff --git a/readme.md b/readme.md index 0ba04bbc59..52aae95cad 100644 --- a/readme.md +++ b/readme.md @@ -17,13 +17,7 @@ Your on-ramp to web3 multichain. Web3Modal is a versatile library that makes it # Dev setup -1. Create `apps/laboratory/env.local` file with following contents - -```zsh -NEXT_PUBLIC_PROJECT_ID="your_project_id" -NEXTAUTH_SECRET="your_session_secret" -NEXTAUTH_URL="" -``` +1. Create `apps/laboratory/.env.local` file using the template from `apps/laboratory/.env.example` 2. In each of the `examples` create `.env.local` file with following contents @@ -69,3 +63,7 @@ npm run changeset pre enter [tag] 11. Check `Set as the last release` and publish release. 12. Update Web3Modal for https://web3modal.com/ (https://github.com/WalletConnect/www-web3modal) and create a PR 13. Update Web3Modal for https://app.web3inbox.com (https://github.com/WalletConnect/web3inbox) and create a PR + +### Running tests + +See