From f2d532d3188cca3b770dda445863262da5006467 Mon Sep 17 00:00:00 2001 From: 0xAsimetriq <3154053+0xAsimetriq@users.noreply.github.com> Date: Fri, 30 Jun 2023 00:05:47 +0300 Subject: [PATCH] Chore/walletconnect dependencies (#384) * Update WalletConnect dependencies * Update to wcm 2.5.4 (adds sourcemaps) * Updated @walletconnect/ethereum-provider dependency * [chore] Update WalletConnect dependencies * chore: format * remove duplicated changesets * Update .changeset/pretty-feet-boil.md --------- Co-authored-by: 0xAsimetriq <0xAsimetriq@users.noreply.github.com> Co-authored-by: awkweb --- .changeset/pretty-feet-boil.md | 5 ++ packages/connectors/package.json | 4 +- packages/connectors/src/walletConnect.ts | 9 ++- pnpm-lock.yaml | 78 ++++++++++++------------ 4 files changed, 54 insertions(+), 42 deletions(-) create mode 100644 .changeset/pretty-feet-boil.md diff --git a/.changeset/pretty-feet-boil.md b/.changeset/pretty-feet-boil.md new file mode 100644 index 00000000..c58d4911 --- /dev/null +++ b/.changeset/pretty-feet-boil.md @@ -0,0 +1,5 @@ +--- +"@wagmi/connectors": patch +--- + +Updated WalletConnect dependencies, exposed `relayUrl` option for `WalletConnectConnector` diff --git a/packages/connectors/package.json b/packages/connectors/package.json index 2e439612..c6709214 100644 --- a/packages/connectors/package.json +++ b/packages/connectors/package.json @@ -25,9 +25,9 @@ "@ledgerhq/connect-kit-loader": "^1.1.0", "@safe-global/safe-apps-provider": "^0.17.1", "@safe-global/safe-apps-sdk": "^8.0.0", - "@walletconnect/ethereum-provider": "2.8.4", + "@walletconnect/ethereum-provider": "2.8.6", "@walletconnect/legacy-provider": "^2.0.0", - "@walletconnect/modal": "2.5.4", + "@walletconnect/modal": "2.5.9", "abitype": "0.8.7", "eventemitter3": "^4.0.7" }, diff --git a/packages/connectors/src/walletConnect.ts b/packages/connectors/src/walletConnect.ts index 77372b58..ebd0044a 100644 --- a/packages/connectors/src/walletConnect.ts +++ b/packages/connectors/src/walletConnect.ts @@ -67,9 +67,14 @@ type WalletConnectOptions = { showQrModal?: EthereumProviderOptions['showQrModal'] /** * Options of QR code modal. - * @link https://docs.walletconnect.com/2.0/web3modal/options + * @link https://docs.walletconnect.com/2.0/web/walletConnectModal/modal/options */ qrModalOptions?: EthereumProviderOptions['qrModalOptions'] + /** + * Option to override default relay url. + * @link https://docs.walletconnect.com/2.0/web/providers/ethereum + */ + relayUrl?: string } type ConnectConfig = { @@ -291,6 +296,7 @@ export class WalletConnectConnector extends Connector< showQrModal = true, qrModalOptions, metadata, + relayUrl, } = this.options this.#provider = await EthereumProvider.init({ showQrModal, @@ -307,6 +313,7 @@ export class WalletConnectConnector extends Connector< ]), ), metadata, + relayUrl, }) } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4599b8cd..71ccb70e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -96,14 +96,14 @@ importers: specifier: ^8.0.0 version: 8.0.0(typescript@5.0.4) '@walletconnect/ethereum-provider': - specifier: 2.8.4 - version: 2.8.4(@walletconnect/modal@2.5.4)(lokijs@1.5.12) + specifier: 2.8.6 + version: 2.8.6(@walletconnect/modal@2.5.9)(lokijs@1.5.12) '@walletconnect/legacy-provider': specifier: ^2.0.0 version: 2.0.0 '@walletconnect/modal': - specifier: 2.5.4 - version: 2.5.4(react@18.2.0) + specifier: 2.5.9 + version: 2.5.9(react@18.2.0) abitype: specifier: 0.8.7 version: 0.8.7(typescript@5.0.4) @@ -980,8 +980,8 @@ packages: dependencies: typescript: 5.0.4 - /@walletconnect/core@2.8.4(lokijs@1.5.12): - resolution: {integrity: sha512-3CQHud4As0kPRvlW1w/wSWS2F3yXlAo5kSEJyRWLRPqXG+aSCVWM8cVM8ch5yoeyNIfOHhEINdsYMuJG1+yIJQ==} + /@walletconnect/core@2.8.6(lokijs@1.5.12): + resolution: {integrity: sha512-rnSqm1KJLcww/v6+UH8JeibQkJ3EKgyUDPfEK0stSEkrIUIcXaFlq3Et8S+vgV8bPhI0MVUhAhFL5OJZ3t2ryg==} dependencies: '@walletconnect/heartbeat': 1.2.1 '@walletconnect/jsonrpc-provider': 1.0.13 @@ -994,8 +994,8 @@ packages: '@walletconnect/relay-auth': 1.0.4 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.8.4(lokijs@1.5.12) - '@walletconnect/utils': 2.8.4(lokijs@1.5.12) + '@walletconnect/types': 2.8.6(lokijs@1.5.12) + '@walletconnect/utils': 2.8.6(lokijs@1.5.12) events: 3.3.0 lodash.isequal: 4.5.0 uint8arrays: 3.1.0 @@ -1031,8 +1031,8 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/ethereum-provider@2.8.4(@walletconnect/modal@2.5.4)(lokijs@1.5.12): - resolution: {integrity: sha512-z7Yz4w8t3eEFv8vQ8DLCgDWPah2aIIyC0iQdwhXgJenQTVuz7JJZRrJUUntzudipHK/owA394c1qTPF0rsMSeQ==} + /@walletconnect/ethereum-provider@2.8.6(@walletconnect/modal@2.5.9)(lokijs@1.5.12): + resolution: {integrity: sha512-wUvJEsXTLmMihrOhQxAs1k9hrWEOT03QBn54P9r9GpJbJ1zEfIjQaXFfi8uup6gldhH+vN38PsbOiLyv/6d3qQ==} peerDependencies: '@walletconnect/modal': '>=2' peerDependenciesMeta: @@ -1043,11 +1043,11 @@ packages: '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/modal': 2.5.4(react@18.2.0) - '@walletconnect/sign-client': 2.8.4(lokijs@1.5.12) - '@walletconnect/types': 2.8.4(lokijs@1.5.12) - '@walletconnect/universal-provider': 2.8.4(lokijs@1.5.12) - '@walletconnect/utils': 2.8.4(lokijs@1.5.12) + '@walletconnect/modal': 2.5.9(react@18.2.0) + '@walletconnect/sign-client': 2.8.6(lokijs@1.5.12) + '@walletconnect/types': 2.8.6(lokijs@1.5.12) + '@walletconnect/universal-provider': 2.8.6(lokijs@1.5.12) + '@walletconnect/utils': 2.8.6(lokijs@1.5.12) events: 3.3.0 transitivePeerDependencies: - '@react-native-async-storage/async-storage' @@ -1241,8 +1241,8 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/modal-core@2.5.4(react@18.2.0): - resolution: {integrity: sha512-ISe4LqmEDFU7b6rLgonqaEtMXzG6ko13HA7S8Ty3d7GgfAEe29LM1dq3zo8ehEOghhofhj1PiiNfvaogZKzT1g==} + /@walletconnect/modal-core@2.5.9(react@18.2.0): + resolution: {integrity: sha512-isIebwF9hOknGouhS/Ob4YJ9Sa/tqNYG2v6Ua9EkCqIoLimepkG5eC53tslUWW29SLSfQ9qqBNG2+iE7yQXqgw==} dependencies: buffer: 6.0.3 valtio: 1.10.6(react@18.2.0) @@ -1250,10 +1250,10 @@ packages: - react dev: false - /@walletconnect/modal-ui@2.5.4(react@18.2.0): - resolution: {integrity: sha512-5qLLjwbE3YC4AsCVhf8J87otklkApcQ5DCMykOcS0APPv8lKQ46JxpQhfWwRYaUkuIiHonI9h1YxFARDkoaI9g==} + /@walletconnect/modal-ui@2.5.9(react@18.2.0): + resolution: {integrity: sha512-nfBaAT9Ls7RZTBBgAq+Nt/3AoUcinIJ9bcq5UHXTV3lOPu/qCKmUC/0HY3GvUK8ykabUAsjr0OAGmcqkB91qug==} dependencies: - '@walletconnect/modal-core': 2.5.4(react@18.2.0) + '@walletconnect/modal-core': 2.5.9(react@18.2.0) lit: 2.7.5 motion: 10.16.2 qrcode: 1.5.3 @@ -1261,11 +1261,11 @@ packages: - react dev: false - /@walletconnect/modal@2.5.4(react@18.2.0): - resolution: {integrity: sha512-JAKMcCd4JQvSEr7pNitg3OBke4DN1JyaQ7bdi3x4T7oLgOr9Y88qdkeOXko/0aJonDHJsM88hZ10POQWmKfEMA==} + /@walletconnect/modal@2.5.9(react@18.2.0): + resolution: {integrity: sha512-Zs2RvPwbBNRdBhb50FuJCxi3FJltt1KSpI7odjU/x9GTpTOcSOkmR66PBCy2JvNA0+ztnS1Xs0LVEr3lu7/Jzw==} dependencies: - '@walletconnect/modal-core': 2.5.4(react@18.2.0) - '@walletconnect/modal-ui': 2.5.4(react@18.2.0) + '@walletconnect/modal-core': 2.5.9(react@18.2.0) + '@walletconnect/modal-ui': 2.5.9(react@18.2.0) transitivePeerDependencies: - react dev: false @@ -1309,17 +1309,17 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/sign-client@2.8.4(lokijs@1.5.12): - resolution: {integrity: sha512-eRvWtKBAgzo/rbIkw+rkKco2ulSW8Wor/58UsOBsl9DKr1rIazZd4ZcUdaTjg9q8AT1476IQakCAIuv+1FvJwQ==} + /@walletconnect/sign-client@2.8.6(lokijs@1.5.12): + resolution: {integrity: sha512-rOFTKTHP7oJfXgYHX7+SdB8VbcsEE3ZFG/bMdmZboWaBim1mrY3vUyDdKrNr0VgI3AwBiEQezQDfKxBX0pMSQQ==} dependencies: - '@walletconnect/core': 2.8.4(lokijs@1.5.12) + '@walletconnect/core': 2.8.6(lokijs@1.5.12) '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.1 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.0.1 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.8.4(lokijs@1.5.12) - '@walletconnect/utils': 2.8.4(lokijs@1.5.12) + '@walletconnect/types': 2.8.6(lokijs@1.5.12) + '@walletconnect/utils': 2.8.6(lokijs@1.5.12) events: 3.3.0 transitivePeerDependencies: - '@react-native-async-storage/async-storage' @@ -1334,8 +1334,8 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/types@2.8.4(lokijs@1.5.12): - resolution: {integrity: sha512-Fgqe87R7rjMOGSvx28YPLTtXM6jj+oUOorx8cE+jEw2PfpWp5myF21aCdaMBR39h0QHij5H1Z0/W9e7gm4oC1Q==} + /@walletconnect/types@2.8.6(lokijs@1.5.12): + resolution: {integrity: sha512-Z/PFa3W1XdxeTcCtdR6lUsFgZfU/69wWJBPyclPwn7cu1+eriuCr6XZXQpJjib3flU+HnwHiXeUuqZaheehPxw==} dependencies: '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.1 @@ -1348,17 +1348,17 @@ packages: - lokijs dev: false - /@walletconnect/universal-provider@2.8.4(lokijs@1.5.12): - resolution: {integrity: sha512-JRpOXKIciRMzd03zZxM1WDsYHo/ZS86zZrZ1aCHW1d45ZLP7SbGPRHzZgBY3xrST26yTvWIlRfTUEYn50fzB1g==} + /@walletconnect/universal-provider@2.8.6(lokijs@1.5.12): + resolution: {integrity: sha512-ln1RVv8+oHu9enOJ/oVkjiarneB+4vJCk16znOklIN2JtDHwB8iObDHlQH3UE6ynNTw1iRvaGuPR4g+YdIfB6w==} dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.7 '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.0.1 - '@walletconnect/sign-client': 2.8.4(lokijs@1.5.12) - '@walletconnect/types': 2.8.4(lokijs@1.5.12) - '@walletconnect/utils': 2.8.4(lokijs@1.5.12) + '@walletconnect/sign-client': 2.8.6(lokijs@1.5.12) + '@walletconnect/types': 2.8.6(lokijs@1.5.12) + '@walletconnect/utils': 2.8.6(lokijs@1.5.12) events: 3.3.0 transitivePeerDependencies: - '@react-native-async-storage/async-storage' @@ -1368,8 +1368,8 @@ packages: - utf-8-validate dev: false - /@walletconnect/utils@2.8.4(lokijs@1.5.12): - resolution: {integrity: sha512-NGw6BINYNeT9JrQrnxldAPheO2ymRrwGrgfExZMyrkb1MShnIX4nzo4KirKInM4LtrY6AA/v0Lu3ooUdfO+xIg==} + /@walletconnect/utils@2.8.6(lokijs@1.5.12): + resolution: {integrity: sha512-wcy6e5+COYo7tfNnW8YqidnATdJDIW6vDiWWE7A1F78Sl/VflkaevB9cIgyn8eLdxC1SxXgGoeC2oLP90nnHJg==} dependencies: '@stablelib/chacha20poly1305': 1.0.1 '@stablelib/hkdf': 1.0.1 @@ -1379,7 +1379,7 @@ packages: '@walletconnect/relay-api': 1.0.9 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.8.4(lokijs@1.5.12) + '@walletconnect/types': 2.8.6(lokijs@1.5.12) '@walletconnect/window-getters': 1.0.1 '@walletconnect/window-metadata': 1.0.1 detect-browser: 5.3.0