Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick transaction settings #22019

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Quick transaction settings #22019

wants to merge 1 commit into from

Conversation

vkjr
Copy link
Contributor

@vkjr vkjr commented Feb 4, 2025

fixes #21019

Summary

Quick transaction settings added. Now you can select normal/fast/urgent mode and see the estimated gas fee.

Screen.Recording.2025-02-07.at.11.39.38.mov

Review notes

Adding quick transaction settings required changes in events flow. Before this PR our app was calling status-go function BuildTransactionsFromRoute at the moment when we navigated to transaction confirmation screen. This function stops the route updates, so the only thing we had to do is to sign the transactions.
But in order to allow user to change transaction settings we need to send changes to status-go and keep getting route updates with new fees.
So the events order was changed. Now we navigate to transaction confirmation screen and still getting the routes update. But when user slides the sign button we:

  • call BuildTransactionsFromRoute
  • await for wallet.router.sign-transactions signal
  • start authorization
  • when authorized - sign transaction and send it to status-go

Along the way the authrization slider was refactored. Update: authorization slider changes were reverted back to not interfere with current @clauxx refactoring of authorization process

Testing notes

This PR has changed the order of events during send/bridge, so they should be tested.

Platforms

  • Android
  • iOS

Areas that may be impacted

Functional

  • wallet / transactions

Steps to test

  • Open Status
  • Go to send screen confirmation
  • Press transaction settings button, make sure that different setting levels are in place and updating.
  • Make sure that setting change affects the change of transaction fee (that happens not immediately but on the next update from status-go

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Feb 4, 2025

Jenkins Builds

Click to see older builds (55)
Commit #️⃣ Finished (UTC) Duration Platform Result
d353634 #1 2025-02-04 11:30:53 ~2 min tests 📄log
✔️ d353634 #1 2025-02-04 11:36:50 ~8 min android-e2e 🤖apk 📲
✔️ d353634 #1 2025-02-04 11:37:22 ~8 min android 🤖apk 📲
✔️ d353634 #1 2025-02-04 11:40:03 ~11 min ios 📱ipa 📲
65e80ad #2 2025-02-04 12:39:47 ~2 min tests 📄log
✔️ 65e80ad #2 2025-02-04 12:44:53 ~8 min android-e2e 🤖apk 📲
✔️ 65e80ad #2 2025-02-04 12:45:31 ~8 min android 🤖apk 📲
✔️ 65e80ad #2 2025-02-04 12:47:25 ~10 min ios 📱ipa 📲
875e1c0 #3 2025-02-04 15:37:27 ~2 min tests 📄log
✔️ 875e1c0 #3 2025-02-04 15:42:20 ~7 min android 🤖apk 📲
✔️ 875e1c0 #3 2025-02-04 15:42:29 ~7 min android-e2e 🤖apk 📲
333f74f #4 2025-02-04 15:46:12 ~3 min tests 📄log
✔️ 333f74f #4 2025-02-04 15:52:03 ~8 min android-e2e 🤖apk 📲
✔️ 333f74f #4 2025-02-04 15:52:44 ~9 min android 🤖apk 📲
✔️ 333f74f #4 2025-02-04 15:52:52 ~9 min ios 📱ipa 📲
c674e5e #5 2025-02-05 19:56:04 ~3 min tests 📄log
✔️ c674e5e #5 2025-02-05 20:01:55 ~9 min android-e2e 🤖apk 📲
✔️ c674e5e #5 2025-02-05 20:02:25 ~9 min android 🤖apk 📲
✔️ c674e5e #5 2025-02-05 20:04:18 ~11 min ios 📱ipa 📲
661cb3d #6 2025-02-06 14:19:25 ~27 sec ios 📄log
661cb3d #6 2025-02-06 14:19:33 ~40 sec android-e2e 📄log
661cb3d #6 2025-02-06 14:19:33 ~40 sec android 📄log
661cb3d #6 2025-02-06 14:19:51 ~54 sec tests 📄log
0d58240 #7 2025-02-06 16:30:18 ~29 sec ios 📄log
0d58240 #7 2025-02-06 16:30:27 ~33 sec android 📄log
0d58240 #7 2025-02-06 16:30:28 ~33 sec android-e2e 📄log
0d58240 #7 2025-02-06 16:30:53 ~59 sec tests 📄log
ee49281 #8 2025-02-06 16:40:21 ~27 sec ios 📄log
ee49281 #8 2025-02-06 16:40:32 ~37 sec android-e2e 📄log
ee49281 #8 2025-02-06 16:40:35 ~41 sec android 📄log
ee49281 #8 2025-02-06 16:42:00 ~2 min tests 📄log
22b4750 #10 2025-02-06 16:47:58 ~3 min tests 📄log
✔️ 22b4750 #10 2025-02-06 16:51:31 ~6 min android-e2e 🤖apk 📲
✔️ 22b4750 #10 2025-02-06 16:52:34 ~7 min android 🤖apk 📲
✔️ 22b4750 #10 2025-02-06 16:55:12 ~10 min ios 📱ipa 📲
7a2b24c #11 2025-02-06 17:10:14 ~3 min tests 📄log
✔️ 7a2b24c #11 2025-02-06 17:15:48 ~8 min android-e2e 🤖apk 📲
✔️ 7a2b24c #11 2025-02-06 17:16:26 ~9 min android 🤖apk 📲
✔️ 7a2b24c #11 2025-02-06 17:18:18 ~11 min ios 📱ipa 📲
254f9c5 #12 2025-02-07 11:16:10 ~3 min tests 📄log
✔️ 254f9c5 #12 2025-02-07 11:20:06 ~7 min android 🤖apk 📲
✔️ 254f9c5 #12 2025-02-07 11:21:04 ~7 min android-e2e 🤖apk 📲
✔️ 254f9c5 #12 2025-02-07 11:24:41 ~11 min ios 📱ipa 📲
✔️ ca855e8 #13 2025-02-07 11:40:21 ~4 min tests 📄log
✔️ ca855e8 #13 2025-02-07 11:44:21 ~8 min android-e2e 🤖apk 📲
✔️ ca855e8 #13 2025-02-07 11:44:51 ~9 min android 🤖apk 📲
✔️ ca855e8 #13 2025-02-07 11:46:23 ~10 min ios 📱ipa 📲
✔️ 3d8d193 #14 2025-02-07 12:39:01 ~4 min tests 📄log
✔️ 3d8d193 #14 2025-02-07 12:41:07 ~6 min android-e2e 🤖apk 📲
✔️ 3d8d193 #14 2025-02-07 12:42:18 ~7 min android 🤖apk 📲
✔️ 3d8d193 #14 2025-02-07 12:45:24 ~10 min ios 📱ipa 📲
✔️ 5462f90 #15 2025-02-07 14:34:00 ~4 min tests 📄log
✔️ 5462f90 #15 2025-02-07 14:37:45 ~8 min android-e2e 🤖apk 📲
✔️ 5462f90 #15 2025-02-07 14:38:17 ~8 min android 🤖apk 📲
✔️ 5462f90 #15 2025-02-07 14:40:16 ~10 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ b750f3e #16 2025-02-07 14:53:42 ~4 min tests 📄log
✔️ b750f3e #16 2025-02-07 14:57:59 ~8 min android-e2e 🤖apk 📲
✔️ b750f3e #16 2025-02-07 14:58:40 ~9 min android 🤖apk 📲
✔️ b750f3e #16 2025-02-07 15:00:17 ~10 min ios 📱ipa 📲
✔️ c8727a3 #17 2025-02-10 13:30:47 ~4 min tests 📄log
✔️ c8727a3 #17 2025-02-10 13:35:00 ~9 min android-e2e 🤖apk 📲
✔️ c8727a3 #17 2025-02-10 13:35:32 ~9 min android 🤖apk 📲
✔️ c8727a3 #17 2025-02-10 13:37:09 ~11 min ios 📱ipa 📲

@vkjr vkjr force-pushed the quick-tx-settings-backup branch 2 times, most recently from 875e1c0 to 333f74f Compare February 4, 2025 15:42
@vkjr vkjr force-pushed the quick-tx-settings-backup branch 2 times, most recently from 22b4750 to 7a2b24c Compare February 6, 2025 17:06
@shivekkhurana shivekkhurana added the wallet-core Issues for mobile wallet team label Feb 7, 2025
@@ -9,35 +9,33 @@

(defn view
[{:keys [track-text customization-color auth-button-label on-auth-success on-auth-fail
auth-button-icon-left size blur? container-style disabled? dependencies on-complete]
auth-button-icon-left size blur? container-style disabled? dependencies]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed on-complete because we used it to prevent the standard authorization slider from doing standard authorization, which is a bit illogical :)
So now this slider works only for standard authorization, for cases when you need to choose between keycard or standard auth there is a simple slider.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain why the changes to standard_auth were needed in this case? Asking cause I'm finishing up on the PR which also removes it, but also allows to sign e.g transaction data with standard_auth (including the keycard support). So I'm wondering what was blocking it to make sure it's also supported there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update: changes were discussed on a call with @clauxx and we aligned our development.

new-path)
precision)
:eip-1559-enabled true
:tx-max-fees-per-gas (send-utils/convert-to-gwei
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new field from status-go that holds currently used gas. It need to be used for fee calculation

new-path)
precision)
:suggested-gas-fees-for-setting
{:transaction-setting/normal (send-utils/convert-to-gwei
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These three now used to calculate possible fees on different quick settings levels.

:flow-id :wallet-send-flow}]]]}))

(rf/reg-event-fx
:wallet.send/auth-slider-completed
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When slider moved by user we initiate sequence of building transaction and signing it

:type :negative
:text (:message error)}]))}]})))

(rf/reg-event-fx
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the key refactoring.
Before if user doesnt need keycard sign, we initiated standard authorization from slider component and than were signing from this event. But when user required keycard sign, we initiated keycard authorization from this event with consecutive sign.
Now both types of authorization run from here, that simplified caller code.

:current 31000}
:nonce {:last-transaction 21
:current 22}})
(assoc-in [:wallet :ui :send :confirmed-tx-setting] :transaction-setting/fast))}))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saved selected user setting

path-tx-identity (send-utils/path-identity route)
params [path-tx-identity gas-rate]]
{:db (assoc-in db [:wallet :ui :send :confirmed-tx-setting] confirmed-setting)
:json-rpc/call [{:method "wallet_setFeeMode"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status-go endpoint for selecting quick transaction setting

(i18n/label :t/slide-to-send))
:container-style {:z-index 2}
:disabled? (not transaction-for-signing)
[quo/slide-button
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced auth slider with simple slider.

currency-symbol
fee-in-fiat)]
fee-formatted))))
(fn [[account route currency currency-symbol prices-per-token]]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed argument from this sub, because we can extract it from db

@vkjr vkjr changed the title [WIP] Quick transaction settings Quick transaction settings Feb 7, 2025
@vkjr vkjr force-pushed the quick-tx-settings-backup branch from 3d8d193 to 5462f90 Compare February 7, 2025 14:29
@churik
Copy link
Member

churik commented Feb 11, 2025

@vkjr please, let us know when it is ready to testing, we need to take it ASAP as the feature is important for release and high-risk.
I'll ask separately people in chat to review it.

Copy link
Member

@clauxx clauxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but there is one usage of the standard-auth slider with the on-complete prop that wasn't adapted - the create-account namespace, which I assume would be broken for keycard here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request-manual-qa wallet-core Issues for mobile wallet team
Projects
Status: REVIEW
Development

Successfully merging this pull request may close these issues.

🧊🔥💥 Implement normal, fast and urgent parameter settings for SEND flow
5 participants