Updated on 2026-08-14
This commit is contained in:
parent
6bc907fe3c
commit
034e28405b
2 changed files with 14 additions and 12 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 7f058ec409b4eaaf8688ecd4bf944ef8d58d3564
|
||||
Subproject commit 64ae04d2086e5a605dd4da3cba4af32a60d46c79
|
||||
|
|
@ -8,16 +8,11 @@ import com.tangem.tap.common.extensions.toFiatString
|
|||
import com.tangem.tap.common.extensions.toFormattedCurrencyString
|
||||
import com.tangem.tap.domain.getFirstToken
|
||||
import com.tangem.tap.domain.tokens.models.BlockchainNetwork
|
||||
import com.tangem.tap.features.wallet.models.WalletRent
|
||||
import com.tangem.tap.features.wallet.models.filterByToken
|
||||
import com.tangem.tap.features.wallet.models.getPendingTransactions
|
||||
import com.tangem.tap.features.wallet.models.removeUnknownTransactions
|
||||
import com.tangem.tap.features.wallet.models.toPendingTransactions
|
||||
import com.tangem.tap.features.wallet.redux.Currency
|
||||
import com.tangem.tap.features.wallet.redux.WalletAction
|
||||
import com.tangem.tap.features.wallet.redux.WalletData
|
||||
import com.tangem.tap.features.wallet.redux.WalletMainButton
|
||||
import com.tangem.tap.features.wallet.redux.WalletState
|
||||
import com.tangem.tap.features.wallet.redux.WalletStore
|
||||
import com.tangem.tap.features.wallet.redux.*
|
||||
import com.tangem.tap.features.wallet.ui.BalanceStatus
|
||||
import com.tangem.tap.features.wallet.ui.BalanceWidgetData
|
||||
import com.tangem.tap.features.wallet.ui.TokenData
|
||||
|
|
@ -109,10 +104,10 @@ class MultiWalletReducer {
|
|||
}
|
||||
is WalletAction.MultiWallet.TokenLoaded -> {
|
||||
val currency = Currency.fromBlockchainNetwork(action.blockchain, action.token)
|
||||
val wallet = state.getWalletManager(currency)?.wallet.guard {
|
||||
throw NullPointerException("MultiWallet.TokenLoaded: WalletManager must be no NULL")
|
||||
val walletManager = state.getWalletManager(currency).guard {
|
||||
throw NullPointerException("MultiWallet.TokenLoaded: WalletManager must be not NULL")
|
||||
}
|
||||
|
||||
val wallet = walletManager.wallet
|
||||
val pendingTransactions = wallet.getPendingTransactions()
|
||||
val tokenPendingTransactions = pendingTransactions.filterByToken(action.token)
|
||||
val tokenBalanceStatus = when {
|
||||
|
|
@ -142,7 +137,8 @@ class MultiWalletReducer {
|
|||
token = action.token,
|
||||
blockchain = action.blockchain.blockchain,
|
||||
derivationPath = action.blockchain.derivationPath
|
||||
)
|
||||
),
|
||||
walletRent = findWalletRent(state.getWalletStore(walletManager.wallet))
|
||||
)
|
||||
state.updateWalletData(newTokenWalletData)
|
||||
}
|
||||
|
|
@ -165,6 +161,12 @@ class MultiWalletReducer {
|
|||
is WalletAction.MultiWallet.SaveCurrencies -> state
|
||||
}
|
||||
}
|
||||
|
||||
private fun findWalletRent(walletStore: WalletStore?): WalletRent? {
|
||||
return walletStore?.walletsData?.firstOrNull {
|
||||
it.walletRent != null
|
||||
}?.walletRent
|
||||
}
|
||||
}
|
||||
|
||||
private fun addTokens(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue