diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/Environment.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/Environment.kt index a84f3d590..c6780ee58 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/Environment.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/Environment.kt @@ -552,6 +552,11 @@ data object StatsigConfig { var ff_enable_timestamp_nonce: Boolean = false } +@JsExport +data object AutoSweepConfig { + var disable_autosweep: Boolean = false +} + @JsExport class AppSettings( val ios: AppSetting?, diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/AccountSupervisor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/AccountSupervisor.kt index 1bb4c1f81..c294fbf84 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/AccountSupervisor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/AccountSupervisor.kt @@ -19,6 +19,7 @@ import exchange.dydx.abacus.state.app.adaptors.V4TransactionErrors import exchange.dydx.abacus.state.changes.Changes import exchange.dydx.abacus.state.changes.StateChanges import exchange.dydx.abacus.state.manager.ApiData +import exchange.dydx.abacus.state.manager.AutoSweepConfig import exchange.dydx.abacus.state.manager.BlockAndTime import exchange.dydx.abacus.state.manager.HistoricalTradingRewardsPeriod import exchange.dydx.abacus.state.manager.HumanReadableCancelAllOrdersPayload @@ -468,6 +469,9 @@ internal open class AccountSupervisor( nobleBalancesTimer = null return } + if (AutoSweepConfig.disable_autosweep) { + return + } val timer = helper.ioImplementations.timer ?: CoroutineTimer.instance nobleBalancesTimer = timer.schedule(0.0, nobleBalancePollingDuration) {