Updated on 2026-08-14

This commit is contained in:
Tangem 2023-04-07 20:39:24 +08:00
parent 069605e151
commit 36516c900f
234 changed files with 902 additions and 1618 deletions

View file

@ -8,9 +8,7 @@ import retrofit2.http.Path
interface MercuryoApi {
@GET("{apiVersion}/lib/currencies")
suspend fun currencies(
@Path("apiVersion") apiVersion: String,
): MercuryoCurrenciesResponse
suspend fun currencies(@Path("apiVersion") apiVersion: String): MercuryoCurrenciesResponse
}
data class MercuryoCurrenciesResponse(

View file

@ -16,11 +16,7 @@ data class MercuryoEnvironment(
private const val BASE_URL = "https://api.mercuryo.io/"
private const val API_VERSION = "v1.6"
fun prod(
widgetId: String,
secret: String,
apiVersion: String = API_VERSION,
): MercuryoEnvironment {
fun prod(widgetId: String, secret: String, apiVersion: String = API_VERSION): MercuryoEnvironment {
return MercuryoEnvironment(
baseUrl = BASE_URL,
apiVersion = apiVersion,

View file

@ -125,10 +125,7 @@ class MercuryoService(
return (address + environment.secret).calculateSha512().toHexString().lowercase()
}
override fun getSellCryptoReceiptUrl(
action: CurrencyExchangeManager.Action,
transactionId: String,
): String? = null
override fun getSellCryptoReceiptUrl(action: CurrencyExchangeManager.Action, transactionId: String): String? = null
private fun blockchainFromCurrencyName(currencyName: String): Blockchain? = when (currencyName) {
"BNB" -> Blockchain.BSC

View file

@ -8,14 +8,10 @@ import retrofit2.http.Query
interface MoonPayApi {
@GET(MOOONPAY_IP_ADDRESS_REQUEST_URL)
suspend fun getUserStatus(
@Query("apiKey") moonPayApiKey: String,
): MoonPayUserStatus
suspend fun getUserStatus(@Query("apiKey") moonPayApiKey: String): MoonPayUserStatus
@GET(MOOONPAY_CURRENCIES_REQUEST_URL)
suspend fun getCurrencies(
@Query("apiKey") moonPayApiKey: String,
): List<MoonPayCurrencies>
suspend fun getCurrencies(@Query("apiKey") moonPayApiKey: String): List<MoonPayCurrencies>
companion object {
const val MOOONPAY_BASE_URL = "https://api.moonpay.com/"

View file

@ -25,15 +25,13 @@ data class UtorgEnvironment(
private val STAGE_BASE_URL = Uri.parse("https://app-stage.utorg.pro")
private const val STAGE_VERSION = "v1"
fun prod(
authProvider: UtorgAuthProvider,
apiVersion: String = PROD_VERSION,
): UtorgEnvironment = UtorgEnvironment(
baseUri = PROD_BASE_URL,
sidValue = authProvider.sidValue,
apiVersion = apiVersion,
utorgApi = createApi(PROD_BASE_URL, authProvider, false),
)
fun prod(authProvider: UtorgAuthProvider, apiVersion: String = PROD_VERSION): UtorgEnvironment =
UtorgEnvironment(
baseUri = PROD_BASE_URL,
sidValue = authProvider.sidValue,
apiVersion = apiVersion,
utorgApi = createApi(PROD_BASE_URL, authProvider, false),
)
fun stage(
authProvider: UtorgAuthProvider,

View file

@ -12,15 +12,10 @@ import retrofit2.http.Path
interface UtorgApi {
@POST("api/merchant/{apiVersion}/settings/currency")
suspend fun getCurrency(
@Path("apiVersion") apiVersion: String,
): UtorgCurrencyResponse
suspend fun getCurrency(@Path("apiVersion") apiVersion: String): UtorgCurrencyResponse
@POST("api/merchant/{apiVersion}/settings/successUrl")
suspend fun setSuccessUrl(
@Path("apiVersion") apiVersion: String,
@Body request: RequestSuccessUrl,
)
suspend fun setSuccessUrl(@Path("apiVersion") apiVersion: String, @Body request: RequestSuccessUrl)
}
data class RequestSuccessUrl(

View file

@ -22,8 +22,7 @@ data class VerifyPayIdResponse(
val addresses: List<PayIdAddress> = mutableListOf(),
val payId: String? = null,
) {
fun getAddressDetails(): PayIdAddressDetails? =
if (addresses.isNotEmpty()) addresses[0].addressDetails else null
fun getAddressDetails(): PayIdAddressDetails? = if (addresses.isNotEmpty()) addresses[0].addressDetails else null
}
@JsonClass(generateAdapter = true)