Commit Graph

884 Commits

Author SHA1 Message Date
Alex Jbanca b340de63d4
fix(Dapps): Fixing fees in transaction requests
Fixes:
1. Fixing the laggy scrolling on transaction requiests popups. The root cause of this issue was the fees request and also the estimated time request. These periodic requests were blocking. Now we'll call these API async.
2. Fixing the max fees: The fees computation was using 21k as gasLimit. This value was hardcoded in WC. Now we're requesting the gasLimit if it's not provided by the dApp. This call is also async.
3. Fixing the periodicity of the fees computation. The fees were computed by the client only if the tx object didn't already provide the fees. But the tx could fail if when the fees are highly volatile because it was not being overridden. Now Status is computing the fees periodically for all tx requests.
4. Fixing an issue where the loading state of the fees text in the modal was showing text underneath the loading animation. Fixed by updating the AnimatedText to support a custom target property. The text component used for session requests is using `cusomColor` property to set the text color and the `color` for the text must not be overriden.
2024-11-18 15:20:10 +02:00
Alex Jbanca 00fb1ff60a
fix(WC): Refactor dapps service to work with multiple SDKs
This PR is refactoring the dapps service to avoid code duplication between SDKs and also to avoid overlapping requests/responses.
It brings Browser Connect inline with Wallet Connect in terms of session management and sign transactions.

New architecture:

WalletConnectService becomes DAppsService. Its responsibility is to provide dapp access to the app. This is the component currently used by the UI
What does it do:
1. Provide dapp APIs line connect, disconnect, session requests etc
2. Spawn app notifications on dapp events
3. Timeout requests if the dapp does not respons

DAppsRequestHandler becomes DAppsModule. This component is consumed by the DAppService. Its responsibility is to aggregate all the building blocks for the dapps, but does not control any of the dapp features or consume the SDKs requests.
What does it do:
1. Aggregate all the building blocks for dapps (currently known as plugins)

DAppConnectionsPlugin - This component provides the session management features line connect, disconnect and provide a model with the connected dapps.
SignRequestPlugin - This component provides the sign request management. It receives the sign request from the dapp, translates it to what Status understands and manages the lifecycle of the request.
2024-11-09 00:38:52 +02:00
Alex Jbanca 4636f80260
feat(WC): Enable Wallet Connect feature by default
+ Update the dialog where the user choses the connection to enable or disable the connection option based on flags
+ Separating the walletConnect flag and browserConnect flag usage so that either one can be disabled without affecting the other feature
+ Update qml test
2024-11-07 21:06:11 +02:00
Alex Jbanca 705d595bdb
fix(WC): Adding tests for ChainsAvailabilityWatchdog and ChainsSupervisorPlugin
+ move other tests from the wrong folder
2024-11-07 21:06:11 +02:00
Alex Jbanca adf760e81c
feat(WC): Handle unavailable chains or internet connection
This commits implements the `connect` `disconnect` session events for WC and also disables primary buttons for WC whenever there is no connection to internet or chains.

+ update tests
2024-11-07 21:06:11 +02:00
Alex Jbanca 9d64cc1a57
feat(WC): Implementing SIWE flows
to squash.- implementing siwe flows
2024-11-07 21:06:08 +02:00
Alex Jbanca 9d6840ef4a
fix(WC): Update storybook mocked store to respond to sign requests 2024-11-07 21:06:07 +02:00
Alex Jbanca a398d348a4
fix(WC): Fix property names collisions
to squash - property names collisions
2024-11-07 21:06:04 +02:00
Dario Gabriel Lipicar ea94065c57 fix(swap): invalidate old uuid and route when a new route request is made
Fixes #16574
2024-10-31 12:12:28 -03:00
Michał Cieślak ba80ba97f7 compressedPubKey exposed via backend models, usages of Utils.getCompressedPk removed, SB pages simplified 2024-10-31 11:11:30 +01:00
Michał Cieślak 28f6bee90e Utils.getCompressedPk removed from multiple components 2024-10-31 11:11:30 +01:00
Michał Cieślak 0f98244e1f UserListPanel simplified, dependency on utilsStore removed 2024-10-31 11:11:30 +01:00
Michał Cieślak 0db6fe2701 Invite flow: compressedKey added to the model, api simplified 2024-10-31 11:11:30 +01:00
Michał Cieślak 143cf63dc0 Community invite flow: dependency on stores reduced 2024-10-31 11:11:30 +01:00
Michał Cieślak 0c86fbf7b6 Storybook: added ability to mark pages with their status
Closes: #16606
2024-10-30 18:23:11 +01:00
Lukáš Tinkl 0b67555ee1 fix(AddAccount): Derivation path drop down is empty
- use `StatusListView` for the popup/menu contentItem
- add the menu to SB too

