Updated on 2026-08-14

This commit is contained in:
Tangem 2023-04-11 12:42:05 +03:00
parent abec0f1ee8
commit a2b3c22e53
17 changed files with 85 additions and 224 deletions

View file

@ -12,9 +12,8 @@ import com.tangem.tap.common.TestActions
import com.tangem.tap.domain.TapError
import com.tangem.tap.domain.extensions.amountToCreateAccount
import com.tangem.tap.domain.getFirstToken
import com.tangem.tap.domain.model.WalletDataModel
import com.tangem.tap.features.demo.isDemoCard
import com.tangem.tap.features.wallet.models.Currency
import com.tangem.tap.features.wallet.redux.AddressData
import com.tangem.tap.features.wallet.redux.reducers.createAddressesData
import com.tangem.tap.network.exchangeServices.CurrencyExchangeManager
import com.tangem.tap.proxy.redux.DaggerGraphState
@ -81,7 +80,7 @@ fun WalletManager.getTopUpUrl(): String? {
)
}
fun WalletManager?.getAddressData(): AddressData? {
fun WalletManager?.getAddressData(): WalletDataModel.AddressData? {
val wallet = this?.wallet ?: return null
val addressDataList = wallet.createAddressesData()
@ -100,11 +99,6 @@ fun <T> WalletManager.Companion.stub(): T {
} as T
}
fun Wallet.getTxHistory(currency: Currency): List<TransactionData> {
return (currency as? Currency.Token)?.let { this.getTokenTxHistory(it.token) }
?: getBlockchainTxHistory()
}
fun Wallet.getBlockchainTxHistory(): List<TransactionData> {
return historyTransactions.filter {
it.contractAddress.isNullOrEmpty()