Updated on 2026-08-14
This commit is contained in:
parent
32de92b496
commit
5fafcc65d4
3 changed files with 5 additions and 6 deletions
|
|
@ -13,16 +13,17 @@ internal class AddressValidator {
|
|||
suspend fun validateAddress(walletManager: WalletManager, address: String): AddressVerifyAction.Error? {
|
||||
val blockchain = walletManager.wallet.blockchain
|
||||
val wallet = walletManager.wallet
|
||||
val regex = Regex("^[a-z0-9-_]+$")
|
||||
return if ((blockchain == Blockchain.Near || blockchain == Blockchain.NearTestnet) &&
|
||||
address.length != NEAR_IMPLICIT_ADDRESS_LENGTH
|
||||
address.length != NEAR_IMPLICIT_ADDRESS_LENGTH && regex.matches(address)
|
||||
) {
|
||||
validateNearAddress(walletManager, address)
|
||||
validateNearNamedAddress(walletManager, address)
|
||||
} else {
|
||||
validateAddress(wallet, address)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun validateNearAddress(
|
||||
private suspend fun validateNearNamedAddress(
|
||||
walletManager: WalletManager,
|
||||
address: String,
|
||||
): AddressVerifyAction.Error? {
|
||||
|
|
|
|||
|
|
@ -221,6 +221,4 @@ private val excludedBlockchains = listOf(
|
|||
Blockchain.Ducatus,
|
||||
Blockchain.Telos,
|
||||
Blockchain.TelosTestnet,
|
||||
Blockchain.Near,
|
||||
Blockchain.NearTestnet,
|
||||
)
|
||||
|
|
@ -81,7 +81,7 @@ spr-client = "3.6.2"
|
|||
# endregion Other libraries
|
||||
|
||||
# region Tangem
|
||||
tangemBlockchainSdk = "release-app_5.0-374"
|
||||
tangemBlockchainSdk = "release-app_5.0-376"
|
||||
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
||||
tangemCardSdk = "release-app_5.0-309"
|
||||
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue