Updated on 2026-08-14
This commit is contained in:
parent
68c8980624
commit
4df89bb521
4 changed files with 10 additions and 0 deletions
|
|
@ -50,6 +50,8 @@ interface TangemExpressApi {
|
|||
@Query("rateType") rateType: String,
|
||||
@Query("toAddress") toAddress: String,
|
||||
@Query("requestId") requestId: String,
|
||||
@Query("refundAddress") refundAddress: String?, // for cex only
|
||||
@Query("refundExtraId") refundExtraId: String?, // for cex only
|
||||
): ApiResponse<ExchangeDataResponse>
|
||||
|
||||
@GET("exchange-status")
|
||||
|
|
|
|||
|
|
@ -256,6 +256,8 @@ internal class DefaultSwapRepository @Inject constructor(
|
|||
providerId: String,
|
||||
rateType: RateType,
|
||||
toAddress: String,
|
||||
refundAddress: String?, // for cex only
|
||||
refundExtraId: String?, // for cex only
|
||||
): Either<DataError, SwapDataModel> {
|
||||
return withContext(coroutineDispatcher.io) {
|
||||
try {
|
||||
|
|
@ -272,6 +274,8 @@ internal class DefaultSwapRepository @Inject constructor(
|
|||
rateType = rateType.name.lowercase(),
|
||||
toAddress = toAddress,
|
||||
requestId = requestId,
|
||||
refundAddress = refundAddress,
|
||||
refundExtraId = refundExtraId,
|
||||
).getOrThrow()
|
||||
if (dataSignatureVerifier.verifySignature(response.signature, response.txDetailsJson)) {
|
||||
val txDetails = parseTxDetails(response.txDetailsJson)
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@ interface SwapRepository {
|
|||
providerId: String,
|
||||
rateType: RateType,
|
||||
toAddress: String,
|
||||
refundAddress: String? = null, // for cex only
|
||||
refundExtraId: String? = null, // for cex only
|
||||
): Either<DataError, SwapDataModel>
|
||||
|
||||
fun getNativeTokenForNetwork(networkId: String): CryptoCurrency
|
||||
|
|
|
|||
|
|
@ -589,6 +589,8 @@ internal class SwapInteractorImpl @Inject constructor(
|
|||
providerId = swapProvider.providerId,
|
||||
rateType = RateType.FLOAT,
|
||||
toAddress = currencyToGet.value.networkAddress?.defaultAddress?.value ?: "",
|
||||
refundAddress = currencyToSend.value.networkAddress?.defaultAddress?.value,
|
||||
refundExtraId = null, // currently always null
|
||||
).getOrElse { return SwapTransactionState.ExpressError(it) }
|
||||
|
||||
val exchangeDataCex =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue