Updated on 2026-08-14
This commit is contained in:
parent
f099f54a6b
commit
64c7ee6618
3 changed files with 8 additions and 0 deletions
|
|
@ -31,6 +31,9 @@ data class ExchangeDataResponse(
|
|||
)
|
||||
|
||||
data class TxDetails(
|
||||
@Json(name = "payoutAddress")
|
||||
val payoutAddress: String,
|
||||
|
||||
@Json(name = "requestId")
|
||||
val requestId: String,
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue