dexbot 1.6.6 → 1.6.8
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/CHANGELOG.md +89 -1
- package/README.md +8 -5
- package/analysis/README.md +2 -3
- package/analysis/tradingview/README.md +78 -1
- package/analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md +1 -1
- package/claw/package.json +1 -1
- package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
- package/claw/runtimes/openclaw-plugin/package.json +1 -1
- package/dist/analysis/tradingview/analyze_tradingview.d.ts +4 -0
- package/dist/analysis/tradingview/analyze_tradingview.js +55 -0
- package/dist/analysis/tradingview/grid_reset_config.d.ts +61 -0
- package/dist/analysis/tradingview/grid_reset_config.js +235 -0
- package/dist/analysis/tradingview/grid_reset_sim.d.ts +67 -0
- package/dist/analysis/tradingview/grid_reset_sim.js +307 -0
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +419 -3
- package/dist/dexbot.js +44 -15
- package/dist/market_adapter/core/market_adapter_service.js +14 -2
- package/dist/market_adapter/core/strategies/dynamic_weight_series.d.ts +8 -1
- package/dist/market_adapter/core/strategies/dynamic_weight_series.js +5 -1
- package/dist/market_adapter/inputs/window_cache.d.ts +97 -19
- package/dist/market_adapter/inputs/window_cache.js +302 -48
- package/dist/market_adapter/market_adapter.d.ts +8 -1
- package/dist/market_adapter/market_adapter.js +22 -4
- package/dist/modules/account_bots.js +20 -9
- package/dist/modules/account_orders.d.ts +44 -4
- package/dist/modules/account_orders.js +104 -7
- package/dist/modules/bitshares-native/chain_client.d.ts +10 -0
- package/dist/modules/bitshares-native/chain_client.js +197 -28
- package/dist/modules/bitshares-native/subscriptions.js +312 -10
- package/dist/modules/bitshares-native/transport.d.ts +1 -0
- package/dist/modules/bitshares-native/transport.js +97 -3
- package/dist/modules/bitshares_client.d.ts +20 -0
- package/dist/modules/bitshares_client.js +29 -0
- package/dist/modules/bot_settings.js +10 -1
- package/dist/modules/chain_keys.d.ts +37 -22
- package/dist/modules/chain_keys.js +145 -44
- package/dist/modules/cli_start_onboarding.d.ts +10 -0
- package/dist/modules/cli_start_onboarding.js +15 -0
- package/dist/modules/cli_start_output.d.ts +6 -0
- package/dist/modules/cli_start_output.js +8 -0
- package/dist/modules/config.d.ts +1 -0
- package/dist/modules/config.js +1 -0
- package/dist/modules/constants.d.ts +23 -2
- package/dist/modules/constants.js +196 -15
- package/dist/modules/dexbot_class.d.ts +6 -76
- package/dist/modules/dexbot_class.js +0 -32
- package/dist/modules/dexbot_cow_runtime.d.ts +3 -58
- package/dist/modules/dexbot_cow_runtime.js +53 -96
- package/dist/modules/dexbot_fill_runtime.d.ts +6 -1
- package/dist/modules/dexbot_fill_runtime.js +22 -3
- package/dist/modules/dexbot_maintenance_runtime.d.ts +38 -1
- package/dist/modules/dexbot_maintenance_runtime.js +103 -11
- package/dist/modules/dexbot_startup_runtime.js +73 -20
- package/dist/modules/dexbot_state_recovery.d.ts +6 -0
- package/dist/modules/dexbot_state_recovery.js +34 -1
- package/dist/modules/order/async_lock.d.ts +8 -0
- package/dist/modules/order/async_lock.js +15 -0
- package/dist/modules/order/genesis_policy.d.ts +162 -0
- package/dist/modules/order/genesis_policy.js +267 -0
- package/dist/modules/order/grid.js +109 -135
- package/dist/modules/order/grid_reconcile.d.ts +9 -0
- package/dist/modules/order/grid_reconcile.js +13 -4
- package/dist/modules/order/grid_reconcile_internal.js +13 -2
- package/dist/modules/order/logger.d.ts +12 -2
- package/dist/modules/order/logger.js +29 -7
- package/dist/modules/order/manager.d.ts +53 -0
- package/dist/modules/order/manager.js +86 -25
- package/dist/modules/order/sync_engine.d.ts +19 -0
- package/dist/modules/order/sync_engine.js +284 -344
- package/dist/modules/order/utils/math.d.ts +22 -1
- package/dist/modules/order/utils/math.js +64 -1
- package/dist/modules/order/utils/order.d.ts +43 -58
- package/dist/modules/order/utils/order.js +302 -194
- package/dist/modules/order/utils/system.d.ts +97 -0
- package/dist/modules/order/utils/system.js +282 -3
- package/dist/modules/paths.d.ts +8 -1
- package/dist/modules/paths.js +11 -3
- package/dist/modules/utils/text_width.d.ts +19 -0
- package/dist/modules/utils/text_width.js +97 -0
- package/dist/modules/version_notice.d.ts +165 -0
- package/dist/modules/version_notice.js +364 -0
- package/dist/pm2.js +104 -18
- package/dist/scripts/update.js +62 -13
- package/dist/unlock.d.ts +14 -2
- package/dist/unlock.js +101 -4
- package/docs/BITSHARES_ONBOARDING.md +8 -1
- package/docs/COW_INVARIANTS.md +11 -2
- package/docs/CREDENTIAL_SECURITY.md +26 -0
- package/docs/DEXBOT_COMPARISON.md +4 -4
- package/docs/EVOLUTION.md +20 -18
- package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +1 -1
- package/docs/GRID_PRICE_INVARIANT.md +204 -31
- package/docs/GRID_RECALCULATION.md +12 -0
- package/docs/LOGGING.md +17 -2
- package/docs/ORDER_ENGINE_POST_1.0_RETROSPECTIVE.md +6 -7
- package/docs/README.md +3 -1
- package/docs/WORKFLOW.md +16 -5
- package/market_adapter/README.md +1 -1
- package/modules/README.md +18 -1
- package/package.json +14 -6
- package/scripts/README.md +28 -2
- package/scripts/clear-all.sh +13 -4
- package/scripts/clear-logs.sh +13 -4
- package/scripts/clear-market-adapter.sh +6 -0
- package/scripts/clear-orders.sh +5 -0
- package/scripts/lib/dexbot-paths.sh +108 -0
- package/tests/README.md +11 -3
- package/analysis/account_resolver.ts +0 -161
- package/analysis/ama_fitting/analyze_ama_price_changes.ts +0 -155
- package/analysis/ama_fitting/analyze_lambda_vs_slow.ts +0 -404
- package/analysis/ama_fitting/calibrate_convergence_er.ts +0 -201
- package/analysis/ama_fitting/fetch_lp_candles.ts +0 -184
- package/analysis/ama_fitting/generate_unified_comparison_chart.ts +0 -232
- package/analysis/ama_fitting/optimizer_high_resolution.ts +0 -802
- package/analysis/analyze_dynamic_weight.ts +0 -243
- package/analysis/analyze_kalman.ts +0 -157
- package/analysis/analyze_regime.ts +0 -158
- package/analysis/analyze_regime_windows.ts +0 -470
- package/analysis/analyze_risk_profile.ts +0 -199
- package/analysis/analyze_trade_heatmap.ts +0 -362
- package/analysis/analyze_volatility.ts +0 -182
- package/analysis/bot_fitting/backtest_ama_sweep.ts +0 -934
- package/analysis/bot_fitting/backtest_bot_fitting.ts +0 -861
- package/analysis/bot_fitting/shared_utils.ts +0 -52
- package/analysis/bot_key_utils.ts +0 -426
- package/analysis/bot_usage/discover_bot_accounts.ts +0 -635
- package/analysis/bot_usage/kibana_bot_queries.ts +0 -211
- package/analysis/chain_pool.ts +0 -47
- package/analysis/chart_css.ts +0 -62
- package/analysis/chart_ui.ts +0 -105
- package/analysis/chart_utils.ts +0 -210
- package/analysis/fills_source.ts +0 -228
- package/analysis/grid_correction_check.ts +0 -786
- package/analysis/math_utils.ts +0 -53
- package/analysis/price_sources.ts +0 -136
- package/analysis/resolve_bot_accounts.ts +0 -199
- package/analysis/resolve_source.ts +0 -99
- package/analysis/results/ama_sweep_results_lp_pool_133_1h.json +0 -2455
- package/analysis/results/bot_fitting_results_lp_pool_133_1h.json +0 -218
- package/analysis/trade_profitability.ts +0 -1335
- package/analysis/tradingview/analyze_tradingview.ts +0 -280
- package/analysis/tradingview/h-bts_tradingview.html +0 -1570
- package/analysis/tradingview/t-bts_tradingview.html +0 -1570
- package/analysis/tradingview/tradingview_uplot_chart_generator.ts +0 -3268
- package/analysis/trend_detection/dynamic_weight_chart_generator.ts +0 -1481
- package/analysis/trend_detection/hurst_analyzer.ts +0 -7
- package/analysis/trend_detection/kalman_chart_generator.ts +0 -398
- package/analysis/trend_detection/kalman_trend_analyzer.ts +0 -9
- package/analysis/trend_detection/kalman_velocity_smoothing.ts +0 -7
- package/analysis/trend_detection/package.json +0 -23
- package/analysis/trend_detection/permutation_entropy_analyzer.ts +0 -7
- package/analysis/trend_detection/regime_chart_generator.ts +0 -338
- package/analysis/trend_detection/tests/test_kalman_trend.ts +0 -153
- package/analysis/trend_detection/tests/test_kalman_velocity_smoothing.ts +0 -64
- package/analysis/trend_detection/volatility_chart_generator.ts +0 -654
- package/analysis/tsconfig.json +0 -29
- package/claw/tests/package.json +0 -3
- package/claw/tests/test_claw_bridge.ts +0 -570
- package/claw/tests/test_claw_catalog_and_credentials.ts +0 -156
- package/claw/tests/test_claw_chain_layer.ts +0 -739
- package/claw/tests/test_claw_data_flow.ts +0 -525
- package/claw/tests/test_claw_domain_logic.ts +0 -471
- package/claw/tests/test_claw_manifest_and_matrix.ts +0 -222
- package/claw/tests/test_claw_mcp_transport.ts +0 -243
- package/claw/tests/test_claw_regressions.ts +0 -711
- package/claw/tests/test_claw_skill_generation.ts +0 -103
- package/claw/tests/test_claw_state_store.ts +0 -44
- package/claw/tests/test_dexbot_profiles.ts +0 -654
- package/claw/tests/test_memu_bridge.ts +0 -189
- package/claw/tests/test_nullclaw_tmp_integration.ts +0 -57
- package/claw/tests/test_position_health.ts +0 -343
- package/claw/tests/test_position_manager.ts +0 -429
- package/claw/tests/test_position_manager_watch_health.ts +0 -100
- package/claw/tests/test_short_mpa_strategy.ts +0 -232
- package/dist/analysis/account_resolver.d.ts.map +0 -1
- package/dist/analysis/account_resolver.js.map +0 -1
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js.map +0 -1
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js.map +0 -1
- package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js.map +0 -1
- package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/fetch_lp_candles.js.map +0 -1
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js.map +0 -1
- package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js.map +0 -1
- package/dist/analysis/analyze_dynamic_weight.d.ts.map +0 -1
- package/dist/analysis/analyze_dynamic_weight.js.map +0 -1
- package/dist/analysis/analyze_kalman.d.ts.map +0 -1
- package/dist/analysis/analyze_kalman.js.map +0 -1
- package/dist/analysis/analyze_regime.d.ts.map +0 -1
- package/dist/analysis/analyze_regime.js.map +0 -1
- package/dist/analysis/analyze_regime_windows.d.ts.map +0 -1
- package/dist/analysis/analyze_regime_windows.js.map +0 -1
- package/dist/analysis/analyze_risk_profile.d.ts.map +0 -1
- package/dist/analysis/analyze_risk_profile.js.map +0 -1
- package/dist/analysis/analyze_trade_heatmap.d.ts.map +0 -1
- package/dist/analysis/analyze_trade_heatmap.js.map +0 -1
- package/dist/analysis/analyze_volatility.d.ts.map +0 -1
- package/dist/analysis/analyze_volatility.js.map +0 -1
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js.map +0 -1
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js.map +0 -1
- package/dist/analysis/bot_fitting/shared_utils.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/shared_utils.js.map +0 -1
- package/dist/analysis/bot_key_utils.d.ts.map +0 -1
- package/dist/analysis/bot_key_utils.js.map +0 -1
- package/dist/analysis/bot_usage/discover_bot_accounts.d.ts.map +0 -1
- package/dist/analysis/bot_usage/discover_bot_accounts.js.map +0 -1
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts.map +0 -1
- package/dist/analysis/bot_usage/kibana_bot_queries.js.map +0 -1
- package/dist/analysis/chain_pool.d.ts.map +0 -1
- package/dist/analysis/chain_pool.js.map +0 -1
- package/dist/analysis/chart_css.d.ts.map +0 -1
- package/dist/analysis/chart_css.js.map +0 -1
- package/dist/analysis/chart_ui.d.ts.map +0 -1
- package/dist/analysis/chart_ui.js.map +0 -1
- package/dist/analysis/chart_utils.d.ts.map +0 -1
- package/dist/analysis/chart_utils.js.map +0 -1
- package/dist/analysis/fills_source.d.ts.map +0 -1
- package/dist/analysis/fills_source.js.map +0 -1
- package/dist/analysis/grid_correction_check.d.ts.map +0 -1
- package/dist/analysis/grid_correction_check.js.map +0 -1
- package/dist/analysis/math_utils.d.ts.map +0 -1
- package/dist/analysis/math_utils.js.map +0 -1
- package/dist/analysis/price_sources.d.ts.map +0 -1
- package/dist/analysis/price_sources.js.map +0 -1
- package/dist/analysis/resolve_bot_accounts.d.ts.map +0 -1
- package/dist/analysis/resolve_bot_accounts.js.map +0 -1
- package/dist/analysis/resolve_source.d.ts.map +0 -1
- package/dist/analysis/resolve_source.js.map +0 -1
- package/dist/analysis/trade_profitability.d.ts.map +0 -1
- package/dist/analysis/trade_profitability.js.map +0 -1
- package/dist/analysis/tradingview/analyze_tradingview.d.ts.map +0 -1
- package/dist/analysis/tradingview/analyze_tradingview.js.map +0 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +0 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/hurst_analyzer.d.ts.map +0 -1
- package/dist/analysis/trend_detection/hurst_analyzer.js.map +0 -1
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/kalman_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts.map +0 -1
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js.map +0 -1
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts.map +0 -1
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js.map +0 -1
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts.map +0 -1
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js.map +0 -1
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts.map +0 -1
- 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 -128
- 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 -37
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js.map +0 -1
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/volatility_chart_generator.js.map +0 -1
- package/dist/bot.d.ts.map +0 -1
- package/dist/bot.js.map +0 -1
- package/dist/credential-daemon.d.ts.map +0 -1
- package/dist/credential-daemon.js.map +0 -1
- package/dist/dexbot.d.ts.map +0 -1
- package/dist/dexbot.js.map +0 -1
- package/dist/market_adapter/ama_signal_runner.d.ts.map +0 -1
- package/dist/market_adapter/ama_signal_runner.js.map +0 -1
- package/dist/market_adapter/candle_utils.d.ts.map +0 -1
- package/dist/market_adapter/candle_utils.js.map +0 -1
- package/dist/market_adapter/core/asymmetric_bounds.d.ts.map +0 -1
- package/dist/market_adapter/core/asymmetric_bounds.js.map +0 -1
- package/dist/market_adapter/core/config_normalizers.d.ts.map +0 -1
- package/dist/market_adapter/core/config_normalizers.js.map +0 -1
- package/dist/market_adapter/core/kibana_candles.d.ts.map +0 -1
- package/dist/market_adapter/core/kibana_candles.js.map +0 -1
- package/dist/market_adapter/core/kibana_client.d.ts.map +0 -1
- package/dist/market_adapter/core/kibana_client.js.map +0 -1
- package/dist/market_adapter/core/kibana_market_candles.d.ts.map +0 -1
- package/dist/market_adapter/core/kibana_market_candles.js.map +0 -1
- package/dist/market_adapter/core/market_adapter_service.d.ts.map +0 -1
- package/dist/market_adapter/core/market_adapter_service.js.map +0 -1
- package/dist/market_adapter/core/signals/hurst_analyzer.d.ts.map +0 -1
- package/dist/market_adapter/core/signals/hurst_analyzer.js.map +0 -1
- package/dist/market_adapter/core/signals/kalman_trend_analyzer.d.ts.map +0 -1
- package/dist/market_adapter/core/signals/kalman_trend_analyzer.js.map +0 -1
- package/dist/market_adapter/core/signals/kalman_velocity_smoothing.d.ts.map +0 -1
- package/dist/market_adapter/core/signals/kalman_velocity_smoothing.js.map +0 -1
- package/dist/market_adapter/core/signals/permutation_entropy_analyzer.d.ts.map +0 -1
- package/dist/market_adapter/core/signals/permutation_entropy_analyzer.js.map +0 -1
- package/dist/market_adapter/core/strategies/ama.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/ama.js.map +0 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.js.map +0 -1
- package/dist/market_adapter/core/strategies/atr/calculator.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/atr/calculator.js.map +0 -1
- package/dist/market_adapter/core/strategies/collateral_manager.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/collateral_manager.js.map +0 -1
- package/dist/market_adapter/core/strategies/dynamic_weight_series.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/dynamic_weight_series.js.map +0 -1
- package/dist/market_adapter/core/strategies/regime_gate.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/regime_gate.js.map +0 -1
- package/dist/market_adapter/core/strategies/regime_interp.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/regime_interp.js.map +0 -1
- package/dist/market_adapter/core/strategies/volatility_shift.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/volatility_shift.js.map +0 -1
- package/dist/market_adapter/inputs/fetch_book_data.d.ts.map +0 -1
- package/dist/market_adapter/inputs/fetch_book_data.js.map +0 -1
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.d.ts.map +0 -1
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js.map +0 -1
- package/dist/market_adapter/inputs/fetch_lp_data.d.ts.map +0 -1
- package/dist/market_adapter/inputs/fetch_lp_data.js.map +0 -1
- package/dist/market_adapter/inputs/kibana_feed_source.d.ts.map +0 -1
- package/dist/market_adapter/inputs/kibana_feed_source.js.map +0 -1
- package/dist/market_adapter/inputs/kibana_source.d.ts.map +0 -1
- package/dist/market_adapter/inputs/kibana_source.js.map +0 -1
- package/dist/market_adapter/inputs/window_cache.d.ts.map +0 -1
- package/dist/market_adapter/inputs/window_cache.js.map +0 -1
- package/dist/market_adapter/interval_utils.d.ts.map +0 -1
- package/dist/market_adapter/interval_utils.js.map +0 -1
- package/dist/market_adapter/log_format.d.ts.map +0 -1
- package/dist/market_adapter/log_format.js.map +0 -1
- package/dist/market_adapter/lp_chart_core.d.ts.map +0 -1
- package/dist/market_adapter/lp_chart_core.js.map +0 -1
- package/dist/market_adapter/lp_chart_runner.d.ts.map +0 -1
- package/dist/market_adapter/lp_chart_runner.js.map +0 -1
- package/dist/market_adapter/lp_chart_strategy_loader.d.ts.map +0 -1
- package/dist/market_adapter/lp_chart_strategy_loader.js.map +0 -1
- package/dist/market_adapter/market_adapter.d.ts.map +0 -1
- package/dist/market_adapter/market_adapter.js.map +0 -1
- package/dist/market_adapter/test_helpers.d.ts.map +0 -1
- package/dist/market_adapter/test_helpers.js.map +0 -1
- package/dist/market_adapter/utils/adapter_client.d.ts.map +0 -1
- package/dist/market_adapter/utils/adapter_client.js.map +0 -1
- package/dist/market_adapter/utils/atomic_write.d.ts.map +0 -1
- package/dist/market_adapter/utils/atomic_write.js.map +0 -1
- package/dist/market_adapter/utils/chain.d.ts.map +0 -1
- package/dist/market_adapter/utils/chain.js.map +0 -1
- package/dist/market_adapter/utils/data_discovery.d.ts.map +0 -1
- package/dist/market_adapter/utils/data_discovery.js.map +0 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts.map +0 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.js.map +0 -1
- package/dist/market_adapter/utils/file_lock.d.ts.map +0 -1
- package/dist/market_adapter/utils/file_lock.js.map +0 -1
- package/dist/market_adapter/utils/native_history.d.ts.map +0 -1
- package/dist/market_adapter/utils/native_history.js.map +0 -1
- package/dist/modules/account_bots.d.ts.map +0 -1
- package/dist/modules/account_bots.js.map +0 -1
- package/dist/modules/account_orders.d.ts.map +0 -1
- package/dist/modules/account_orders.js.map +0 -1
- package/dist/modules/authority_resolver.d.ts.map +0 -1
- package/dist/modules/authority_resolver.js.map +0 -1
- package/dist/modules/bitshares-native/chain_client.d.ts.map +0 -1
- package/dist/modules/bitshares-native/chain_client.js.map +0 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts.map +0 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.js.map +0 -1
- package/dist/modules/bitshares-native/crypto/ecc.d.ts.map +0 -1
- package/dist/modules/bitshares-native/crypto/ecc.js.map +0 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts.map +0 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.js.map +0 -1
- package/dist/modules/bitshares-native/index.d.ts.map +0 -1
- package/dist/modules/bitshares-native/index.js.map +0 -1
- package/dist/modules/bitshares-native/lru_cache.d.ts.map +0 -1
- package/dist/modules/bitshares-native/lru_cache.js.map +0 -1
- package/dist/modules/bitshares-native/resolvers.d.ts.map +0 -1
- package/dist/modules/bitshares-native/resolvers.js.map +0 -1
- package/dist/modules/bitshares-native/serial/chain_constants.d.ts.map +0 -1
- package/dist/modules/bitshares-native/serial/chain_constants.js.map +0 -1
- package/dist/modules/bitshares-native/serial/index.d.ts.map +0 -1
- package/dist/modules/bitshares-native/serial/index.js.map +0 -1
- package/dist/modules/bitshares-native/serial/operations.d.ts.map +0 -1
- package/dist/modules/bitshares-native/serial/operations.js.map +0 -1
- package/dist/modules/bitshares-native/serial/serializer.d.ts.map +0 -1
- package/dist/modules/bitshares-native/serial/serializer.js.map +0 -1
- package/dist/modules/bitshares-native/serial/types.d.ts.map +0 -1
- package/dist/modules/bitshares-native/serial/types.js.map +0 -1
- package/dist/modules/bitshares-native/signing_client.d.ts.map +0 -1
- package/dist/modules/bitshares-native/signing_client.js.map +0 -1
- package/dist/modules/bitshares-native/subscriptions.d.ts.map +0 -1
- package/dist/modules/bitshares-native/subscriptions.js.map +0 -1
- package/dist/modules/bitshares-native/transport.d.ts.map +0 -1
- package/dist/modules/bitshares-native/transport.js.map +0 -1
- package/dist/modules/bitshares-native/tx/builder.d.ts.map +0 -1
- package/dist/modules/bitshares-native/tx/builder.js.map +0 -1
- package/dist/modules/bitshares-native/tx/tx_cache.d.ts.map +0 -1
- package/dist/modules/bitshares-native/tx/tx_cache.js.map +0 -1
- package/dist/modules/bitshares_client.d.ts.map +0 -1
- package/dist/modules/bitshares_client.js.map +0 -1
- package/dist/modules/bot_defaults.d.ts.map +0 -1
- package/dist/modules/bot_defaults.js.map +0 -1
- package/dist/modules/bot_settings.d.ts.map +0 -1
- package/dist/modules/bot_settings.js.map +0 -1
- package/dist/modules/bots_file_lock.d.ts.map +0 -1
- package/dist/modules/bots_file_lock.js.map +0 -1
- package/dist/modules/broadcast_failure.d.ts.map +0 -1
- package/dist/modules/broadcast_failure.js.map +0 -1
- package/dist/modules/chain_keys.d.ts.map +0 -1
- package/dist/modules/chain_keys.js.map +0 -1
- package/dist/modules/chain_orders.d.ts.map +0 -1
- package/dist/modules/chain_orders.js.map +0 -1
- package/dist/modules/cli_colors.d.ts.map +0 -1
- package/dist/modules/cli_colors.js.map +0 -1
- package/dist/modules/config.d.ts.map +0 -1
- package/dist/modules/config.js.map +0 -1
- package/dist/modules/constants.d.ts.map +0 -1
- package/dist/modules/constants.js.map +0 -1
- package/dist/modules/cr_planner.d.ts.map +0 -1
- package/dist/modules/cr_planner.js.map +0 -1
- package/dist/modules/credential_policy.d.ts.map +0 -1
- package/dist/modules/credential_policy.js.map +0 -1
- package/dist/modules/credential_runtime.d.ts.map +0 -1
- package/dist/modules/credential_runtime.js.map +0 -1
- package/dist/modules/credential_session_cache.d.ts.map +0 -1
- package/dist/modules/credential_session_cache.js.map +0 -1
- package/dist/modules/credit_pricing.d.ts.map +0 -1
- package/dist/modules/credit_pricing.js.map +0 -1
- package/dist/modules/credit_runtime.d.ts.map +0 -1
- package/dist/modules/credit_runtime.js.map +0 -1
- package/dist/modules/crypto/browser_provider.d.ts.map +0 -1
- package/dist/modules/crypto/browser_provider.js.map +0 -1
- package/dist/modules/crypto/index.d.ts.map +0 -1
- package/dist/modules/crypto/index.js.map +0 -1
- package/dist/modules/crypto/node_provider.d.ts.map +0 -1
- package/dist/modules/crypto/node_provider.js.map +0 -1
- package/dist/modules/crypto/provider.d.ts.map +0 -1
- package/dist/modules/crypto/provider.js.map +0 -1
- package/dist/modules/crypto/pure_ripemd160.d.ts.map +0 -1
- package/dist/modules/crypto/pure_ripemd160.js.map +0 -1
- package/dist/modules/crypto/pure_scrypt.d.ts.map +0 -1
- package/dist/modules/crypto/pure_scrypt.js.map +0 -1
- package/dist/modules/crypto/pure_secp256k1.d.ts.map +0 -1
- package/dist/modules/crypto/pure_secp256k1.js.map +0 -1
- package/dist/modules/crypto/sync.d.ts.map +0 -1
- package/dist/modules/crypto/sync.js.map +0 -1
- package/dist/modules/daemon_node_health.d.ts.map +0 -1
- package/dist/modules/daemon_node_health.js.map +0 -1
- package/dist/modules/dexbot_class.d.ts.map +0 -1
- package/dist/modules/dexbot_class.js.map +0 -1
- package/dist/modules/dexbot_cow_runtime.d.ts.map +0 -1
- package/dist/modules/dexbot_cow_runtime.js.map +0 -1
- package/dist/modules/dexbot_credential_client.d.ts.map +0 -1
- package/dist/modules/dexbot_credential_client.js.map +0 -1
- package/dist/modules/dexbot_fill_runtime.d.ts.map +0 -1
- package/dist/modules/dexbot_fill_runtime.js.map +0 -1
- package/dist/modules/dexbot_maintenance_runtime.d.ts.map +0 -1
- package/dist/modules/dexbot_maintenance_runtime.js.map +0 -1
- package/dist/modules/dexbot_startup_runtime.d.ts.map +0 -1
- package/dist/modules/dexbot_startup_runtime.js.map +0 -1
- package/dist/modules/dexbot_state_recovery.d.ts.map +0 -1
- package/dist/modules/dexbot_state_recovery.js.map +0 -1
- package/dist/modules/env.d.ts.map +0 -1
- package/dist/modules/env.js.map +0 -1
- package/dist/modules/fund_registry.d.ts.map +0 -1
- package/dist/modules/fund_registry.js.map +0 -1
- package/dist/modules/general_settings.d.ts.map +0 -1
- package/dist/modules/general_settings.js.map +0 -1
- package/dist/modules/graceful_shutdown.d.ts.map +0 -1
- package/dist/modules/graceful_shutdown.js.map +0 -1
- package/dist/modules/grid_price_source.d.ts.map +0 -1
- package/dist/modules/grid_price_source.js.map +0 -1
- package/dist/modules/key_store.d.ts.map +0 -1
- package/dist/modules/key_store.js.map +0 -1
- package/dist/modules/launcher/adapter_requirement.d.ts.map +0 -1
- package/dist/modules/launcher/adapter_requirement.js.map +0 -1
- package/dist/modules/launcher/bot_supervisor.d.ts.map +0 -1
- package/dist/modules/launcher/bot_supervisor.js.map +0 -1
- package/dist/modules/launcher/child_env.d.ts.map +0 -1
- package/dist/modules/launcher/child_env.js.map +0 -1
- package/dist/modules/launcher/credential_bootstrap.d.ts.map +0 -1
- package/dist/modules/launcher/credential_bootstrap.js.map +0 -1
- package/dist/modules/launcher/credential_daemon.d.ts.map +0 -1
- package/dist/modules/launcher/credential_daemon.js.map +0 -1
- package/dist/modules/launcher/credential_secret.d.ts.map +0 -1
- package/dist/modules/launcher/credential_secret.js.map +0 -1
- package/dist/modules/launcher/foreign_cred_daemon.d.ts.map +0 -1
- package/dist/modules/launcher/foreign_cred_daemon.js.map +0 -1
- package/dist/modules/launcher/headless_password.d.ts.map +0 -1
- package/dist/modules/launcher/headless_password.js.map +0 -1
- package/dist/modules/launcher/launch_modes.d.ts.map +0 -1
- package/dist/modules/launcher/launch_modes.js.map +0 -1
- package/dist/modules/launcher/market_adapter_runtime.d.ts.map +0 -1
- package/dist/modules/launcher/market_adapter_runtime.js.map +0 -1
- package/dist/modules/launcher/market_adapter_watchdog.d.ts.map +0 -1
- package/dist/modules/launcher/market_adapter_watchdog.js.map +0 -1
- package/dist/modules/launcher/monolithic_runtime.d.ts.map +0 -1
- package/dist/modules/launcher/monolithic_runtime.js.map +0 -1
- package/dist/modules/launcher/runtime_entry.d.ts.map +0 -1
- package/dist/modules/launcher/runtime_entry.js.map +0 -1
- package/dist/modules/launcher/status_reporting.d.ts.map +0 -1
- package/dist/modules/launcher/status_reporting.js.map +0 -1
- package/dist/modules/launcher/supervisor_control.d.ts.map +0 -1
- package/dist/modules/launcher/supervisor_control.js.map +0 -1
- package/dist/modules/market_adapter_whitelist.d.ts.map +0 -1
- package/dist/modules/market_adapter_whitelist.js.map +0 -1
- package/dist/modules/node_connect_policy.d.ts.map +0 -1
- package/dist/modules/node_connect_policy.js.map +0 -1
- package/dist/modules/node_failure_ledger.d.ts.map +0 -1
- package/dist/modules/node_failure_ledger.js.map +0 -1
- package/dist/modules/node_health_cache.d.ts.map +0 -1
- package/dist/modules/node_health_cache.js.map +0 -1
- package/dist/modules/node_manager.d.ts.map +0 -1
- package/dist/modules/node_manager.js.map +0 -1
- package/dist/modules/order/accounting.d.ts.map +0 -1
- package/dist/modules/order/accounting.js.map +0 -1
- package/dist/modules/order/async_lock.d.ts.map +0 -1
- package/dist/modules/order/async_lock.js.map +0 -1
- package/dist/modules/order/export.d.ts.map +0 -1
- package/dist/modules/order/export.js.map +0 -1
- package/dist/modules/order/format.d.ts.map +0 -1
- package/dist/modules/order/format.js.map +0 -1
- package/dist/modules/order/grid.d.ts.map +0 -1
- package/dist/modules/order/grid.js.map +0 -1
- package/dist/modules/order/grid_reconcile.d.ts.map +0 -1
- package/dist/modules/order/grid_reconcile.js.map +0 -1
- package/dist/modules/order/grid_reconcile_internal.d.ts.map +0 -1
- package/dist/modules/order/grid_reconcile_internal.js.map +0 -1
- package/dist/modules/order/index.d.ts.map +0 -1
- package/dist/modules/order/index.js.map +0 -1
- package/dist/modules/order/logger.d.ts.map +0 -1
- package/dist/modules/order/logger.js.map +0 -1
- package/dist/modules/order/logger_state.d.ts.map +0 -1
- package/dist/modules/order/logger_state.js.map +0 -1
- package/dist/modules/order/manager.d.ts.map +0 -1
- package/dist/modules/order/manager.js.map +0 -1
- package/dist/modules/order/processed_fill_store.d.ts.map +0 -1
- package/dist/modules/order/processed_fill_store.js.map +0 -1
- package/dist/modules/order/strategy.d.ts.map +0 -1
- package/dist/modules/order/strategy.js.map +0 -1
- package/dist/modules/order/sync_engine.d.ts.map +0 -1
- package/dist/modules/order/sync_engine.js.map +0 -1
- package/dist/modules/order/utils/math.d.ts.map +0 -1
- package/dist/modules/order/utils/math.js.map +0 -1
- package/dist/modules/order/utils/order.d.ts.map +0 -1
- package/dist/modules/order/utils/order.js.map +0 -1
- package/dist/modules/order/utils/slot.d.ts.map +0 -1
- package/dist/modules/order/utils/slot.js.map +0 -1
- package/dist/modules/order/utils/system.d.ts.map +0 -1
- package/dist/modules/order/utils/system.js.map +0 -1
- package/dist/modules/order/utils/timeout.d.ts.map +0 -1
- package/dist/modules/order/utils/timeout.js.map +0 -1
- package/dist/modules/order/utils/validate.d.ts.map +0 -1
- package/dist/modules/order/utils/validate.js.map +0 -1
- package/dist/modules/order/utils/withPoolRef.d.ts.map +0 -1
- package/dist/modules/order/utils/withPoolRef.js.map +0 -1
- package/dist/modules/order/working_grid.d.ts.map +0 -1
- package/dist/modules/order/working_grid.js.map +0 -1
- package/dist/modules/path_api.d.ts.map +0 -1
- package/dist/modules/path_api.js.map +0 -1
- package/dist/modules/paths.d.ts.map +0 -1
- package/dist/modules/paths.js.map +0 -1
- package/dist/modules/process_discovery.d.ts.map +0 -1
- package/dist/modules/process_discovery.js.map +0 -1
- package/dist/modules/runtime.d.ts.map +0 -1
- package/dist/modules/runtime.js.map +0 -1
- package/dist/modules/runtime_settings.d.ts.map +0 -1
- package/dist/modules/runtime_settings.js.map +0 -1
- package/dist/modules/settings_merge.d.ts.map +0 -1
- package/dist/modules/settings_merge.js.map +0 -1
- package/dist/modules/socket_json_client.d.ts.map +0 -1
- package/dist/modules/socket_json_client.js.map +0 -1
- package/dist/modules/storage/browser_adapter.d.ts.map +0 -1
- package/dist/modules/storage/browser_adapter.js.map +0 -1
- package/dist/modules/storage/index.d.ts.map +0 -1
- package/dist/modules/storage/index.js.map +0 -1
- package/dist/modules/storage/node_adapter.d.ts.map +0 -1
- package/dist/modules/storage/node_adapter.js.map +0 -1
- package/dist/modules/storage/types.d.ts.map +0 -1
- package/dist/modules/storage/types.js.map +0 -1
- package/dist/modules/types.d.ts.map +0 -1
- package/dist/modules/types.js.map +0 -1
- package/dist/modules/utils/base58check.d.ts.map +0 -1
- package/dist/modules/utils/base58check.js.map +0 -1
- package/dist/modules/utils/build_dir.d.ts.map +0 -1
- package/dist/modules/utils/build_dir.js.map +0 -1
- package/dist/modules/utils/chain_logs.d.ts.map +0 -1
- package/dist/modules/utils/chain_logs.js.map +0 -1
- package/dist/modules/utils/errors.d.ts.map +0 -1
- package/dist/modules/utils/errors.js.map +0 -1
- package/dist/modules/utils/sanitize_key.d.ts.map +0 -1
- package/dist/modules/utils/sanitize_key.js.map +0 -1
- package/dist/modules/validate_profiles.d.ts.map +0 -1
- package/dist/modules/validate_profiles.js.map +0 -1
- package/dist/pm2.d.ts.map +0 -1
- package/dist/pm2.js.map +0 -1
- package/dist/scripts/analyze-credit.d.ts.map +0 -1
- package/dist/scripts/analyze-credit.js.map +0 -1
- package/dist/scripts/analyze-git.d.ts.map +0 -1
- package/dist/scripts/analyze-git.js.map +0 -1
- package/dist/scripts/analyze-orders.d.ts.map +0 -1
- package/dist/scripts/analyze-orders.js.map +0 -1
- package/dist/scripts/chart_command.d.ts.map +0 -1
- package/dist/scripts/chart_command.js.map +0 -1
- package/dist/scripts/diagnose-kibana-candles.d.ts.map +0 -1
- package/dist/scripts/diagnose-kibana-candles.js.map +0 -1
- package/dist/scripts/diagnose-pool-history.d.ts.map +0 -1
- package/dist/scripts/diagnose-pool-history.js.map +0 -1
- package/dist/scripts/divergence-calc.d.ts.map +0 -1
- package/dist/scripts/divergence-calc.js.map +0 -1
- package/dist/scripts/dw.d.ts.map +0 -1
- package/dist/scripts/dw.js.map +0 -1
- package/dist/scripts/generate_lp_chart.d.ts.map +0 -1
- package/dist/scripts/generate_lp_chart.js.map +0 -1
- package/dist/scripts/generate_mainnet_corpus_report.d.ts.map +0 -1
- package/dist/scripts/generate_mainnet_corpus_report.js.map +0 -1
- package/dist/scripts/native_release_gates.d.ts.map +0 -1
- package/dist/scripts/native_release_gates.js.map +0 -1
- package/dist/scripts/print_grid.d.ts.map +0 -1
- package/dist/scripts/print_grid.js.map +0 -1
- package/dist/scripts/run-tests.d.ts.map +0 -1
- package/dist/scripts/run-tests.js.map +0 -1
- package/dist/scripts/runner.d.ts.map +0 -1
- package/dist/scripts/runner.js.map +0 -1
- package/dist/scripts/sync-version.d.ts.map +0 -1
- package/dist/scripts/sync-version.js.map +0 -1
- package/dist/scripts/test-credit-renewal.d.ts.map +0 -1
- package/dist/scripts/test-credit-renewal.js.map +0 -1
- package/dist/scripts/tv.d.ts.map +0 -1
- package/dist/scripts/tv.js.map +0 -1
- package/dist/scripts/update.d.ts.map +0 -1
- package/dist/scripts/update.js.map +0 -1
- package/dist/scripts/update_dist_freshness.d.ts.map +0 -1
- package/dist/scripts/update_dist_freshness.js.map +0 -1
- package/dist/scripts/validate_bots.d.ts.map +0 -1
- package/dist/scripts/validate_bots.js.map +0 -1
- package/dist/scripts/verify-browser-bundle.d.ts.map +0 -1
- package/dist/scripts/verify-browser-bundle.js.map +0 -1
- package/dist/unlock.d.ts.map +0 -1
- package/dist/unlock.js.map +0 -1
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
* All newly written private keys use the v2 vault format.
|
|
23
23
|
*
|
|
24
24
|
* ===============================================================================
|
|
25
|
-
* EXPORTS (
|
|
25
|
+
* EXPORTS (24 functions + 1 error class)
|
|
26
26
|
* ===============================================================================
|
|
27
27
|
*
|
|
28
28
|
* AUTHENTICATION (3 functions)
|
|
29
29
|
* 1. authenticate() - Authenticate and return a derived vault secret (async)
|
|
30
30
|
* Prompts user for password, verifies vault metadata
|
|
31
|
-
* Throws MasterPasswordError on failure
|
|
31
|
+
* Throws MasterPasswordError on failure, MasterPasswordCancelledError on Escape
|
|
32
32
|
* 2. unlockWithPassword(password, accountsData) - Derive the vault secret from a password
|
|
33
33
|
* Throws MasterPasswordError if the password is incorrect
|
|
34
|
-
* 3. isMasterPasswordFailure(err) - Check if an error is a master-password failure
|
|
34
|
+
* 3. isMasterPasswordFailure(err) - Check if an error is a master-password failure or cancellation
|
|
35
35
|
*
|
|
36
36
|
* KEY MANAGEMENT (4 functions)
|
|
37
37
|
* 4. getPrivateKey(accountName, vaultSecret) - Get private key for account
|
|
@@ -53,18 +53,19 @@
|
|
|
53
53
|
* 13. isVaultSecret(value) - Type guard for vault-secret objects
|
|
54
54
|
* 14. isDaemonSigningToken(value) - Type guard for daemon signing-token objects
|
|
55
55
|
*
|
|
56
|
-
* STORAGE (
|
|
56
|
+
* STORAGE (4 functions)
|
|
57
57
|
* 15. loadAccounts() - Load accounts from keys.json
|
|
58
|
-
* 16.
|
|
59
|
-
* 17.
|
|
58
|
+
* 16. hasKeySetup() - Check whether the vault has a valid account entry
|
|
59
|
+
* 17. saveAccounts(data) - Save accounts to keys.json
|
|
60
|
+
* 18. checkKeysFileSecurity() - Verify keys.json permissions and ownership
|
|
60
61
|
*
|
|
61
62
|
* DAEMON (6 functions)
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
63
|
+
* 19. createDaemonSigningToken(accountName, options) - Build a credential-daemon signing token
|
|
64
|
+
* 20. isDaemonReady(options) - Check if credential daemon is ready
|
|
65
|
+
* 21. isDaemonResponsive(options, timeout) - Check if daemon is responsive
|
|
66
|
+
* 22. waitForDaemon(maxWaitMs, options) - Wait for daemon to become ready (async)
|
|
67
|
+
* 23. probeAccountInDaemon(accountName, timeout, options) - Probe daemon for account (async)
|
|
68
|
+
* 24. pingDaemon(accountName, timeout, options) - Lightweight daemon health check (async)
|
|
68
69
|
*
|
|
69
70
|
* ERROR HANDLING (1 error class)
|
|
70
71
|
* - MasterPasswordError - Thrown when authentication fails
|
|
@@ -89,6 +90,11 @@
|
|
|
89
90
|
*
|
|
90
91
|
* ===============================================================================
|
|
91
92
|
*/
|
|
93
|
+
/**
|
|
94
|
+
* Pick the onboarding link to show: the copy shipped with this installation
|
|
95
|
+
* when present, otherwise the hosted document. Exported for testing.
|
|
96
|
+
*/
|
|
97
|
+
export declare function resolveOnboardingUrl(localExists?: boolean, localHref?: string): string;
|
|
92
98
|
declare function isVaultSecret(value: any): boolean;
|
|
93
99
|
declare function createVaultSecret(vaultKey: any, extra?: Record<string, any>): {
|
|
94
100
|
kind: string;
|
|
@@ -149,6 +155,12 @@ declare function loadAccounts(): {
|
|
|
149
155
|
vaultVerifier: string;
|
|
150
156
|
accounts: any;
|
|
151
157
|
};
|
|
158
|
+
/**
|
|
159
|
+
* Report whether the key vault has a usable account entry.
|
|
160
|
+
* Password metadata alone is not sufficient: cancelling key setup can leave
|
|
161
|
+
* a valid-looking vault with no account key to use at runtime.
|
|
162
|
+
*/
|
|
163
|
+
declare function hasKeySetup(accountsData?: any): boolean;
|
|
152
164
|
/**
|
|
153
165
|
* Check that the keys file has restrictive permissions (0o600) and is owned by
|
|
154
166
|
* the current user. Returns silently if the file doesn't exist yet (it will be
|
|
@@ -178,23 +190,26 @@ declare class MasterPasswordError extends Error {
|
|
|
178
190
|
constructor(message: string);
|
|
179
191
|
}
|
|
180
192
|
/**
|
|
181
|
-
* Check if an error
|
|
193
|
+
* Check if an error should abort an authentication-dependent flow.
|
|
194
|
+
* Covers both wrong-password failures and user cancellation.
|
|
182
195
|
* @param {Error} err - Error to check
|
|
183
|
-
* @returns {boolean} True if the error indicates
|
|
196
|
+
* @returns {boolean} True if the error indicates authentication could not complete
|
|
184
197
|
*/
|
|
185
198
|
declare function isMasterPasswordFailure(err: any): boolean;
|
|
199
|
+
type VaultSecret = {
|
|
200
|
+
kind: string;
|
|
201
|
+
version: any;
|
|
202
|
+
vaultKeyHex: string;
|
|
203
|
+
};
|
|
186
204
|
/**
|
|
187
205
|
* Authenticate and return a derived vault secret.
|
|
188
206
|
* Prompts user interactively with limited retry attempts.
|
|
189
|
-
* @returns {Promise<
|
|
207
|
+
* @returns {Promise<VaultSecret>} The verified vault secret
|
|
208
|
+
* @throws {MasterPasswordCancelledError} If the user cancels with Escape
|
|
190
209
|
* @throws {Error} If no master password is set
|
|
191
210
|
* @throws {MasterPasswordError} If max attempts exceeded
|
|
192
211
|
*/
|
|
193
|
-
declare function authenticate(): Promise<
|
|
194
|
-
kind: string;
|
|
195
|
-
version: any;
|
|
196
|
-
vaultKeyHex: string;
|
|
197
|
-
}>;
|
|
212
|
+
declare function authenticate(): Promise<VaultSecret>;
|
|
198
213
|
/**
|
|
199
214
|
* Retrieve and decrypt a stored private key.
|
|
200
215
|
* @param {string} accountName - Name of the account
|
|
@@ -228,7 +243,7 @@ declare function saveAccounts(data: any): void;
|
|
|
228
243
|
* Provides menu for: add/modify/remove keys, test decryption,
|
|
229
244
|
* change master password.
|
|
230
245
|
*/
|
|
231
|
-
declare function main(): Promise<
|
|
246
|
+
declare function main(): Promise<boolean>;
|
|
232
247
|
/**
|
|
233
248
|
* Check if dexbot-cred daemon is ready and responsive
|
|
234
249
|
* @param {Object} [options={}] - Optional socket/ready-file path overrides
|
|
@@ -270,5 +285,5 @@ declare function pingDaemon(accountName: any, timeout?: any, options?: any): Pro
|
|
|
270
285
|
* @returns {Promise<string|null>} Resolves with sessionId if account is available, rejects otherwise
|
|
271
286
|
*/
|
|
272
287
|
declare function probeAccountInDaemon(accountName: any, timeout?: any, options?: any): Promise<any>;
|
|
273
|
-
export { validatePrivateKey, loadAccounts, saveAccounts, checkKeysFileSecurity, encrypt, decrypt, deriveVaultKey, createDaemonSigningToken, createSessionSecret, createVaultSecret, isVaultSecret, isDaemonSigningToken, unlockWithPassword, main, authenticate, getPrivateKey, resolvePrivateKey, isMasterPasswordFailure, MasterPasswordError, isDaemonReady, isDaemonResponsive, waitForDaemon, probeAccountInDaemon, pingDaemon };
|
|
288
|
+
export { validatePrivateKey, loadAccounts, hasKeySetup, saveAccounts, checkKeysFileSecurity, encrypt, decrypt, deriveVaultKey, createDaemonSigningToken, createSessionSecret, createVaultSecret, isVaultSecret, isDaemonSigningToken, unlockWithPassword, main, authenticate, getPrivateKey, resolvePrivateKey, isMasterPasswordFailure, MasterPasswordError, isDaemonReady, isDaemonResponsive, waitForDaemon, probeAccountInDaemon, pingDaemon };
|
|
274
289
|
//# sourceMappingURL=chain_keys.d.ts.map
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
* All newly written private keys use the v2 vault format.
|
|
23
23
|
*
|
|
24
24
|
* ===============================================================================
|
|
25
|
-
* EXPORTS (
|
|
25
|
+
* EXPORTS (24 functions + 1 error class)
|
|
26
26
|
* ===============================================================================
|
|
27
27
|
*
|
|
28
28
|
* AUTHENTICATION (3 functions)
|
|
29
29
|
* 1. authenticate() - Authenticate and return a derived vault secret (async)
|
|
30
30
|
* Prompts user for password, verifies vault metadata
|
|
31
|
-
* Throws MasterPasswordError on failure
|
|
31
|
+
* Throws MasterPasswordError on failure, MasterPasswordCancelledError on Escape
|
|
32
32
|
* 2. unlockWithPassword(password, accountsData) - Derive the vault secret from a password
|
|
33
33
|
* Throws MasterPasswordError if the password is incorrect
|
|
34
|
-
* 3. isMasterPasswordFailure(err) - Check if an error is a master-password failure
|
|
34
|
+
* 3. isMasterPasswordFailure(err) - Check if an error is a master-password failure or cancellation
|
|
35
35
|
*
|
|
36
36
|
* KEY MANAGEMENT (4 functions)
|
|
37
37
|
* 4. getPrivateKey(accountName, vaultSecret) - Get private key for account
|
|
@@ -53,18 +53,19 @@
|
|
|
53
53
|
* 13. isVaultSecret(value) - Type guard for vault-secret objects
|
|
54
54
|
* 14. isDaemonSigningToken(value) - Type guard for daemon signing-token objects
|
|
55
55
|
*
|
|
56
|
-
* STORAGE (
|
|
56
|
+
* STORAGE (4 functions)
|
|
57
57
|
* 15. loadAccounts() - Load accounts from keys.json
|
|
58
|
-
* 16.
|
|
59
|
-
* 17.
|
|
58
|
+
* 16. hasKeySetup() - Check whether the vault has a valid account entry
|
|
59
|
+
* 17. saveAccounts(data) - Save accounts to keys.json
|
|
60
|
+
* 18. checkKeysFileSecurity() - Verify keys.json permissions and ownership
|
|
60
61
|
*
|
|
61
62
|
* DAEMON (6 functions)
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
63
|
+
* 19. createDaemonSigningToken(accountName, options) - Build a credential-daemon signing token
|
|
64
|
+
* 20. isDaemonReady(options) - Check if credential daemon is ready
|
|
65
|
+
* 21. isDaemonResponsive(options, timeout) - Check if daemon is responsive
|
|
66
|
+
* 22. waitForDaemon(maxWaitMs, options) - Wait for daemon to become ready (async)
|
|
67
|
+
* 23. probeAccountInDaemon(accountName, timeout, options) - Probe daemon for account (async)
|
|
68
|
+
* 24. pingDaemon(accountName, timeout, options) - Lightweight daemon health check (async)
|
|
68
69
|
*
|
|
69
70
|
* ERROR HANDLING (1 error class)
|
|
70
71
|
* - MasterPasswordError - Thrown when authentication fails
|
|
@@ -90,11 +91,15 @@
|
|
|
90
91
|
* ===============================================================================
|
|
91
92
|
*/
|
|
92
93
|
import { createRequire } from 'node:module';
|
|
94
|
+
import { pathToFileURL } from 'node:url';
|
|
93
95
|
const require = createRequire(import.meta.url);
|
|
94
96
|
import { path } from './path_api.js';
|
|
95
97
|
import { readInput, readPassword, sleep } from './order/utils/system.js';
|
|
96
|
-
import { TIMING, CREDENTIAL_PROMPTS } from './constants.js';
|
|
98
|
+
import { TIMING, CREDENTIAL_PROMPTS, UPDATER } from './constants.js';
|
|
97
99
|
import { PATHS } from './paths.js';
|
|
100
|
+
import { CLI_COLORS } from './cli_colors.js';
|
|
101
|
+
import { formatStartupNotice } from './cli_start_output.js';
|
|
102
|
+
import { displayWidth, padDisplay } from './utils/text_width.js';
|
|
98
103
|
import { getStorage } from './storage/index.js';
|
|
99
104
|
import { sendSocketJsonRequest } from './socket_json_client.js';
|
|
100
105
|
import { resolvePrivateKey as resolveAuthKey } from './authority_resolver.js';
|
|
@@ -160,6 +165,25 @@ const VAULT_DAEMON_SIGNING_TOKEN_KIND = 'dexbot-daemon-signing-token';
|
|
|
160
165
|
const PROFILES_KEYS_FILE = Config.DEXBOT_KEYS_FILE
|
|
161
166
|
? path.resolve(Config.DEXBOT_KEYS_FILE)
|
|
162
167
|
: PATHS.PROFILES.KEYS_JSON();
|
|
168
|
+
const BITSHARES_ONBOARDING_FILE = path.join(PATHS.PROJECT_ROOT, 'docs', 'BITSHARES_ONBOARDING.md');
|
|
169
|
+
const BITSHARES_ONBOARDING_DOC_PATH = 'docs/BITSHARES_ONBOARDING.md';
|
|
170
|
+
// Derive the web link from the canonical repository metadata so a repo/branch
|
|
171
|
+
// change only has to be made in modules/constants.ts.
|
|
172
|
+
const BITSHARES_ONBOARDING_REMOTE_URL = `${UPDATER.REPOSITORY_URL.replace(/\.git$/, '')}/blob/${UPDATER.BRANCH === 'auto' ? 'main' : UPDATER.BRANCH}/${BITSHARES_ONBOARDING_DOC_PATH}`;
|
|
173
|
+
/**
|
|
174
|
+
* Pick the onboarding link to show: the copy shipped with this installation
|
|
175
|
+
* when present, otherwise the hosted document. Exported for testing.
|
|
176
|
+
*/
|
|
177
|
+
export function resolveOnboardingUrl(localExists = storage.exists(BITSHARES_ONBOARDING_FILE), localHref = pathToFileURL(BITSHARES_ONBOARDING_FILE).href) {
|
|
178
|
+
return localExists ? localHref : BITSHARES_ONBOARDING_REMOTE_URL;
|
|
179
|
+
}
|
|
180
|
+
function printEmptyVaultOnboardingNotice() {
|
|
181
|
+
const message = `New to DEXBot2 and BitShares? Check out:\n${resolveOnboardingUrl()}`;
|
|
182
|
+
console.log(formatStartupNotice(message, {
|
|
183
|
+
isTTY: hasProcess() && Boolean(process.stdout?.isTTY),
|
|
184
|
+
noColor: Boolean(Config.NO_COLOR),
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
163
187
|
/**
|
|
164
188
|
* Ensures that the profiles/keys directory exists.
|
|
165
189
|
* @private
|
|
@@ -422,6 +446,26 @@ function loadAccounts() {
|
|
|
422
446
|
return normalizeAccountsData();
|
|
423
447
|
}
|
|
424
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* Report whether the key vault has a usable account entry.
|
|
451
|
+
* Password metadata alone is not sufficient: cancelling key setup can leave
|
|
452
|
+
* a valid-looking vault with no account key to use at runtime.
|
|
453
|
+
*/
|
|
454
|
+
function hasKeySetup(accountsData = loadAccounts()) {
|
|
455
|
+
if (!hasModernVault(accountsData))
|
|
456
|
+
return false;
|
|
457
|
+
// A vault created by cancelling key setup can contain only password
|
|
458
|
+
// metadata (salt/verifier) and no usable account key. Treat that as
|
|
459
|
+
// incomplete onboarding so `dexbot start` returns to the key manager.
|
|
460
|
+
return Object.entries(accountsData.accounts || {}).some(([accountName, account]) => {
|
|
461
|
+
if (!accountName.trim() || !account || typeof account.encryptedKey !== 'string')
|
|
462
|
+
return false;
|
|
463
|
+
const parts = account.encryptedKey.split(':');
|
|
464
|
+
return parts.length === 5
|
|
465
|
+
&& parts[0] === 'v2'
|
|
466
|
+
&& parts.slice(1).every((part) => part.length > 0 && part.length % 2 === 0 && /^[0-9a-f]+$/i.test(part));
|
|
467
|
+
});
|
|
468
|
+
}
|
|
425
469
|
function setupModernVault(accountsData, password) {
|
|
426
470
|
const vaultSalt = randomBytes(VAULT_SALT_BYTES);
|
|
427
471
|
const vaultKey = deriveVaultKey(password, vaultSalt);
|
|
@@ -477,12 +521,31 @@ class MasterPasswordError extends Error {
|
|
|
477
521
|
}
|
|
478
522
|
}
|
|
479
523
|
/**
|
|
480
|
-
*
|
|
524
|
+
* Thrown when the user cancels an interactive master-password prompt (Escape).
|
|
525
|
+
* Kept distinct from MasterPasswordError so cancellation is never reported as a
|
|
526
|
+
* wrong-password failure, while still aborting callers that cannot continue.
|
|
527
|
+
*/
|
|
528
|
+
class MasterPasswordCancelledError extends Error {
|
|
529
|
+
static code = 'MASTER_PASSWORD_CANCELLED';
|
|
530
|
+
code;
|
|
531
|
+
constructor(message = 'Master password entry cancelled.') {
|
|
532
|
+
super(message);
|
|
533
|
+
this.name = 'MasterPasswordCancelledError';
|
|
534
|
+
this.code = MasterPasswordCancelledError.code;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Check if an error should abort an authentication-dependent flow.
|
|
539
|
+
* Covers both wrong-password failures and user cancellation.
|
|
481
540
|
* @param {Error} err - Error to check
|
|
482
|
-
* @returns {boolean} True if the error indicates
|
|
541
|
+
* @returns {boolean} True if the error indicates authentication could not complete
|
|
483
542
|
*/
|
|
484
543
|
function isMasterPasswordFailure(err) {
|
|
485
|
-
return !!(err &&
|
|
544
|
+
return !!(err &&
|
|
545
|
+
(err instanceof MasterPasswordError ||
|
|
546
|
+
err instanceof MasterPasswordCancelledError ||
|
|
547
|
+
err.code === MasterPasswordError.code ||
|
|
548
|
+
err.code === MasterPasswordCancelledError.code));
|
|
486
549
|
}
|
|
487
550
|
const MASTER_PASSWORD_MAX_ATTEMPTS = CREDENTIAL_PROMPTS.MAX_MASTER_PASSWORD_ATTEMPTS;
|
|
488
551
|
let masterPasswordAttempts = 0;
|
|
@@ -503,7 +566,8 @@ async function _promptPassword() {
|
|
|
503
566
|
/**
|
|
504
567
|
* Authenticate and return a derived vault secret.
|
|
505
568
|
* Prompts user interactively with limited retry attempts.
|
|
506
|
-
* @returns {Promise<
|
|
569
|
+
* @returns {Promise<VaultSecret>} The verified vault secret
|
|
570
|
+
* @throws {MasterPasswordCancelledError} If the user cancels with Escape
|
|
507
571
|
* @throws {Error} If no master password is set
|
|
508
572
|
* @throws {MasterPasswordError} If max attempts exceeded
|
|
509
573
|
*/
|
|
@@ -526,6 +590,10 @@ async function authenticate() {
|
|
|
526
590
|
throw new MasterPasswordError(`Incorrect master password after ${MASTER_PASSWORD_MAX_ATTEMPTS} attempts.`);
|
|
527
591
|
}
|
|
528
592
|
const enteredPassword = await _promptPassword();
|
|
593
|
+
if (enteredPassword === '\x1b') {
|
|
594
|
+
masterPasswordAttempts = 0;
|
|
595
|
+
throw new MasterPasswordCancelledError();
|
|
596
|
+
}
|
|
529
597
|
try {
|
|
530
598
|
const secret = unlockWithPassword(enteredPassword, accountsData);
|
|
531
599
|
masterPasswordAttempts = 0;
|
|
@@ -540,7 +608,7 @@ async function authenticate() {
|
|
|
540
608
|
}
|
|
541
609
|
}
|
|
542
610
|
catch (err) {
|
|
543
|
-
if (err instanceof MasterPasswordError) {
|
|
611
|
+
if (err instanceof MasterPasswordError || err instanceof MasterPasswordCancelledError) {
|
|
544
612
|
masterPasswordAttempts = 0;
|
|
545
613
|
}
|
|
546
614
|
throw err;
|
|
@@ -598,13 +666,19 @@ async function resolvePrivateKey(accountName, vaultSecret, chainClient) {
|
|
|
598
666
|
* @returns {Array<string>} Array of account names
|
|
599
667
|
*/
|
|
600
668
|
function listKeyNames(accounts) {
|
|
601
|
-
|
|
669
|
+
const names = accounts ? Object.keys(accounts) : [];
|
|
670
|
+
if (names.length === 0) {
|
|
602
671
|
console.log(' (no accounts stored yet)');
|
|
603
672
|
return [];
|
|
604
673
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
674
|
+
const indexWidth = Math.max(1, ...names.map((_, index) => String(index + 1).length));
|
|
675
|
+
const accountWidth = Math.max('Account'.length, ...names.map((name) => displayWidth(name)));
|
|
676
|
+
const header = `#`.padEnd(indexWidth) + ' ' + padDisplay('Account', accountWidth);
|
|
677
|
+
console.log(` ${CLI_COLORS.yellowBold}${header}${CLI_COLORS.reset}`);
|
|
678
|
+
return names.map((name, index) => {
|
|
679
|
+
const rowIndex = String(index + 1);
|
|
680
|
+
console.log(` ${CLI_COLORS.gray}${rowIndex.padEnd(indexWidth)}${CLI_COLORS.reset} ` +
|
|
681
|
+
`${CLI_COLORS.greenBold}${padDisplay(name, accountWidth)}${CLI_COLORS.reset}`);
|
|
608
682
|
return name;
|
|
609
683
|
});
|
|
610
684
|
}
|
|
@@ -612,7 +686,7 @@ function listKeyNames(accounts) {
|
|
|
612
686
|
* Prompts the user to select an account name from the stored keys.
|
|
613
687
|
* @param {Object} accounts - The accounts object.
|
|
614
688
|
* @param {string} promptText - The prompt message to display.
|
|
615
|
-
* @returns {Promise<string|null>} The selected account name, or null/
|
|
689
|
+
* @returns {Promise<string|null>} The selected account name, or null if cancelled/invalid.
|
|
616
690
|
*/
|
|
617
691
|
async function selectKeyName(accounts, promptText) {
|
|
618
692
|
const names = Object.keys(accounts);
|
|
@@ -623,7 +697,7 @@ async function selectKeyName(accounts, promptText) {
|
|
|
623
697
|
names.forEach((name, index) => console.log(` ${index + 1}. ${name}`));
|
|
624
698
|
const raw = (await readInput(`${promptText} [1-${names.length}]: `)).trim();
|
|
625
699
|
if (raw === '\x1b')
|
|
626
|
-
return
|
|
700
|
+
return null;
|
|
627
701
|
const idx = Number(raw) - 1;
|
|
628
702
|
if (Number.isNaN(idx) || idx < 0 || idx >= names.length) {
|
|
629
703
|
if (raw !== '')
|
|
@@ -636,7 +710,8 @@ async function selectKeyName(accounts, promptText) {
|
|
|
636
710
|
* Interactively changes the master password and re-encrypts all stored keys.
|
|
637
711
|
* @param {Object} accountsData - The loaded accounts data object.
|
|
638
712
|
* @param {Object|Buffer|null} currentSecret - The current derived secret.
|
|
639
|
-
* @returns {Promise<Object|Buffer|null>} The new vault secret, or the old one if failed
|
|
713
|
+
* @returns {Promise<Object|Buffer|null>} The new vault secret, or the old one if unchanged/failed.
|
|
714
|
+
* @throws {MasterPasswordCancelledError} If the user cancels with Escape
|
|
640
715
|
*/
|
|
641
716
|
async function changeMasterPassword(accountsData, currentSecret) {
|
|
642
717
|
if (!hasModernVault(accountsData)) {
|
|
@@ -645,7 +720,7 @@ async function changeMasterPassword(accountsData, currentSecret) {
|
|
|
645
720
|
}
|
|
646
721
|
const oldPassword = await readPassword('Enter current master password: ');
|
|
647
722
|
if (oldPassword === '\x1b')
|
|
648
|
-
|
|
723
|
+
throw new MasterPasswordCancelledError();
|
|
649
724
|
if (!verifyCurrentPassword(oldPassword, accountsData)) {
|
|
650
725
|
console.log('Incorrect master password!');
|
|
651
726
|
return currentSecret;
|
|
@@ -653,10 +728,10 @@ async function changeMasterPassword(accountsData, currentSecret) {
|
|
|
653
728
|
const oldSecret = deriveModernSecretFromPassword(oldPassword, accountsData);
|
|
654
729
|
const newPassword = await readPassword('Enter new master password: ');
|
|
655
730
|
if (newPassword === '\x1b')
|
|
656
|
-
|
|
731
|
+
throw new MasterPasswordCancelledError();
|
|
657
732
|
const confirmPassword = await readPassword('Confirm new master password: ');
|
|
658
733
|
if (confirmPassword === '\x1b')
|
|
659
|
-
|
|
734
|
+
throw new MasterPasswordCancelledError();
|
|
660
735
|
if (newPassword !== confirmPassword) {
|
|
661
736
|
console.log('Passwords do not match!');
|
|
662
737
|
return currentSecret;
|
|
@@ -726,37 +801,53 @@ function saveAccounts(data) {
|
|
|
726
801
|
* change master password.
|
|
727
802
|
*/
|
|
728
803
|
async function main() {
|
|
804
|
+
const ESC = '\x1b';
|
|
729
805
|
console.log('Chain Key Manager');
|
|
730
806
|
console.log('========================');
|
|
731
807
|
let accountsData = loadAccounts();
|
|
732
808
|
let vaultSecret = null;
|
|
809
|
+
let vaultReady = false;
|
|
733
810
|
// Check if master password is set
|
|
734
811
|
if (!hasModernVault(accountsData)) {
|
|
735
|
-
console.log(
|
|
812
|
+
console.log(`${CLI_COLORS.boldRed}No master password set. Please set one:${CLI_COLORS.reset}`);
|
|
736
813
|
const password1 = await readPassword('Enter master password: ');
|
|
814
|
+
if (password1 === ESC)
|
|
815
|
+
return false;
|
|
737
816
|
const password2 = await readPassword('Confirm master password: ');
|
|
817
|
+
if (password2 === ESC)
|
|
818
|
+
return false;
|
|
738
819
|
if (password1 !== password2) {
|
|
739
820
|
console.log('Passwords do not match!');
|
|
740
|
-
return;
|
|
821
|
+
return false;
|
|
741
822
|
}
|
|
742
823
|
vaultSecret = setupModernVault(accountsData, password1);
|
|
743
824
|
saveAccounts(accountsData);
|
|
825
|
+
vaultReady = true;
|
|
744
826
|
console.log('Master password set successfully.');
|
|
827
|
+
console.log('');
|
|
745
828
|
}
|
|
746
829
|
else {
|
|
747
830
|
try {
|
|
748
831
|
vaultSecret = await authenticate();
|
|
749
832
|
accountsData = loadAccounts();
|
|
833
|
+
vaultReady = true;
|
|
750
834
|
console.log('Authenticated successfully.');
|
|
835
|
+
console.log('');
|
|
751
836
|
}
|
|
752
837
|
catch (err) {
|
|
838
|
+
if (err instanceof MasterPasswordCancelledError) {
|
|
839
|
+
return false;
|
|
840
|
+
}
|
|
753
841
|
if (err instanceof MasterPasswordError) {
|
|
754
842
|
console.log(getErrorMessage(err));
|
|
755
|
-
return;
|
|
843
|
+
return false;
|
|
756
844
|
}
|
|
757
845
|
throw err;
|
|
758
846
|
}
|
|
759
847
|
}
|
|
848
|
+
if (Object.keys(accountsData.accounts || {}).length === 0) {
|
|
849
|
+
printEmptyVaultOnboardingNotice();
|
|
850
|
+
}
|
|
760
851
|
while (true) {
|
|
761
852
|
console.log('\nMenu:');
|
|
762
853
|
console.log('1. Add key');
|
|
@@ -768,21 +859,20 @@ async function main() {
|
|
|
768
859
|
console.log('7. Exit (or press Enter)');
|
|
769
860
|
const choiceRaw = await readInput('Choose an option: ');
|
|
770
861
|
console.log('');
|
|
771
|
-
if (choiceRaw ===
|
|
772
|
-
console.log('Keymanager closed!');
|
|
862
|
+
if (choiceRaw === ESC || choiceRaw.trim() === '') {
|
|
773
863
|
break;
|
|
774
864
|
}
|
|
775
865
|
const choice = choiceRaw.trim();
|
|
776
866
|
if (choice === '1') {
|
|
777
867
|
const accountNameRaw = await readInput('Enter account name: ');
|
|
778
|
-
if (accountNameRaw ===
|
|
868
|
+
if (accountNameRaw === ESC)
|
|
779
869
|
continue;
|
|
780
870
|
const accountName = accountNameRaw.trim();
|
|
781
871
|
if (!accountName) {
|
|
782
872
|
continue;
|
|
783
873
|
}
|
|
784
874
|
const privateKeyRaw = await readPassword('Enter private key: ');
|
|
785
|
-
if (privateKeyRaw ===
|
|
875
|
+
if (privateKeyRaw === ESC)
|
|
786
876
|
continue;
|
|
787
877
|
const privateKey = privateKeyRaw.replace(/\s+/g, '');
|
|
788
878
|
const validation = validatePrivateKey(privateKey);
|
|
@@ -798,10 +888,10 @@ async function main() {
|
|
|
798
888
|
}
|
|
799
889
|
else if (choice === '2') {
|
|
800
890
|
const accountName = await selectKeyName(accountsData.accounts, 'Select key to modify');
|
|
801
|
-
if (
|
|
891
|
+
if (!accountName)
|
|
802
892
|
continue;
|
|
803
893
|
const privateKeyRaw = await readPassword('Enter private key: ');
|
|
804
|
-
if (privateKeyRaw ===
|
|
894
|
+
if (privateKeyRaw === ESC)
|
|
805
895
|
continue;
|
|
806
896
|
const privateKey = privateKeyRaw.replace(/\s+/g, '');
|
|
807
897
|
const validation = validatePrivateKey(privateKey);
|
|
@@ -817,11 +907,12 @@ async function main() {
|
|
|
817
907
|
}
|
|
818
908
|
else if (choice === '3') {
|
|
819
909
|
const accountName = await selectKeyName(accountsData.accounts, 'Select key to remove');
|
|
820
|
-
if (
|
|
910
|
+
if (!accountName)
|
|
821
911
|
continue;
|
|
822
|
-
const
|
|
823
|
-
if (
|
|
912
|
+
const confirmRaw = await readInput(`Remove '${accountName}'? (y/n): `);
|
|
913
|
+
if (confirmRaw === ESC)
|
|
824
914
|
continue;
|
|
915
|
+
const confirm = confirmRaw.trim().toLowerCase();
|
|
825
916
|
if (confirm === 'y') {
|
|
826
917
|
delete accountsData.accounts[accountName];
|
|
827
918
|
saveAccounts(accountsData);
|
|
@@ -836,7 +927,7 @@ async function main() {
|
|
|
836
927
|
}
|
|
837
928
|
else if (choice === '5') {
|
|
838
929
|
const accountName = await selectKeyName(accountsData.accounts, 'Select key to test');
|
|
839
|
-
if (
|
|
930
|
+
if (!accountName)
|
|
840
931
|
continue;
|
|
841
932
|
try {
|
|
842
933
|
const decryptedKey = decrypt(accountsData.accounts[accountName].encryptedKey, vaultSecret);
|
|
@@ -847,16 +938,26 @@ async function main() {
|
|
|
847
938
|
}
|
|
848
939
|
}
|
|
849
940
|
else if (choice === '6') {
|
|
850
|
-
|
|
941
|
+
try {
|
|
942
|
+
vaultSecret = await changeMasterPassword(accountsData, vaultSecret);
|
|
943
|
+
}
|
|
944
|
+
catch (err) {
|
|
945
|
+
if (err instanceof MasterPasswordCancelledError) {
|
|
946
|
+
console.log('Cancelled.');
|
|
947
|
+
continue;
|
|
948
|
+
}
|
|
949
|
+
throw err;
|
|
950
|
+
}
|
|
851
951
|
}
|
|
852
952
|
else if (choice === '7') {
|
|
853
|
-
console.log('Keymanager closed!');
|
|
854
953
|
break;
|
|
855
954
|
}
|
|
856
955
|
else {
|
|
857
956
|
console.log('Invalid choice.');
|
|
858
957
|
}
|
|
859
958
|
}
|
|
959
|
+
console.log('Keymanager closed!');
|
|
960
|
+
return vaultReady;
|
|
860
961
|
}
|
|
861
962
|
/**
|
|
862
963
|
* Check if dexbot-cred daemon is ready and responsive
|
|
@@ -1029,5 +1130,5 @@ function probeAccountInDaemon(accountName, timeout = TIMING.DAEMON_PING_TIMEOUT_
|
|
|
1029
1130
|
throw new Error(response.error || 'Daemon probe failed');
|
|
1030
1131
|
});
|
|
1031
1132
|
}
|
|
1032
|
-
export { validatePrivateKey, loadAccounts, saveAccounts, checkKeysFileSecurity, encrypt, decrypt, deriveVaultKey, createDaemonSigningToken, createSessionSecret, createVaultSecret, isVaultSecret, isDaemonSigningToken, unlockWithPassword, main, authenticate, getPrivateKey, resolvePrivateKey, isMasterPasswordFailure, MasterPasswordError, isDaemonReady, isDaemonResponsive, waitForDaemon, probeAccountInDaemon, pingDaemon };
|
|
1133
|
+
export { validatePrivateKey, loadAccounts, hasKeySetup, saveAccounts, checkKeysFileSecurity, encrypt, decrypt, deriveVaultKey, createDaemonSigningToken, createSessionSecret, createVaultSecret, isVaultSecret, isDaemonSigningToken, unlockWithPassword, main, authenticate, getPrivateKey, resolvePrivateKey, isMasterPasswordFailure, MasterPasswordError, isDaemonReady, isDaemonResponsive, waitForDaemon, probeAccountInDaemon, pingDaemon };
|
|
1033
1134
|
//# sourceMappingURL=chain_keys.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type StartOnboardingCommand = 'key' | 'bot' | null;
|
|
2
|
+
/**
|
|
3
|
+
* Select the setup editor that should handle an otherwise-normal start
|
|
4
|
+
* command (`start` or its `unlock` alias).
|
|
5
|
+
* Key setup takes precedence because runtime launches require a usable account
|
|
6
|
+
* key, not just password metadata. A vault with a valid account and no bot
|
|
7
|
+
* definitions proceeds to the bot editor.
|
|
8
|
+
*/
|
|
9
|
+
export declare function selectStartOnboardingCommand(hasKeySetup: boolean, botCount: number): StartOnboardingCommand;
|
|
10
|
+
//# sourceMappingURL=cli_start_onboarding.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select the setup editor that should handle an otherwise-normal start
|
|
3
|
+
* command (`start` or its `unlock` alias).
|
|
4
|
+
* Key setup takes precedence because runtime launches require a usable account
|
|
5
|
+
* key, not just password metadata. A vault with a valid account and no bot
|
|
6
|
+
* definitions proceeds to the bot editor.
|
|
7
|
+
*/
|
|
8
|
+
export function selectStartOnboardingCommand(hasKeySetup, botCount) {
|
|
9
|
+
if (!hasKeySetup)
|
|
10
|
+
return 'key';
|
|
11
|
+
if (botCount === 0)
|
|
12
|
+
return 'bot';
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=cli_start_onboarding.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CLI_COLORS } from './cli_colors.js';
|
|
2
|
+
/** Format a launcher notice consistently for TTY and non-TTY output. */
|
|
3
|
+
export function formatStartupNotice(text, { isTTY = false, noColor = false } = {}) {
|
|
4
|
+
return isTTY && !noColor
|
|
5
|
+
? `${CLI_COLORS.yellowBold}${text}${CLI_COLORS.reset}`
|
|
6
|
+
: text;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=cli_start_output.js.map
|
package/dist/modules/config.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare const Config: {
|
|
|
10
10
|
DEXBOT_MONOLITHIC_BG: boolean;
|
|
11
11
|
DEXBOT_LAUNCHER_WORKER: boolean;
|
|
12
12
|
DEXBOT_UPDATE_SKIP_RELOAD: boolean;
|
|
13
|
+
DEXBOT_SKIP_VERSION_NOTICE: boolean;
|
|
13
14
|
NO_COLOR: string | undefined;
|
|
14
15
|
PM2_HOME: string | undefined;
|
|
15
16
|
DEXBOT_SUPERVISOR_SOCKET: string | undefined;
|
package/dist/modules/config.js
CHANGED
|
@@ -53,6 +53,7 @@ const Config = {
|
|
|
53
53
|
DEXBOT_MONOLITHIC_BG: bool('DEXBOT_MONOLITHIC_BG'),
|
|
54
54
|
DEXBOT_LAUNCHER_WORKER: bool('DEXBOT_LAUNCHER_WORKER'),
|
|
55
55
|
DEXBOT_UPDATE_SKIP_RELOAD: bool('DEXBOT_UPDATE_SKIP_RELOAD'),
|
|
56
|
+
DEXBOT_SKIP_VERSION_NOTICE: bool('DEXBOT_SKIP_VERSION_NOTICE'),
|
|
56
57
|
NO_COLOR: str('NO_COLOR'),
|
|
57
58
|
// ── Paths ───────────────────────────────────────────────────────
|
|
58
59
|
PM2_HOME: str('PM2_HOME'),
|