Updated on 2026-08-14
This commit is contained in:
parent
c7941ee1f7
commit
2b327fd3e9
32 changed files with 853 additions and 0 deletions
|
|
@ -198,4 +198,18 @@ interface TangemTechApi {
|
|||
*/
|
||||
@POST("v1/transaction-events")
|
||||
suspend fun transactionEvents(@Body name: TransactionEventBody): ApiResponse<Unit>
|
||||
|
||||
// region Earn
|
||||
@GET("v1/earn/yield/markets")
|
||||
suspend fun getEarnTokens(
|
||||
@Query("isForEarn") isForEarn: Boolean?,
|
||||
@Query("page") page: String? = null,
|
||||
@Query("limit") limit: Int? = null,
|
||||
@Query("type") type: String? = null,
|
||||
@Query("network") network: String? = null,
|
||||
): ApiResponse<EarnListResponse>
|
||||
|
||||
@GET("v1/earn/networks")
|
||||
suspend fun getEarnNetworks(@Query("type") type: String): ApiResponse<EarnNetworkListResponse>
|
||||
// endregion
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class EarnNetworkListResponse(
|
||||
@Json(name = "items") val items: List<EarnNetworkResponse>,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class EarnNetworkResponse(
|
||||
@Json(name = "networkId") val networkId: String,
|
||||
)
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class EarnListResponse(
|
||||
@Json(name = "meta") val meta: MetaEarnListResponse,
|
||||
@Json(name = "items") val items: List<EarnResponse>,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class EarnResponse(
|
||||
@Json(name = "apy") val apy: String,
|
||||
@Json(name = "networkId") val networkId: String,
|
||||
@Json(name = "rewardType") val rewardType: String,
|
||||
@Json(name = "type") val type: String,
|
||||
@Json(name = "token") val token: EarnTokenResponse,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class EarnTokenResponse(
|
||||
@Json(name = "id") val id: String,
|
||||
@Json(name = "symbol") val symbol: String,
|
||||
@Json(name = "name") val name: String,
|
||||
@Json(name = "address") val address: String,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class MetaEarnListResponse(
|
||||
@Json(name = "page") val page: Int,
|
||||
@Json(name = "limit") val limit: Int,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue