Updated on 2026-08-14
This commit is contained in:
parent
21418379dd
commit
3c48cdf744
5 changed files with 33 additions and 13 deletions
|
|
@ -78,9 +78,10 @@ data class ExchangeItemResponse(
|
|||
@Json(name = "createdAt")
|
||||
val createdAt: String,
|
||||
|
||||
/** Transaction last-update timestamp in ISO-8601 format */
|
||||
@Json(name = "updatedAt")
|
||||
val updatedAt: String,
|
||||
// todo txHistory backend does not send `updatedAt` yet — uncomment once it does.
|
||||
// /** Transaction last-update timestamp in ISO-8601 format */
|
||||
// @Json(name = "updatedAt")
|
||||
// val updatedAt: String,
|
||||
|
||||
/** Pay-in expiration timestamp in ISO-8601 format */
|
||||
@Json(name = "payTill")
|
||||
|
|
|
|||
|
|
@ -43,9 +43,10 @@ data class OnrampItemResponse(
|
|||
@Json(name = "createdAt")
|
||||
val createdAt: String,
|
||||
|
||||
/** Transaction last-update timestamp in ISO-8601 format */
|
||||
@Json(name = "updatedAt")
|
||||
val updatedAt: String,
|
||||
// todo txHistory backend does not send `updatedAt` yet — uncomment once it does.
|
||||
// /** Transaction last-update timestamp in ISO-8601 format */
|
||||
// @Json(name = "updatedAt")
|
||||
// val updatedAt: String,
|
||||
// endregion
|
||||
|
||||
// region fromAsset (fiat) info
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ import com.tangem.datasource.api.express.models.response.ExchangeItemResponse
|
|||
import com.tangem.datasource.api.onramp.models.response.OnrampItemResponse
|
||||
import com.tangem.datasource.local.txhistory.db.entity.express.ExpressExchangeEntity
|
||||
import com.tangem.datasource.local.txhistory.db.entity.express.ExpressOnrampEntity
|
||||
import org.joda.time.DateTime
|
||||
|
||||
// todo txHistory backend does not send `updatedAt` yet — drop this placeholder and map the real
|
||||
// ExchangeItemResponse.updatedAt / OnrampItemResponse.updatedAt once it does.
|
||||
private fun updatedAtPlaceholder(): String = DateTime.now().toString()
|
||||
|
||||
/**
|
||||
* Maps API history items into their persisted [androidx.room.Entity] representations.
|
||||
|
|
@ -30,7 +35,7 @@ fun ExchangeItemResponse.toEntity(): ExpressExchangeEntity? {
|
|||
refundNetwork = refundNetwork,
|
||||
refundContractAddress = refundContractAddress,
|
||||
createdAt = createdAt,
|
||||
updatedAt = updatedAt,
|
||||
updatedAt = updatedAtPlaceholder(),
|
||||
payTill = payTill,
|
||||
averageDuration = averageDuration,
|
||||
from = ExpressExchangeEntity.AssetEmbedded(
|
||||
|
|
@ -61,7 +66,7 @@ fun OnrampItemResponse.toEntity(): ExpressOnrampEntity {
|
|||
externalTxUrl = externalTxUrl,
|
||||
payoutHash = payoutHash,
|
||||
createdAt = createdAt,
|
||||
updatedAt = updatedAt,
|
||||
updatedAt = updatedAtPlaceholder(),
|
||||
fromCurrencyCode = fromCurrencyCode,
|
||||
fromAmount = fromAmount,
|
||||
fromPrecision = fromPrecision,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue