From 69e34800d1bdf5adf6ca461d2b47e20bcca84cfe Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Fri, 5 May 2023 14:53:49 -0600 Subject: [PATCH 1/2] Wallet switching chains now working properly and setting required chains to the config chains in w3o --- packages/demo/package.json | 2 +- packages/walletconnect/package.json | 2 +- packages/walletconnect/src/v2.ts | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/demo/package.json b/packages/demo/package.json index 6c44aec0d..1f3668ba4 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -46,7 +46,7 @@ "@web3-onboard/taho": "^2.0.2", "@web3-onboard/unstoppable-resolution": "^2.0.0", "@web3-onboard/web3auth": "^2.2.1", - "@web3-onboard/walletconnect": "^2.3.6", + "@web3-onboard/walletconnect": "^2.3.7-alpha.1", "@web3-onboard/enkrypt": "^2.0.2", "@web3-onboard/mew-wallet": "^2.0.1", "@web3-onboard/xdefi": "^2.0.2", diff --git a/packages/walletconnect/package.json b/packages/walletconnect/package.json index 85f4d8c55..efe8526eb 100644 --- a/packages/walletconnect/package.json +++ b/packages/walletconnect/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/walletconnect", - "version": "2.3.6", + "version": "2.3.7-alpha.1", "description": "WalletConnect SDK module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", diff --git a/packages/walletconnect/src/v2.ts b/packages/walletconnect/src/v2.ts index bffcab7b6..fe338b23d 100644 --- a/packages/walletconnect/src/v2.ts +++ b/packages/walletconnect/src/v2.ts @@ -72,7 +72,7 @@ function walletConnect(options?: WalletConnectOptions): WalletInit { ? // @ts-ignore // Required as WC package does not support hex numbers requiredChains.map(chainID => parseInt(chainID)) - : [1] + : [...chains.map(({ id }) => parseInt(id, 16))] const connector = await EthereumProvider.init({ projectId, @@ -136,7 +136,9 @@ function walletConnect(options?: WalletConnectOptions): WalletInit { .pipe(takeUntil(this.disconnected$)) .subscribe({ next: chainId => { - const hexChainId = `0x${chainId.toString(16)}` + const hexChainId = isHexString(chainId) + ? chainId + : `0x${chainId.toString(16)}` this.emit('chainChanged', hexChainId) }, error: console.warn From 1fb8cbd4e63abcd7a3baa6431bc5950cdd953812 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Mon, 8 May 2023 09:40:47 -0600 Subject: [PATCH 2/2] Fix web3auth ci build --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 69de2f94a..0da9ad582 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -287,7 +287,7 @@ jobs: - node-build-steps build-web3auth: docker: - - image: cimg/node:16.13.1 + - image: cimg/node:16.18.1 working_directory: ~/web3-onboard-monorepo/packages/web3auth steps: - node-build-steps @@ -511,7 +511,7 @@ jobs: - node-staging-build-steps build-staging-web3auth: docker: - - image: cimg/node:16.13.1 + - image: cimg/node:16.18.1 working_directory: ~/web3-onboard-monorepo/packages/web3auth steps: - node-staging-build-steps