Updated on 2026-08-14

This commit is contained in:
Tangem 2024-04-24 15:18:48 +08:00
parent a3f2c421bf
commit d174ada664
20 changed files with 71 additions and 189 deletions

View file

@ -1,6 +1,5 @@
package com.tangem.lib.crypto
import com.tangem.lib.crypto.models.Currency
import com.tangem.lib.crypto.models.ProxyAmount
/**
@ -8,28 +7,11 @@ import com.tangem.lib.crypto.models.ProxyAmount
*/
interface UserWalletManager {
/**
* Returns all user tokens (merged from local and backend)
*/
@Throws(IllegalStateException::class)
suspend fun getUserTokens(networkId: String, derivationPath: String?, isExcludeCustom: Boolean): List<Currency>
@Throws(IllegalStateException::class)
fun getNativeTokenForNetwork(networkId: String): Currency
/**
* Returns user walletId or empty string
*/
fun getWalletId(): String
/**
* Checks that token added to user wallet
*
* @param currency to receive referral payments
*/
@Throws(IllegalStateException::class)
suspend fun isTokenAdded(currency: Currency, derivationPath: String?): Boolean
suspend fun hideAllTokens()
/**
@ -41,21 +23,6 @@ interface UserWalletManager {
@Throws(IllegalStateException::class)
suspend fun getWalletAddress(networkId: String, derivationPath: String?): String
/**
* Return balances from wallet found by networkId
*
* @param networkId
* @param extraTokens tokens you want to check balance that not exists in wallet
* @param derivationPath if null uses default
* @return map of <Symbol, [ProxyAmount]>
*/
@Throws(IllegalStateException::class)
suspend fun getCurrentWalletTokensBalance(
networkId: String,
extraTokens: List<Currency>,
derivationPath: String?,
): Map<String, ProxyAmount>
@Throws(IllegalStateException::class)
suspend fun getNativeTokenBalance(networkId: String, derivationPath: String?): ProxyAmount?