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.
This commit is contained in:
Alex Jbanca 2024-11-25 13:35:10 +02:00 committed by Alex Jbanca
parent 63e0ab35f0
commit c99697134b
1 changed files with 2 additions and 3 deletions

View File

@ -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)