Updated on 2026-08-14

This commit is contained in:
Tangem 2023-02-03 21:19:21 +03:00
parent 9072a01917
commit 4559200dc4

View file

@ -21,6 +21,7 @@ import com.tangem.tap.domain.getFirstToken
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.coroutineScope
import timber.log.Timber
import java.math.BigDecimal
import java.math.BigInteger
import java.util.concurrent.atomic.AtomicLong
@ -149,6 +150,12 @@ class GnosisRegistrator(
}
suspend fun transferFrom(amountToClaim: BigDecimal, signer: TransactionSigner): Result<Unit> {
Timber.e(Throwable("transferFrom"))
if (walletManager.txCount == -1L) {
walletManager.safeUpdate().successOr {
return Result.Failure(BlockchainSdkError.WrappedThrowable(it.error))
}
}
val amount = Amount(token, amountToClaim)
val feeAmount = walletManager.getFeeToTransferFrom(amount, addressTreasureSafe)
.extractFeeAmount().successOr { return it }