Updated on 2026-08-14

This commit is contained in:
Tangem 2022-05-24 16:41:47 +03:00
parent 7d2fc1d6ee
commit cfae358cd5
2 changed files with 8 additions and 2 deletions

View file

@ -17,7 +17,8 @@ class AddCustomTokenService(
networkId: String? = null,
active: Boolean? = null,
): Result<List<CoinsResponse.Coin>> {
val result = tangemTechService.coins(contractAddress, networkId, active)
val networksIds = selectNetworksForSearch(networkId)
val result = tangemTechService.coins(contractAddress, networksIds, active)
return when (result) {
is Result.Success -> {
var coinsList = mutableListOf<CoinsResponse.Coin>()
@ -40,4 +41,9 @@ class AddCustomTokenService(
is Result.Failure -> result
}
}
private fun selectNetworksForSearch(networkId: String?): String {
return networkId ?: supportedTokenNetworkIds.joinToString(",")
}
}

View file

@ -11,7 +11,7 @@ interface TangemTechApi {
@GET("coins")
suspend fun coins(
@Query("contractAddress") contractAddress: String? = null,
@Query("networkId") networkId: String? = null,
@Query("networkIds") networkId: String? = null,
@Query("active") active: Boolean? = null,
): CoinsResponse