From 674b31628765e32d89abbc7b33cba473a79541e8 Mon Sep 17 00:00:00 2001 From: Alex Jbanca Date: Thu, 28 Nov 2024 15:21:29 +0200 Subject: [PATCH] fix(BC): Fixing chains transformation on connect --- .../Wallet/services/dapps/DappsConnectorSDK.qml | 2 +- .../services/dapps/plugins/DAppConnectionsPlugin.qml | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ui/app/AppLayouts/Wallet/services/dapps/DappsConnectorSDK.qml b/ui/app/AppLayouts/Wallet/services/dapps/DappsConnectorSDK.qml index 4be459eed4..76b7152d93 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/DappsConnectorSDK.qml +++ b/ui/app/AppLayouts/Wallet/services/dapps/DappsConnectorSDK.qml @@ -334,7 +334,7 @@ WalletConnectSDKBase { url } }, - requiredNamespaces: supportedNamespaces + requiredNamespaces: JSON.parse(supportedNamespaces) } } return proposal diff --git a/ui/app/AppLayouts/Wallet/services/dapps/plugins/DAppConnectionsPlugin.qml b/ui/app/AppLayouts/Wallet/services/dapps/plugins/DAppConnectionsPlugin.qml index 32ca3bc6f3..5974e98b2c 100644 --- a/ui/app/AppLayouts/Wallet/services/dapps/plugins/DAppConnectionsPlugin.qml +++ b/ui/app/AppLayouts/Wallet/services/dapps/plugins/DAppConnectionsPlugin.qml @@ -139,8 +139,17 @@ SQUtils.QObject { function onSessionProposal(sessionProposal) { const key = sessionProposal.id + const namespaces = sessionProposal.params.requiredNamespaces + const { chains, _ } = DAppsHelpers.extractChainsAndAccountsFromApprovedNamespaces(namespaces) d.activeProposals.set(key.toString(), { context: sessionProposal, promise: bcConnectionPromise }) - root.newConnectionProposed(key, [1], sessionProposal.params.proposer.metadata.url, sessionProposal.params.proposer.metadata.name, sessionProposal.params.proposer.metadata.icons[0], Constants.DAppConnectors.StatusConnect) + root.newConnectionProposed( + key, + chains, + sessionProposal.params.proposer.metadata.url, + sessionProposal.params.proposer.metadata.name, + sessionProposal.params.proposer.metadata.icons[0], + Constants.DAppConnectors.StatusConnect + ) } function onApproveSessionResult(proposalId, session, err) {