Updated on 2026-08-14

This commit is contained in:
Tangem 2023-12-22 12:53:20 +03:00
parent f099f54a6b
commit 64c7ee6618
3 changed files with 8 additions and 0 deletions

View file

@ -31,6 +31,9 @@ data class ExchangeDataResponse(
)
data class TxDetails(
@Json(name = "payoutAddress")
val payoutAddress: String,
@Json(name = "requestId")
val requestId: String,

View file

@ -292,6 +292,9 @@ internal class DefaultSwapRepository @Inject constructor(
if (txDetails.requestId != requestId) {
return@withContext DataError.InvalidRequestIdError().left()
}
if (toAddress != txDetails.payoutAddress) {
return@withContext DataError.InvalidPayoutAddressError().left()
}
expressDataConverter.convert(
ExchangeDataResponseWithTxDetails(
dataResponse = response,

View file

@ -36,6 +36,8 @@ sealed class DataError {
data class InvalidRequestIdError(override val code: Int = 991) : DataError()
data class InvalidPayoutAddressError(override val code: Int = 992) : DataError()
object UnknownError : DataError() {
override val code: Int = -1
}