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

Swaps: Use quotes conversion rate #2795

Merged
merged 12 commits into from
Jul 27, 2021

Conversation

wachunei
Copy link
Member

@wachunei wachunei commented Jun 11, 2021

Description

From https://github.com/MetaMask/swaps-controller/issues/41

To calculate the value of the quotes the controller needs the destination token conversion rate, this is passed from the client to the controller, forcing the client to have it added to their wallet everytime.

Upcoming version of the API includes both the source and destination rate values as part of the response:

export interface Quote {
// ...
sourceTokenRate: number | null;
destinationTokenRate: number | null;
// ...
}

These should be used instead of the values coming from the client.

This PR removes having to add the destination token to fetch quotes and only adds it if a swaps is attempted.

TODO

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

@wachunei wachunei requested a review from a team as a code owner June 11, 2021 23:59
@wachunei wachunei changed the title Use quotes conversion rate Swaps: Use quotes conversion rate Jun 11, 2021
@wachunei wachunei added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) needs-qa Any New Features that needs a full manual QA prior to being added to a release. swaps MetaSwaps issues labels Jun 12, 2021
Copy link
Contributor

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

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

Just a couple of minor comments

app/components/UI/Swaps/QuotesView.js Show resolved Hide resolved
app/components/UI/Swaps/QuotesView.js Outdated Show resolved Hide resolved
app/components/UI/Swaps/QuotesView.js Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@andrepimenta andrepimenta removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jun 17, 2021
@ibrahimtaveras00 ibrahimtaveras00 added QA in Progress QA has started on the feature. and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Jul 27, 2021
Copy link
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

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

QA Passed 👍🏽

@ibrahimtaveras00 ibrahimtaveras00 added QA Passed A successful QA run through has been done and removed QA in Progress QA has started on the feature. labels Jul 27, 2021
@wachunei wachunei merged commit 3f94f73 into develop Jul 27, 2021
@wachunei wachunei deleted the feature/swaps-quotes-conversion-rate branch July 27, 2021 21:59
rickycodes pushed a commit that referenced this pull request Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA Passed A successful QA run through has been done swaps MetaSwaps issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants