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

feat: support txv3 in estimateFee (UI) #263

Merged
merged 25 commits into from
Aug 16, 2024
Merged

feat: support txv3 in estimateFee (UI) #263

merged 25 commits into from
Aug 16, 2024

Conversation

khanti42
Copy link
Collaborator

@khanti42 khanti42 commented Jun 27, 2024

Description

This PR updates the UI to support fee estimation for both transaction versions V2 (pay fee in ETH) and V3 (pay fee in STRK). The changes introduce new components and logic to handle the selected fee token, allowing users to choose between different tokens for fee estimation.

see here for details.

Enregistrement.de.l.ecran.2024-08-14.a.14.11.38.mov

Summary of Changes:

  • SendModal.view.tsx:

    • Added a DropDown component to select the fee token (ETH or STRK).
    • Updated state management to include feeToken.
    • Pass the selected fee token to relevant components.
  • SendSummaryModal.view.tsx:

    • Added support for selecting fee token (ETH or STRK) in the fee estimation.
    • Adjusted calculations to handle different fee tokens and their respective balances.
    • Updated display elements to show the selected fee token for gas fees and total amounts.
  • useStarkNetSnap.ts:

    • Modified function signatures to accept transactionVersion as an optional parameter.
    • Updated the call to include the transaction version when requesting fee estimates.

Impact:

  • UI Changes:
    Users can now select between ETH and STRK as the fee token. The UI updates ensure that the fee estimation and total amount calculations reflect the selected fee token.

  • Fee Estimation:
    Fee estimation now considers the transaction version and selected fee token, improving flexibility.

  • Display Adjustments:
    Updated components to display amounts and fees in the context of the selected fee token.

These updates prepare the UI for enhanced fee estimation capabilities, accommodating future changes and different transaction versions.

Requirement:

Requires this PR to be merged first:

@khanti42 khanti42 requested a review from a team as a code owner June 27, 2024 05:59
@khanti42 khanti42 requested review from Julink-eth and wantedsystem and removed request for a team June 27, 2024 05:59
Base automatically changed from feat/sf-602 to main August 15, 2024 10:34
Copy link
Collaborator

@stanleyyconsensys stanleyyconsensys left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

sonarcloud bot commented Aug 16, 2024

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-starknet-snap'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Aug 16, 2024

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-wallet-ui'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@khanti42 khanti42 added this pull request to the merge queue Aug 16, 2024
Merged via the queue into main with commit 52b07d0 Aug 16, 2024
13 checks passed
@khanti42 khanti42 deleted the feat/sf-604 branch August 16, 2024 14:11
@github-actions github-actions bot mentioned this pull request Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants