From e85753af128c68d65e2be08b4abfdbd29eec30d1 Mon Sep 17 00:00:00 2001 From: mike-dydx Date: Thu, 25 Apr 2024 20:08:48 -0400 Subject: [PATCH] add isSlTpEnabled feature flag --- .../kotlin/exchange.dydx.abacus/state/manager/Enviroment.kt | 3 +++ .../exchange.dydx.abacus/tests/payloads/AbacusMockData.kt | 1 + 2 files changed, 4 insertions(+) diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/Enviroment.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/Enviroment.kt index 1fda228e5..8e5f52dff 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/Enviroment.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/Enviroment.kt @@ -105,6 +105,7 @@ data class EnvironmentFeatureFlags( val usePessimisticCollateralCheck: Boolean, val useOptimisticCollateralCheck: Boolean, val withdrawalSafetyEnabled: Boolean, + val isSlTpEnabled: Boolean ) { companion object { fun parse( @@ -115,12 +116,14 @@ data class EnvironmentFeatureFlags( val usePessimisticCollateralCheck = parser.asBool(data?.get("usePessimisticCollateralCheck")) ?: false val useOptimisticCollateralCheck = parser.asBool(data?.get("useOptimisticCollateralCheck")) ?: false val withdrawalSafetyEnabled = parser.asBool(data?.get("withdrawalSafetyEnabled")) ?: false + val isSlTpEnabled = parser.asBool(data?.get("isSlTpEnabled")) ?: false return EnvironmentFeatureFlags( reduceOnlySupported, usePessimisticCollateralCheck, useOptimisticCollateralCheck, withdrawalSafetyEnabled, + isSlTpEnabled ) } } diff --git a/src/commonTest/kotlin/exchange.dydx.abacus/tests/payloads/AbacusMockData.kt b/src/commonTest/kotlin/exchange.dydx.abacus/tests/payloads/AbacusMockData.kt index 4112aa04d..1a6cf879b 100644 --- a/src/commonTest/kotlin/exchange.dydx.abacus/tests/payloads/AbacusMockData.kt +++ b/src/commonTest/kotlin/exchange.dydx.abacus/tests/payloads/AbacusMockData.kt @@ -107,6 +107,7 @@ class AbacusMockData { usePessimisticCollateralCheck = false, useOptimisticCollateralCheck = true, withdrawalSafetyEnabled = true, + isSlTpEnabled = true, ), ) }