Updated on 2026-08-14
This commit is contained in:
parent
30c34a9e14
commit
01e5b6d95a
15 changed files with 322 additions and 124 deletions
|
|
@ -2,6 +2,7 @@ package com.tangem.feature.swap.converters
|
|||
|
||||
import com.tangem.datasource.api.oneinch.models.QuoteResponse
|
||||
import com.tangem.feature.swap.domain.models.data.SwapState.QuoteModel
|
||||
import com.tangem.feature.swap.domain.models.data.createFromAmountWithOffset
|
||||
import com.tangem.utils.converter.Converter
|
||||
import javax.inject.Inject
|
||||
|
||||
|
|
@ -9,8 +10,10 @@ class QuotesConverter @Inject constructor() : Converter<QuoteResponse, QuoteMode
|
|||
|
||||
override fun convert(value: QuoteResponse): QuoteModel {
|
||||
return QuoteModel(
|
||||
fromTokenAmount = value.fromTokenAmount,
|
||||
toTokenAmount = value.toTokenAmount,
|
||||
fromTokenAmount = createFromAmountWithOffset(value.fromTokenAmount, value.fromToken.decimals),
|
||||
toTokenAmount = createFromAmountWithOffset(value.toTokenAmount, value.toToken.decimals),
|
||||
fromTokenAddress = value.fromToken.address,
|
||||
toTokenAddress = value.toToken.address,
|
||||
estimatedGas = value.estimatedGas,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue