Skip to content

Commit

Permalink
v7.6.1; fix(coinbase): allow SMS 2FA (#1023)
Browse files Browse the repository at this point in the history
* fix : SMS 2FA is not working

* v7.6.1

Co-authored-by: synmcj <[email protected]>
  • Loading branch information
hadia and Syn-McJ authored Aug 19, 2022
1 parent 77c5132 commit be9d31c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class CoinBaseRepository @Inject constructor(
commitBuyOrderMapper.map(commitBuyResult?.data)
}

override suspend fun sendFundsToWallet(sendTransactionToWalletParams: SendTransactionToWalletParams, api2FATokenVersion: String) = safeApiCall {
override suspend fun sendFundsToWallet(sendTransactionToWalletParams: SendTransactionToWalletParams, api2FATokenVersion: String?) = safeApiCall {
servicesApi.sendCoinsToWallet(accountId = userPreferences.coinbaseUserAccountId, sendTransactionToWalletParams = sendTransactionToWalletParams, api2FATokenVersion = api2FATokenVersion)
}

Expand Down Expand Up @@ -193,7 +193,7 @@ interface CoinBaseRepositoryInt {
suspend fun getActivePaymentMethods(): ResponseResource<List<PaymentMethodsData>>
suspend fun placeBuyOrder(placeBuyOrderParams: PlaceBuyOrderParams): ResponseResource<PlaceBuyOrderUIModel>
suspend fun commitBuyOrder(buyOrderId: String): ResponseResource<CommitBuyOrderUIModel>
suspend fun sendFundsToWallet(sendTransactionToWalletParams: SendTransactionToWalletParams, api2FATokenVersion: String): ResponseResource<SendTransactionToWalletResponse?>
suspend fun sendFundsToWallet(sendTransactionToWalletParams: SendTransactionToWalletParams, api2FATokenVersion: String?): ResponseResource<SendTransactionToWalletResponse?>
fun getUserLastCoinbaseBalance(): String
fun isUserConnected(): Boolean
suspend fun swapTrade(tradesRequest: TradesRequest): ResponseResource<SwapTradeUIModel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ interface CoinBaseServicesApi {
@POST("v2/accounts/{account_id}/transactions")
suspend fun sendCoinsToWallet(
@Header(CB_VERSION_KEY) apiVersion: String = CB_VERSION_VALUE,
@Header(CB_2FA_TOKEN_KEY) api2FATokenVersion: String,
@Header(CB_2FA_TOKEN_KEY) api2FATokenVersion: String?,
@Path("account_id") accountId: String,
@Body sendTransactionToWalletParams: SendTransactionToWalletParams
): SendTransactionToWalletResponse?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class EnterTwoFaCodeFragment : Fragment(R.layout.enter_two_fa_code_fragment) {
super.onViewCreated(view, savedInstanceState)
handleBackPress()
val params = arguments?.let { EnterTwoFaCodeFragmentArgs.fromBundle(it).transactionParams }
viewModel.sendInitialTransactionToSMSTwoFactorAuth(params?.params)

binding.verifyBtn.setOnClickListener {
viewModel.verifyUserAndCompleteTransaction(params?.params, binding.enterCodeField.text.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ class EnterTwoFaCodeViewModel @Inject constructor(
_isRetryingTransfer = isRetryingTransfer
}

fun sendInitialTransactionToSMSTwoFactorAuth(
params: SendTransactionToWalletParams? ) =viewModelScope.launch(Dispatchers.Main) {
val sendTransactionToWalletParams= params?.copy(idem = UUID.randomUUID().toString())
sendTransactionToWalletParams?.let {
coinBaseRepository.sendFundsToWallet(it,null)
}
}

fun verifyUserAndCompleteTransaction(
params: SendTransactionToWalletParams?,
twoFaCode: String
Expand Down
3 changes: 3 additions & 0 deletions wallet/CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Dash Wallet
v7.6.1
* Coinbase 2FA fixes

v7.6
* Add support for Coinbase
* Buy DASH
Expand Down
4 changes: 2 additions & 2 deletions wallet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ android {
defaultConfig {
minSdkVersion 23
targetSdkVersion 30
versionCode project.hasProperty('versionCode') ? project.property('versionCode') as int : 70602
versionName project.hasProperty('versionName') ? project.property('versionName') : "7.6"
versionCode project.hasProperty('versionCode') ? project.property('versionCode') as int : 70610
versionName project.hasProperty('versionName') ? project.property('versionName') : "7.6.1"
multiDexEnabled true
generatedDensities = ['hdpi', 'xhdpi']
vectorDrawables.useSupportLibrary = true
Expand Down

0 comments on commit be9d31c

Please sign in to comment.