Updated on 2026-08-14

This commit is contained in:
Tangem 2025-04-15 19:22:37 +05:00
parent fac21a0c25
commit c6da35bb66
3 changed files with 6 additions and 20 deletions

View file

@ -6,7 +6,6 @@ import arrow.core.raise.either
import com.tangem.domain.tokens.model.Network
import com.tangem.domain.txhistory.models.TxStatusError
import com.tangem.domain.txhistory.repository.TxHistoryRepository
import com.tangem.domain.wallets.models.UserWalletId
class GetExplorerTransactionUrlUseCase(
private val repository: TxHistoryRepository,
@ -23,17 +22,4 @@ class GetExplorerTransactionUrlUseCase(
)
}
}
suspend operator fun invoke(userWalletId: UserWalletId, network: Network): Either<TxStatusError, String> {
return either {
catch(
block = {
repository.getTxExploreUrl(userWalletId, network).ifEmpty {
raise(TxStatusError.EmptyUrlError)
}
},
catch = { raise(TxStatusError.DataError(it)) },
)
}
}
}

View file

@ -395,10 +395,10 @@ internal class SendConfirmModel @Inject constructor(
}
}
private suspend fun updateTransactionStatus(txData: TransactionData.Uncompiled) {
private fun updateTransactionStatus(txData: TransactionData.Uncompiled) {
val txUrl = getExplorerTransactionUrlUseCase(
userWalletId = userWallet.walletId,
network = cryptoCurrency.network,
txHash = txData.hash.orEmpty(),
networkId = cryptoCurrency.network.id,
).getOrElse { "" }
_uiState.update(SendConfirmSentStateTransformer(txData, txUrl))
}

View file

@ -995,10 +995,10 @@ internal class SendModel @Inject constructor(
}
}
private suspend fun updateTransactionStatus(txData: TransactionData.Uncompiled) {
private fun updateTransactionStatus(txData: TransactionData.Uncompiled) {
val txUrl = getExplorerTransactionUrlUseCase(
userWalletId = userWalletId,
network = cryptoCurrency.network,
txHash = txData.hash.orEmpty(),
networkId = cryptoCurrency.network.id,
).getOrElse { "" }
uiState.value = stateFactory.getTransactionSendState(txData, txUrl)
}