dexbot 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analysis/chart_utils.d.ts +11 -9
- package/dist/analysis/chart_utils.d.ts.map +1 -1
- package/dist/analysis/chart_utils.js +21 -16
- package/dist/analysis/chart_utils.js.map +1 -1
- package/dist/analysis/math_utils.d.ts +4 -13
- package/dist/analysis/math_utils.d.ts.map +1 -1
- package/dist/analysis/math_utils.js +16 -18
- package/dist/analysis/math_utils.js.map +1 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts +3 -7
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +1 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +38 -34
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +1 -1
- package/dist/analysis/trend_detection/hurst_analyzer.d.ts +1 -4
- package/dist/analysis/trend_detection/hurst_analyzer.d.ts.map +1 -1
- package/dist/analysis/trend_detection/hurst_analyzer.js +10 -7
- package/dist/analysis/trend_detection/hurst_analyzer.js.map +1 -1
- package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts +6 -6
- package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts.map +1 -1
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js +23 -15
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js.map +1 -1
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts +12 -13
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts.map +1 -1
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js +16 -16
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js.map +1 -1
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts +1 -4
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts.map +1 -1
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js +10 -7
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js.map +1 -1
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +6 -13
- package/dist/bot.js.map +1 -1
- package/dist/credential-daemon.d.ts.map +1 -1
- package/dist/credential-daemon.js +74 -35
- package/dist/credential-daemon.js.map +1 -1
- package/dist/dexbot.d.ts.map +1 -1
- package/dist/dexbot.js +16 -15
- package/dist/dexbot.js.map +1 -1
- package/dist/market_adapter/ama_signal_runner.d.ts +1 -1
- package/dist/market_adapter/ama_signal_runner.d.ts.map +1 -1
- package/dist/market_adapter/ama_signal_runner.js +8 -20
- package/dist/market_adapter/ama_signal_runner.js.map +1 -1
- package/dist/market_adapter/candle_utils.d.ts +2 -10
- package/dist/market_adapter/candle_utils.d.ts.map +1 -1
- package/dist/market_adapter/candle_utils.js +7 -8
- package/dist/market_adapter/candle_utils.js.map +1 -1
- package/dist/market_adapter/core/asymmetric_bounds.d.ts +12 -7
- package/dist/market_adapter/core/asymmetric_bounds.d.ts.map +1 -1
- package/dist/market_adapter/core/asymmetric_bounds.js +4 -5
- package/dist/market_adapter/core/asymmetric_bounds.js.map +1 -1
- package/dist/market_adapter/core/config_normalizers.d.ts +4 -9
- package/dist/market_adapter/core/config_normalizers.d.ts.map +1 -1
- package/dist/market_adapter/core/config_normalizers.js +9 -9
- package/dist/market_adapter/core/config_normalizers.js.map +1 -1
- package/dist/market_adapter/core/kibana_candles.d.ts +16 -20
- package/dist/market_adapter/core/kibana_candles.d.ts.map +1 -1
- package/dist/market_adapter/core/kibana_candles.js +16 -15
- package/dist/market_adapter/core/kibana_candles.js.map +1 -1
- package/dist/market_adapter/core/kibana_client.d.ts +8 -11
- package/dist/market_adapter/core/kibana_client.d.ts.map +1 -1
- package/dist/market_adapter/core/kibana_client.js +13 -11
- package/dist/market_adapter/core/kibana_client.js.map +1 -1
- package/dist/market_adapter/core/kibana_market_candles.d.ts +5 -12
- package/dist/market_adapter/core/kibana_market_candles.d.ts.map +1 -1
- package/dist/market_adapter/core/kibana_market_candles.js +12 -21
- package/dist/market_adapter/core/kibana_market_candles.js.map +1 -1
- package/dist/market_adapter/core/market_adapter_service.d.ts +75 -53
- package/dist/market_adapter/core/market_adapter_service.d.ts.map +1 -1
- package/dist/market_adapter/core/market_adapter_service.js +102 -98
- package/dist/market_adapter/core/market_adapter_service.js.map +1 -1
- package/dist/market_adapter/core/strategies/ama.d.ts +21 -1
- package/dist/market_adapter/core/strategies/ama.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/ama.js +10 -10
- package/dist/market_adapter/core/strategies/ama.js.map +1 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.d.ts +7 -11
- package/dist/market_adapter/core/strategies/ama_slope_model.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.js +23 -30
- package/dist/market_adapter/core/strategies/ama_slope_model.js.map +1 -1
- package/dist/market_adapter/core/strategies/atr/calculator.d.ts +5 -4
- package/dist/market_adapter/core/strategies/atr/calculator.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/atr/calculator.js +5 -3
- package/dist/market_adapter/core/strategies/atr/calculator.js.map +1 -1
- package/dist/market_adapter/core/strategies/collateral_manager.d.ts +4 -7
- package/dist/market_adapter/core/strategies/collateral_manager.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/collateral_manager.js +5 -4
- package/dist/market_adapter/core/strategies/collateral_manager.js.map +1 -1
- package/dist/market_adapter/core/strategies/regime_gate.d.ts +11 -19
- package/dist/market_adapter/core/strategies/regime_gate.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/regime_gate.js +22 -22
- package/dist/market_adapter/core/strategies/regime_gate.js.map +1 -1
- package/dist/market_adapter/index.d.ts +24 -2
- package/dist/market_adapter/index.d.ts.map +1 -1
- package/dist/market_adapter/index.js +82 -56
- package/dist/market_adapter/index.js.map +1 -1
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js +26 -37
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js.map +1 -1
- package/dist/market_adapter/inputs/fetch_lp_data.d.ts +4 -12
- package/dist/market_adapter/inputs/fetch_lp_data.d.ts.map +1 -1
- package/dist/market_adapter/inputs/fetch_lp_data.js +100 -66
- package/dist/market_adapter/inputs/fetch_lp_data.js.map +1 -1
- package/dist/market_adapter/inputs/kibana_source.d.ts +4 -9
- package/dist/market_adapter/inputs/kibana_source.d.ts.map +1 -1
- package/dist/market_adapter/inputs/kibana_source.js +17 -18
- package/dist/market_adapter/inputs/kibana_source.js.map +1 -1
- package/dist/market_adapter/interval_utils.d.ts +1 -4
- package/dist/market_adapter/interval_utils.d.ts.map +1 -1
- package/dist/market_adapter/interval_utils.js +2 -3
- package/dist/market_adapter/interval_utils.js.map +1 -1
- package/dist/market_adapter/log_format.d.ts +1 -9
- package/dist/market_adapter/log_format.d.ts.map +1 -1
- package/dist/market_adapter/log_format.js +7 -8
- package/dist/market_adapter/log_format.js.map +1 -1
- package/dist/market_adapter/lp_chart_core.d.ts +1 -4
- package/dist/market_adapter/lp_chart_core.d.ts.map +1 -1
- package/dist/market_adapter/lp_chart_core.js +22 -20
- package/dist/market_adapter/lp_chart_core.js.map +1 -1
- package/dist/market_adapter/lp_chart_runner.d.ts +13 -24
- package/dist/market_adapter/lp_chart_runner.d.ts.map +1 -1
- package/dist/market_adapter/lp_chart_runner.js +58 -56
- package/dist/market_adapter/lp_chart_runner.js.map +1 -1
- package/dist/market_adapter/lp_chart_strategy_loader.d.ts +4 -17
- package/dist/market_adapter/lp_chart_strategy_loader.d.ts.map +1 -1
- package/dist/market_adapter/lp_chart_strategy_loader.js +36 -36
- package/dist/market_adapter/lp_chart_strategy_loader.js.map +1 -1
- package/dist/market_adapter/market_adapter.d.ts +51 -72
- package/dist/market_adapter/market_adapter.d.ts.map +1 -1
- package/dist/market_adapter/market_adapter.js +227 -192
- package/dist/market_adapter/market_adapter.js.map +1 -1
- package/dist/market_adapter/merge_lp_data.js +17 -16
- package/dist/market_adapter/merge_lp_data.js.map +1 -1
- package/dist/market_adapter/test_helpers.d.ts +9 -13
- package/dist/market_adapter/test_helpers.d.ts.map +1 -1
- package/dist/market_adapter/test_helpers.js +14 -14
- package/dist/market_adapter/test_helpers.js.map +1 -1
- package/dist/market_adapter/utils/adapter_client.d.ts +6 -14
- package/dist/market_adapter/utils/adapter_client.d.ts.map +1 -1
- package/dist/market_adapter/utils/adapter_client.js +16 -15
- package/dist/market_adapter/utils/adapter_client.js.map +1 -1
- package/dist/market_adapter/utils/atomic_write.d.ts +2 -5
- package/dist/market_adapter/utils/atomic_write.d.ts.map +1 -1
- package/dist/market_adapter/utils/atomic_write.js +5 -5
- package/dist/market_adapter/utils/atomic_write.js.map +1 -1
- package/dist/market_adapter/utils/chain.d.ts +19 -21
- package/dist/market_adapter/utils/chain.d.ts.map +1 -1
- package/dist/market_adapter/utils/chain.js +15 -16
- package/dist/market_adapter/utils/chain.js.map +1 -1
- package/dist/market_adapter/utils/data_discovery.d.ts +1 -4
- package/dist/market_adapter/utils/data_discovery.d.ts.map +1 -1
- package/dist/market_adapter/utils/data_discovery.js +10 -10
- package/dist/market_adapter/utils/data_discovery.js.map +1 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts +1 -6
- package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts.map +1 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.js +14 -14
- package/dist/market_adapter/utils/dynamic_grid_snapshot.js.map +1 -1
- package/dist/market_adapter/utils/file_lock.d.ts +1 -7
- package/dist/market_adapter/utils/file_lock.d.ts.map +1 -1
- package/dist/market_adapter/utils/file_lock.js +21 -25
- package/dist/market_adapter/utils/file_lock.js.map +1 -1
- package/dist/market_adapter/utils/native_history.d.ts +12 -12
- package/dist/market_adapter/utils/native_history.d.ts.map +1 -1
- package/dist/market_adapter/utils/native_history.js +15 -15
- package/dist/market_adapter/utils/native_history.js.map +1 -1
- package/dist/market_adapter/utils/paths.d.ts +2 -4
- package/dist/market_adapter/utils/paths.d.ts.map +1 -1
- package/dist/market_adapter/utils/paths.js +6 -5
- package/dist/market_adapter/utils/paths.js.map +1 -1
- package/dist/modules/account_bots.d.ts +7 -8
- package/dist/modules/account_bots.d.ts.map +1 -1
- package/dist/modules/account_bots.js +92 -114
- package/dist/modules/account_bots.js.map +1 -1
- package/dist/modules/account_orders.d.ts +5 -9
- package/dist/modules/account_orders.d.ts.map +1 -1
- package/dist/modules/account_orders.js +69 -32
- package/dist/modules/account_orders.js.map +1 -1
- package/dist/modules/authority_resolver.d.ts +32 -1
- package/dist/modules/authority_resolver.d.ts.map +1 -1
- package/dist/modules/authority_resolver.js +18 -12
- package/dist/modules/authority_resolver.js.map +1 -1
- package/dist/modules/bitshares-native/chain_client.d.ts +3 -8
- package/dist/modules/bitshares-native/chain_client.d.ts.map +1 -1
- package/dist/modules/bitshares-native/chain_client.js +21 -16
- package/dist/modules/bitshares-native/chain_client.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts +21 -29
- package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.js +72 -38
- package/dist/modules/bitshares-native/crypto/ecc.browser.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.d.ts +9 -36
- package/dist/modules/bitshares-native/crypto/ecc.d.ts.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.js +40 -83
- package/dist/modules/bitshares-native/crypto/ecc.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts +14 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.js +5 -3
- package/dist/modules/bitshares-native/crypto/ecc_selector.js.map +1 -1
- package/dist/modules/bitshares-native/index.d.ts +10 -2
- package/dist/modules/bitshares-native/index.d.ts.map +1 -1
- package/dist/modules/bitshares-native/index.js +68 -31
- package/dist/modules/bitshares-native/index.js.map +1 -1
- package/dist/modules/bitshares-native/lru_cache.d.ts +1 -4
- package/dist/modules/bitshares-native/lru_cache.d.ts.map +1 -1
- package/dist/modules/bitshares-native/lru_cache.js +6 -3
- package/dist/modules/bitshares-native/lru_cache.js.map +1 -1
- package/dist/modules/bitshares-native/resolvers.d.ts +3 -6
- package/dist/modules/bitshares-native/resolvers.d.ts.map +1 -1
- package/dist/modules/bitshares-native/resolvers.js +11 -9
- package/dist/modules/bitshares-native/resolvers.js.map +1 -1
- package/dist/modules/bitshares-native/serial/chain_constants.d.ts +53 -55
- package/dist/modules/bitshares-native/serial/chain_constants.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/chain_constants.js +28 -27
- package/dist/modules/bitshares-native/serial/chain_constants.js.map +1 -1
- package/dist/modules/bitshares-native/serial/index.d.ts +5 -9
- package/dist/modules/bitshares-native/serial/index.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/index.js +46 -12
- package/dist/modules/bitshares-native/serial/index.js.map +1 -1
- package/dist/modules/bitshares-native/serial/operations.d.ts +102 -100
- package/dist/modules/bitshares-native/serial/operations.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/operations.js +473 -471
- package/dist/modules/bitshares-native/serial/operations.js.map +1 -1
- package/dist/modules/bitshares-native/serial/serializer.d.ts +2 -7
- package/dist/modules/bitshares-native/serial/serializer.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/serializer.js +8 -3
- package/dist/modules/bitshares-native/serial/serializer.js.map +1 -1
- package/dist/modules/bitshares-native/serial/types.d.ts +26 -41
- package/dist/modules/bitshares-native/serial/types.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/types.js +76 -42
- package/dist/modules/bitshares-native/serial/types.js.map +1 -1
- package/dist/modules/bitshares-native/signing_client.d.ts +1 -5
- package/dist/modules/bitshares-native/signing_client.d.ts.map +1 -1
- package/dist/modules/bitshares-native/signing_client.js +49 -11
- package/dist/modules/bitshares-native/signing_client.js.map +1 -1
- package/dist/modules/bitshares-native/subscriptions.d.ts +1 -4
- package/dist/modules/bitshares-native/subscriptions.d.ts.map +1 -1
- package/dist/modules/bitshares-native/subscriptions.js +47 -84
- package/dist/modules/bitshares-native/subscriptions.js.map +1 -1
- package/dist/modules/bitshares-native/transport.d.ts +1 -8
- package/dist/modules/bitshares-native/transport.d.ts.map +1 -1
- package/dist/modules/bitshares-native/transport.js +22 -15
- package/dist/modules/bitshares-native/transport.js.map +1 -1
- package/dist/modules/bitshares-native/tx/builder.d.ts +3 -8
- package/dist/modules/bitshares-native/tx/builder.d.ts.map +1 -1
- package/dist/modules/bitshares-native/tx/builder.js +61 -23
- package/dist/modules/bitshares-native/tx/builder.js.map +1 -1
- package/dist/modules/bitshares-native/tx/tx_cache.d.ts +1 -8
- package/dist/modules/bitshares-native/tx/tx_cache.d.ts.map +1 -1
- package/dist/modules/bitshares-native/tx/tx_cache.js +21 -17
- package/dist/modules/bitshares-native/tx/tx_cache.js.map +1 -1
- package/dist/modules/bitshares_client.d.ts +12 -23
- package/dist/modules/bitshares_client.d.ts.map +1 -1
- package/dist/modules/bitshares_client.js +109 -56
- package/dist/modules/bitshares_client.js.map +1 -1
- package/dist/modules/bot_settings.d.ts +1 -13
- package/dist/modules/bot_settings.d.ts.map +1 -1
- package/dist/modules/bot_settings.js +34 -34
- package/dist/modules/bot_settings.js.map +1 -1
- package/dist/modules/bots_file_lock.d.ts +3 -9
- package/dist/modules/bots_file_lock.d.ts.map +1 -1
- package/dist/modules/bots_file_lock.js +8 -9
- package/dist/modules/bots_file_lock.js.map +1 -1
- package/dist/modules/chain_keys.d.ts +7 -39
- package/dist/modules/chain_keys.d.ts.map +1 -1
- package/dist/modules/chain_keys.js +126 -90
- package/dist/modules/chain_keys.js.map +1 -1
- package/dist/modules/chain_orders.d.ts +46 -52
- package/dist/modules/chain_orders.d.ts.map +1 -1
- package/dist/modules/chain_orders.js +152 -104
- package/dist/modules/chain_orders.js.map +1 -1
- package/dist/modules/config.d.ts +50 -57
- package/dist/modules/config.d.ts.map +1 -1
- package/dist/modules/config.js +28 -24
- package/dist/modules/config.js.map +1 -1
- package/dist/modules/constants.d.ts +492 -492
- package/dist/modules/constants.d.ts.map +1 -1
- package/dist/modules/constants.js +79 -39
- package/dist/modules/constants.js.map +1 -1
- package/dist/modules/cr_planner.d.ts +1 -13
- package/dist/modules/cr_planner.d.ts.map +1 -1
- package/dist/modules/cr_planner.js +28 -28
- package/dist/modules/cr_planner.js.map +1 -1
- package/dist/modules/credential_policy.d.ts +18 -33
- package/dist/modules/credential_policy.d.ts.map +1 -1
- package/dist/modules/credential_policy.js +114 -87
- package/dist/modules/credential_policy.js.map +1 -1
- package/dist/modules/credential_runtime.d.ts +11 -21
- package/dist/modules/credential_runtime.d.ts.map +1 -1
- package/dist/modules/credential_runtime.js +40 -40
- package/dist/modules/credential_runtime.js.map +1 -1
- package/dist/modules/credential_session_cache.d.ts +8 -8
- package/dist/modules/credential_session_cache.d.ts.map +1 -1
- package/dist/modules/credential_session_cache.js +41 -8
- package/dist/modules/credential_session_cache.js.map +1 -1
- package/dist/modules/credit_runtime.d.ts +51 -316
- package/dist/modules/credit_runtime.d.ts.map +1 -1
- package/dist/modules/credit_runtime.js +257 -183
- package/dist/modules/credit_runtime.js.map +1 -1
- package/dist/modules/crypto/browser_provider.js +6 -6
- package/dist/modules/crypto/browser_provider.js.map +1 -1
- package/dist/modules/crypto/index.d.ts.map +1 -1
- package/dist/modules/crypto/index.js +2 -0
- package/dist/modules/crypto/index.js.map +1 -1
- package/dist/modules/crypto/sync.js +3 -3
- package/dist/modules/crypto/sync.js.map +1 -1
- package/dist/modules/dexbot_class.d.ts +124 -73
- package/dist/modules/dexbot_class.d.ts.map +1 -1
- package/dist/modules/dexbot_class.js +198 -3577
- package/dist/modules/dexbot_class.js.map +1 -1
- package/dist/modules/dexbot_cow_runtime.d.ts +322 -0
- package/dist/modules/dexbot_cow_runtime.d.ts.map +1 -0
- package/dist/modules/dexbot_cow_runtime.js +1836 -0
- package/dist/modules/dexbot_cow_runtime.js.map +1 -0
- package/dist/modules/dexbot_credential_client.d.ts +5 -11
- package/dist/modules/dexbot_credential_client.d.ts.map +1 -1
- package/dist/modules/dexbot_credential_client.js +32 -30
- package/dist/modules/dexbot_credential_client.js.map +1 -1
- package/dist/modules/dexbot_fill_runtime.d.ts +47 -15
- package/dist/modules/dexbot_fill_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_fill_runtime.js +565 -22
- package/dist/modules/dexbot_fill_runtime.js.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.d.ts +79 -10
- package/dist/modules/dexbot_maintenance_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.js +294 -55
- package/dist/modules/dexbot_maintenance_runtime.js.map +1 -1
- package/dist/modules/dexbot_startup_runtime.d.ts +26 -0
- package/dist/modules/dexbot_startup_runtime.d.ts.map +1 -0
- package/dist/modules/dexbot_startup_runtime.js +575 -0
- package/dist/modules/dexbot_startup_runtime.js.map +1 -0
- package/dist/modules/dexbot_state_recovery.d.ts +115 -0
- package/dist/modules/dexbot_state_recovery.d.ts.map +1 -0
- package/dist/modules/dexbot_state_recovery.js +431 -0
- package/dist/modules/dexbot_state_recovery.js.map +1 -0
- package/dist/modules/fund_registry.d.ts +1 -13
- package/dist/modules/fund_registry.d.ts.map +1 -1
- package/dist/modules/fund_registry.js +23 -22
- package/dist/modules/fund_registry.js.map +1 -1
- package/dist/modules/general_settings.d.ts +3 -7
- package/dist/modules/general_settings.d.ts.map +1 -1
- package/dist/modules/general_settings.js +15 -15
- package/dist/modules/general_settings.js.map +1 -1
- package/dist/modules/graceful_shutdown.d.ts +1 -6
- package/dist/modules/graceful_shutdown.d.ts.map +1 -1
- package/dist/modules/graceful_shutdown.js +19 -16
- package/dist/modules/graceful_shutdown.js.map +1 -1
- package/dist/modules/key_store.d.ts.map +1 -1
- package/dist/modules/key_store.js +53 -20
- package/dist/modules/key_store.js.map +1 -1
- package/dist/modules/launcher/bot_supervisor.d.ts +23 -66
- package/dist/modules/launcher/bot_supervisor.d.ts.map +1 -1
- package/dist/modules/launcher/bot_supervisor.js +115 -107
- package/dist/modules/launcher/bot_supervisor.js.map +1 -1
- package/dist/modules/launcher/child_env.d.ts +2 -5
- package/dist/modules/launcher/child_env.d.ts.map +1 -1
- package/dist/modules/launcher/child_env.js +4 -4
- package/dist/modules/launcher/child_env.js.map +1 -1
- package/dist/modules/launcher/credential_bootstrap.d.ts +4 -8
- package/dist/modules/launcher/credential_bootstrap.d.ts.map +1 -1
- package/dist/modules/launcher/credential_bootstrap.js +30 -26
- package/dist/modules/launcher/credential_bootstrap.js.map +1 -1
- package/dist/modules/launcher/credential_daemon.d.ts +8 -15
- package/dist/modules/launcher/credential_daemon.d.ts.map +1 -1
- package/dist/modules/launcher/credential_daemon.js +72 -41
- package/dist/modules/launcher/credential_daemon.js.map +1 -1
- package/dist/modules/launcher/credential_secret.d.ts +1 -4
- package/dist/modules/launcher/credential_secret.d.ts.map +1 -1
- package/dist/modules/launcher/credential_secret.js +36 -4
- package/dist/modules/launcher/credential_secret.js.map +1 -1
- package/dist/modules/launcher/foreign_cred_daemon.d.ts +32 -1
- package/dist/modules/launcher/foreign_cred_daemon.d.ts.map +1 -1
- package/dist/modules/launcher/foreign_cred_daemon.js +25 -28
- package/dist/modules/launcher/foreign_cred_daemon.js.map +1 -1
- package/dist/modules/launcher/headless_password.d.ts +1 -4
- package/dist/modules/launcher/headless_password.d.ts.map +1 -1
- package/dist/modules/launcher/headless_password.js +11 -11
- package/dist/modules/launcher/headless_password.js.map +1 -1
- package/dist/modules/launcher/launch_modes.d.ts +15 -14
- package/dist/modules/launcher/launch_modes.d.ts.map +1 -1
- package/dist/modules/launcher/launch_modes.js +8 -8
- package/dist/modules/launcher/launch_modes.js.map +1 -1
- package/dist/modules/launcher/market_adapter_runtime.d.ts +10 -19
- package/dist/modules/launcher/market_adapter_runtime.d.ts.map +1 -1
- package/dist/modules/launcher/market_adapter_runtime.js +33 -34
- package/dist/modules/launcher/market_adapter_runtime.js.map +1 -1
- package/dist/modules/launcher/market_adapter_watchdog.d.ts +10 -17
- package/dist/modules/launcher/market_adapter_watchdog.d.ts.map +1 -1
- package/dist/modules/launcher/market_adapter_watchdog.js +42 -39
- package/dist/modules/launcher/market_adapter_watchdog.js.map +1 -1
- package/dist/modules/launcher/monolithic_runtime.d.ts +28 -57
- package/dist/modules/launcher/monolithic_runtime.d.ts.map +1 -1
- package/dist/modules/launcher/monolithic_runtime.js +135 -108
- package/dist/modules/launcher/monolithic_runtime.js.map +1 -1
- package/dist/modules/launcher/runtime_entry.d.ts +5 -10
- package/dist/modules/launcher/runtime_entry.d.ts.map +1 -1
- package/dist/modules/launcher/runtime_entry.js +14 -14
- package/dist/modules/launcher/runtime_entry.js.map +1 -1
- package/dist/modules/launcher/status_reporting.d.ts +17 -37
- package/dist/modules/launcher/status_reporting.d.ts.map +1 -1
- package/dist/modules/launcher/status_reporting.js +35 -34
- package/dist/modules/launcher/status_reporting.js.map +1 -1
- package/dist/modules/launcher/supervisor_control.d.ts +1 -4
- package/dist/modules/launcher/supervisor_control.d.ts.map +1 -1
- package/dist/modules/launcher/supervisor_control.js +9 -4
- package/dist/modules/launcher/supervisor_control.js.map +1 -1
- package/dist/modules/logger.d.ts +3 -1
- package/dist/modules/logger.d.ts.map +1 -1
- package/dist/modules/logger.js +38 -28
- package/dist/modules/logger.js.map +1 -1
- package/dist/modules/market_adapter_whitelist.d.ts +2 -10
- package/dist/modules/market_adapter_whitelist.d.ts.map +1 -1
- package/dist/modules/market_adapter_whitelist.js +18 -16
- package/dist/modules/market_adapter_whitelist.js.map +1 -1
- package/dist/modules/node_health_cache.d.ts +2 -12
- package/dist/modules/node_health_cache.d.ts.map +1 -1
- package/dist/modules/node_health_cache.js +24 -24
- package/dist/modules/node_health_cache.js.map +1 -1
- package/dist/modules/node_manager.d.ts +1 -1
- package/dist/modules/node_manager.d.ts.map +1 -1
- package/dist/modules/node_manager.js +44 -38
- package/dist/modules/node_manager.js.map +1 -1
- package/dist/modules/order/accounting.d.ts +12 -12
- package/dist/modules/order/accounting.d.ts.map +1 -1
- package/dist/modules/order/accounting.js +111 -76
- package/dist/modules/order/accounting.js.map +1 -1
- package/dist/modules/order/async_lock.d.ts +1 -2
- package/dist/modules/order/async_lock.d.ts.map +1 -1
- package/dist/modules/order/async_lock.js +4 -4
- package/dist/modules/order/async_lock.js.map +1 -1
- package/dist/modules/order/export.d.ts +8 -14
- package/dist/modules/order/export.d.ts.map +1 -1
- package/dist/modules/order/export.js +77 -42
- package/dist/modules/order/export.js.map +1 -1
- package/dist/modules/order/format.d.ts +17 -22
- package/dist/modules/order/format.d.ts.map +1 -1
- package/dist/modules/order/format.js +25 -31
- package/dist/modules/order/format.js.map +1 -1
- package/dist/modules/order/grid.d.ts +18 -104
- package/dist/modules/order/grid.d.ts.map +1 -1
- package/dist/modules/order/grid.js +246 -188
- package/dist/modules/order/grid.js.map +1 -1
- package/dist/modules/order/grid_reconcile.d.ts +8 -8
- package/dist/modules/order/grid_reconcile.d.ts.map +1 -1
- package/dist/modules/order/grid_reconcile.js +24 -24
- package/dist/modules/order/grid_reconcile.js.map +1 -1
- package/dist/modules/order/grid_reconcile_internal.d.ts +224 -1
- package/dist/modules/order/grid_reconcile_internal.d.ts.map +1 -1
- package/dist/modules/order/grid_reconcile_internal.js +145 -72
- package/dist/modules/order/grid_reconcile_internal.js.map +1 -1
- package/dist/modules/order/index.d.ts +1 -1
- package/dist/modules/order/index.d.ts.map +1 -1
- package/dist/modules/order/index.js +42 -7
- package/dist/modules/order/index.js.map +1 -1
- package/dist/modules/order/logger.d.ts +6 -16
- package/dist/modules/order/logger.d.ts.map +1 -1
- package/dist/modules/order/logger.js +76 -53
- package/dist/modules/order/logger.js.map +1 -1
- package/dist/modules/order/logger_state.d.ts +4 -4
- package/dist/modules/order/logger_state.d.ts.map +1 -1
- package/dist/modules/order/logger_state.js +3 -1
- package/dist/modules/order/logger_state.js.map +1 -1
- package/dist/modules/order/manager.d.ts +160 -37
- package/dist/modules/order/manager.d.ts.map +1 -1
- package/dist/modules/order/manager.js +166 -128
- package/dist/modules/order/manager.js.map +1 -1
- package/dist/modules/order/processed_fill_store.d.ts +6 -10
- package/dist/modules/order/processed_fill_store.d.ts.map +1 -1
- package/dist/modules/order/processed_fill_store.js +10 -9
- package/dist/modules/order/processed_fill_store.js.map +1 -1
- package/dist/modules/order/strategy.d.ts +3 -3
- package/dist/modules/order/strategy.d.ts.map +1 -1
- package/dist/modules/order/strategy.js +29 -27
- package/dist/modules/order/strategy.js.map +1 -1
- package/dist/modules/order/sync_engine.d.ts +9 -19
- package/dist/modules/order/sync_engine.d.ts.map +1 -1
- package/dist/modules/order/sync_engine.js +176 -126
- package/dist/modules/order/sync_engine.js.map +1 -1
- package/dist/modules/order/utils/math.d.ts +55 -85
- package/dist/modules/order/utils/math.d.ts.map +1 -1
- package/dist/modules/order/utils/math.js +155 -88
- package/dist/modules/order/utils/math.js.map +1 -1
- package/dist/modules/order/utils/order.d.ts +27 -72
- package/dist/modules/order/utils/order.d.ts.map +1 -1
- package/dist/modules/order/utils/order.js +144 -105
- package/dist/modules/order/utils/order.js.map +1 -1
- package/dist/modules/order/utils/system.d.ts +74 -44
- package/dist/modules/order/utils/system.d.ts.map +1 -1
- package/dist/modules/order/utils/system.js +188 -149
- package/dist/modules/order/utils/system.js.map +1 -1
- package/dist/modules/order/utils/validate.d.ts +21 -43
- package/dist/modules/order/utils/validate.d.ts.map +1 -1
- package/dist/modules/order/utils/validate.js +140 -110
- package/dist/modules/order/utils/validate.js.map +1 -1
- package/dist/modules/order/working_grid.d.ts +1 -4
- package/dist/modules/order/working_grid.d.ts.map +1 -1
- package/dist/modules/order/working_grid.js +9 -7
- package/dist/modules/order/working_grid.js.map +1 -1
- package/dist/modules/path_api.js +2 -2
- package/dist/modules/path_api.js.map +1 -1
- package/dist/modules/paths.d.ts +51 -55
- package/dist/modules/paths.d.ts.map +1 -1
- package/dist/modules/paths.js +72 -52
- package/dist/modules/paths.js.map +1 -1
- package/dist/modules/process_discovery.d.ts +1 -1
- package/dist/modules/process_discovery.d.ts.map +1 -1
- package/dist/modules/process_discovery.js +7 -7
- package/dist/modules/process_discovery.js.map +1 -1
- package/dist/modules/runtime.d.ts +1 -1
- package/dist/modules/runtime.d.ts.map +1 -1
- package/dist/modules/runtime.js +4 -4
- package/dist/modules/runtime.js.map +1 -1
- package/dist/modules/runtime_settings.d.ts +1 -0
- package/dist/modules/runtime_settings.d.ts.map +1 -1
- package/dist/modules/runtime_settings.js +15 -10
- package/dist/modules/runtime_settings.js.map +1 -1
- package/dist/modules/settings_merge.d.ts +1 -4
- package/dist/modules/settings_merge.d.ts.map +1 -1
- package/dist/modules/settings_merge.js +2 -1
- package/dist/modules/settings_merge.js.map +1 -1
- package/dist/modules/storage/browser_adapter.d.ts +7 -3
- package/dist/modules/storage/browser_adapter.d.ts.map +1 -1
- package/dist/modules/storage/browser_adapter.js +2 -0
- package/dist/modules/storage/browser_adapter.js.map +1 -1
- package/dist/modules/storage/index.d.ts +2 -2
- package/dist/modules/storage/index.d.ts.map +1 -1
- package/dist/modules/storage/index.js +2 -5
- package/dist/modules/storage/index.js.map +1 -1
- package/dist/modules/storage/node_adapter.d.ts +3 -3
- package/dist/modules/storage/node_adapter.d.ts.map +1 -1
- package/dist/modules/storage/node_adapter.js +9 -7
- package/dist/modules/storage/node_adapter.js.map +1 -1
- package/dist/modules/storage/types.d.ts +13 -10
- package/dist/modules/storage/types.d.ts.map +1 -1
- package/dist/modules/types.d.ts +0 -2
- package/dist/modules/types.d.ts.map +1 -1
- package/dist/modules/utils/base58check.d.ts +1 -9
- package/dist/modules/utils/base58check.d.ts.map +1 -1
- package/dist/modules/utils/base58check.js +14 -16
- package/dist/modules/utils/base58check.js.map +1 -1
- package/dist/modules/utils/build_dir.d.ts +2 -5
- package/dist/modules/utils/build_dir.d.ts.map +1 -1
- package/dist/modules/utils/build_dir.js +6 -3
- package/dist/modules/utils/build_dir.js.map +1 -1
- package/dist/modules/utils/errors.d.ts +2 -0
- package/dist/modules/utils/errors.d.ts.map +1 -0
- package/dist/modules/utils/errors.js +12 -0
- package/dist/modules/utils/errors.js.map +1 -0
- package/dist/modules/utils/fs_utils.d.ts +1 -8
- package/dist/modules/utils/fs_utils.d.ts.map +1 -1
- package/dist/modules/utils/fs_utils.js +8 -3
- package/dist/modules/utils/fs_utils.js.map +1 -1
- package/dist/modules/utils/math_utils.d.ts +2 -6
- package/dist/modules/utils/math_utils.d.ts.map +1 -1
- package/dist/modules/utils/math_utils.js +6 -2
- package/dist/modules/utils/math_utils.js.map +1 -1
- package/dist/modules/validate_profiles.d.ts +1 -11
- package/dist/modules/validate_profiles.d.ts.map +1 -1
- package/dist/modules/validate_profiles.js +25 -27
- package/dist/modules/validate_profiles.js.map +1 -1
- package/dist/pm2.d.ts +7 -6
- package/dist/pm2.d.ts.map +1 -1
- package/dist/pm2.js +132 -106
- package/dist/pm2.js.map +1 -1
- package/dist/scripts/analyze-git.d.ts.map +1 -1
- package/dist/scripts/analyze-git.js +15 -11
- package/dist/scripts/analyze-git.js.map +1 -1
- package/dist/scripts/analyze-orders.d.ts +146 -1
- package/dist/scripts/analyze-orders.d.ts.map +1 -1
- package/dist/scripts/analyze-orders.js +81 -105
- package/dist/scripts/analyze-orders.js.map +1 -1
- package/dist/scripts/diagnose-pool-history.d.ts.map +1 -1
- package/dist/scripts/diagnose-pool-history.js +9 -8
- package/dist/scripts/diagnose-pool-history.js.map +1 -1
- package/dist/scripts/divergence-calc.d.ts.map +1 -1
- package/dist/scripts/divergence-calc.js +11 -8
- package/dist/scripts/divergence-calc.js.map +1 -1
- package/dist/scripts/fix-err-message.d.ts +3 -0
- package/dist/scripts/fix-err-message.d.ts.map +1 -0
- package/dist/scripts/fix-err-message.js +198 -0
- package/dist/scripts/fix-err-message.js.map +1 -0
- package/dist/scripts/generate_lp_chart.d.ts +2 -9
- package/dist/scripts/generate_lp_chart.d.ts.map +1 -1
- package/dist/scripts/generate_lp_chart.js +14 -10
- package/dist/scripts/generate_lp_chart.js.map +1 -1
- package/dist/scripts/generate_mainnet_corpus_report.js +4 -4
- package/dist/scripts/generate_mainnet_corpus_report.js.map +1 -1
- package/dist/scripts/generate_market_adapter_whitelist.d.ts +17 -1
- package/dist/scripts/generate_market_adapter_whitelist.d.ts.map +1 -1
- package/dist/scripts/generate_market_adapter_whitelist.js +23 -20
- package/dist/scripts/generate_market_adapter_whitelist.js.map +1 -1
- package/dist/scripts/migrate_bot_keys.d.ts +1 -4
- package/dist/scripts/migrate_bot_keys.d.ts.map +1 -1
- package/dist/scripts/migrate_bot_keys.js +48 -124
- package/dist/scripts/migrate_bot_keys.js.map +1 -1
- package/dist/scripts/native_release_gates.d.ts.map +1 -1
- package/dist/scripts/native_release_gates.js +18 -14
- package/dist/scripts/native_release_gates.js.map +1 -1
- package/dist/scripts/print_grid.js +1 -1
- package/dist/scripts/print_grid.js.map +1 -1
- package/dist/scripts/run-tests.js +1 -0
- package/dist/scripts/run-tests.js.map +1 -1
- package/dist/scripts/runner.d.ts +1 -11
- package/dist/scripts/runner.d.ts.map +1 -1
- package/dist/scripts/runner.js +21 -19
- package/dist/scripts/runner.js.map +1 -1
- package/dist/scripts/test-credit-renewal.d.ts.map +1 -1
- package/dist/scripts/test-credit-renewal.js +2 -1
- package/dist/scripts/test-credit-renewal.js.map +1 -1
- package/dist/scripts/update.d.ts.map +1 -1
- package/dist/scripts/update.js +85 -79
- package/dist/scripts/update.js.map +1 -1
- package/dist/scripts/validate_bots.js +2 -2
- package/dist/scripts/validate_bots.js.map +1 -1
- package/dist/scripts/verify-browser-bundle.js +25 -1
- package/dist/scripts/verify-browser-bundle.js.map +1 -1
- package/dist/unlock.d.ts +4 -17
- package/dist/unlock.d.ts.map +1 -1
- package/dist/unlock.js +141 -108
- package/dist/unlock.js.map +1 -1
- package/package.json +7 -2
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts +0 -3
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js +0 -149
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js.map +0 -1
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts +0 -3
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js +0 -387
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js.map +0 -1
- package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts +0 -3
- package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js +0 -200
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js.map +0 -1
- package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts +0 -3
- package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/fetch_lp_candles.js +0 -212
- package/dist/analysis/ama_fitting/fetch_lp_candles.js.map +0 -1
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts +0 -31
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js +0 -249
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js.map +0 -1
- package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts +0 -2
- package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js +0 -782
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js.map +0 -1
- package/dist/analysis/analyze_derivatives.d.ts +0 -95
- package/dist/analysis/analyze_derivatives.d.ts.map +0 -1
- package/dist/analysis/analyze_derivatives.js +0 -295
- package/dist/analysis/analyze_derivatives.js.map +0 -1
- package/dist/analysis/analyze_dynamic_weight.d.ts +0 -14
- package/dist/analysis/analyze_dynamic_weight.d.ts.map +0 -1
- package/dist/analysis/analyze_dynamic_weight.js +0 -207
- package/dist/analysis/analyze_dynamic_weight.js.map +0 -1
- package/dist/analysis/analyze_kalman.d.ts +0 -13
- package/dist/analysis/analyze_kalman.d.ts.map +0 -1
- package/dist/analysis/analyze_kalman.js +0 -123
- package/dist/analysis/analyze_kalman.js.map +0 -1
- package/dist/analysis/analyze_regime.d.ts +0 -20
- package/dist/analysis/analyze_regime.d.ts.map +0 -1
- package/dist/analysis/analyze_regime.js +0 -139
- package/dist/analysis/analyze_regime.js.map +0 -1
- package/dist/analysis/analyze_regime_windows.d.ts +0 -19
- package/dist/analysis/analyze_regime_windows.d.ts.map +0 -1
- package/dist/analysis/analyze_regime_windows.js +0 -413
- package/dist/analysis/analyze_regime_windows.js.map +0 -1
- package/dist/analysis/analyze_risk_profile.d.ts +0 -3
- package/dist/analysis/analyze_risk_profile.d.ts.map +0 -1
- package/dist/analysis/analyze_risk_profile.js +0 -159
- package/dist/analysis/analyze_risk_profile.js.map +0 -1
- package/dist/analysis/analyze_trade_heatmap.d.ts +0 -3
- package/dist/analysis/analyze_trade_heatmap.d.ts.map +0 -1
- package/dist/analysis/analyze_trade_heatmap.js +0 -367
- package/dist/analysis/analyze_trade_heatmap.js.map +0 -1
- package/dist/analysis/analyze_volatility.d.ts +0 -22
- package/dist/analysis/analyze_volatility.d.ts.map +0 -1
- package/dist/analysis/analyze_volatility.js +0 -172
- package/dist/analysis/analyze_volatility.js.map +0 -1
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts +0 -99
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js +0 -804
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js.map +0 -1
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts +0 -2
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js +0 -347
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js.map +0 -1
- package/dist/analysis/bot_fitting/shared_utils.d.ts +0 -15
- package/dist/analysis/bot_fitting/shared_utils.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/shared_utils.js +0 -48
- package/dist/analysis/bot_fitting/shared_utils.js.map +0 -1
- package/dist/analysis/bot_key_utils.d.ts +0 -22
- package/dist/analysis/bot_key_utils.d.ts.map +0 -1
- package/dist/analysis/bot_key_utils.js +0 -162
- package/dist/analysis/bot_key_utils.js.map +0 -1
- package/dist/analysis/bot_usage/discover_bot_accounts.d.ts +0 -3
- package/dist/analysis/bot_usage/discover_bot_accounts.d.ts.map +0 -1
- package/dist/analysis/bot_usage/discover_bot_accounts.js +0 -498
- package/dist/analysis/bot_usage/discover_bot_accounts.js.map +0 -1
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts +0 -546
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts.map +0 -1
- package/dist/analysis/bot_usage/kibana_bot_queries.js +0 -427
- package/dist/analysis/bot_usage/kibana_bot_queries.js.map +0 -1
- package/dist/analysis/derivative_chart_generator.d.ts +0 -18
- package/dist/analysis/derivative_chart_generator.d.ts.map +0 -1
- package/dist/analysis/derivative_chart_generator.js +0 -896
- package/dist/analysis/derivative_chart_generator.js.map +0 -1
- package/dist/analysis/price_sources.d.ts +0 -34
- package/dist/analysis/price_sources.d.ts.map +0 -1
- package/dist/analysis/price_sources.js +0 -103
- package/dist/analysis/price_sources.js.map +0 -1
- package/dist/analysis/trade_profitability.d.ts +0 -115
- package/dist/analysis/trade_profitability.d.ts.map +0 -1
- package/dist/analysis/trade_profitability.js +0 -1247
- package/dist/analysis/trade_profitability.js.map +0 -1
- package/dist/analysis/tradingview/analyze_tradingview.d.ts +0 -36
- package/dist/analysis/tradingview/analyze_tradingview.d.ts.map +0 -1
- package/dist/analysis/tradingview/analyze_tradingview.js +0 -172
- package/dist/analysis/tradingview/analyze_tradingview.js.map +0 -1
- package/dist/analysis/trend_detection/derivative_analyzer.d.ts +0 -250
- package/dist/analysis/trend_detection/derivative_analyzer.d.ts.map +0 -1
- package/dist/analysis/trend_detection/derivative_analyzer.js +0 -903
- package/dist/analysis/trend_detection/derivative_analyzer.js.map +0 -1
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts +0 -6
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js +0 -1450
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts +0 -6
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/kalman_chart_generator.js +0 -408
- package/dist/analysis/trend_detection/kalman_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts +0 -6
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/regime_chart_generator.js +0 -345
- package/dist/analysis/trend_detection/regime_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts +0 -2
- package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts.map +0 -1
- package/dist/analysis/trend_detection/tests/test_kalman_trend.js +0 -130
- package/dist/analysis/trend_detection/tests/test_kalman_trend.js.map +0 -1
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts +0 -2
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts.map +0 -1
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js +0 -38
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js.map +0 -1
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts +0 -6
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/volatility_chart_generator.js +0 -732
- package/dist/analysis/trend_detection/volatility_chart_generator.js.map +0 -1
|
@@ -1,23 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SOCKET_PATH = void 0;
|
|
7
|
+
exports.createBotSupervisor = createBotSupervisor;
|
|
8
|
+
exports.parseCronExpression = parseCronExpression;
|
|
9
|
+
exports.getNextCronDate = getNextCronDate;
|
|
10
|
+
exports.forwardSignal = forwardSignal;
|
|
11
|
+
exports.isPidAlive = isPidAlive;
|
|
12
|
+
exports.waitForPidExit = waitForPidExit;
|
|
13
|
+
exports.readProcArgs = readProcArgs;
|
|
14
|
+
exports.readProcCwd = readProcCwd;
|
|
15
|
+
exports.normalizeProcScriptArg = normalizeProcScriptArg;
|
|
16
|
+
exports.scriptPathForRoot = scriptPathForRoot;
|
|
17
|
+
exports.candidateRuntimeScriptPaths = candidateRuntimeScriptPaths;
|
|
18
|
+
exports.pidMatchesScriptCandidates = pidMatchesScriptCandidates;
|
|
19
|
+
exports.isNodeProcessWithExactScript = isNodeProcessWithExactScript;
|
|
20
|
+
exports.readMarketAdapterLockPid = readMarketAdapterLockPid;
|
|
21
|
+
exports.stopMarketAdapterFromLock = stopMarketAdapterFromLock;
|
|
22
|
+
exports.usesAmaGridPrice = usesAmaGridPrice;
|
|
23
|
+
exports.waitForChildSpawn = waitForChildSpawn;
|
|
24
|
+
exports.getChildRSS = getChildRSS;
|
|
25
|
+
exports.formatUptime = formatUptime;
|
|
26
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
27
|
+
const path_api_1 = require("../path_api");
|
|
28
|
+
const node_net_1 = __importDefault(require("node:net"));
|
|
29
|
+
const storage_1 = require("../storage");
|
|
30
|
+
const node_child_process_1 = require("node:child_process");
|
|
31
|
+
const child_env_1 = require("./child_env");
|
|
32
|
+
const paths_1 = require("../paths");
|
|
33
|
+
const bot_settings_1 = require("../bot_settings");
|
|
34
|
+
const constants_1 = require("../constants");
|
|
35
|
+
const fs_utils_1 = require("../utils/fs_utils");
|
|
36
|
+
const config_1 = require("../config");
|
|
37
|
+
const process_discovery_1 = require("../process_discovery");
|
|
38
|
+
const runtime_1 = require("../runtime");
|
|
39
|
+
const system_1 = require("../order/utils/system");
|
|
1
40
|
'use strict';
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const {
|
|
9
|
-
const { buildRuntimeScriptPath, isDistCodeRoot, SCRIPTS_ROOT: CODE_ROOT } = require('./runtime_entry');
|
|
10
|
-
const { PATHS } = require('../paths');
|
|
11
|
-
const { normalizeBotEntries, resolveRawBotEntries, loadSettingsFile } = require('../bot_settings');
|
|
12
|
-
const { UPDATER, BUILD_DIR, LAUNCHER } = require('../constants');
|
|
13
|
-
const { ensureDir, readJSON, safeUnlink } = require('../utils/fs_utils');
|
|
14
|
-
const { Config } = require('../config');
|
|
15
|
-
const { getProcessDiscovery } = require('../process_discovery');
|
|
16
|
-
const { runtime } = require('../runtime');
|
|
17
|
-
const { sleep } = require('../order/utils/system');
|
|
18
|
-
const BOT_SCRIPT = buildRuntimeScriptPath(CODE_ROOT, ['bot']);
|
|
19
|
-
const SOCKET_PATH = Config.DEXBOT_SUPERVISOR_SOCKET || PATHS.PROFILES.SUPERVISOR_SOCK;
|
|
20
|
-
const { MAX_RESTARTS, MIN_UPTIME_MS, RESTART_DELAY_MS, SHUTDOWN_TIMEOUT_MS, STAGGER_DELAY_MS, MAX_MEMORY_MB, MEMORY_CHECK_INTERVAL_MS, STATUS_LOG_INTERVAL_MS, MAX_CRON_LOOKAHEAD_MINUTES, } = LAUNCHER.SUPERVISOR;
|
|
41
|
+
const storage = (0, storage_1.getStorage)();
|
|
42
|
+
const runtime_entry_1 = require("./runtime_entry");
|
|
43
|
+
const errors_1 = require("../utils/errors");
|
|
44
|
+
const BOT_SCRIPT = (0, runtime_entry_1.buildRuntimeScriptPath)(runtime_entry_1.SCRIPTS_ROOT, ['bot']);
|
|
45
|
+
const SOCKET_PATH = config_1.Config.DEXBOT_SUPERVISOR_SOCKET || paths_1.PATHS.PROFILES.SUPERVISOR_SOCK;
|
|
46
|
+
exports.SOCKET_PATH = SOCKET_PATH;
|
|
47
|
+
const { MAX_RESTARTS, MIN_UPTIME_MS, RESTART_DELAY_MS, SHUTDOWN_TIMEOUT_MS, STAGGER_DELAY_MS, MAX_MEMORY_MB, MEMORY_CHECK_INTERVAL_MS, STATUS_LOG_INTERVAL_MS, MAX_CRON_LOOKAHEAD_MINUTES, } = constants_1.LAUNCHER.SUPERVISOR;
|
|
21
48
|
const MAX_MEMORY_BYTES = MAX_MEMORY_MB * 1024 * 1024;
|
|
22
49
|
const SUPERVISOR_PREFIX = '[supervisor]';
|
|
23
50
|
function usesAmaGridPrice(bot) {
|
|
@@ -32,16 +59,16 @@ function isServiceApp(app) {
|
|
|
32
59
|
return name === 'dexbot-update' || name === 'dexbot-adapter';
|
|
33
60
|
}
|
|
34
61
|
function ensureLogDir() {
|
|
35
|
-
if (!storage.exists(PATHS.LOGS_DIR)) {
|
|
36
|
-
ensureDir(PATHS.LOGS_DIR);
|
|
62
|
+
if (!storage.exists(paths_1.PATHS.LOGS_DIR)) {
|
|
63
|
+
(0, fs_utils_1.ensureDir)(paths_1.PATHS.LOGS_DIR);
|
|
37
64
|
}
|
|
38
65
|
}
|
|
39
66
|
function loadActiveBots(explicitBots) {
|
|
40
67
|
if (explicitBots)
|
|
41
68
|
return explicitBots;
|
|
42
|
-
const { config } = loadSettingsFile(PATHS.PROFILES.BOTS_JSON);
|
|
43
|
-
const raw = resolveRawBotEntries(config);
|
|
44
|
-
return normalizeBotEntries(raw).filter((b) => b.active !== false);
|
|
69
|
+
const { config } = (0, bot_settings_1.loadSettingsFile)(paths_1.PATHS.PROFILES.BOTS_JSON);
|
|
70
|
+
const raw = (0, bot_settings_1.resolveRawBotEntries)(config);
|
|
71
|
+
return (0, bot_settings_1.normalizeBotEntries)(raw).filter((b) => b.active !== false);
|
|
45
72
|
}
|
|
46
73
|
function buildSupervisedApps(bots, updaterActive) {
|
|
47
74
|
const apps = (bots || []).map((bot, index) => {
|
|
@@ -51,10 +78,10 @@ function buildSupervisedApps(bots, updaterActive) {
|
|
|
51
78
|
name: botName,
|
|
52
79
|
script: BOT_SCRIPT,
|
|
53
80
|
args: botName,
|
|
54
|
-
cwd: PATHS.PROJECT_ROOT,
|
|
81
|
+
cwd: paths_1.PATHS.PROJECT_ROOT,
|
|
55
82
|
max_memory_restart: '250M',
|
|
56
|
-
error_file: path.join(PATHS.LOGS_DIR, `${botName}-error.log`),
|
|
57
|
-
out_file: path.join(PATHS.LOGS_DIR, `${botName}.log`),
|
|
83
|
+
error_file: path_api_1.path.join(paths_1.PATHS.LOGS_DIR, `${botName}-error.log`),
|
|
84
|
+
out_file: path_api_1.path.join(paths_1.PATHS.LOGS_DIR, `${botName}.log`),
|
|
58
85
|
max_restarts: 13,
|
|
59
86
|
min_uptime: 86400000,
|
|
60
87
|
restart_delay: 3000,
|
|
@@ -64,11 +91,11 @@ function buildSupervisedApps(bots, updaterActive) {
|
|
|
64
91
|
apps.unshift({
|
|
65
92
|
kind: 'service',
|
|
66
93
|
name: 'dexbot-adapter',
|
|
67
|
-
script: buildRuntimeScriptPath(
|
|
68
|
-
cwd: PATHS.PROJECT_ROOT,
|
|
94
|
+
script: (0, runtime_entry_1.buildRuntimeScriptPath)(runtime_entry_1.SCRIPTS_ROOT, ['market_adapter', 'market_adapter']),
|
|
95
|
+
cwd: paths_1.PATHS.PROJECT_ROOT,
|
|
69
96
|
max_memory_restart: '150M',
|
|
70
|
-
error_file: path.join(PATHS.LOGS_DIR, 'dexbot-adapter-error.log'),
|
|
71
|
-
out_file: path.join(PATHS.LOGS_DIR, 'dexbot-adapter.log'),
|
|
97
|
+
error_file: path_api_1.path.join(paths_1.PATHS.LOGS_DIR, 'dexbot-adapter-error.log'),
|
|
98
|
+
out_file: path_api_1.path.join(paths_1.PATHS.LOGS_DIR, 'dexbot-adapter.log'),
|
|
72
99
|
max_restarts: 13,
|
|
73
100
|
min_uptime: 60000,
|
|
74
101
|
restart_delay: 3000,
|
|
@@ -78,13 +105,13 @@ function buildSupervisedApps(bots, updaterActive) {
|
|
|
78
105
|
apps.push({
|
|
79
106
|
kind: 'job',
|
|
80
107
|
name: 'dexbot-update',
|
|
81
|
-
script: buildRuntimeScriptPath(
|
|
82
|
-
cwd: PATHS.PROJECT_ROOT,
|
|
83
|
-
error_file: path.join(PATHS.LOGS_DIR, 'dexbot-update-error.log'),
|
|
84
|
-
out_file: path.join(PATHS.LOGS_DIR, 'dexbot-update.log'),
|
|
108
|
+
script: (0, runtime_entry_1.buildRuntimeScriptPath)(runtime_entry_1.SCRIPTS_ROOT, ['scripts', 'update']),
|
|
109
|
+
cwd: paths_1.PATHS.PROJECT_ROOT,
|
|
110
|
+
error_file: path_api_1.path.join(paths_1.PATHS.LOGS_DIR, 'dexbot-update-error.log'),
|
|
111
|
+
out_file: path_api_1.path.join(paths_1.PATHS.LOGS_DIR, 'dexbot-update.log'),
|
|
85
112
|
autorestart: false,
|
|
86
113
|
bulk_control: false,
|
|
87
|
-
cron_schedule: UPDATER.SCHEDULE,
|
|
114
|
+
cron_schedule: constants_1.UPDATER.SCHEDULE,
|
|
88
115
|
});
|
|
89
116
|
}
|
|
90
117
|
return apps;
|
|
@@ -218,7 +245,7 @@ function isPidAlive(pid) {
|
|
|
218
245
|
if (!Number.isInteger(pid) || pid <= 0)
|
|
219
246
|
return false;
|
|
220
247
|
try {
|
|
221
|
-
return runtime.kill(pid, 0);
|
|
248
|
+
return runtime_1.runtime.kill(pid, 0);
|
|
222
249
|
}
|
|
223
250
|
catch (_) {
|
|
224
251
|
return false;
|
|
@@ -229,45 +256,45 @@ async function waitForPidExit(pid, timeoutMs) {
|
|
|
229
256
|
while (Date.now() - started < timeoutMs) {
|
|
230
257
|
if (!isPidAlive(pid))
|
|
231
258
|
return true;
|
|
232
|
-
await sleep(200);
|
|
259
|
+
await (0, system_1.sleep)(200);
|
|
233
260
|
}
|
|
234
261
|
return !isPidAlive(pid);
|
|
235
262
|
}
|
|
236
263
|
function readProcArgs(pid) {
|
|
237
|
-
return getProcessDiscovery().readArgs(pid);
|
|
264
|
+
return (0, process_discovery_1.getProcessDiscovery)().readArgs(pid);
|
|
238
265
|
}
|
|
239
266
|
function readProcCwd(pid) {
|
|
240
|
-
return getProcessDiscovery().readCwd(pid);
|
|
267
|
+
return (0, process_discovery_1.getProcessDiscovery)().readCwd(pid);
|
|
241
268
|
}
|
|
242
269
|
function normalizeProcScriptArg(arg, cwd) {
|
|
243
270
|
if (!arg || String(arg).startsWith('-'))
|
|
244
271
|
return '';
|
|
245
272
|
if (!/\.(?:[cm]?js|ts)$/i.test(String(arg)))
|
|
246
273
|
return '';
|
|
247
|
-
return path.isAbsolute(arg)
|
|
248
|
-
? path.normalize(arg)
|
|
249
|
-
: path.resolve(cwd || PATHS.PROJECT_ROOT, arg);
|
|
274
|
+
return path_api_1.path.isAbsolute(arg)
|
|
275
|
+
? path_api_1.path.normalize(arg)
|
|
276
|
+
: path_api_1.path.resolve(cwd || paths_1.PATHS.PROJECT_ROOT, arg);
|
|
250
277
|
}
|
|
251
278
|
function scriptPathForRoot(root, scriptSegments, ext) {
|
|
252
279
|
const segments = [...scriptSegments];
|
|
253
280
|
const last = segments.pop();
|
|
254
281
|
segments.push(String(last).replace(/\.(?:[cm]?js|ts)$/i, '') + ext);
|
|
255
|
-
return path.join(root, ...segments);
|
|
282
|
+
return path_api_1.path.join(root, ...segments);
|
|
256
283
|
}
|
|
257
284
|
function candidateRuntimeScriptPaths(scriptSegments) {
|
|
258
285
|
const candidates = new Set([
|
|
259
|
-
buildRuntimeScriptPath(
|
|
260
|
-
scriptPathForRoot(PATHS.PROJECT_ROOT, scriptSegments, '.ts'),
|
|
261
|
-
scriptPathForRoot(path.join(PATHS.PROJECT_ROOT, BUILD_DIR), scriptSegments, '.js'),
|
|
286
|
+
(0, runtime_entry_1.buildRuntimeScriptPath)(runtime_entry_1.SCRIPTS_ROOT, scriptSegments),
|
|
287
|
+
scriptPathForRoot(paths_1.PATHS.PROJECT_ROOT, scriptSegments, '.ts'),
|
|
288
|
+
scriptPathForRoot(path_api_1.path.join(paths_1.PATHS.PROJECT_ROOT, constants_1.BUILD_DIR), scriptSegments, '.js'),
|
|
262
289
|
]);
|
|
263
290
|
if (scriptSegments.length === 1) {
|
|
264
|
-
candidates.add(scriptPathForRoot(PATHS.PROJECT_ROOT, scriptSegments, '.js'));
|
|
291
|
+
candidates.add(scriptPathForRoot(paths_1.PATHS.PROJECT_ROOT, scriptSegments, '.js'));
|
|
265
292
|
}
|
|
266
293
|
// Compatibility for wrappers already running from before the unlock-start -> unlock rename.
|
|
267
294
|
if (scriptSegments.length === 1 && scriptSegments[0] === 'unlock') {
|
|
268
|
-
candidates.add(scriptPathForRoot(PATHS.PROJECT_ROOT, ['unlock-start'], '.js'));
|
|
269
|
-
candidates.add(scriptPathForRoot(PATHS.PROJECT_ROOT, ['unlock-start'], '.ts'));
|
|
270
|
-
candidates.add(scriptPathForRoot(path.join(PATHS.PROJECT_ROOT, BUILD_DIR), ['unlock-start'], '.js'));
|
|
295
|
+
candidates.add(scriptPathForRoot(paths_1.PATHS.PROJECT_ROOT, ['unlock-start'], '.js'));
|
|
296
|
+
candidates.add(scriptPathForRoot(paths_1.PATHS.PROJECT_ROOT, ['unlock-start'], '.ts'));
|
|
297
|
+
candidates.add(scriptPathForRoot(path_api_1.path.join(paths_1.PATHS.PROJECT_ROOT, constants_1.BUILD_DIR), ['unlock-start'], '.js'));
|
|
271
298
|
}
|
|
272
299
|
return candidates;
|
|
273
300
|
}
|
|
@@ -275,7 +302,7 @@ function pidMatchesScriptCandidates(pid, expectedPaths) {
|
|
|
275
302
|
if (!expectedPaths || expectedPaths.size === 0)
|
|
276
303
|
return false;
|
|
277
304
|
const args = readProcArgs(pid);
|
|
278
|
-
if (!args.some((arg) => path.basename(String(arg)).includes('node'))) {
|
|
305
|
+
if (!args.some((arg) => path_api_1.path.basename(String(arg)).includes('node'))) {
|
|
279
306
|
return false;
|
|
280
307
|
}
|
|
281
308
|
const cwd = readProcCwd(pid);
|
|
@@ -292,7 +319,7 @@ function isNodeProcessWithExactScript(pid, scriptSegments) {
|
|
|
292
319
|
}
|
|
293
320
|
function readMarketAdapterLockPid() {
|
|
294
321
|
try {
|
|
295
|
-
const info = readJSON(PATHS.MARKET_ADAPTER.LOCK_FILE);
|
|
322
|
+
const info = (0, fs_utils_1.readJSON)(paths_1.PATHS.MARKET_ADAPTER.LOCK_FILE);
|
|
296
323
|
const pid = Number(info.pid);
|
|
297
324
|
return Number.isInteger(pid) && pid > 0 ? pid : null;
|
|
298
325
|
}
|
|
@@ -306,10 +333,10 @@ async function stopMarketAdapterFromLock(timeoutMs = 5000) {
|
|
|
306
333
|
return { pid, stopped: false };
|
|
307
334
|
}
|
|
308
335
|
try {
|
|
309
|
-
runtime.kill(pid, 'SIGTERM');
|
|
336
|
+
runtime_1.runtime.kill(pid, 'SIGTERM');
|
|
310
337
|
let stopped = await waitForPidExit(pid, timeoutMs);
|
|
311
338
|
if (!stopped && isNodeProcessWithExactScript(pid, ['market_adapter', 'market_adapter'])) {
|
|
312
|
-
runtime.kill(pid, 'SIGKILL');
|
|
339
|
+
runtime_1.runtime.kill(pid, 'SIGKILL');
|
|
313
340
|
stopped = await waitForPidExit(pid, 2000);
|
|
314
341
|
}
|
|
315
342
|
return { pid, stopped };
|
|
@@ -325,12 +352,13 @@ function getChildRSS(child) {
|
|
|
325
352
|
if (!child || !child.pid)
|
|
326
353
|
return -1;
|
|
327
354
|
try {
|
|
328
|
-
if (Config.PLATFORM === 'linux') {
|
|
329
|
-
const bytes = getProcessDiscovery().readRSSBytes(child.pid);
|
|
355
|
+
if (config_1.Config.PLATFORM === 'linux') {
|
|
356
|
+
const bytes = (0, process_discovery_1.getProcessDiscovery)().readRSSBytes(child.pid);
|
|
330
357
|
if (bytes > 0)
|
|
331
358
|
return bytes;
|
|
332
359
|
}
|
|
333
|
-
else if (Config.PLATFORM === 'darwin') {
|
|
360
|
+
else if (config_1.Config.PLATFORM === 'darwin') {
|
|
361
|
+
const { execSync } = require('child_process');
|
|
334
362
|
const out = execSync(`ps -o rss= -p ${child.pid}`, { encoding: 'utf8', timeout: 3000 });
|
|
335
363
|
const rssKB = parseInt(out.trim(), 10);
|
|
336
364
|
if (rssKB > 0)
|
|
@@ -378,7 +406,7 @@ function formatUptime(ms) {
|
|
|
378
406
|
return `${m}m ${s % 60}s`;
|
|
379
407
|
return `${s}s`;
|
|
380
408
|
}
|
|
381
|
-
function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spawnFn = spawn, log = (...args) => console.log(SUPERVISOR_PREFIX, ...args), logError = (...args) => console.error(SUPERVISOR_PREFIX, ...args), controlSocket = !Config.DEXBOT_DISABLE_SUPERVISOR_SOCKET, getChildRss = getChildRSS, memoryCheckIntervalMs = MEMORY_CHECK_INTERVAL_MS, statusLogIntervalMs = STATUS_LOG_INTERVAL_MS, setTimeoutFn = setTimeout, clearTimeoutFn = clearTimeout, nowFn = () => Date.now(), stopMarketAdapter = stopMarketAdapterFromLock, updaterActive = UPDATER.ACTIVE, } = {}) {
|
|
409
|
+
function createBotSupervisor({ bots = null, buildEnv = child_env_1.buildScopedChildEnv, spawnFn = node_child_process_1.spawn, log = (...args) => console.log(SUPERVISOR_PREFIX, ...args), logError = (...args) => console.error(SUPERVISOR_PREFIX, ...args), controlSocket = !config_1.Config.DEXBOT_DISABLE_SUPERVISOR_SOCKET, getChildRss = getChildRSS, memoryCheckIntervalMs = MEMORY_CHECK_INTERVAL_MS, statusLogIntervalMs = STATUS_LOG_INTERVAL_MS, setTimeoutFn = setTimeout, clearTimeoutFn = clearTimeout, nowFn = () => Date.now(), stopMarketAdapter = stopMarketAdapterFromLock, updaterActive = constants_1.UPDATER.ACTIVE, } = {}) {
|
|
382
410
|
const botStates = new Map();
|
|
383
411
|
let shuttingDown = false;
|
|
384
412
|
let shutdownResolve = null;
|
|
@@ -461,7 +489,7 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
461
489
|
}
|
|
462
490
|
}
|
|
463
491
|
catch (err) {
|
|
464
|
-
logError(`Failed to start scheduled job ${state.name}:`,
|
|
492
|
+
logError(`Failed to start scheduled job ${state.name}:`, (0, errors_1.getErrorMessage)(err));
|
|
465
493
|
state.status = 'crashed';
|
|
466
494
|
}
|
|
467
495
|
finally {
|
|
@@ -473,7 +501,7 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
473
501
|
}
|
|
474
502
|
}
|
|
475
503
|
catch (err) {
|
|
476
|
-
logError(`Invalid cron schedule for ${state.name}: ${err
|
|
504
|
+
logError(`Invalid cron schedule for ${state.name}: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
477
505
|
}
|
|
478
506
|
}
|
|
479
507
|
function runMemoryCheck() {
|
|
@@ -511,28 +539,28 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
511
539
|
return null;
|
|
512
540
|
}
|
|
513
541
|
ensureLogDir();
|
|
514
|
-
const outFile = app.out_file || path.join(PATHS.LOGS_DIR, `${appName}.log`);
|
|
515
|
-
const errorFile = app.error_file || path.join(PATHS.LOGS_DIR, `${appName}-error.log`);
|
|
516
|
-
const outStream =
|
|
517
|
-
const errStream =
|
|
542
|
+
const outFile = app.out_file || path_api_1.path.join(paths_1.PATHS.LOGS_DIR, `${appName}.log`);
|
|
543
|
+
const errorFile = app.error_file || path_api_1.path.join(paths_1.PATHS.LOGS_DIR, `${appName}-error.log`);
|
|
544
|
+
const outStream = node_fs_1.default.createWriteStream(outFile, { flags: 'a' });
|
|
545
|
+
const errStream = node_fs_1.default.createWriteStream(errorFile, { flags: 'a' });
|
|
518
546
|
const isBot = !isServiceApp(app);
|
|
519
547
|
const extraEnv = {
|
|
520
548
|
...(app.env || {}),
|
|
521
549
|
DEXBOT_LAUNCH_MODE: 'isolated',
|
|
522
550
|
...(isBot ? { LIVE_BOT_NAME: appName } : {}),
|
|
523
551
|
};
|
|
524
|
-
const runtimeArgs = isDistCodeRoot(
|
|
552
|
+
const runtimeArgs = (0, runtime_entry_1.isDistCodeRoot)(runtime_entry_1.SCRIPTS_ROOT)
|
|
525
553
|
? [app.script || BOT_SCRIPT, ...normalizeAppArgs(app.args)]
|
|
526
554
|
: ['--import', 'tsx', app.script || BOT_SCRIPT, ...normalizeAppArgs(app.args)];
|
|
527
|
-
const child = spawnFn(Config.EXEC_PATH, runtimeArgs, {
|
|
528
|
-
cwd: app.cwd || PATHS.PROJECT_ROOT,
|
|
555
|
+
const child = spawnFn(config_1.Config.EXEC_PATH, runtimeArgs, {
|
|
556
|
+
cwd: app.cwd || paths_1.PATHS.PROJECT_ROOT,
|
|
529
557
|
env: buildEnv({ extra: extraEnv }),
|
|
530
558
|
stdio: ['inherit', 'pipe', 'pipe'],
|
|
531
559
|
});
|
|
532
560
|
child.stdout.pipe(outStream);
|
|
533
|
-
child.stdout.pipe(runtime.stdout);
|
|
561
|
+
child.stdout.pipe(runtime_1.runtime.stdout);
|
|
534
562
|
child.stderr.pipe(errStream);
|
|
535
|
-
child.stderr.pipe(runtime.stderr);
|
|
563
|
+
child.stderr.pipe(runtime_1.runtime.stderr);
|
|
536
564
|
child.stdout.on('error', () => { });
|
|
537
565
|
child.stderr.on('error', () => { });
|
|
538
566
|
outStream.on('error', () => { });
|
|
@@ -603,7 +631,7 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
603
631
|
}, restartDelay);
|
|
604
632
|
});
|
|
605
633
|
child.on('error', (err) => {
|
|
606
|
-
logError(`${appName} spawn error:`,
|
|
634
|
+
logError(`${appName} spawn error:`, (0, errors_1.getErrorMessage)(err));
|
|
607
635
|
});
|
|
608
636
|
return child;
|
|
609
637
|
}
|
|
@@ -696,7 +724,7 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
696
724
|
}
|
|
697
725
|
}
|
|
698
726
|
catch (err) {
|
|
699
|
-
return { error: err
|
|
727
|
+
return { error: (0, errors_1.getErrorMessage)(err) };
|
|
700
728
|
}
|
|
701
729
|
}
|
|
702
730
|
function startSocketServer() {
|
|
@@ -708,7 +736,7 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
708
736
|
settled = true;
|
|
709
737
|
fn(value);
|
|
710
738
|
};
|
|
711
|
-
const testSocket =
|
|
739
|
+
const testSocket = node_net_1.default.createConnection(SOCKET_PATH);
|
|
712
740
|
testSocket.on('connect', () => {
|
|
713
741
|
testSocket.end();
|
|
714
742
|
settle(reject, new Error('Another supervisor instance is already running (socket exists). Stop it first or use a different profile.'));
|
|
@@ -724,8 +752,8 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
724
752
|
}
|
|
725
753
|
function startSocketServerInternal() {
|
|
726
754
|
return new Promise((resolve, reject) => {
|
|
727
|
-
safeUnlink(SOCKET_PATH);
|
|
728
|
-
socketServer =
|
|
755
|
+
(0, fs_utils_1.safeUnlink)(SOCKET_PATH);
|
|
756
|
+
socketServer = node_net_1.default.createServer((socket) => {
|
|
729
757
|
socketConnections.add(socket);
|
|
730
758
|
let buffer = '';
|
|
731
759
|
let commandQueue = Promise.resolve();
|
|
@@ -735,7 +763,7 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
735
763
|
.then(handler)
|
|
736
764
|
.catch((err) => {
|
|
737
765
|
try {
|
|
738
|
-
socket.write(JSON.stringify({ error: err
|
|
766
|
+
socket.write(JSON.stringify({ error: (0, errors_1.getErrorMessage)(err) }) + '\n');
|
|
739
767
|
}
|
|
740
768
|
catch (_) { }
|
|
741
769
|
});
|
|
@@ -746,7 +774,7 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
746
774
|
return;
|
|
747
775
|
buffer += data.toString();
|
|
748
776
|
const lines = buffer.split('\n');
|
|
749
|
-
buffer = lines.pop();
|
|
777
|
+
buffer = lines.pop() ?? '';
|
|
750
778
|
for (const line of lines) {
|
|
751
779
|
if (deleteQueued)
|
|
752
780
|
break;
|
|
@@ -785,14 +813,14 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
785
813
|
});
|
|
786
814
|
});
|
|
787
815
|
const onError = (err) => {
|
|
788
|
-
logError(`Socket server error: ${err
|
|
816
|
+
logError(`Socket server error: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
789
817
|
reject(err);
|
|
790
818
|
};
|
|
791
819
|
socketServer.once('error', onError);
|
|
792
820
|
socketServer.listen(SOCKET_PATH, () => {
|
|
793
821
|
socketServer.off('error', onError);
|
|
794
822
|
socketServer.on('error', (err) => {
|
|
795
|
-
logError(`Socket server error: ${err
|
|
823
|
+
logError(`Socket server error: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
796
824
|
});
|
|
797
825
|
try {
|
|
798
826
|
storage.chmod(SOCKET_PATH, 0o600);
|
|
@@ -802,7 +830,7 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
802
830
|
resolve(undefined);
|
|
803
831
|
});
|
|
804
832
|
process.once('exit', () => {
|
|
805
|
-
safeUnlink(SOCKET_PATH);
|
|
833
|
+
(0, fs_utils_1.safeUnlink)(SOCKET_PATH);
|
|
806
834
|
});
|
|
807
835
|
});
|
|
808
836
|
}
|
|
@@ -824,7 +852,7 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
824
852
|
catch (_) { }
|
|
825
853
|
}
|
|
826
854
|
socketConnections = new Set([...socketConnections].filter((sock) => preserved.has(sock)));
|
|
827
|
-
safeUnlink(SOCKET_PATH);
|
|
855
|
+
(0, fs_utils_1.safeUnlink)(SOCKET_PATH);
|
|
828
856
|
}
|
|
829
857
|
async function start() {
|
|
830
858
|
const activeBots = loadActiveBots(bots);
|
|
@@ -860,9 +888,11 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
860
888
|
});
|
|
861
889
|
}
|
|
862
890
|
memoryCheckTimer = setInterval(runMemoryCheck, memoryCheckIntervalMs);
|
|
863
|
-
memoryCheckTimer
|
|
891
|
+
if (memoryCheckTimer)
|
|
892
|
+
memoryCheckTimer.unref();
|
|
864
893
|
statusLogTimer = setInterval(printStatusSummary, statusLogIntervalMs);
|
|
865
|
-
statusLogTimer
|
|
894
|
+
if (statusLogTimer)
|
|
895
|
+
statusLogTimer.unref();
|
|
866
896
|
log(`Memory limit: ${MAX_MEMORY_MB}MB per process`);
|
|
867
897
|
for (let i = 0; i < activeApps.length; i++) {
|
|
868
898
|
const app = activeApps[i];
|
|
@@ -874,14 +904,14 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
874
904
|
}
|
|
875
905
|
}
|
|
876
906
|
catch (err) {
|
|
877
|
-
logError(`Failed to start ${app.name}:`,
|
|
907
|
+
logError(`Failed to start ${app.name}:`, (0, errors_1.getErrorMessage)(err));
|
|
878
908
|
const state = botStates.get(app.name);
|
|
879
909
|
if (state) {
|
|
880
910
|
state.status = 'crashed';
|
|
881
911
|
}
|
|
882
912
|
}
|
|
883
913
|
if (i < activeApps.length - 1) {
|
|
884
|
-
await sleep(STAGGER_DELAY_MS);
|
|
914
|
+
await (0, system_1.sleep)(STAGGER_DELAY_MS);
|
|
885
915
|
}
|
|
886
916
|
}
|
|
887
917
|
for (const [, state] of botStates) {
|
|
@@ -1039,26 +1069,4 @@ function createBotSupervisor({ bots = null, buildEnv = buildScopedChildEnv, spaw
|
|
|
1039
1069
|
waitForStableStartup,
|
|
1040
1070
|
};
|
|
1041
1071
|
}
|
|
1042
|
-
module.exports = {
|
|
1043
|
-
createBotSupervisor,
|
|
1044
|
-
SOCKET_PATH,
|
|
1045
|
-
parseCronExpression,
|
|
1046
|
-
getNextCronDate,
|
|
1047
|
-
forwardSignal,
|
|
1048
|
-
isPidAlive,
|
|
1049
|
-
waitForPidExit,
|
|
1050
|
-
readProcArgs,
|
|
1051
|
-
readProcCwd,
|
|
1052
|
-
normalizeProcScriptArg,
|
|
1053
|
-
scriptPathForRoot,
|
|
1054
|
-
candidateRuntimeScriptPaths,
|
|
1055
|
-
pidMatchesScriptCandidates,
|
|
1056
|
-
isNodeProcessWithExactScript,
|
|
1057
|
-
readMarketAdapterLockPid,
|
|
1058
|
-
stopMarketAdapterFromLock,
|
|
1059
|
-
usesAmaGridPrice,
|
|
1060
|
-
waitForChildSpawn,
|
|
1061
|
-
getChildRSS,
|
|
1062
|
-
formatUptime,
|
|
1063
|
-
};
|
|
1064
1072
|
//# sourceMappingURL=bot_supervisor.js.map
|