diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/functional/vault/VaultDepositWithdrawForm.kt b/src/commonMain/kotlin/exchange.dydx.abacus/functional/vault/VaultDepositWithdrawForm.kt index 80cd3bbc7..d3e342e09 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/functional/vault/VaultDepositWithdrawForm.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/functional/vault/VaultDepositWithdrawForm.kt @@ -1,7 +1,9 @@ package exchange.dydx.abacus.functional.vault import exchange.dydx.abacus.output.input.ErrorType +import exchange.dydx.abacus.protocols.asTypedObject import exchange.dydx.abacus.utils.IList +import exchange.dydx.abacus.utils.Parser import kollections.toIList import kotlinx.serialization.Serializable import kotlin.js.JsExport @@ -101,11 +103,16 @@ data class VaultFormValidationResult( @JsExport object VaultDepositWithdrawFormValidator { + private val parser = Parser() private const val SLIPPAGE_PERCENT_WARN = 0.01 private const val SLIPPAGE_PERCENT_ACK = 0.04 private const val SLIPPAGE_TOLERANCE = 0.01 + fun getVaultDepositWithdrawSlippageResponse(apiResponse: String): VaultDepositWithdrawSlippageResponse? { + return parser.asTypedObject(apiResponse) + } + fun validateVaultForm( formData: VaultFormData, accountData: VaultFormAccountData?,