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
package/dist/pm2.js
CHANGED
|
@@ -68,40 +68,73 @@
|
|
|
68
68
|
* - Credential daemon is started as a PM2 app after one-shot bootstrap
|
|
69
69
|
* - Bots request private keys from credential daemon via Unix socket
|
|
70
70
|
*/
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
72
|
+
if (k2 === undefined) k2 = k;
|
|
73
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
74
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
75
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
76
|
+
}
|
|
77
|
+
Object.defineProperty(o, k2, desc);
|
|
78
|
+
}) : (function(o, m, k, k2) {
|
|
79
|
+
if (k2 === undefined) k2 = k;
|
|
80
|
+
o[k2] = m[k];
|
|
81
|
+
}));
|
|
82
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
83
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
84
|
+
}) : function(o, v) {
|
|
85
|
+
o["default"] = v;
|
|
86
|
+
});
|
|
87
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
88
|
+
var ownKeys = function(o) {
|
|
89
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
90
|
+
var ar = [];
|
|
91
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
92
|
+
return ar;
|
|
93
|
+
};
|
|
94
|
+
return ownKeys(o);
|
|
95
|
+
};
|
|
96
|
+
return function (mod) {
|
|
97
|
+
if (mod && mod.__esModule) return mod;
|
|
98
|
+
var result = {};
|
|
99
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
100
|
+
__setModuleDefault(result, mod);
|
|
101
|
+
return result;
|
|
102
|
+
};
|
|
103
|
+
})();
|
|
104
|
+
const config_1 = require("./modules/config");
|
|
105
|
+
const path_api_1 = require("./modules/path_api");
|
|
106
|
+
const node_child_process_1 = require("node:child_process");
|
|
107
|
+
const system_1 = require("./modules/order/utils/system");
|
|
108
|
+
const bots_file_lock_1 = require("./modules/bots_file_lock");
|
|
109
|
+
const bot_settings_1 = require("./modules/bot_settings");
|
|
110
|
+
const chainKeys = __importStar(require("./modules/chain_keys"));
|
|
111
|
+
const credentialPolicy = __importStar(require("./modules/credential_policy"));
|
|
112
|
+
const headless_password_1 = require("./modules/launcher/headless_password");
|
|
113
|
+
const child_env_1 = require("./modules/launcher/child_env");
|
|
114
|
+
const credential_bootstrap_1 = require("./modules/launcher/credential_bootstrap");
|
|
115
|
+
const launch_modes_1 = require("./modules/launcher/launch_modes");
|
|
116
|
+
const graceful_shutdown_1 = require("./modules/graceful_shutdown");
|
|
117
|
+
const constants_1 = require("./modules/constants");
|
|
118
|
+
const paths_1 = require("./modules/paths");
|
|
119
|
+
const runtime_entry_1 = require("./modules/launcher/runtime_entry");
|
|
120
|
+
const storage_1 = require("./modules/storage");
|
|
121
|
+
const fs_utils_1 = require("./modules/utils/fs_utils");
|
|
122
|
+
const config_2 = require("./modules/config");
|
|
123
|
+
const bitshares_client_1 = require("./modules/bitshares_client");
|
|
124
|
+
const readline = __importStar(require("node:readline"));
|
|
125
|
+
const errors_1 = require("./modules/utils/errors");
|
|
126
|
+
(0, config_1.setUmask)(0o077);
|
|
83
127
|
const { ensureCredentialRuntimeDirSync, getCredentialReadyFilePath, getCredentialSocketPath, } = require('./modules/credential_runtime');
|
|
84
|
-
const
|
|
85
|
-
const { createPasswordBootstrapServer } = require('./modules/launcher/credential_bootstrap');
|
|
86
|
-
const { parsePm2Args } = require('./modules/launcher/launch_modes');
|
|
87
|
-
const { setupGracefulShutdown } = require('./modules/graceful_shutdown');
|
|
88
|
-
const { UPDATER, TIMING } = require('./modules/constants');
|
|
89
|
-
const { PATHS } = require('./modules/paths');
|
|
90
|
-
const { isDistCodeRoot, buildRuntimeScriptPath } = require('./modules/launcher/runtime_entry');
|
|
91
|
-
const { getStorage } = require('./modules/storage');
|
|
92
|
-
const storage = getStorage();
|
|
93
|
-
const { ensureDir, safeUnlink } = require('./modules/utils/fs_utils');
|
|
94
|
-
const { Config } = require('./modules/config');
|
|
128
|
+
const storage = (0, storage_1.getStorage)();
|
|
95
129
|
// Setup graceful shutdown handlers
|
|
96
|
-
setupGracefulShutdown();
|
|
97
|
-
const execAsync = promisify(exec);
|
|
130
|
+
(0, graceful_shutdown_1.setupGracefulShutdown)();
|
|
98
131
|
const PM2_COLORS = {
|
|
99
132
|
reset: '\x1b[0m',
|
|
100
133
|
ok: '\x1b[1;92m',
|
|
101
134
|
error: '\x1b[1;31m',
|
|
102
135
|
};
|
|
103
136
|
function colorPm2Output(text, color, stream = process.stdout) {
|
|
104
|
-
return stream.isTTY && !Config.NO_COLOR
|
|
137
|
+
return stream.isTTY && !config_2.Config.NO_COLOR
|
|
105
138
|
? `${color}${text}${PM2_COLORS.reset}`
|
|
106
139
|
: text;
|
|
107
140
|
}
|
|
@@ -112,16 +145,15 @@ function pm2Error(text) {
|
|
|
112
145
|
return colorPm2Output(text, PM2_COLORS.error, process.stderr);
|
|
113
146
|
}
|
|
114
147
|
const CODE_ROOT = __dirname;
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
const LOGS_DIR = PATHS.LOGS_DIR;
|
|
148
|
+
const BOTS_JSON = paths_1.PATHS.PROFILES.BOTS_JSON;
|
|
149
|
+
const ECOSYSTEM_FILE = paths_1.PATHS.PROFILES.ECOSYSTEM_CONFIG_JS;
|
|
150
|
+
const POLICY_CONFIG_FILE = paths_1.PATHS.PROFILES.DAEMON_POLICIES_JSON;
|
|
151
|
+
const LOGS_DIR = paths_1.PATHS.LOGS_DIR;
|
|
120
152
|
const CREDENTIAL_DAEMON_APP_NAME = 'dexbot-cred';
|
|
121
|
-
const CREDENTIAL_SOCKET_PATH = getCredentialSocketPath({ root: PATHS.PROJECT_ROOT });
|
|
122
|
-
const CREDENTIAL_READY_FILE = getCredentialReadyFilePath({ root: PATHS.PROJECT_ROOT });
|
|
153
|
+
const CREDENTIAL_SOCKET_PATH = getCredentialSocketPath({ root: paths_1.PATHS.PROJECT_ROOT });
|
|
154
|
+
const CREDENTIAL_READY_FILE = getCredentialReadyFilePath({ root: paths_1.PATHS.PROJECT_ROOT });
|
|
123
155
|
function runtimeScript(...segments) {
|
|
124
|
-
return path.join(CODE_ROOT, ...segments);
|
|
156
|
+
return path_api_1.path.join(CODE_ROOT, ...segments);
|
|
125
157
|
}
|
|
126
158
|
function usesAmaGridPrice(bot) {
|
|
127
159
|
const gridPrice = typeof bot?.gridPrice === 'string' ? bot.gridPrice.trim().toLowerCase() : '';
|
|
@@ -191,14 +223,14 @@ function buildEcosystemApps(bots, { includeUpdater = true } = {}) {
|
|
|
191
223
|
const botName = bot.name || `bot-${index}`;
|
|
192
224
|
return {
|
|
193
225
|
name: botName,
|
|
194
|
-
script: buildRuntimeScriptPath(CODE_ROOT, ['bot']),
|
|
226
|
+
script: (0, runtime_entry_1.buildRuntimeScriptPath)(CODE_ROOT, ['bot']),
|
|
195
227
|
args: botName,
|
|
196
|
-
cwd: PATHS.PROJECT_ROOT,
|
|
228
|
+
cwd: paths_1.PATHS.PROJECT_ROOT,
|
|
197
229
|
max_memory_restart: '250M',
|
|
198
230
|
watch: false,
|
|
199
231
|
autorestart: true,
|
|
200
|
-
error_file: path.join(LOGS_DIR, `${botName}-error.log`),
|
|
201
|
-
out_file: path.join(LOGS_DIR, `${botName}.log`),
|
|
232
|
+
error_file: path_api_1.path.join(LOGS_DIR, `${botName}-error.log`),
|
|
233
|
+
out_file: path_api_1.path.join(LOGS_DIR, `${botName}.log`),
|
|
202
234
|
log_date_format: 'YY-MM-DD HH:mm:ss.SSS',
|
|
203
235
|
merge_logs: false,
|
|
204
236
|
combine_logs: true,
|
|
@@ -211,13 +243,13 @@ function buildEcosystemApps(bots, { includeUpdater = true } = {}) {
|
|
|
211
243
|
if (needsMarketAdapter(bots)) {
|
|
212
244
|
apps.unshift({
|
|
213
245
|
name: 'dexbot-adapter',
|
|
214
|
-
script: buildRuntimeScriptPath(CODE_ROOT, ['market_adapter', 'market_adapter']),
|
|
215
|
-
cwd: PATHS.PROJECT_ROOT,
|
|
246
|
+
script: (0, runtime_entry_1.buildRuntimeScriptPath)(CODE_ROOT, ['market_adapter', 'market_adapter']),
|
|
247
|
+
cwd: paths_1.PATHS.PROJECT_ROOT,
|
|
216
248
|
watch: false,
|
|
217
249
|
autorestart: true,
|
|
218
250
|
max_memory_restart: '150M',
|
|
219
|
-
error_file: path.join(LOGS_DIR, 'dexbot-adapter-error.log'),
|
|
220
|
-
out_file: path.join(LOGS_DIR, 'dexbot-adapter.log'),
|
|
251
|
+
error_file: path_api_1.path.join(LOGS_DIR, 'dexbot-adapter-error.log'),
|
|
252
|
+
out_file: path_api_1.path.join(LOGS_DIR, 'dexbot-adapter.log'),
|
|
221
253
|
log_date_format: 'YY-MM-DD HH:mm:ss.SSS',
|
|
222
254
|
merge_logs: false,
|
|
223
255
|
combine_logs: true,
|
|
@@ -225,18 +257,18 @@ function buildEcosystemApps(bots, { includeUpdater = true } = {}) {
|
|
|
225
257
|
max_restarts: 13,
|
|
226
258
|
min_uptime: 60000,
|
|
227
259
|
restart_delay: 3000,
|
|
228
|
-
...(isDistCodeRoot(CODE_ROOT) ? {} : { node_args: ['--import', 'tsx'] })
|
|
260
|
+
...((0, runtime_entry_1.isDistCodeRoot)(CODE_ROOT) ? {} : { node_args: ['--import', 'tsx'] })
|
|
229
261
|
});
|
|
230
262
|
}
|
|
231
|
-
if (includeUpdater && UPDATER.ACTIVE) {
|
|
263
|
+
if (includeUpdater && constants_1.UPDATER.ACTIVE) {
|
|
232
264
|
apps.push({
|
|
233
265
|
name: "dexbot-update",
|
|
234
266
|
script: runtimeScript('scripts', 'update.js'),
|
|
235
|
-
cwd: PATHS.PROJECT_ROOT,
|
|
267
|
+
cwd: paths_1.PATHS.PROJECT_ROOT,
|
|
236
268
|
autorestart: false,
|
|
237
|
-
cron_restart: UPDATER.SCHEDULE,
|
|
238
|
-
error_file: path.join(LOGS_DIR, `dexbot-update-error.log`),
|
|
239
|
-
out_file: path.join(LOGS_DIR, `dexbot-update.log`),
|
|
269
|
+
cron_restart: constants_1.UPDATER.SCHEDULE,
|
|
270
|
+
error_file: path_api_1.path.join(LOGS_DIR, `dexbot-update-error.log`),
|
|
271
|
+
out_file: path_api_1.path.join(LOGS_DIR, `dexbot-update.log`),
|
|
240
272
|
log_date_format: "YY-MM-DD HH:mm:ss.SSS",
|
|
241
273
|
max_size: '100M'
|
|
242
274
|
});
|
|
@@ -247,10 +279,10 @@ function buildCredentialDaemonApp({ credentialEnv = {} } = {}) {
|
|
|
247
279
|
return {
|
|
248
280
|
name: CREDENTIAL_DAEMON_APP_NAME,
|
|
249
281
|
script: runtimeScript('credential-daemon.js'),
|
|
250
|
-
cwd: PATHS.PROJECT_ROOT,
|
|
282
|
+
cwd: paths_1.PATHS.PROJECT_ROOT,
|
|
251
283
|
autorestart: false,
|
|
252
|
-
error_file: path.join(LOGS_DIR, 'dexbot-cred-error.log'),
|
|
253
|
-
out_file: path.join(LOGS_DIR, 'dexbot-cred.log'),
|
|
284
|
+
error_file: path_api_1.path.join(LOGS_DIR, 'dexbot-cred-error.log'),
|
|
285
|
+
out_file: path_api_1.path.join(LOGS_DIR, 'dexbot-cred.log'),
|
|
254
286
|
log_date_format: 'YY-MM-DD HH:mm:ss.SSS',
|
|
255
287
|
merge_logs: false,
|
|
256
288
|
combine_logs: true,
|
|
@@ -280,14 +312,14 @@ function generateEcosystemConfig({ botNameFilter = null, clawOnly = false, exitO
|
|
|
280
312
|
}
|
|
281
313
|
// Ensure logs directory exists
|
|
282
314
|
if (!storage.exists(LOGS_DIR)) {
|
|
283
|
-
ensureDir(LOGS_DIR);
|
|
315
|
+
(0, fs_utils_1.ensureDir)(LOGS_DIR);
|
|
284
316
|
}
|
|
285
317
|
try {
|
|
286
318
|
if (clawOnly) {
|
|
287
319
|
const appsClaw = [];
|
|
288
320
|
const ecosystemContent = `// Auto-generated by pm2.js - DO NOT EDIT
|
|
289
321
|
// Regenerate with: dexbot pm2 or node dist/dexbot.js pm2
|
|
290
|
-
|
|
322
|
+
export default { apps: ${JSON.stringify(appsClaw, null, 2)} }
|
|
291
323
|
`;
|
|
292
324
|
storage.writeFile(ECOSYSTEM_FILE, ecosystemContent);
|
|
293
325
|
return appsClaw;
|
|
@@ -295,8 +327,8 @@ module.exports = { apps: ${JSON.stringify(appsClaw, null, 2)} };
|
|
|
295
327
|
if (!storage.exists(BOTS_JSON)) {
|
|
296
328
|
fail('profiles/bots.json not found. Run: dexbot bot');
|
|
297
329
|
}
|
|
298
|
-
const { config } = loadSettingsFile(BOTS_JSON, { exitOnError });
|
|
299
|
-
const bots = selectActiveBotEntries(config);
|
|
330
|
+
const { config } = (0, bot_settings_1.loadSettingsFile)(BOTS_JSON, { exitOnError });
|
|
331
|
+
const bots = (0, bot_settings_1.selectActiveBotEntries)(config);
|
|
300
332
|
if (botNameFilter) {
|
|
301
333
|
const filtered = bots.filter((b) => b.name === botNameFilter);
|
|
302
334
|
if (filtered.length === 0) {
|
|
@@ -322,7 +354,7 @@ module.exports = { apps: ${JSON.stringify(apps, null, 2)} };
|
|
|
322
354
|
return apps;
|
|
323
355
|
}
|
|
324
356
|
catch (err) {
|
|
325
|
-
fail(`Error reading bots.json: ${err
|
|
357
|
+
fail(`Error reading bots.json: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
326
358
|
}
|
|
327
359
|
}
|
|
328
360
|
async function runManagedAppsPm2Action(action, { regenerate = false } = {}) {
|
|
@@ -336,15 +368,15 @@ async function runManagedAppsPm2Action(action, { regenerate = false } = {}) {
|
|
|
336
368
|
}
|
|
337
369
|
function cleanupStaleCredentialDaemonFiles() {
|
|
338
370
|
try {
|
|
339
|
-
safeUnlink(CREDENTIAL_SOCKET_PATH);
|
|
340
|
-
safeUnlink(CREDENTIAL_READY_FILE);
|
|
371
|
+
(0, fs_utils_1.safeUnlink)(CREDENTIAL_SOCKET_PATH);
|
|
372
|
+
(0, fs_utils_1.safeUnlink)(CREDENTIAL_READY_FILE);
|
|
341
373
|
}
|
|
342
374
|
catch (e) {
|
|
343
375
|
// Socket files already cleaned, that's fine
|
|
344
376
|
}
|
|
345
377
|
}
|
|
346
|
-
async function ensureCredentialDaemonPM2({ forceRefresh = false,
|
|
347
|
-
ensureCredentialRuntimeDirSync({ root: PATHS.PROJECT_ROOT, socketPath: CREDENTIAL_SOCKET_PATH, readyFilePath: CREDENTIAL_READY_FILE });
|
|
378
|
+
async function ensureCredentialDaemonPM2({ forceRefresh = false, headless = false, passwordFile = null } = {}) {
|
|
379
|
+
ensureCredentialRuntimeDirSync({ root: paths_1.PATHS.PROJECT_ROOT, socketPath: CREDENTIAL_SOCKET_PATH, readyFilePath: CREDENTIAL_READY_FILE });
|
|
348
380
|
credentialPolicy.ensurePolicyConfig(POLICY_CONFIG_FILE);
|
|
349
381
|
const daemonReady = await chainKeys.isDaemonResponsive({
|
|
350
382
|
socketPath: CREDENTIAL_SOCKET_PATH,
|
|
@@ -360,12 +392,12 @@ async function ensureCredentialDaemonPM2({ forceRefresh = false, logReuse, headl
|
|
|
360
392
|
try {
|
|
361
393
|
let vaultSecret;
|
|
362
394
|
if (headless) {
|
|
363
|
-
vaultSecret = chainKeys.unlockWithPassword(readHeadlessPassword({ passwordFile }));
|
|
395
|
+
vaultSecret = chainKeys.unlockWithPassword((0, headless_password_1.readHeadlessPassword)({ passwordFile }));
|
|
364
396
|
}
|
|
365
397
|
else {
|
|
366
398
|
vaultSecret = await chainKeys.authenticate();
|
|
367
399
|
}
|
|
368
|
-
bootstrap = await createPasswordBootstrapServer({ secret: vaultSecret });
|
|
400
|
+
bootstrap = await (0, credential_bootstrap_1.createPasswordBootstrapServer)({ secret: vaultSecret });
|
|
369
401
|
console.log(pm2Success('✓ Authentication successful'));
|
|
370
402
|
await startManagedRuntimePM2({ apps: [], bootstrap });
|
|
371
403
|
return true;
|
|
@@ -378,17 +410,17 @@ async function ensureCredentialDaemonPM2({ forceRefresh = false, logReuse, headl
|
|
|
378
410
|
}
|
|
379
411
|
async function assertActiveBotTarget(target) {
|
|
380
412
|
try {
|
|
381
|
-
const { config } = await readBotsFileWithLock(BOTS_JSON, parseJsonWithComments);
|
|
382
|
-
const botExists = selectActiveBotEntries(config).some((b) => b.name === target);
|
|
413
|
+
const { config } = await (0, bots_file_lock_1.readBotsFileWithLock)(BOTS_JSON, system_1.parseJsonWithComments);
|
|
414
|
+
const botExists = (0, bot_settings_1.selectActiveBotEntries)(config).some((b) => b.name === target);
|
|
383
415
|
if (!botExists) {
|
|
384
416
|
throw new Error(`Bot '${target}' not found or not active in profiles/bots.json`);
|
|
385
417
|
}
|
|
386
418
|
}
|
|
387
419
|
catch (err) {
|
|
388
|
-
if (String(err && err
|
|
420
|
+
if (String(err && (0, errors_1.getErrorMessage)(err) || '').includes('not found or not active')) {
|
|
389
421
|
throw err;
|
|
390
422
|
}
|
|
391
|
-
throw new Error(`Failed to read bots configuration: ${err
|
|
423
|
+
throw new Error(`Failed to read bots configuration: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
392
424
|
}
|
|
393
425
|
}
|
|
394
426
|
/**
|
|
@@ -402,7 +434,7 @@ async function main({ botNameFilter = null, clawOnly = false, headless = false,
|
|
|
402
434
|
if (typeof chainKeys.checkKeysFileSecurity === 'function')
|
|
403
435
|
chainKeys.checkKeysFileSecurity();
|
|
404
436
|
if (typeof credentialPolicy.checkPolicyFileSecurity === 'function')
|
|
405
|
-
credentialPolicy.checkPolicyFileSecurity(PATHS.PROFILES.DAEMON_POLICIES_JSON);
|
|
437
|
+
credentialPolicy.checkPolicyFileSecurity(paths_1.PATHS.PROFILES.DAEMON_POLICIES_JSON);
|
|
406
438
|
console.log('='.repeat(50));
|
|
407
439
|
console.log('DEXBot2 PM2 Launcher');
|
|
408
440
|
if (clawOnly) {
|
|
@@ -418,7 +450,6 @@ async function main({ botNameFilter = null, clawOnly = false, headless = false,
|
|
|
418
450
|
console.log();
|
|
419
451
|
if (!clawOnly) {
|
|
420
452
|
// Step 0: Wait for BitShares connection (suppress BitShares client logs)
|
|
421
|
-
const { waitForConnected } = require('./modules/bitshares_client');
|
|
422
453
|
// Suppress BitShares console output during connection
|
|
423
454
|
const originalLog = console.log;
|
|
424
455
|
try {
|
|
@@ -429,7 +460,7 @@ async function main({ botNameFilter = null, clawOnly = false, headless = false,
|
|
|
429
460
|
originalLog(...args);
|
|
430
461
|
}
|
|
431
462
|
};
|
|
432
|
-
await waitForConnected(TIMING.CONNECTION_TIMEOUT_MS);
|
|
463
|
+
await (0, bitshares_client_1.waitForConnected)(constants_1.TIMING.CONNECTION_TIMEOUT_MS);
|
|
433
464
|
}
|
|
434
465
|
finally {
|
|
435
466
|
// Always restore console output, even if waitForConnected throws
|
|
@@ -450,7 +481,7 @@ async function main({ botNameFilter = null, clawOnly = false, headless = false,
|
|
|
450
481
|
await ensureCredentialDaemonPM2({ headless, passwordFile });
|
|
451
482
|
}
|
|
452
483
|
catch (error) {
|
|
453
|
-
console.error(pm2Error(`\n❌ ${error
|
|
484
|
+
console.error(pm2Error(`\n❌ ${(0, errors_1.getErrorMessage)(error)}`));
|
|
454
485
|
process.exit(1);
|
|
455
486
|
}
|
|
456
487
|
// Step 3: Generate ecosystem config
|
|
@@ -471,10 +502,10 @@ async function main({ botNameFilter = null, clawOnly = false, headless = false,
|
|
|
471
502
|
console.log('='.repeat(50));
|
|
472
503
|
console.log();
|
|
473
504
|
}
|
|
474
|
-
function startPM2Process(args, env = buildScopedChildEnv()) {
|
|
505
|
+
function startPM2Process(args, env = (0, child_env_1.buildScopedChildEnv)()) {
|
|
475
506
|
return new Promise((resolve, reject) => {
|
|
476
|
-
const pm2 = spawn('pm2', args, {
|
|
477
|
-
cwd: PATHS.PROJECT_ROOT,
|
|
507
|
+
const pm2 = (0, node_child_process_1.spawn)('pm2', args, {
|
|
508
|
+
cwd: paths_1.PATHS.PROJECT_ROOT,
|
|
478
509
|
env,
|
|
479
510
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
480
511
|
detached: false,
|
|
@@ -522,12 +553,12 @@ function startCredentialDaemonPM2({ credentialEnv = {} } = {}) {
|
|
|
522
553
|
'--log-date-format', app.log_date_format,
|
|
523
554
|
'--no-autorestart',
|
|
524
555
|
];
|
|
525
|
-
return startPM2Process(args, buildScopedChildEnv({ extra: app.env }))
|
|
556
|
+
return startPM2Process(args, (0, child_env_1.buildScopedChildEnv)({ extra: app.env }))
|
|
526
557
|
.then(() => {
|
|
527
558
|
console.log(`[PM2] App [${CREDENTIAL_DAEMON_APP_NAME}] launched`);
|
|
528
559
|
});
|
|
529
560
|
}
|
|
530
|
-
async function startManagedRuntimePM2({ apps, bootstrap
|
|
561
|
+
async function startManagedRuntimePM2({ apps, bootstrap } = {}) {
|
|
531
562
|
if (bootstrap) {
|
|
532
563
|
await execPM2CommandIgnoreMissing('delete', CREDENTIAL_DAEMON_APP_NAME);
|
|
533
564
|
// Write the bootstrap socket path to a stable file in the runtime dir.
|
|
@@ -535,12 +566,12 @@ async function startManagedRuntimePM2({ apps, bootstrap = null } = {}) {
|
|
|
535
566
|
// PM2-persisted env var. Once consumed the file is deleted, so a
|
|
536
567
|
// future `pm2 restart dexbot-cred` or `pm2 resurrect` will not
|
|
537
568
|
// find it and will fall through to interactive auth.
|
|
538
|
-
const bootstrapPathFile = path.join(path.dirname(CREDENTIAL_SOCKET_PATH), '.dexbot-cred-bootstrap-path');
|
|
569
|
+
const bootstrapPathFile = path_api_1.path.join(path_api_1.path.dirname(CREDENTIAL_SOCKET_PATH), '.dexbot-cred-bootstrap-path');
|
|
539
570
|
try {
|
|
540
571
|
storage.writeFile(bootstrapPathFile, bootstrap.socketPath, { mode: 0o600 });
|
|
541
572
|
}
|
|
542
573
|
catch (err) {
|
|
543
|
-
throw new Error(`Cannot write bootstrap path file at ${bootstrapPathFile}: ${err
|
|
574
|
+
throw new Error(`Cannot write bootstrap path file at ${bootstrapPathFile}: ${(0, errors_1.getErrorMessage)(err)}. ` +
|
|
544
575
|
`The daemon needs this file to find the bootstrap socket.`);
|
|
545
576
|
}
|
|
546
577
|
// Start the daemon WITHOUT DEXBOT_CRED_BOOTSTRAP_SOCKET so PM2 never
|
|
@@ -553,7 +584,7 @@ async function startManagedRuntimePM2({ apps, bootstrap = null } = {}) {
|
|
|
553
584
|
await startCredentialDaemonPM2({ credentialEnv: daemonEnv });
|
|
554
585
|
await Promise.all([
|
|
555
586
|
bootstrap.waitForTransfer(),
|
|
556
|
-
chainKeys.waitForDaemon(TIMING.DAEMON_STARTUP_TIMEOUT_MS, {
|
|
587
|
+
chainKeys.waitForDaemon(constants_1.TIMING.DAEMON_STARTUP_TIMEOUT_MS, {
|
|
557
588
|
socketPath: CREDENTIAL_SOCKET_PATH,
|
|
558
589
|
readyFilePath: CREDENTIAL_READY_FILE,
|
|
559
590
|
}),
|
|
@@ -572,9 +603,8 @@ function checkPM2Installed() {
|
|
|
572
603
|
}
|
|
573
604
|
catch (e) {
|
|
574
605
|
// Check if pm2 is available in PATH
|
|
575
|
-
const { execSync } = require('child_process');
|
|
576
606
|
try {
|
|
577
|
-
execSync('pm2 --version', { stdio: 'ignore' });
|
|
607
|
+
(0, node_child_process_1.execSync)('pm2 --version', { stdio: 'ignore' });
|
|
578
608
|
return true;
|
|
579
609
|
}
|
|
580
610
|
catch (err) {
|
|
@@ -587,8 +617,6 @@ function checkPM2Installed() {
|
|
|
587
617
|
* @returns {Promise<void>}
|
|
588
618
|
*/
|
|
589
619
|
async function installPM2() {
|
|
590
|
-
const readline = require('readline');
|
|
591
|
-
const { spawn } = require('child_process');
|
|
592
620
|
const rl = readline.createInterface({
|
|
593
621
|
input: process.stdin,
|
|
594
622
|
output: process.stdout
|
|
@@ -604,7 +632,7 @@ async function installPM2() {
|
|
|
604
632
|
// Helper to run installation command
|
|
605
633
|
const runInstall = (command, args) => {
|
|
606
634
|
return new Promise((res, rej) => {
|
|
607
|
-
const proc = spawn(command, args, {
|
|
635
|
+
const proc = (0, node_child_process_1.spawn)(command, args, {
|
|
608
636
|
stdio: 'inherit',
|
|
609
637
|
shell: process.platform === 'win32'
|
|
610
638
|
});
|
|
@@ -623,7 +651,7 @@ async function installPM2() {
|
|
|
623
651
|
console.log(pm2Success('PM2 installed successfully!'));
|
|
624
652
|
resolve();
|
|
625
653
|
})
|
|
626
|
-
.catch((
|
|
654
|
+
.catch((_err) => {
|
|
627
655
|
// If failed and not on Windows, try sudo
|
|
628
656
|
if (process.platform !== 'win32') {
|
|
629
657
|
console.log('\nStandard installation failed (likely permissions). Trying with sudo...');
|
|
@@ -633,7 +661,7 @@ async function installPM2() {
|
|
|
633
661
|
console.log(pm2Success('PM2 installed successfully with sudo!'));
|
|
634
662
|
resolve();
|
|
635
663
|
})
|
|
636
|
-
.catch((
|
|
664
|
+
.catch((_finalErr) => {
|
|
637
665
|
reject(new Error('PM2 installation failed even with sudo'));
|
|
638
666
|
});
|
|
639
667
|
}
|
|
@@ -656,7 +684,7 @@ async function installPM2() {
|
|
|
656
684
|
reject(new Error('PM2 installation failed or was cancelled in the elevated window.'));
|
|
657
685
|
}
|
|
658
686
|
})
|
|
659
|
-
.catch((
|
|
687
|
+
.catch((_winErr) => {
|
|
660
688
|
console.error(pm2Error('\nFailed to elevate permissions.'));
|
|
661
689
|
console.error(pm2Error('Please manually run "npm install -g pm2" as Administrator.'));
|
|
662
690
|
reject(new Error('PM2 installation failed.'));
|
|
@@ -689,8 +717,7 @@ async function execPM2Command(action, target, { suppressStderrOnError = false, s
|
|
|
689
717
|
if (target) {
|
|
690
718
|
args.push(target);
|
|
691
719
|
}
|
|
692
|
-
const
|
|
693
|
-
const pm2 = spawn('pm2', args, {
|
|
720
|
+
const pm2 = (0, node_child_process_1.spawn)('pm2', args, {
|
|
694
721
|
stdio: 'pipe',
|
|
695
722
|
shell: process.platform === 'win32'
|
|
696
723
|
});
|
|
@@ -729,7 +756,7 @@ async function execPM2CommandIgnoreMissing(action, target, options = {}) {
|
|
|
729
756
|
return true;
|
|
730
757
|
}
|
|
731
758
|
catch (error) {
|
|
732
|
-
const message = String(error && error
|
|
759
|
+
const message = String(error && (0, errors_1.getErrorMessage)(error) ? (0, errors_1.getErrorMessage)(error) : error);
|
|
733
760
|
if (message.includes('Process or Namespace') || message.includes('not found') || message.includes('does not exist')) {
|
|
734
761
|
return false;
|
|
735
762
|
}
|
|
@@ -758,7 +785,7 @@ async function stopPM2Processes(target) {
|
|
|
758
785
|
await runManagedAppsPm2Action('stop', { regenerate: true });
|
|
759
786
|
}
|
|
760
787
|
catch (err) {
|
|
761
|
-
console.warn(`Skipping managed bot stop: ${err
|
|
788
|
+
console.warn(`Skipping managed bot stop: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
762
789
|
}
|
|
763
790
|
}
|
|
764
791
|
console.log('');
|
|
@@ -772,14 +799,14 @@ async function stopPM2Processes(target) {
|
|
|
772
799
|
}
|
|
773
800
|
// Validate bot exists in configuration before stopping (with lock protection)
|
|
774
801
|
try {
|
|
775
|
-
const { config } = await readBotsFileWithLock(BOTS_JSON, parseJsonWithComments);
|
|
776
|
-
const botExists = selectActiveBotEntries(config).some((b) => b.name === target);
|
|
802
|
+
const { config } = await (0, bots_file_lock_1.readBotsFileWithLock)(BOTS_JSON, system_1.parseJsonWithComments);
|
|
803
|
+
const botExists = (0, bot_settings_1.selectActiveBotEntries)(config).some((b) => b.name === target);
|
|
777
804
|
if (!botExists) {
|
|
778
805
|
throw new Error(`Bot '${target}' not found or not active in profiles/bots.json`);
|
|
779
806
|
}
|
|
780
807
|
}
|
|
781
808
|
catch (err) {
|
|
782
|
-
throw new Error(`Failed to read bots configuration: ${err
|
|
809
|
+
throw new Error(`Failed to read bots configuration: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
783
810
|
}
|
|
784
811
|
// Stop specific bot by name
|
|
785
812
|
await execPM2Command('stop', target);
|
|
@@ -804,7 +831,7 @@ async function deletePM2Processes(target) {
|
|
|
804
831
|
await runManagedAppsPm2Action('delete', { regenerate: true });
|
|
805
832
|
}
|
|
806
833
|
catch (err) {
|
|
807
|
-
console.warn(`Skipping managed bot delete: ${err
|
|
834
|
+
console.warn(`Skipping managed bot delete: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
808
835
|
}
|
|
809
836
|
}
|
|
810
837
|
console.log('');
|
|
@@ -819,14 +846,14 @@ async function deletePM2Processes(target) {
|
|
|
819
846
|
}
|
|
820
847
|
// Validate bot exists in configuration before deleting (with lock protection)
|
|
821
848
|
try {
|
|
822
|
-
const { config } = await readBotsFileWithLock(BOTS_JSON, parseJsonWithComments);
|
|
823
|
-
const botExists = selectActiveBotEntries(config).some((b) => b.name === target);
|
|
849
|
+
const { config } = await (0, bots_file_lock_1.readBotsFileWithLock)(BOTS_JSON, system_1.parseJsonWithComments);
|
|
850
|
+
const botExists = (0, bot_settings_1.selectActiveBotEntries)(config).some((b) => b.name === target);
|
|
824
851
|
if (!botExists) {
|
|
825
852
|
throw new Error(`Bot '${target}' not found or not active in profiles/bots.json`);
|
|
826
853
|
}
|
|
827
854
|
}
|
|
828
855
|
catch (err) {
|
|
829
|
-
throw new Error(`Failed to read bots configuration: ${err
|
|
856
|
+
throw new Error(`Failed to read bots configuration: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
830
857
|
}
|
|
831
858
|
// Delete specific bot by name
|
|
832
859
|
await execPM2Command('delete', target);
|
|
@@ -895,10 +922,10 @@ Repo-root users can run \`./pm2\` instead.
|
|
|
895
922
|
}
|
|
896
923
|
// Run if called directly or via the root-level pm2.js shim
|
|
897
924
|
const isPm2DirectRun = require.main === module || (process.argv[1] &&
|
|
898
|
-
path.basename(process.argv[1]).replace(/\.js$/, '') === 'pm2');
|
|
925
|
+
path_api_1.path.basename(process.argv[1]).replace(/\.js$/, '') === 'pm2');
|
|
899
926
|
if (isPm2DirectRun) {
|
|
900
927
|
// Parse command line arguments
|
|
901
|
-
const { command, target, clawOnly, headless, passwordFile } = parsePm2Args(process.argv);
|
|
928
|
+
const { command, target, clawOnly, headless, passwordFile } = (0, launch_modes_1.parsePm2Args)(process.argv);
|
|
902
929
|
(async () => {
|
|
903
930
|
try {
|
|
904
931
|
if (!command) {
|
|
@@ -918,8 +945,7 @@ if (isPm2DirectRun) {
|
|
|
918
945
|
process.exit(0);
|
|
919
946
|
}
|
|
920
947
|
else if (command === 'update') {
|
|
921
|
-
const
|
|
922
|
-
const update = spawn(Config.EXEC_PATH, [runtimeScript('scripts', 'update.js')], { stdio: 'inherit' });
|
|
948
|
+
const update = (0, node_child_process_1.spawn)(config_2.Config.EXEC_PATH, [runtimeScript('scripts', 'update.js')], { stdio: 'inherit' });
|
|
923
949
|
update.on('close', (code) => process.exit(code));
|
|
924
950
|
}
|
|
925
951
|
else if (command === 'stop') {
|
|
@@ -933,7 +959,7 @@ if (isPm2DirectRun) {
|
|
|
933
959
|
process.exit(0);
|
|
934
960
|
}
|
|
935
961
|
catch (err) {
|
|
936
|
-
console.error(pm2Error(`Failed to stop processes: ${err
|
|
962
|
+
console.error(pm2Error(`Failed to stop processes: ${(0, errors_1.getErrorMessage)(err)}`));
|
|
937
963
|
process.exit(1);
|
|
938
964
|
}
|
|
939
965
|
}
|
|
@@ -948,7 +974,7 @@ if (isPm2DirectRun) {
|
|
|
948
974
|
process.exit(0);
|
|
949
975
|
}
|
|
950
976
|
catch (err) {
|
|
951
|
-
console.error(pm2Error(`Failed to delete processes: ${err
|
|
977
|
+
console.error(pm2Error(`Failed to delete processes: ${(0, errors_1.getErrorMessage)(err)}`));
|
|
952
978
|
process.exit(1);
|
|
953
979
|
}
|
|
954
980
|
}
|
|
@@ -963,7 +989,7 @@ if (isPm2DirectRun) {
|
|
|
963
989
|
process.exit(0);
|
|
964
990
|
}
|
|
965
991
|
catch (err) {
|
|
966
|
-
console.error(pm2Error(`Failed to restart processes: ${err
|
|
992
|
+
console.error(pm2Error(`Failed to restart processes: ${(0, errors_1.getErrorMessage)(err)}`));
|
|
967
993
|
process.exit(1);
|
|
968
994
|
}
|
|
969
995
|
}
|
|
@@ -978,7 +1004,7 @@ if (isPm2DirectRun) {
|
|
|
978
1004
|
}
|
|
979
1005
|
}
|
|
980
1006
|
catch (err) {
|
|
981
|
-
console.error(pm2Error(`Error: ${err
|
|
1007
|
+
console.error(pm2Error(`Error: ${(0, errors_1.getErrorMessage)(err)}`));
|
|
982
1008
|
process.exit(1);
|
|
983
1009
|
}
|
|
984
1010
|
})();
|
|
@@ -986,7 +1012,7 @@ if (isPm2DirectRun) {
|
|
|
986
1012
|
module.exports = {
|
|
987
1013
|
buildCredentialDaemonApp,
|
|
988
1014
|
buildEcosystemApps,
|
|
989
|
-
buildScopedChildEnv,
|
|
1015
|
+
buildScopedChildEnv: child_env_1.buildScopedChildEnv,
|
|
990
1016
|
countManagedBots,
|
|
991
1017
|
deletePM2Processes,
|
|
992
1018
|
ensureCredentialDaemonPM2,
|