status-desktop/ui/imports/shared
Alex Jbanca 7603f24372 refactor: Remove business logic from WC ui components
This commit brings a separation of concerns for the UI components involved in dApp interactions.

Issue: The UI components depend on the WalletConnectService and also on its dependencies like DAppsRequestHAndler. As a result the UI components have a hard dependency on the WalletConnect specifics and are incompatible with BC. This results in duplication of logic.
Issue: The UI components operate on WalletConnect specific JSON object. E.g. session objects, session proposal etc. As a result the UI is built around the WalletConnect message format.
Issue: The UI components operate on ListModel items received through functions and stored internally. Any change in the model would result in a crash.
Solution: Remove the WalletConnectService dependency from DAppsWorkflow. The DAppsWorkflow now operates with models, signals and functions. This is the first step in the broader refactoring. Moving the logic into the service itself will allow us to further refactor the WC and BC.

How does it work now:

Dependencies - The UI components have a dependency on models. SessionRequestsModel and DAppsModel.
Pairing - The pairing is initiated in the UI. On user input a pairingValidationRequested signal is emitted and the result is received as a function pairingValidated. If the url is valid the UI requests a pairingRequested. When the WalletConnectService is refactored we can go further and request only pairingRequested and to receive a pairingResult call as a function with the result. In the current implementation on pairingRequested we'll receive a connectDApp request.
Connecting dApps - The flow is initiated with connectDApp function. This call currently contains all the needed info as args. In the next step it could be replaced with a ConnectionRequests model. The connectDApp call triggered a connection popup if we're not currently showing one to the user. If we're currently showing one it will be queued (corner case). The connection can be accepted with connectionAccepted and rejected with connectionDeclined. Once the connection is accepted we're expecting a result connectionSuccessful or connectionFailed. The connectionSuccessful also expects a new id for the established connection.
Signing - The signing flow orbits around the SessionRequestsModel. Each item from the model will generate a popup showing the sign details to the user. Sign can be accepted or rejected using signRequestAccepted or signRequestRejected. No response is currently expected. The model is expected to remove the sign request item.
2024-10-09 13:32:53 +03:00
..
controls fix(MessageContextMenuView): Message context menu displaying incorrectly 2024-10-02 15:58:59 +02:00
img
panels fix(StatusSeedPhraseInput): accept a common prefix suggestion 2024-09-10 16:00:40 +02:00
popups refactor: Remove business logic from WC ui components 2024-10-09 13:32:53 +03:00
status chore: applicationWindow property removed from Global singleton 2024-10-05 14:15:35 +02:00
stores fix(CurrencyStore): fix passing the CurrencyStore around 2024-10-07 12:09:23 +02:00
views fix(CurrencyStore): fix passing the CurrencyStore around 2024-10-07 12:09:23 +02:00
DelegateModelGeneralized.qml
LoadingAnimation.qml
MacTrafficLights.qml chore: applicationWindow property removed from Global singleton 2024-10-05 14:15:35 +02:00
qmldir chore: drop NumberPolyfill 2023-06-26 17:17:59 +02:00