Updated on 2026-08-14

This commit is contained in:
Tangem 2025-05-16 12:52:27 +05:00
parent 7be6ce9dba
commit 0cd80d7c50
13 changed files with 109 additions and 5 deletions

View file

@ -47,5 +47,10 @@ internal class DefaultNFTPersistenceStore(
}
}
override suspend fun clear() {
collectionsPersistenceStore.updateData { emptyList() }
pricesPersistenceStore.updateData { emptyList() }
}
private fun NFTCollection.getAsset(assetId: NFTAsset.Identifier) = assets.firstOrNull { it.identifier == assetId }
}

View file

@ -71,6 +71,16 @@ internal class DefaultNFTRuntimeStore(
}
}
override suspend fun clear() {
collectionsRuntimeStore.store(
NFTCollections(
network = network,
content = NFTCollections.Content.Collections(null, StatusSource.ONLY_CACHE),
),
)
pricesRuntimeStore.store(emptyMap())
}
private fun NFTCollections.getCollection(collectionId: NFTCollection.Identifier): NFTCollection? =
(content as? NFTCollections.Content.Collections)
?.collections

View file

@ -18,4 +18,6 @@ interface NFTPersistenceStore {
suspend fun saveCollections(collections: List<NFTCollection>)
suspend fun saveSalePrice(assetId: NFTAsset.Identifier, salePrice: NFTAsset.SalePrice)
suspend fun clear()
}

View file

@ -23,4 +23,6 @@ interface NFTRuntimeStore {
suspend fun saveCollections(collections: NFTCollections)
suspend fun saveSalePrice(salePrice: NFTSalePrice)
suspend fun clear()
}