Repository navigation
feat: buy dash from coinbase data-layer - #843
Conversation
…itory and an implementation for the interface - set up web services for payment_methods, place_buy_order, commit_order and send_funds_to_wallet
…to feature-buy-dash-data # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt
Syn-McJ
left a comment
There was a problem hiding this comment.
Looks fine to me, but shouldn't there be some examples of using these endpoints? I know we need UI for getting actual values the user has input, but until then some predefined mock values could be used.
You mean provide unit tests and set default values for the data classes ? |
…_Order_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt
…r_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt
…_Order_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt
…1131_Buy_Dash_UI_Order_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt
…i models - update implementation in CoinBaseRepository.kt and CoinbaseServicesViewModel.kt to for buy/commit/send flows
…to feature-buy-dash-data # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt
…t.kt - change user authorization scope for coinbase in CoinBaseWebClientActivity.kt - inject wallet data provider in WalletDataProviderModule.kt - update calls to get payment methods, place/commit buy orders and send funds to dash wallet
…to feature-buy-dash-data # Conflicts: # .gitignore # common/src/main/java/org/dash/wallet/common/Configuration.java # common/src/main/res/values/styles.xml # features/exploredash/src/androidTest/java/org/dash/wallet/features/exploredash/CoroutineDispatcherRule.kt # features/exploredash/src/androidTest/java/org/dash/wallet/features/exploredash/ExampleInstrumentedTest.kt # features/exploredash/src/androidTest/java/org/dash/wallet/features/exploredash/TestUtils.kt # features/exploredash/src/androidTest/java/org/dash/wallet/features/exploredash/repository/CoinBaseRepositoryTest.kt # features/exploredash/src/androidTest/java/org/dash/wallet/features/exploredash/viewmodels/CoinbaseServicesViewModelTest.kt
- redirect to coinbase portal upon successful login via coinbase
- redirect to wallet home screen after successful transfer of dash wallet - set min_amount and send_limit_period for coinbase client
| const val TEMP_ACCESS_TOKEN = "133848085c006dd1ec9b591c859506d6c2e31598d3b7c5e8c197da600687417d" | ||
| const val TEMP_REFRESH_TOKEN = "d28ae95beb4c5149644ee946e100479206b7204559e5944bc5ab151389a4279c" |
There was a problem hiding this comment.
should these be in the code, or be taken from services.properties?
There was a problem hiding this comment.
these constants as well will be removed. They were used for testing purposes, forgot to remove it
| /* | ||
| val refreshToken = if (userPreferences.hasTempTokenBeenUsed) { | ||
| userPreferences.lastCoinbaseRefreshToken | ||
| } else { | ||
| userPreferences.hasTempTokenBeenUsed = true | ||
| TEMP_REFRESH_TOKEN | ||
| } | ||
| */ |
There was a problem hiding this comment.
should this still be here?
There was a problem hiding this comment.
ahh yes, this portion is depreciated. will remove it !
Syn-McJ
left a comment
There was a problem hiding this comment.
Great work, there are some minor fixes needed with AmountView and styles.
| output-metadata.json | ||
| service.properties | ||
| wallet/schemas/*/*.json | ||
| wallet/schemas/*/*.json No newline at end of file |
There was a problem hiding this comment.
I thought we've decided not to remove those from git
There was a problem hiding this comment.
This may have been from another PR that was merged into this PR.
| class FancyAlertDialog : DialogFragment() { | ||
| private val lockScreenViewModel by activityViewModels<LockScreenViewModel>() | ||
| private val sharedViewModel by activityViewModels<FancyAlertDialogViewModel>() | ||
| var onFancyAlertButtonsClickListener: FancyAlertButtonsClickListener? = null |
There was a problem hiding this comment.
I don't get why do we need both sharedViewModel and a click listener for observing dialog actions. It's probably better to get rid of the ViewModel at some point as it is misused here. (No action needed atm)
There was a problem hiding this comment.
I agree with removing FancyAlertDialogViewModel and use lamda's instead for the click listeners as a separate action.
| set(value) { | ||
| field = value | ||
| binding.inputCurrencyToggle.isVisible = value | ||
| binding.resultCurrencyToggle.isVisible = value |
There was a problem hiding this comment.
If this property is set to True and updateDashSymbols isn't called, both currency toggles will be visible. dashToFiat has to be considered here before setting visibility.
| <item name="android:textColor">@color/dash_blue</item> | ||
| </style> | ||
|
|
||
| <style name="Body2.red_300"> |
There was a problem hiding this comment.
Styling names don't match the rest. Let's keep it consistent to avoid duplicates. This should be Body2.Red300, as well as Headline5.Bold.Red previously. Also, if we have a style with red_300 color, it should be either .Red or .Red300, but not both.
| <item name="android:lineSpacingExtra">3sp</item> | ||
| </style> | ||
|
|
||
| <style name="Caption.dashBlue"> |
There was a problem hiding this comment.
Just .Blue is fine. dash_blue is the default blue color.
| setOrHideIfEmpty(binding.coinbaseDialogPositiveButton, "positive_text") | ||
| setOrHideIfEmpty(binding.coinbaseDialogNegativeButton, "negative_text") | ||
| lockScreenViewModel.activatingLockScreen.observe(this){ | ||
| Log.e(this::class.java.simpleName, "Closing dialog") |
There was a problem hiding this comment.
Do we really need these error logs in the logcat? I understand if it is used for development purposes, but it should be cleaned up afterward. Having random red messages in logcat that are not actually errors is confusing.
| /** | ||
| * Used as a wrapper for data that is exposed via a LiveData that represents an event. | ||
| */ | ||
| open class Event<out T>(private val content: T) { |
There was a problem hiding this comment.
We have SingleLiveEvent, can it serve the same purpose?
|
there were some work from Hadia that I forgot to update accordingly, working on the fixes |
- remove FancyAlertDialogViewModel.kt - update FancyAlertDialog event listener
Issue being fixed or feature implemented
This task focuses on providing data needed by the UI to perform the buy dash from coinbase flow:
buy order)commit order)send transactions)Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist: