Updated on 2026-08-14
This commit is contained in:
commit
03aff4ea33
5 changed files with 12 additions and 25 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.tap.features.wallet.redux.reducers
|
||||
|
||||
import com.tangem.blockchain.common.Wallet
|
||||
import com.tangem.blockchain.common.address.AddressType
|
||||
import com.tangem.domain.common.TapWorkarounds.isTestCard
|
||||
import com.tangem.domain.models.scan.CardDTO
|
||||
import com.tangem.tap.common.redux.AppState
|
||||
|
|
@ -151,7 +152,7 @@ fun Wallet.createAddressesData(): List<WalletDataModel.AddressData> {
|
|||
getShareUri(it.value),
|
||||
getExploreUrl(it.value),
|
||||
)
|
||||
if (it.type == blockchain.defaultAddressType()) {
|
||||
if (it.type == AddressType.Default) {
|
||||
listOfAddressData.add(0, addressData)
|
||||
} else {
|
||||
listOfAddressData.add(addressData)
|
||||
|
|
|
|||
|
|
@ -1,40 +1,24 @@
|
|||
package com.tangem.tap.features.wallet.ui
|
||||
|
||||
import android.view.View
|
||||
import com.tangem.blockchain.blockchains.bitcoin.BitcoinAddressType
|
||||
import com.tangem.blockchain.blockchains.cardano.CardanoAddressType
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.blockchain.common.address.AddressType
|
||||
import com.tangem.wallet.R
|
||||
|
||||
object MultipleAddressUiHelper {
|
||||
|
||||
fun typeToId(type: AddressType): Int {
|
||||
return when (type) {
|
||||
is BitcoinAddressType.Legacy -> R.id.chip_legacy
|
||||
is BitcoinAddressType.Segwit -> R.id.chip_default
|
||||
is CardanoAddressType.Byron -> R.id.chip_legacy
|
||||
is CardanoAddressType.Shelley -> R.id.chip_default
|
||||
else -> View.NO_ID
|
||||
AddressType.Legacy -> R.id.chip_legacy
|
||||
AddressType.Default -> R.id.chip_default
|
||||
}
|
||||
}
|
||||
|
||||
fun idToType(id: Int, blockchain: Blockchain?): AddressType? {
|
||||
return when (id) {
|
||||
R.id.chip_default -> {
|
||||
when (blockchain) {
|
||||
Blockchain.Bitcoin, Blockchain.BitcoinTestnet, Blockchain.Litecoin -> BitcoinAddressType.Segwit
|
||||
Blockchain.CardanoShelley -> CardanoAddressType.Shelley
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
R.id.chip_legacy -> {
|
||||
when (blockchain) {
|
||||
Blockchain.Bitcoin, Blockchain.BitcoinTestnet, Blockchain.Litecoin -> BitcoinAddressType.Legacy
|
||||
Blockchain.CardanoShelley -> CardanoAddressType.Byron
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
R.id.chip_default -> AddressType.Default
|
||||
R.id.chip_legacy -> AddressType.Legacy
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
BIN
buildSrc/build/libs/buildSrc.jar
Normal file
BIN
buildSrc/build/libs/buildSrc.jar
Normal file
Binary file not shown.
2
buildSrc/build/tmp/jar/MANIFEST.MF
Normal file
2
buildSrc/build/tmp/jar/MANIFEST.MF
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Manifest-Version: 1.0
|
||||
|
||||
|
|
@ -77,8 +77,8 @@ walletConnectWeb3 = "1.8.0"
|
|||
# endregion Other libraries
|
||||
|
||||
# region Tangem
|
||||
tangemBlockchainSdk = "develop-240"
|
||||
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
||||
#tangemBlockchainSdk = "develop-240"
|
||||
tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
||||
tangemCardSdk = "develop-266"
|
||||
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds
|
||||
# endregion Tangem
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue