-
Notifications
You must be signed in to change notification settings - Fork 174
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
Cw 657 new buy sell flow #1553
base: main
Are you sure you want to change the base?
Cw 657 new buy sell flow #1553
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good,
I like the abstraction you added so that we can re-use the components for multiple purposes
just please make sure that it's passing the correct fields to the APIs cuz we have 2 cases, buy and sell, and we need to make sure we are passing the correct data for all providers
|
||
ProviderRecommendation? getRecommendationFromString(String title) { | ||
switch (title) { | ||
case 'BEST RATE': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the expected value? the others are without spaces, so just making sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this is what was in the Figma mockup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figma? this is used for fetching the recommendations returned by onramper?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you were asking about the expected response value. From Onramper, we are getting ‘BestPrice’, but we ignore it anyway because we set the best rate ourselves here:
recommendations.insert(0, ProviderRecommendation.bestRate);
in the view model.
|
||
final queryParams = { | ||
'applicationId': _applicationId, | ||
'fiatCode': sourceCurrencyName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be the currency in case of sell right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is an assetCode parameter missing, fixed.
…ch/cake_wallet into CW-657-New-buy-sell-flow
fix providers to be fetched with the selected currency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we already have a field for fiat currency and one for crypto currency, why confuse ourselves with sourceCurrency
and destinationCurrency
just make the parameters take Fiat and Crypto and pass them without confusion and we get to decide in each provider which one gets passed as which parameter in the request
too many unnecessary confusion
if(!isBuyAction && destinationCurrency as FiatCurrency != FiatCurrency.eur) { | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be in DFX
should be checking if destinationCurrency
is Fiat or Crypto first
should be checking for EUR and CHF both are valid for DFX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a fiat currency check as well. It appears that if Moonpay doesn't support the fiat for the sell action, it returns a quote for euros as default.I made the check a bit clearer.
currencyValueValidator: (value) { | ||
return null; | ||
}, | ||
addressTextFieldValidator: AddressValidator(type: buySellViewModel.cryptoCurrency), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor
this is the fiat amount, why address validator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
currencyValueValidator: (value) { | ||
return null; | ||
}, | ||
addressTextFieldValidator: AddressValidator(type: CryptoCurrency.xmr), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only xmr?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
…CW-657-New-buy-sell-flow # Conflicts: # lib/di.dart # lib/src/screens/new_wallet/widgets/select_button.dart
Replaced source and destination currency parameters with the corresponding fiat and crypto currency parameters. |
Issue Number (if Applicable): Fixes #
Description
Please include a summary of the changes and which issue is fixed / feature is added.
Pull Request - Checklist