From a547f4dec97b8af104ef47aaa8793e8a18999f46 Mon Sep 17 00:00:00 2001 From: 0xAsimetriq <3154053+0xAsimetriq@users.noreply.github.com> Date: Wed, 28 Jun 2023 09:32:57 +0300 Subject: [PATCH] Release/2.5.5 (#11) * Update deps, apply canary * add loading states and tag canary * Apply web3modal patches * update to latest monorepo packages * remove manual metamask * Use latest monorepo canary * Update to 2.8.3 monorepo packages * tag 2.5.3 * Add sourcemap * Tag 2.5.4 * tag 2.5.5 --- laboratory/package.json | 12 +++--- lerna.json | 2 +- package-lock.json | 40 +++++++++---------- packages/modal-core/package.json | 2 +- .../src/controllers/ExplorerCtrl.ts | 10 ++--- packages/modal-core/src/utils/CoreUtil.ts | 35 +++++++++++----- packages/modal-ui/package.json | 4 +- packages/modal-ui/src/utils/UiUtil.ts | 20 +++++++--- projects/modal-auth-html/package.json | 4 +- projects/modal-auth-react/package.json | 4 +- projects/modal-sign-html/package.json | 4 +- projects/modal-sign-html/src/client.ts | 6 ++- projects/modal-sign-react/package.json | 4 +- projects/modal/package.json | 6 +-- 14 files changed, 90 insertions(+), 63 deletions(-) diff --git a/laboratory/package.json b/laboratory/package.json index 4160af2..e9f84ed 100644 --- a/laboratory/package.json +++ b/laboratory/package.json @@ -1,6 +1,6 @@ { "name": "laboratory", - "version": "2.5.4", + "version": "2.5.5", "private": true, "scripts": { "dev": "rm -rf .next; next dev", @@ -9,11 +9,11 @@ "dependencies": { "@nextui-org/react": "1.0.0-beta.13", "@walletconnect/ethereum-provider": "2.8.3", - "@walletconnect/modal": "2.5.4", - "@walletconnect/modal-auth-html": "2.5.4", - "@walletconnect/modal-auth-react": "2.5.4", - "@walletconnect/modal-sign-html": "2.5.4", - "@walletconnect/modal-sign-react": "2.5.4", + "@walletconnect/modal": "2.5.5", + "@walletconnect/modal-auth-html": "2.5.5", + "@walletconnect/modal-auth-react": "2.5.5", + "@walletconnect/modal-sign-html": "2.5.5", + "@walletconnect/modal-sign-react": "2.5.5", "next": "13.4.7", "react": "18.2.0", "react-code-blocks": "0.0.9-0", diff --git a/lerna.json b/lerna.json index e0529ed..836ad0b 100644 --- a/lerna.json +++ b/lerna.json @@ -10,6 +10,6 @@ "projects/modal-sign-react", "laboratory" ], - "version": "2.5.4", + "version": "2.5.5", "$schema": "node_modules/lerna/schemas/lerna-schema.json" } diff --git a/package-lock.json b/package-lock.json index 9bb5d26..9ae2d5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,15 +43,15 @@ } }, "laboratory": { - "version": "2.5.4", + "version": "2.5.5", "dependencies": { "@nextui-org/react": "1.0.0-beta.13", "@walletconnect/ethereum-provider": "2.8.3", - "@walletconnect/modal": "2.5.4", - "@walletconnect/modal-auth-html": "2.5.4", - "@walletconnect/modal-auth-react": "2.5.4", - "@walletconnect/modal-sign-html": "2.5.4", - "@walletconnect/modal-sign-react": "2.5.4", + "@walletconnect/modal": "2.5.5", + "@walletconnect/modal-auth-html": "2.5.5", + "@walletconnect/modal-auth-react": "2.5.5", + "@walletconnect/modal-sign-html": "2.5.5", + "@walletconnect/modal-sign-react": "2.5.5", "next": "13.4.7", "react": "18.2.0", "react-code-blocks": "0.0.9-0", @@ -14259,7 +14259,7 @@ }, "packages/modal-core": { "name": "@walletconnect/modal-core", - "version": "2.5.4", + "version": "2.5.5", "license": "Apache-2.0", "dependencies": { "buffer": "6.0.3", @@ -14291,10 +14291,10 @@ }, "packages/modal-ui": { "name": "@walletconnect/modal-ui", - "version": "2.5.4", + "version": "2.5.5", "license": "Apache-2.0", "dependencies": { - "@walletconnect/modal-core": "2.5.4", + "@walletconnect/modal-core": "2.5.5", "lit": "2.7.5", "motion": "10.16.2", "qrcode": "1.5.3" @@ -14307,28 +14307,28 @@ }, "projects/modal": { "name": "@walletconnect/modal", - "version": "2.5.4", + "version": "2.5.5", "license": "Apache-2.0", "dependencies": { - "@walletconnect/modal-core": "2.5.4", - "@walletconnect/modal-ui": "2.5.4" + "@walletconnect/modal-core": "2.5.5", + "@walletconnect/modal-ui": "2.5.5" } }, "projects/modal-auth-html": { "name": "@walletconnect/modal-auth-html", - "version": "2.5.4", + "version": "2.5.5", "license": "Apache-2.0", "dependencies": { "@walletconnect/auth-client": "2.1.0", - "@walletconnect/modal": "2.5.4" + "@walletconnect/modal": "2.5.5" } }, "projects/modal-auth-react": { "name": "@walletconnect/modal-auth-react", - "version": "2.5.4", + "version": "2.5.5", "license": "Apache-2.0", "dependencies": { - "@walletconnect/modal-auth-html": "2.5.4" + "@walletconnect/modal-auth-html": "2.5.5" }, "peerDependencies": { "react": ">=17", @@ -14337,19 +14337,19 @@ }, "projects/modal-sign-html": { "name": "@walletconnect/modal-sign-html", - "version": "2.5.4", + "version": "2.5.5", "license": "Apache-2.0", "dependencies": { - "@walletconnect/modal": "2.5.4", + "@walletconnect/modal": "2.5.5", "@walletconnect/sign-client": "2.8.3" } }, "projects/modal-sign-react": { "name": "@walletconnect/modal-sign-react", - "version": "2.5.4", + "version": "2.5.5", "license": "Apache-2.0", "dependencies": { - "@walletconnect/modal-sign-html": "2.5.4", + "@walletconnect/modal-sign-html": "2.5.5", "mitt": "3.0.0" }, "peerDependencies": { diff --git a/packages/modal-core/package.json b/packages/modal-core/package.json index 0f9560f..87b9cd1 100644 --- a/packages/modal-core/package.json +++ b/packages/modal-core/package.json @@ -1,6 +1,6 @@ { "name": "@walletconnect/modal-core", - "version": "2.5.4", + "version": "2.5.5", "main": "dist/index.js", "type": "module", "types": "dist/_types/index.d.ts", diff --git a/packages/modal-core/src/controllers/ExplorerCtrl.ts b/packages/modal-core/src/controllers/ExplorerCtrl.ts index f2adb14..37afbaf 100644 --- a/packages/modal-core/src/controllers/ExplorerCtrl.ts +++ b/packages/modal-core/src/controllers/ExplorerCtrl.ts @@ -77,12 +77,10 @@ export const ExplorerCtrl = { } // Don't fetch recomended wallets, as we already have these - if (!extendedParams.search) { - if (recomendedWallets.length) { - extendedParams.excludedIds = recomendedWallets.map(wallet => wallet.id).join(',') - } else if (CoreUtil.isArray(explorerRecommendedWalletIds)) { - extendedParams.excludedIds = explorerRecommendedWalletIds.join(',') - } + if (recomendedWallets.length) { + extendedParams.excludedIds = recomendedWallets.map(wallet => wallet.id).join(',') + } else if (CoreUtil.isArray(explorerRecommendedWalletIds)) { + extendedParams.excludedIds = explorerRecommendedWalletIds.join(',') } // Don't fetch user defined excluded wallets & recomended wallets diff --git a/packages/modal-core/src/utils/CoreUtil.ts b/packages/modal-core/src/utils/CoreUtil.ts index d562061..e5052cf 100644 --- a/packages/modal-core/src/utils/CoreUtil.ts +++ b/packages/modal-core/src/utils/CoreUtil.ts @@ -79,25 +79,40 @@ export const CoreUtil = { }, setWalletConnectDeepLink(href: string, name: string) { - localStorage.setItem(CoreUtil.WALLETCONNECT_DEEPLINK_CHOICE, JSON.stringify({ href, name })) + try { + localStorage.setItem(CoreUtil.WALLETCONNECT_DEEPLINK_CHOICE, JSON.stringify({ href, name })) + } catch { + console.info('Unable to set WalletConnect deep link') + } }, setWalletConnectAndroidDeepLink(wcUri: string) { - const [href] = wcUri.split('?') - - localStorage.setItem( - CoreUtil.WALLETCONNECT_DEEPLINK_CHOICE, - JSON.stringify({ href, name: 'Android' }) - ) + try { + const [href] = wcUri.split('?') + localStorage.setItem( + CoreUtil.WALLETCONNECT_DEEPLINK_CHOICE, + JSON.stringify({ href, name: 'Android' }) + ) + } catch { + console.info('Unable to set WalletConnect android deep link') + } }, removeWalletConnectDeepLink() { - localStorage.removeItem(CoreUtil.WALLETCONNECT_DEEPLINK_CHOICE) + try { + localStorage.removeItem(CoreUtil.WALLETCONNECT_DEEPLINK_CHOICE) + } catch { + console.info('Unable to remove WalletConnect deep link') + } }, setModalVersionInStorage() { - if (typeof localStorage !== 'undefined') { - localStorage.setItem(CoreUtil.WCM_VERSION, process.env.ROLLUP_WCM_VERSION ?? 'UNKNOWN') + try { + if (typeof localStorage !== 'undefined') { + localStorage.setItem(CoreUtil.WCM_VERSION, process.env.ROLLUP_WCM_VERSION ?? 'UNKNOWN') + } + } catch { + console.info('Unable to set Web3Modal version in storage') } }, diff --git a/packages/modal-ui/package.json b/packages/modal-ui/package.json index c8d90a6..be07d98 100644 --- a/packages/modal-ui/package.json +++ b/packages/modal-ui/package.json @@ -1,6 +1,6 @@ { "name": "@walletconnect/modal-ui", - "version": "2.5.4", + "version": "2.5.5", "main": "dist/index.js", "type": "module", "types": "dist/_types/index.d.ts", @@ -16,7 +16,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@walletconnect/modal-core": "2.5.4", + "@walletconnect/modal-core": "2.5.5", "lit": "2.7.5", "motion": "10.16.2", "qrcode": "1.5.3" diff --git a/packages/modal-ui/src/utils/UiUtil.ts b/packages/modal-ui/src/utils/UiUtil.ts index 59bf155..88bca74 100644 --- a/packages/modal-ui/src/utils/UiUtil.ts +++ b/packages/modal-ui/src/utils/UiUtil.ts @@ -135,15 +135,25 @@ export const UiUtil = { }, setRecentWallet(wallet: WalletData) { - localStorage.setItem(UiUtil.WCM_RECENT_WALLET_DATA, JSON.stringify(wallet)) + try { + localStorage.setItem(UiUtil.WCM_RECENT_WALLET_DATA, JSON.stringify(wallet)) + } catch { + console.info('Unable to set recent wallet') + } }, getRecentWallet() { - const wallet = localStorage.getItem(UiUtil.WCM_RECENT_WALLET_DATA) - if (wallet) { - const json = JSON.parse(wallet) + try { + const wallet = localStorage.getItem(UiUtil.WCM_RECENT_WALLET_DATA) + if (wallet) { + const json = JSON.parse(wallet) + + return json as WalletData + } - return json as WalletData + return undefined + } catch { + console.info('Unable to get recent wallet') } return undefined diff --git a/projects/modal-auth-html/package.json b/projects/modal-auth-html/package.json index b5c3f84..9f05c2a 100644 --- a/projects/modal-auth-html/package.json +++ b/projects/modal-auth-html/package.json @@ -1,6 +1,6 @@ { "name": "@walletconnect/modal-auth-html", - "version": "2.5.4", + "version": "2.5.5", "main": "dist/index.js", "unpkg": "dist/cdn/bundle.js", "type": "module", @@ -19,7 +19,7 @@ }, "dependencies": { "@walletconnect/auth-client": "2.1.0", - "@walletconnect/modal": "2.5.4" + "@walletconnect/modal": "2.5.5" }, "keywords": [ "web3", diff --git a/projects/modal-auth-react/package.json b/projects/modal-auth-react/package.json index 620518b..561ed3d 100644 --- a/projects/modal-auth-react/package.json +++ b/projects/modal-auth-react/package.json @@ -1,6 +1,6 @@ { "name": "@walletconnect/modal-auth-react", - "version": "2.5.4", + "version": "2.5.5", "main": "dist/index.js", "type": "module", "types": "dist/_types/index.d.ts", @@ -17,7 +17,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@walletconnect/modal-auth-html": "2.5.4" + "@walletconnect/modal-auth-html": "2.5.5" }, "peerDependencies": { "react": ">=17", diff --git a/projects/modal-sign-html/package.json b/projects/modal-sign-html/package.json index cfa93cb..dd5dfca 100644 --- a/projects/modal-sign-html/package.json +++ b/projects/modal-sign-html/package.json @@ -1,6 +1,6 @@ { "name": "@walletconnect/modal-sign-html", - "version": "2.5.4", + "version": "2.5.5", "main": "dist/index.js", "unpkg": "dist/cdn/bundle.js", "type": "module", @@ -18,7 +18,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@walletconnect/modal": "2.5.4", + "@walletconnect/modal": "2.5.5", "@walletconnect/sign-client": "2.8.3" }, "keywords": [ diff --git a/projects/modal-sign-html/src/client.ts b/projects/modal-sign-html/src/client.ts index d374a61..f92e42c 100644 --- a/projects/modal-sign-html/src/client.ts +++ b/projects/modal-sign-html/src/client.ts @@ -176,6 +176,10 @@ export class WalletConnectModalSign { relayUrl: this.#options.relayUrl }) const clientId = await this.#signClient.core.crypto.getClientId() - localStorage.setItem('WCM_WALLETCONNECT_CLIENT_ID', clientId) + try { + localStorage.setItem('WCM_WALLETCONNECT_CLIENT_ID', clientId) + } catch { + console.info('Unable to set client id') + } } } diff --git a/projects/modal-sign-react/package.json b/projects/modal-sign-react/package.json index 20bc8f2..ce3295d 100644 --- a/projects/modal-sign-react/package.json +++ b/projects/modal-sign-react/package.json @@ -1,6 +1,6 @@ { "name": "@walletconnect/modal-sign-react", - "version": "2.5.4", + "version": "2.5.5", "main": "dist/index.js", "type": "module", "types": "dist/_types/index.d.ts", @@ -17,7 +17,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@walletconnect/modal-sign-html": "2.5.4", + "@walletconnect/modal-sign-html": "2.5.5", "mitt": "3.0.0" }, "peerDependencies": { diff --git a/projects/modal/package.json b/projects/modal/package.json index 3b8e0b1..e394c83 100644 --- a/projects/modal/package.json +++ b/projects/modal/package.json @@ -1,6 +1,6 @@ { "name": "@walletconnect/modal", - "version": "2.5.4", + "version": "2.5.5", "main": "dist/index.js", "unpkg": "dist/cdn/bundle.js", "type": "module", @@ -18,8 +18,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@walletconnect/modal-core": "2.5.4", - "@walletconnect/modal-ui": "2.5.4" + "@walletconnect/modal-core": "2.5.5", + "@walletconnect/modal-ui": "2.5.5" }, "keywords": [ "web3",