Updated on 2026-08-14

This commit is contained in:
Tangem 2024-04-18 21:17:41 +01:00
parent c58110a78b
commit 463e5b1d52
4 changed files with 8 additions and 2 deletions

View file

@ -42,6 +42,7 @@ interface TangemExpressApi {
@Query("fromContractAddress") fromContractAddress: String,
@Query("fromNetwork") fromNetwork: String,
@Query("toContractAddress") toContractAddress: String,
@Query("fromAddress") fromAddress: String,
@Query("toNetwork") toNetwork: String,
@Query("fromAmount") fromAmount: String,
@Query("fromDecimals") fromDecimals: Int,

View file

@ -249,6 +249,7 @@ internal class DefaultSwapRepository @Inject constructor(
fromContractAddress: String,
fromNetwork: String,
toContractAddress: String,
fromAddress: String,
toNetwork: String,
fromAmount: String,
fromDecimals: Int,
@ -266,6 +267,7 @@ internal class DefaultSwapRepository @Inject constructor(
fromContractAddress = fromContractAddress,
fromNetwork = fromNetwork,
toContractAddress = toContractAddress,
fromAddress = fromAddress,
toNetwork = toNetwork,
fromAmount = fromAmount,
fromDecimals = fromDecimals,

View file

@ -58,6 +58,7 @@ interface SwapRepository {
fromContractAddress: String,
fromNetwork: String,
toContractAddress: String,
fromAddress: String,
toNetwork: String,
fromAmount: String,
fromDecimals: Int,

View file

@ -583,13 +583,14 @@ internal class SwapInteractorImpl @Inject constructor(
fromContractAddress = currencyToSend.currency.getContractAddress(),
fromNetwork = currencyToSend.currency.network.backendId,
toContractAddress = currencyToGet.currency.getContractAddress(),
fromAddress = currencyToSend.value.networkAddress?.defaultAddress?.value.orEmpty(),
toNetwork = currencyToGet.currency.network.backendId,
fromAmount = amount.toStringWithRightOffset(),
fromDecimals = amount.decimals,
toDecimals = currencyToGet.currency.decimals,
providerId = swapProvider.providerId,
rateType = RateType.FLOAT,
toAddress = currencyToGet.value.networkAddress?.defaultAddress?.value ?: "",
toAddress = currencyToGet.value.networkAddress?.defaultAddress?.value.orEmpty(),
refundAddress = currencyToSend.value.networkAddress?.defaultAddress?.value,
refundExtraId = null, // currently always null
).getOrElse { return SwapTransactionState.ExpressError(it) }
@ -1048,13 +1049,14 @@ internal class SwapInteractorImpl @Inject constructor(
fromContractAddress = fromToken.currency.getContractAddress(),
fromNetwork = fromToken.currency.network.backendId,
toContractAddress = toToken.currency.getContractAddress(),
fromAddress = fromToken.value.networkAddress?.defaultAddress?.value.orEmpty(),
toNetwork = toToken.currency.network.backendId,
fromAmount = amount.toStringWithRightOffset(),
fromDecimals = amount.decimals,
toDecimals = toToken.currency.decimals,
providerId = provider.providerId,
rateType = RateType.FLOAT,
toAddress = toToken.value.networkAddress?.defaultAddress?.value ?: "",
toAddress = toToken.value.networkAddress?.defaultAddress?.value.orEmpty(),
).fold(
ifRight = { swapData ->
val feeData = transactionManager.getFee(