Updated on 2026-08-14

This commit is contained in:
Tangem 2026-02-06 12:40:48 +03:00
commit 870c3fa9d3
291 changed files with 4985 additions and 5870 deletions

View file

@ -205,4 +205,18 @@ interface TangemTechApi {
*/
@POST("v1/transaction-events")
suspend fun transactionEvents(@Body name: TransactionEventBody): ApiResponse<Unit>
// region Earn
@GET("v1/earn/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
}

View file

@ -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,
)

View file

@ -0,0 +1,34 @@
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,
@Json(name = "decimalCount") val decimalCount: Int? = null,
)
@JsonClass(generateAdapter = true)
data class MetaEarnListResponse(
@Json(name = "page") val page: Int,
@Json(name = "limit") val limit: Int,
)

View file

@ -30,6 +30,10 @@ internal object BlockchainSDKConfigConverter : Converter<EnvironmentConfigModel,
apiKey = value.quiknodePlasmaApiKey,
subdomain = value.quiknodePlasmaSubdomain,
),
quickNodeMonadCredentials = QuickNodeCredentials(
apiKey = value.quiknodeMonadApiKey,
subdomain = value.quiknodeMonadSubdomain,
),
infuraProjectId = value.infuraProjectId,
tronGridApiKey = value.tronGridApiKey,
nowNodeCredentials = NowNodeCredentials(value.nowNodesApiKey),
@ -109,6 +113,8 @@ internal object BlockchainSDKConfigConverter : Converter<EnvironmentConfigModel,
sui = GetBlockAccessToken(jsonRpc = accessTokens.sui?.jsonRPC),
telos = GetBlockAccessToken(jsonRpc = accessTokens.telos?.jsonRPC),
tezos = GetBlockAccessToken(rest = accessTokens.tezos?.rest),
monad = GetBlockAccessToken(rest = accessTokens.monad?.rest),
stellar = GetBlockAccessToken(rest = accessTokens.stellar?.rest),
)
}
}

View file

@ -18,6 +18,8 @@ class EnvironmentConfigModel(
@Json(name = "bscQuiknodeApiKey") val bscQuiknodeApiKey: String,
@Json(name = "quiknodePlasmaSubdomain") val quiknodePlasmaSubdomain: String,
@Json(name = "quiknodePlasmaApiKey") val quiknodePlasmaApiKey: String,
@Json(name = "quiknodeMonadSubdomain") val quiknodeMonadSubdomain: String,
@Json(name = "quiknodeMonadApiKey") val quiknodeMonadApiKey: String,
@Json(name = "nowNodesApiKey") val nowNodesApiKey: String,
@Json(name = "getBlockAccessTokens") val getBlockAccessTokens: GetBlockAccessTokens?,
@Json(name = "tonCenterApiKey") val tonCenterKeys: TonCenterKeys,
@ -96,6 +98,8 @@ data class GetBlockAccessTokens(
@Json(name = "sui") val sui: GetBlockToken?,
@Json(name = "telos") val telos: GetBlockToken?,
@Json(name = "tezos") val tezos: GetBlockToken?,
@Json(name = "monad") val monad: GetBlockToken?,
@Json(name = "stellar") val stellar: GetBlockToken?,
)
@JsonClass(generateAdapter = true)