Updated on 2026-08-14
This commit is contained in:
parent
91200c4973
commit
0693835f07
9 changed files with 99 additions and 13 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.domain.express.models
|
||||
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
|
|
@ -39,6 +40,13 @@ data class ExpressAsset(
|
|||
operator fun invoke(networkId: String, contractAddress: String?): ID {
|
||||
return ID(networkId = networkId, contractAddress = contractAddress ?: EMPTY_CONTRACT_ADDRESS_VALUE)
|
||||
}
|
||||
|
||||
operator fun invoke(cryptoCurrency: CryptoCurrency): ID {
|
||||
return ID(
|
||||
networkId = cryptoCurrency.network.rawId,
|
||||
contractAddress = (cryptoCurrency as? CryptoCurrency.Token)?.contractAddress,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,4 +35,6 @@ interface ExpressServiceFetcher {
|
|||
* @return A flow emitting Lce states containing either a list of Express assets or an error.
|
||||
*/
|
||||
fun getInitializationStatus(userWalletId: UserWalletId): Flow<Lce<Throwable, List<ExpressAsset>>>
|
||||
|
||||
suspend fun getOrFetch(userWalletId: UserWalletId, assetId: ExpressAsset.ID): Either<Throwable, ExpressAsset>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue