Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket connection to walletconnect v1 bridge failed #2373

Closed
simonzg opened this issue Aug 9, 2023 · 8 comments
Closed

WebSocket connection to walletconnect v1 bridge failed #2373

simonzg opened this issue Aug 9, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@simonzg
Copy link

simonzg commented Aug 9, 2023

Bug description

It seems like safe-wallet-web page is trying to connect to walletconnect v1 bridge, I guess something need to be configured to turn it off, but I can't find details in documentation. I don't see this behavior on https://app.safe.global/ , only the safe-wallet-web deployment for meter mainnet

Environment

  • Browser: Chrome
  • Wallet: MetaMask
  • Chain: meter mainnet

Steps to reproduce

  1. Deployed contracts on meter mainnet
  2. use safe-infrastructure to run the transaction service and client gateway
  3. configure the safe-wallet-web to point to the gateway url

Expected result

no console error

Obtained result

WebSocket connection to 'wss://3.bridge.walletconnect.org/?env=browser&host=safe.meter.io&protocol=wc&version=1' failed:

Screenshots

Screenshot 2023-08-08 at 5 17 08 PM

@simonzg simonzg added the bug Something isn't working label Aug 9, 2023
@osiastedian
Copy link

+1

@katspaugh
Copy link
Member

You can turn it off in the config-service.

On app.safe.global we use an environment variable that sets the bridge to our custom bridge. WC's official v1 bridge has been turned off.

@katspaugh
Copy link
Member

Btw, I've noticed your fork of the app isn't clearly branded as a fork. Please make sure to at least change the logo.

@simonzg
Copy link
Author

simonzg commented Aug 9, 2023

Thanks @katspaugh for quick response.

I'll update the logo to indicate it's a fork.

For the v1 bridge, is there any way we could turn it off instead of preparing a custom bridge? Thanks

@katspaugh
Copy link
Member

katspaugh commented Aug 10, 2023

Like I said, you can turn it off in the config-service.

I'll update the logo to indicate it's a fork.

Thanks for updating the logo! Ideally you shouldn't be using or modifying the Safe{Wallet} logo at all, as it's our brand. Please use a completely different, distinct logo. Like the one you had in v1.

@simonzg
Copy link
Author

simonzg commented Aug 10, 2023

Got it, thanks @katspaugh

Will give the logo a completely new design and it won't be similar to Safe{Wallet} at all. For now, I'll just use the text "Meter Safe" as a place holder to replace Safe{Wallet}.

@simonzg simonzg closed this as completed Aug 10, 2023
@svanegmond
Copy link

svanegmond commented Sep 12, 2023

@simonzg did you figure out where in config-service this is configured?
So far we have set up wallet connect v2 on walletconnect.org, obtained a project ID, and placed it in ui server's NEXT_PUBLIC_WC_PROJECT_ID
Find me in discord #setup if you like (@d-fens)

@simonzg
Copy link
Author

simonzg commented Sep 14, 2023

@svanegmond

I didn't find out how to configure the config-service. I ended up commenting out the reference to walletconnect v1 completely on the UI. Here's the diff:

diff --git a/src/hooks/wallets/consts.ts b/src/hooks/wallets/consts.ts
index 8150309c..4a4cdd0c 100644
--- a/src/hooks/wallets/consts.ts
+++ b/src/hooks/wallets/consts.ts
@@ -5,7 +5,7 @@ export const enum WALLET_KEYS {
   LEDGER = 'LEDGER',
   PAIRING = 'PAIRING',
   TREZOR = 'TREZOR',
-  WALLETCONNECT = 'WALLETCONNECT',
+  // WALLETCONNECT = 'WALLETCONNECT',
   WALLETCONNECT_V2 = 'WALLETCONNECT_V2',
   TAHO = 'TAHO',
 }
@@ -17,7 +17,7 @@ export const CGW_NAMES: { [key in WALLET_KEYS]: string | undefined } = {
   [WALLET_KEYS.LEDGER]: 'ledger',
   [WALLET_KEYS.PAIRING]: 'safeMobile',
   [WALLET_KEYS.TREZOR]: 'trezor',
-  [WALLET_KEYS.WALLETCONNECT]: 'walletConnect',
+  // [WALLET_KEYS.WALLETCONNECT]: 'walletConnect',
   [WALLET_KEYS.WALLETCONNECT_V2]: 'walletConnect_v2',
   [WALLET_KEYS.TAHO]: 'tally',
 }
diff --git a/src/hooks/wallets/useOnboard.ts b/src/hooks/wallets/useOnboard.ts
index d440c01c..2f839448 100644
--- a/src/hooks/wallets/useOnboard.ts
+++ b/src/hooks/wallets/useOnboard.ts
@@ -11,7 +11,6 @@ import { useInitPairing } from '@/services/pairing/hooks'
 import { isWalletUnlocked, WalletNames } from '@/utils/wallets'
 import { useAppSelector } from '@/store'
 import { type EnvState, selectRpc } from '@/store/settingsSlice'
-import { WALLET_KEYS } from './consts'

 export type ConnectedWallet = {
   label: string
@@ -68,7 +67,7 @@ export const getConnectedWallet = (wallets: WalletState[]): ConnectedWallet | nu
 }

 const getWalletConnectLabel = async ({ label, provider }: ConnectedWallet): Promise<string | undefined> => {
-  if (label.toUpperCase() !== WALLET_KEYS.WALLETCONNECT.toUpperCase()) return
+  // if (label.toUpperCase() !== WALLET_KEYS.WALLETCONNECT.toUpperCase()) return

   const UNKNOWN_PEER = 'Unknown'
   const { default: WalletConnect } = await import('@walletconnect/client')
diff --git a/src/hooks/wallets/wallets.ts b/src/hooks/wallets/wallets.ts
index 474ab89c..521f8d15 100644
--- a/src/hooks/wallets/wallets.ts
+++ b/src/hooks/wallets/wallets.ts
@@ -54,7 +54,8 @@ const walletConnectV2 = (chain: ChainInfo): WalletInit => {
 const WALLET_MODULES: { [key in WALLET_KEYS]: (chain: ChainInfo) => WalletInit } = {
   [WALLET_KEYS.INJECTED]: () => injectedWalletModule(),
   [WALLET_KEYS.PAIRING]: () => pairingModule(),
-  [WALLET_KEYS.WALLETCONNECT]: () => walletConnectV1(),
+  // [WALLET_KEYS.WALLETCONNECT]: () => {},
+  // [WALLET_KEYS.WALLETCONNECT]: () => walletConnectV1(),
   [WALLET_KEYS.WALLETCONNECT_V2]: (chain) => walletConnectV2(chain),
   [WALLET_KEYS.LEDGER]: () => ledgerModule(),
   [WALLET_KEYS.TREZOR]: () => trezorModule({ appUrl: TREZOR_APP_URL, email: TREZOR_EMAIL }),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants