Skip to content

NMA-1066 Custodial Swaps | Buy Dash - #891

Merged
HashEngineering merged 85 commits into
feature-coinbase-integrationfrom
NMA-1066_Custodial_Swaps_Buy_Dash
Feb 15, 2022
Merged

HashEngineering merged 85 commits into
feature-coinbase-integrationfrom
NMA-1066_Custodial_Swaps_Buy_Dash

Conversation

@hadia

@hadia hadia commented Feb 15, 2022

Copy link
Copy Markdown
Contributor

user who has a Coinbase account I would like to be able to swap my crypto holdings in my Coinbase account for Dash in my Dash Wallet.

Issue being fixed or feature implemented

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

Syn-McJ and others added 30 commits December 14, 2021 13:00
…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
…_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
…1131_Buy_Dash_UI_Order_Preview_Info_dialogs_Error_Success_messages

# Conflicts:
#	integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseBuyDashFragment.kt
#	integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt
#	wallet/src/de/schildbach/wallet/ui/coinbase/CoinBaseWebClientActivity.kt
hadia added 19 commits February 1, 2022 14:59
…waps_Buy_Dash

# Conflicts:
#	common/src/main/java/org/dash/wallet/common/ui/enter_amount/AmountView.kt
#	integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseBuyDashFragment.kt
#	integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt
#	integrations/coinbase-integration/src/main/res/navigation/nav_coinbase.xml

@Syn-McJ Syn-McJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, I have some comments that can probably be fixed later. I'll leave it to @HashEngineering

<item name="android:textColor">@color/steel_gray_500</item>
</style>

<style name="Body2.Gray900">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Body2 is already Gray900


<style name="MontserratRegular.G900.16">
<item name="android:textSize">16sp</item>
</style>

@Syn-McJ Syn-McJ Feb 15, 2022 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see why we need this bunch of styles, it's better to use the ones adapted for the design system.

<item name="android:textColor">@color/gray_400</item>
</style>

<style name="Caption.dashBlue">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this needed to be renamed. Dash Blue is our primary Blue color.

import java.io.InputStream
import java.io.InputStreamReader

object TestUtils {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are these test classes in the Explore Dash?

@Provides
fun provideCommitBuyOrderMapper(): CommitBuyOrderMapper = CommitBuyOrderMapper()
@Provides
fun provideSwapTradeMapper(): SwapTradeMapper = SwapTradeMapper()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Provides is for providing an existing instance of a class. If a new instance is created, you can use @Binds - see ExploreDashModule.

binding.contentOrderReview.inputAccountSubtitle.text = this.inputCurrency
binding.contentOrderReview.convertOutputSubtitle.text = this.outputCurrency

if (this.inputCurrency == "DASH") {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think there is DASH_CURRENCY is the coinbase constants, might be better to use that.

}

binding.convertFromDashBalance.text = "${context.getString(R.string.balance)} ${dashFormat.minDecimals(0)
.optionalDecimals(0,8).format(coin)} ${input?.currency}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will ignore localization rules for the currency in front/after the amount. fiatToString method would be better suited here.

}

is ResponseResource.Failure -> {
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The failure state is ignored which seems weird.

@HashEngineering HashEngineering left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, any comments can be fixed in the next PR.

There is a merge conflict which I can fix before merging later today.

…waps_Buy_Dash

# Conflicts:
#	wallet/src/de/schildbach/wallet/ui/SetPinActivity.kt
@HashEngineering
HashEngineering merged commit 912013b into feature-coinbase-integration Feb 15, 2022
@Syn-McJ
Syn-McJ deleted the NMA-1066_Custodial_Swaps_Buy_Dash branch March 16, 2022 05:11
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.

4 participants