Fixes #16635
2024-10-30 11:43:02 +01:00
Jonathan Rainville d511c25d2e
remove old code about ID verification and fix trustStatus bug (#16548)
* chore: remove old code about ID verification

* refactor(trust): remove untrustowrthy and isVerified from items and use trustStatus

* chore(status-go): up status-go to get fix for trustStatus reseting

Fixes #16392

* chore: remove verified/trusted profile showcase category
2024-10-29 14:08:12 -04:00
Sale Djenic f6055946d4 chore: usage of goerli removed 2024-10-29 15:46:09 +01:00
Michał Cieślak dedaaa5a60 Unused StatusEmojiAndColorComboBox removed
Closes: #16558
2024-10-28 23:16:31 +01:00
Michał Cieślak fe249225a2 Storybook pages - multiple fixes regarding stores 2024-10-28 23:16:31 +01:00
Cuteivist c47f42eb39
fix: Show only selected networks (#16588) 2024-10-28 13:10:30 +01:00
Jonathan Rainville f7823cd0b7
refactor(members): unify members models into one (#16508)
Fixes #16433
2024-10-25 21:25:50 -04:00
Dario Gabriel Lipicar f34050a5bc fix(wallet): debounce send modal route requests and assign new uuid on each fetch 2024-10-24 11:26:53 -03:00
Michał Cieślak 0828787b4d Storybook: switch to determine how to resolve stores' paths in QtCreator
Closes: #16582
2024-10-24 09:30:19 +02:00
Michał Cieślak c9ba0a9aa7 Components for storing chart data renamed and moved
ChartStoreBase -> ChartDataBase
TokenBalanceHistoryStore -> TokenBalanceHistoryData
TokenMarketValuesStore -> TokenMarketValuesData

Those components store data without any interaction with the backend.
Therefore they are not stores.

Closes: #16295
2024-10-23 14:36:21 +02:00
Lukáš Tinkl 76af3a469b chore: help QtCreator find the new StatusQ module
- also help recognize other interesting project files
2024-10-22 15:54:31 +02:00
Lukáš Tinkl d9d6d90dc9 [Style] remove legacy Style and its themes
- legacy Style and ThemePalette removed
- moved and deduplicated font definitions into `Theme` (unrelated to a
color palette)
- `Style.current.foo` -> `Theme.foo`
- `Style.current.fooColor` -> `Theme.palette.fooColor`
- upgrade the imports to 5.15
- removed some mode dead components

Fixes #16514
2024-10-22 15:54:31 +02:00
Anastasiya Semenkevich 05f8005336 chore(@storybook): skip flaky test 2024-10-18 20:14:28 +03:00
Michał Cieślak 02993196e9 References to Global.userProfile removed from multiple components 2024-10-16 23:02:02 +02:00
Lukáš Tinkl b052416666 fix(PasswordView): Password instructions missing max length requirement
- set the pass max length to 100 (via `Constants`, not with a hardcoded
regexp)
- delay the validation until the user hits the limit
- clear the categories (lower/upper/num/sym) info if the password is
cleared too
- update the error messages according to latest Figma designs

Fixes #16239
2024-10-16 22:24:56 +02:00
Sale Djenic fe5c135486 chore: sign the flow only once if approval and transaction need to be placed once after another (swap flow)
Closes #16337
2024-10-16 09:52:46 +02:00
Alex Jbanca 684d0b4d63 fix: DAppsWorkflow flaky test 2024-10-15 13:40:48 +03:00
Michał Cieślak d5a0589591 Remove unused RecipientSelector and related components 2024-10-14 23:28:05 +02:00
Lukáš Tinkl 26dddcaff9 feat(CreateCommunityPopup): validation and ensuring min. 1 tag added
- enable the Next button, and delay the validation after it's been clicked
- visually display required fields also for logo, banner, and tags (min
1 tag is required now)
- when pasting over limit, chop the text to the maximum length, instead
of just leaving the text field empty
- do not let the popup autoclose on clicking outside or pressing Esc
- add a StoryBook page
- minor cleanups and alignments to the latest Figma designs/flows

Fixes #13966
Fixes #16479
Fixes #14902
2024-10-14 11:39:58 +02:00
Michał Cieślak 03db15529e Cleanup after #16497 workaround 2024-10-11 23:37:50 +02:00
Michał Cieślak f75e4e0c47 Introduce ability of calling StatusQ methods from nim
Closes: #16496
2024-10-11 23:37:50 +02:00
Khushboo Mehta 3f55e6c9c5 feat(@desktop/wallet): Remove preferred chains from wallet accounts all over the app 2024-10-11 18:48:37 +02:00
Khushboo Mehta 7003ba73e2 feat(@desktop/wallet): Remove network prefixes in saved addresses and ReceiveModal 2024-10-11 18:48:37 +02:00
Khushboo Mehta 16a403e3e5 feat(@desktop/wallet): Remove network prefixes in Profile, Profile showcase and Profile preview 2024-10-11 18:48:37 +02:00
Khushboo Mehta 60fb566580 feat(@desktop/wallet): remove address prefixes from wallet account settings 2024-10-11 18:48:37 +02:00
Michał Cieślak 206bc79ab4 downloadImageByUrl moved to SystemUtils 2024-10-11 12:14:53 +02:00
Michał Cieślak 3f9f175e07 restartApplication() removed from Utils.qml and nim 2024-10-11 12:14:53 +02:00
Michał Cieślak 417ad03ce1 StatusQ: Redundant TextUtils removed 2024-10-11 12:14:53 +02:00
Michał Cieślak 9f9dcefcf8 chore: using StringUtils.plainText consistently
There were two version of plainText - one exposed from the backend,
another, backend-independent in StringUtils. The latter one is now
used in all cases.
2024-10-11 12:14:53 +02:00
Alex Jbanca fd99b96cb5 feat(WalletConnect): Handle sign request expiration
Implementing the user-story for sign request expiry and add qml tests
+ other minor fixes

## Acceptance Criteria

```
//Always show the expiration
Given the sign/transaction request dialog is shown
When request has an expiration date
Then the user sees a 1 minute countdown in the dialog
```

```
// Show 1 minute timer
Given the sign/transaction request dialog is shown
When the request has 1 minute or less before expiring
Then the user sees a 1 second countdown in the dialog
```

```
Given the sign/transaction dialog is open
When the request expires
Then the Accept button is removed
And the only option for the user is to close the dialog
```

```
Given the sign/transaction request dialog is open
When the request expired
Then the `Sign` and `Reject` buttons are removed
And the `Close` button is visible
```

```
Given the sign/transaction request expired
Then a toast message is showing
And it contains the "<dapp domain> sign request timed out" message
```

```
Given the sign/transaction request dialog is open
When the request expired
Then the sign/transaction request dialog is still visible
```

```
Given the sign/transaction request expires
Then a console message is shown
And it contains 'WC WalletConnectSDK.onSessionRequestExpire; id: ${id}`'
```
2024-10-10 12:49:15 +03:00
Lukáš Tinkl bf666c20f5 fix(chat): chat input accepts DnD for blocked users
- do not allow DND when the StatusChatInput is disabled
- remove `Global.dragArea` variable from the Global singleton
- move the `DropAreaPanel` into `StatusChatInput` and handle its
enabling from there

Fixes #16451
2024-10-10 10:33:13 +03:00
Alex Jbanca 92d8d601e5 fix: Enable WebEngineLoader qml tests 2024-10-10 10:29:12 +03:00
Alex Jbanca 0c0b2292bc fix: WebEngineView with qt 5.15.2
Adding `--disable-seccomp-filter-sandbox` flag to chromium as a workaround for https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1944468
2024-10-10 10:29:12 +03:00
Alex Jbanca c9549079b9 chore: update WC qml tests with the new DAppsWorkflow API 2024-10-09 13:32:53 +03:00
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