Updated on 2026-08-14
This commit is contained in:
parent
926840dded
commit
6446d5357b
5 changed files with 11 additions and 3 deletions
|
|
@ -64,7 +64,7 @@ dependencies {
|
|||
implementation 'com.google.android.material:material:1.2.1'
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10'
|
||||
|
||||
implementation 'com.tangem:blockchain:1.45.0'
|
||||
implementation 'com.tangem:blockchain:1.49.0'
|
||||
|
||||
//lifecycle
|
||||
implementation "androidx.lifecycle:lifecycle-runtime:2.2.0"
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.tangem.tap.domain
|
|||
|
||||
import androidx.annotation.StringRes
|
||||
import com.tangem.wallet.R
|
||||
import java.math.BigDecimal
|
||||
|
||||
interface TapErrors
|
||||
interface MultiMessageError : TapErrors {
|
||||
|
|
@ -24,7 +25,9 @@ sealed class TapError(@StringRes val localizedMessage: Int) : Throwable(), TapEr
|
|||
object InvalidAmountValue : TapError(R.string.invalid_amount_value)
|
||||
object InvalidFeeValue : TapError(R.string.invalid_fee_value)
|
||||
object DustAmount : TapError(R.string.dust_amount)
|
||||
object DustChang : TapError(R.string.dust_change)
|
||||
object DustChange : TapError(R.string.dust_change)
|
||||
object CreateAccountUnderfunded : TapError(R.string.create_account_underfunded)
|
||||
|
||||
data class ValidateTransactionErrors(
|
||||
override val errorList: List<TapError>,
|
||||
override val builder: (List<String>) -> String
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class AmountMiddleware {
|
|||
TransactionError.InvalidAmountValue -> TapError.InvalidAmountValue
|
||||
TransactionError.InvalidFeeValue -> TapError.InvalidFeeValue
|
||||
TransactionError.DustAmount -> TapError.DustAmount
|
||||
TransactionError.DustChange -> TapError.DustChang
|
||||
TransactionError.DustChange -> TapError.DustChange
|
||||
else -> TapError.UnknownError
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.tap.features.send.redux.middlewares
|
||||
|
||||
import com.tangem.blockchain.common.Amount
|
||||
import com.tangem.blockchain.common.CreateAccountUnderfunded
|
||||
import com.tangem.blockchain.common.TransactionSender
|
||||
import com.tangem.blockchain.extensions.Signer
|
||||
import com.tangem.blockchain.extensions.SimpleResult
|
||||
|
|
@ -69,6 +70,9 @@ private fun verifyAndSendTransaction(appState: AppState?, dispatch: (Action) ->
|
|||
}
|
||||
is SimpleResult.Failure -> {
|
||||
when (result.error) {
|
||||
is CreateAccountUnderfunded ->
|
||||
dispatch(SendAction.SendError(TapError.CreateAccountUnderfunded))
|
||||
|
||||
is Throwable -> {
|
||||
val message = (result.error as Throwable).message
|
||||
when {
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@
|
|||
<string name="invalid_fee_value">invalid_fee_value</string>
|
||||
<string name="dust_amount">dust_amount</string>
|
||||
<string name="dust_change">dust_change</string>
|
||||
<string name="create_account_underfunded">Target account is not created. Send more than base reserve to create</string>
|
||||
|
||||
<string name="send_title">Send</string>
|
||||
<string name="send_address_or_payid">Address or PayID</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue