2023-10-03 15:43:35 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
2023-11-15 21:26:12 +00:00
|
|
|
import AppLayouts.Wallet.stores 1.0 as WalletStores
|
2023-10-03 15:43:35 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
|
2023-10-27 16:18:24 +00:00
|
|
|
required property var controller
|
2023-10-03 15:43:35 +00:00
|
|
|
|
2023-11-15 21:26:12 +00:00
|
|
|
property alias modal: modal
|
|
|
|
property alias sdk: sdk
|
|
|
|
property alias url: sdk.url
|
2023-11-06 19:05:18 +00:00
|
|
|
|
2023-11-15 21:26:12 +00:00
|
|
|
WalletConnectModal {
|
|
|
|
id: modal
|
2023-11-06 19:05:18 +00:00
|
|
|
|
2023-11-15 21:26:12 +00:00
|
|
|
controller: root.controller
|
|
|
|
sdk: sdk
|
2023-11-18 16:06:04 +00:00
|
|
|
}
|
2023-10-03 15:43:35 +00:00
|
|
|
|
2023-11-18 16:06:04 +00:00
|
|
|
WalletConnectSDK {
|
2023-11-15 21:26:12 +00:00
|
|
|
id: sdk
|
2023-10-03 15:43:35 +00:00
|
|
|
|
2023-11-06 19:05:18 +00:00
|
|
|
projectId: controller.projectId
|
|
|
|
|
2023-11-15 21:26:12 +00:00
|
|
|
active: WalletStores.RootStore.walletSectionInst.walletReady && (controller.hasActivePairings || modal.opened)
|
2023-11-06 19:05:18 +00:00
|
|
|
|
2023-11-15 21:26:12 +00:00
|
|
|
onSessionRequestEvent: (details) => {
|
|
|
|
modal.openWithSessionRequestEvent(details)
|
2023-11-06 19:05:18 +00:00
|
|
|
}
|
2023-11-24 12:51:36 +00:00
|
|
|
onSessionDelete: (deletePayload) => {
|
|
|
|
root.controller.deletePairing(deletePayload.topic)
|
|
|
|
}
|
2023-11-06 19:05:18 +00:00
|
|
|
}
|
2023-12-01 19:43:21 +00:00
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: root.controller
|
|
|
|
function onRequestOpenWalletConnectPopup(uri) {
|
|
|
|
modal.openWithUri(uri)
|
|
|
|
}
|
|
|
|
}
|
2023-10-03 15:43:35 +00:00
|
|
|
}
|