From c99697134b831e4fad9d5556f2f05d73cc7a7124 Mon Sep 17 00:00:00 2001 From: Alex Jbanca Date: Mon, 25 Nov 2024 13:35:10 +0200 Subject: [PATCH] fix(WC): Fixing the namespace negotiation for non eip155 chains in pairing process Check if the approved namespaces contains `eip155` property. Show an unsupported chain error if it doesn't. We should display the unsupported network error when the required namespaces is empty or meets the app supported namespace, but the optional namespace contains only non eip155 chains. --- .../Wallet/services/dapps/plugins/DAppConnectionsPlugin.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/app/AppLayouts/Wallet/services/dapps/plugins/DAppConnectionsPlugin.qml b/ui/app/AppLayouts/Wallet/services/dapps/plugins/DAppConnectionsPlugin.qml index 9da07c5066..fb5516e4b8 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/plugins/DAppConnectionsPlugin.qml +++ b/ui/app/AppLayouts/Wallet/services/dapps/plugins/DAppConnectionsPlugin.qml @@ -195,9 +195,8 @@ SQUtils.QObject { const proposal = d.activeProposals.get(key.toString()).context const dAppUrl = proposal.params.proposer.metadata.url - if(error || !approvedNamespaces) { - // Check that it contains Non conforming namespaces" - if (error.includes("Non conforming namespaces")) { + if(error || !approvedNamespaces || !approvedNamespaces.eip155) { + if (!approvedNamespaces.eip155 || error.includes("Non conforming namespaces")) { root.newConnectionFailed(proposal.id, dAppUrl, Pairing.errors.unsupportedNetwork) } else { root.newConnectionFailed(proposal.id, dAppUrl, Pairing.errors.unknownError)