Updated on 2026-08-14
This commit is contained in:
parent
7d2fc1d6ee
commit
cfae358cd5
2 changed files with 8 additions and 2 deletions
|
|
@ -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(",")
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue