Updated on 2026-08-14

This commit is contained in:
Tangem 2023-10-19 15:45:54 +03:00
parent 84022714e7
commit bd80fa068a
3 changed files with 6 additions and 5 deletions

View file

@ -10,6 +10,7 @@ import com.tangem.tap.features.send.redux.*
import com.tangem.tap.features.send.redux.AddressVerifyAction.AddressVerification.SetAddressError
import com.tangem.tap.features.send.redux.AddressVerifyAction.AddressVerification.SetWalletAddress
import com.tangem.tap.features.send.redux.AddressVerifyAction.Error
import com.tangem.tap.mainScope
import com.tangem.tap.scope
import kotlinx.coroutines.*
import org.rekotlin.Action
@ -20,7 +21,7 @@ import org.rekotlin.DispatchFunction
*/
internal class AddressMiddleware {
val addressValidator = AddressValidator()
private val addressValidator = AddressValidator()
fun handle(action: AddressActionUi, appState: AppState?, dispatch: (Action) -> Unit) {
when (action) {
@ -81,7 +82,7 @@ internal class AddressMiddleware {
) {
val wallet = walletManager.wallet
scope.launch(Dispatchers.Main) {
mainScope.launch {
val failReason = withContext(Dispatchers.IO) {
addressValidator.validateAddress(walletManager, address)
}

View file

@ -8,7 +8,7 @@ import com.tangem.blockchain.common.WalletManager
import com.tangem.blockchain.extensions.Result
import com.tangem.tap.features.send.redux.AddressVerifyAction
class AddressValidator {
internal class AddressValidator {
suspend fun validateAddress(walletManager: WalletManager, address: String): AddressVerifyAction.Error? {
val blockchain = walletManager.wallet.blockchain
@ -47,6 +47,6 @@ class AddressValidator {
}
companion object {
const val NEAR_IMPLICIT_ADDRESS_LENGTH = 64
private const val NEAR_IMPLICIT_ADDRESS_LENGTH = 64
}
}

View file

@ -82,7 +82,7 @@ okHttp-prettyLogging = "3.1.0"
# endregion Other libraries
# region Tangem
tangemBlockchainSdk = "release-app_5.0-361"
tangemBlockchainSdk = "release-app_5.0-362"
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
tangemCardSdk = "release-app_5.0-303"
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds