Updated on 2026-08-14

This commit is contained in:
Tangem 2025-05-12 18:28:46 +03:00
commit 1510b5e454
10 changed files with 189 additions and 32 deletions

View file

@ -43,7 +43,7 @@ internal class DefaultNFTPersistenceStore(
override suspend fun saveSalePrice(assetId: NFTAsset.Identifier, salePrice: NFTAsset.SalePrice) {
pricesPersistenceStore.updateData {
it.toMutableList().plus(NFTPriceId(assetId = assetId, price = salePrice))
it.toMutableList() + NFTPriceId(assetId = assetId, price = salePrice)
}
}

View file

@ -5,14 +5,16 @@ import com.tangem.domain.nft.models.NFTSalePrice
import com.tangem.utils.converter.TwoWayConverter
import com.tangem.blockchain.nft.models.NFTAsset.SalePrice as SDKSalePrice
internal class NFTSdkAssetSalePriceConverter(
class NFTSdkAssetSalePriceConverter(
private val assetId: NFTAsset.Identifier,
) : TwoWayConverter<SDKSalePrice, NFTSalePrice.Value> {
override fun convert(value: SDKSalePrice): NFTSalePrice.Value {
return NFTSalePrice.Value(
assetId = assetId,
fiatValue = null,
value = value.value,
symbol = value.symbol,
symbol = value.symbol.orEmpty(),
decimals = value.decimals ?: 0,
)
}
@ -20,6 +22,7 @@ internal class NFTSdkAssetSalePriceConverter(
return SDKSalePrice(
symbol = value.symbol,
value = value.value,
decimals = value.decimals,
)
}
}

View file

@ -0,0 +1,8 @@
package com.tangem.datasource.local.nft.custom
import com.tangem.blockchain.nft.models.NFTAsset
data class NFTPriceKeyValue(
val key: NFTAsset.Identifier,
val value: NFTAsset.SalePrice,
)