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

refactor: transaction estimation flow #1549

Merged
merged 4 commits into from
Oct 5, 2024
Merged

Conversation

LuizAsFight
Copy link
Contributor

@LuizAsFight LuizAsFight commented Oct 5, 2024

  • Closes Issues when using Fuel Wallet with SwayLend #1546

  • Simplified the estimation / approval part of the DAPP Approve Transaction screen

  • Send transaction part

    • Simulate transaction before sending, avoiding the user to spend gas in case of fail
    • Skip estimating dependencies at this point, on this approval step we don’t wanna change the tx anymore
  • Refact the transaction estimation part:

    • Save the initialTxRequest as the one the dev first informed. All further changes will be always done based on this first tx informed
    • Do the estimation, fee changes, funding if needed, and generate a proposedTxRequest which may have some changes
      • this proposedTxRequest is gonna be the one to go for approval
      • If the user choose to customize gas or tips, we apply again to the initialTxRequest and create a new proposetTxRequest, this way we don’t continuously manipulate a transactionRequest. Instead we always have a safe start point
  • If the user didn't customize the gasLimit we automatically increase 20% on it, avoiding OutOfGas errors

  • Remove all minGasLimit, letting the user just inform the gas he wants, if it’s too low the dryRun will fail

  • For the approve screen to start in “Advanced Mode”

    • It will be needed that the tip informed in the tx is different then the regularTip and fastTIp we calculated
    • Also the gas can be different from the one calculated on proposedTxRequest, this will also make the Advanced Mode initiated

@LuizAsFight LuizAsFight marked this pull request as ready for review October 5, 2024 19:35
@LuizAsFight LuizAsFight changed the title feat: rethink transaction estimation flow refact: transaction estimation flow Oct 5, 2024
@LuizAsFight LuizAsFight changed the title refact: transaction estimation flow refactor: transaction estimation flow Oct 5, 2024
Copy link
Contributor

@arthurgeron arthurgeron left a comment

Choose a reason for hiding this comment

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

Great stuff 🔥

@LuizAsFight LuizAsFight merged commit c163db4 into master Oct 5, 2024
30 of 31 checks passed
@LuizAsFight LuizAsFight deleted the lf/fix/wallet-gas-flow branch October 5, 2024 21:18
LuizAsFight pushed a commit that referenced this pull request Oct 5, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to master, this PR
will be updated.


# Releases
## @fuels/[email protected]



## [email protected]

### Minor Changes

- [#1549](#1549)
[`c163db48`](c163db4)
Thanks [@LuizAsFight](https://github.com/LuizAsFight)! - Increase
gasLimit by 20% to avoid OutOfGas error

- [#1549](#1549)
[`c163db48`](c163db4)
Thanks [@LuizAsFight](https://github.com/LuizAsFight)! - Refactor
transaction estimation / customization of fees flow

### Patch Changes

- [#1548](#1548)
[`6dd69ceb`](6dd69ce)
Thanks [@helciofranco](https://github.com/helciofranco)! - Fix asset
list scrollable container when there are many assets available.

- [#1543](#1543)
[`a64d31f5`](a64d31f)
Thanks [@LuizAsFight](https://github.com/LuizAsFight)! - chore: test
version publish of multiple packages

-   Updated dependencies \[]:
    -   @fuel-wallet/[email protected]

## @fuel-wallet/[email protected]



## @fuel-wallet/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

Issues when using Fuel Wallet with SwayLend
2 participants