dexbot 1.4.11 → 1.4.12
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/README.md +4 -4
- package/dist/analysis/chart_utils.d.ts.map +1 -1
- package/dist/analysis/chart_utils.js +9 -18
- package/dist/analysis/chart_utils.js.map +1 -1
- package/dist/analysis/math_utils.d.ts.map +1 -1
- package/dist/analysis/math_utils.js +6 -16
- package/dist/analysis/math_utils.js.map +1 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts +1 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +1 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +31 -38
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +1 -1
- package/dist/analysis/trend_detection/hurst_analyzer.js +7 -10
- package/dist/analysis/trend_detection/hurst_analyzer.js.map +1 -1
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js +10 -14
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js.map +1 -1
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js +10 -15
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js.map +1 -1
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js +7 -10
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js.map +1 -1
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +4 -12
- package/dist/bot.js.map +1 -1
- package/dist/credential-daemon.d.ts +0 -1
- package/dist/credential-daemon.d.ts.map +1 -1
- package/dist/credential-daemon.js +3 -123
- package/dist/credential-daemon.js.map +1 -1
- package/dist/dexbot.d.ts +0 -87
- package/dist/dexbot.d.ts.map +1 -1
- package/dist/dexbot.js +11 -14
- package/dist/dexbot.js.map +1 -1
- package/dist/market_adapter/ama_signal_runner.js +8 -9
- package/dist/market_adapter/ama_signal_runner.js.map +1 -1
- package/dist/market_adapter/candle_utils.js +1 -7
- package/dist/market_adapter/candle_utils.js.map +1 -1
- package/dist/market_adapter/core/asymmetric_bounds.js +1 -4
- package/dist/market_adapter/core/asymmetric_bounds.js.map +1 -1
- package/dist/market_adapter/core/config_normalizers.js +5 -9
- package/dist/market_adapter/core/config_normalizers.js.map +1 -1
- package/dist/market_adapter/core/kibana_candles.js +8 -15
- package/dist/market_adapter/core/kibana_candles.js.map +1 -1
- package/dist/market_adapter/core/kibana_client.js +7 -13
- package/dist/market_adapter/core/kibana_client.js.map +1 -1
- package/dist/market_adapter/core/kibana_market_candles.js +6 -12
- package/dist/market_adapter/core/kibana_market_candles.js.map +1 -1
- package/dist/market_adapter/core/market_adapter_service.js +92 -102
- package/dist/market_adapter/core/market_adapter_service.js.map +1 -1
- package/dist/market_adapter/core/strategies/ama.js +5 -10
- package/dist/market_adapter/core/strategies/ama.js.map +1 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.js +21 -24
- package/dist/market_adapter/core/strategies/ama_slope_model.js.map +1 -1
- package/dist/market_adapter/core/strategies/atr/calculator.js +3 -5
- package/dist/market_adapter/core/strategies/atr/calculator.js.map +1 -1
- package/dist/market_adapter/core/strategies/collateral_manager.js +4 -6
- package/dist/market_adapter/core/strategies/collateral_manager.js.map +1 -1
- package/dist/market_adapter/core/strategies/regime_gate.js +15 -22
- package/dist/market_adapter/core/strategies/regime_gate.js.map +1 -1
- package/dist/market_adapter/index.d.ts +23 -23
- package/dist/market_adapter/index.d.ts.map +1 -1
- package/dist/market_adapter/index.js +24 -82
- package/dist/market_adapter/index.js.map +1 -1
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js +2 -1
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js.map +1 -1
- package/dist/market_adapter/inputs/fetch_lp_data.d.ts.map +1 -1
- package/dist/market_adapter/inputs/fetch_lp_data.js +59 -98
- package/dist/market_adapter/inputs/fetch_lp_data.js.map +1 -1
- package/dist/market_adapter/inputs/kibana_source.js +11 -17
- package/dist/market_adapter/inputs/kibana_source.js.map +1 -1
- package/dist/market_adapter/interval_utils.js +1 -2
- package/dist/market_adapter/interval_utils.js.map +1 -1
- package/dist/market_adapter/log_format.js +1 -7
- package/dist/market_adapter/log_format.js.map +1 -1
- package/dist/market_adapter/lp_chart_core.js +20 -22
- package/dist/market_adapter/lp_chart_core.js.map +1 -1
- package/dist/market_adapter/lp_chart_runner.d.ts +1 -1
- package/dist/market_adapter/lp_chart_runner.d.ts.map +1 -1
- package/dist/market_adapter/lp_chart_runner.js +41 -57
- package/dist/market_adapter/lp_chart_runner.js.map +1 -1
- package/dist/market_adapter/lp_chart_strategy_loader.js +30 -34
- package/dist/market_adapter/lp_chart_strategy_loader.js.map +1 -1
- package/dist/market_adapter/market_adapter.d.ts +2 -2
- package/dist/market_adapter/market_adapter.d.ts.map +1 -1
- package/dist/market_adapter/market_adapter.js +157 -221
- package/dist/market_adapter/market_adapter.js.map +1 -1
- package/dist/market_adapter/merge_lp_data.js +17 -18
- package/dist/market_adapter/merge_lp_data.js.map +1 -1
- package/dist/market_adapter/test_helpers.js +3 -14
- package/dist/market_adapter/test_helpers.js.map +1 -1
- package/dist/market_adapter/utils/adapter_client.js +7 -16
- package/dist/market_adapter/utils/adapter_client.js.map +1 -1
- package/dist/market_adapter/utils/atomic_write.js +3 -5
- package/dist/market_adapter/utils/atomic_write.js.map +1 -1
- package/dist/market_adapter/utils/chain.d.ts.map +1 -1
- package/dist/market_adapter/utils/chain.js +9 -17
- package/dist/market_adapter/utils/chain.js.map +1 -1
- package/dist/market_adapter/utils/data_discovery.js +8 -10
- package/dist/market_adapter/utils/data_discovery.js.map +1 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts.map +1 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.js +11 -14
- package/dist/market_adapter/utils/dynamic_grid_snapshot.js.map +1 -1
- package/dist/market_adapter/utils/file_lock.js +14 -19
- package/dist/market_adapter/utils/file_lock.js.map +1 -1
- package/dist/market_adapter/utils/native_history.js +8 -14
- package/dist/market_adapter/utils/native_history.js.map +1 -1
- package/dist/market_adapter/utils/paths.js +3 -6
- package/dist/market_adapter/utils/paths.js.map +1 -1
- package/dist/modules/account_bots.d.ts +1 -1
- package/dist/modules/account_bots.d.ts.map +1 -1
- package/dist/modules/account_bots.js +90 -97
- package/dist/modules/account_bots.js.map +1 -1
- package/dist/modules/account_orders.d.ts +0 -9
- package/dist/modules/account_orders.d.ts.map +1 -1
- package/dist/modules/account_orders.js +26 -121
- package/dist/modules/account_orders.js.map +1 -1
- package/dist/modules/authority_resolver.js +12 -18
- package/dist/modules/authority_resolver.js.map +1 -1
- package/dist/modules/bitshares-native/chain_client.js +16 -21
- package/dist/modules/bitshares-native/chain_client.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.js +12 -72
- package/dist/modules/bitshares-native/crypto/ecc.browser.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.js +13 -40
- package/dist/modules/bitshares-native/crypto/ecc.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.js +5 -6
- package/dist/modules/bitshares-native/crypto/ecc_selector.js.map +1 -1
- package/dist/modules/bitshares-native/index.d.ts +8 -8
- package/dist/modules/bitshares-native/index.d.ts.map +1 -1
- package/dist/modules/bitshares-native/index.js +11 -68
- package/dist/modules/bitshares-native/index.js.map +1 -1
- package/dist/modules/bitshares-native/lru_cache.js +3 -6
- package/dist/modules/bitshares-native/lru_cache.js.map +1 -1
- package/dist/modules/bitshares-native/resolvers.js +9 -11
- package/dist/modules/bitshares-native/resolvers.js.map +1 -1
- package/dist/modules/bitshares-native/serial/chain_constants.js +3 -28
- package/dist/modules/bitshares-native/serial/chain_constants.js.map +1 -1
- package/dist/modules/bitshares-native/serial/index.d.ts +4 -4
- package/dist/modules/bitshares-native/serial/index.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/index.js +5 -46
- package/dist/modules/bitshares-native/serial/index.js.map +1 -1
- package/dist/modules/bitshares-native/serial/operations.d.ts +98 -98
- package/dist/modules/bitshares-native/serial/operations.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/operations.js +372 -473
- package/dist/modules/bitshares-native/serial/operations.js.map +1 -1
- package/dist/modules/bitshares-native/serial/serializer.js +3 -8
- package/dist/modules/bitshares-native/serial/serializer.js.map +1 -1
- package/dist/modules/bitshares-native/serial/types.js +9 -74
- package/dist/modules/bitshares-native/serial/types.js.map +1 -1
- package/dist/modules/bitshares-native/signing_client.d.ts.map +1 -1
- package/dist/modules/bitshares-native/signing_client.js +11 -48
- package/dist/modules/bitshares-native/signing_client.js.map +1 -1
- package/dist/modules/bitshares-native/subscriptions.d.ts.map +1 -1
- package/dist/modules/bitshares-native/subscriptions.js +24 -27
- package/dist/modules/bitshares-native/subscriptions.js.map +1 -1
- package/dist/modules/bitshares-native/transport.d.ts.map +1 -1
- package/dist/modules/bitshares-native/transport.js +14 -26
- package/dist/modules/bitshares-native/transport.js.map +1 -1
- package/dist/modules/bitshares-native/tx/builder.js +29 -72
- package/dist/modules/bitshares-native/tx/builder.js.map +1 -1
- package/dist/modules/bitshares-native/tx/tx_cache.js +12 -21
- package/dist/modules/bitshares-native/tx/tx_cache.js.map +1 -1
- package/dist/modules/bitshares_client.d.ts +21 -0
- package/dist/modules/bitshares_client.d.ts.map +1 -1
- package/dist/modules/bitshares_client.js +32 -86
- package/dist/modules/bitshares_client.js.map +1 -1
- package/dist/modules/bot_settings.d.ts.map +1 -1
- package/dist/modules/bot_settings.js +30 -49
- package/dist/modules/bot_settings.js.map +1 -1
- package/dist/modules/bots_file_lock.d.ts.map +1 -1
- package/dist/modules/bots_file_lock.js +5 -13
- package/dist/modules/bots_file_lock.js.map +1 -1
- package/dist/modules/broadcast_failure.js +1 -3
- package/dist/modules/broadcast_failure.js.map +1 -1
- package/dist/modules/chain_keys.d.ts +4 -9
- package/dist/modules/chain_keys.d.ts.map +1 -1
- package/dist/modules/chain_keys.js +77 -182
- package/dist/modules/chain_keys.js.map +1 -1
- package/dist/modules/chain_orders.d.ts +2 -2
- package/dist/modules/chain_orders.d.ts.map +1 -1
- package/dist/modules/chain_orders.js +81 -144
- package/dist/modules/chain_orders.js.map +1 -1
- package/dist/modules/config.d.ts.map +1 -1
- package/dist/modules/config.js +23 -28
- package/dist/modules/config.js.map +1 -1
- package/dist/modules/constants.d.ts +2 -9
- package/dist/modules/constants.d.ts.map +1 -1
- package/dist/modules/constants.js +38 -73
- package/dist/modules/constants.js.map +1 -1
- package/dist/modules/cr_planner.js +15 -26
- package/dist/modules/cr_planner.js.map +1 -1
- package/dist/modules/credential_policy.d.ts +3 -6
- package/dist/modules/credential_policy.d.ts.map +1 -1
- package/dist/modules/credential_policy.js +62 -153
- package/dist/modules/credential_policy.js.map +1 -1
- package/dist/modules/credential_runtime.d.ts +1 -1
- package/dist/modules/credential_runtime.d.ts.map +1 -1
- package/dist/modules/credential_runtime.js +34 -41
- package/dist/modules/credential_runtime.js.map +1 -1
- package/dist/modules/credential_session_cache.d.ts +1 -1
- package/dist/modules/credential_session_cache.d.ts.map +1 -1
- package/dist/modules/credential_session_cache.js +5 -42
- package/dist/modules/credential_session_cache.js.map +1 -1
- package/dist/modules/credit_runtime.d.ts.map +1 -1
- package/dist/modules/credit_runtime.js +126 -162
- package/dist/modules/credit_runtime.js.map +1 -1
- package/dist/modules/crypto/browser_provider.d.ts +1 -1
- package/dist/modules/crypto/browser_provider.d.ts.map +1 -1
- package/dist/modules/crypto/browser_provider.js +7 -11
- package/dist/modules/crypto/browser_provider.js.map +1 -1
- package/dist/modules/crypto/index.d.ts +6 -6
- package/dist/modules/crypto/index.d.ts.map +1 -1
- package/dist/modules/crypto/index.js +12 -30
- package/dist/modules/crypto/index.js.map +1 -1
- package/dist/modules/crypto/node_provider.d.ts +1 -1
- package/dist/modules/crypto/node_provider.d.ts.map +1 -1
- package/dist/modules/crypto/node_provider.js +3 -5
- package/dist/modules/crypto/node_provider.js.map +1 -1
- package/dist/modules/crypto/provider.js +1 -2
- package/dist/modules/crypto/pure_ripemd160.js +1 -3
- package/dist/modules/crypto/pure_ripemd160.js.map +1 -1
- package/dist/modules/crypto/pure_scrypt.js +1 -4
- package/dist/modules/crypto/pure_scrypt.js.map +1 -1
- package/dist/modules/crypto/pure_secp256k1.d.ts +1 -1
- package/dist/modules/crypto/pure_secp256k1.d.ts.map +1 -1
- package/dist/modules/crypto/pure_secp256k1.js +1 -16
- package/dist/modules/crypto/pure_secp256k1.js.map +1 -1
- package/dist/modules/crypto/sync.d.ts.map +1 -1
- package/dist/modules/crypto/sync.js +16 -17
- package/dist/modules/crypto/sync.js.map +1 -1
- package/dist/modules/daemon_node_health.js +14 -16
- package/dist/modules/daemon_node_health.js.map +1 -1
- package/dist/modules/dexbot_class.d.ts +19 -14
- package/dist/modules/dexbot_class.d.ts.map +1 -1
- package/dist/modules/dexbot_class.js +127 -164
- package/dist/modules/dexbot_class.js.map +1 -1
- package/dist/modules/dexbot_cow_runtime.d.ts +28 -27
- package/dist/modules/dexbot_cow_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_cow_runtime.js +55 -45
- package/dist/modules/dexbot_cow_runtime.js.map +1 -1
- package/dist/modules/dexbot_credential_client.d.ts +6 -2
- package/dist/modules/dexbot_credential_client.d.ts.map +1 -1
- package/dist/modules/dexbot_credential_client.js +21 -31
- package/dist/modules/dexbot_credential_client.js.map +1 -1
- package/dist/modules/dexbot_fill_runtime.d.ts +23 -23
- package/dist/modules/dexbot_fill_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_fill_runtime.js +119 -77
- package/dist/modules/dexbot_fill_runtime.js.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.d.ts +46 -38
- package/dist/modules/dexbot_maintenance_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.js +81 -81
- package/dist/modules/dexbot_maintenance_runtime.js.map +1 -1
- package/dist/modules/dexbot_startup_runtime.d.ts +3 -3
- package/dist/modules/dexbot_startup_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_startup_runtime.js +43 -81
- package/dist/modules/dexbot_startup_runtime.js.map +1 -1
- package/dist/modules/dexbot_state_recovery.d.ts +11 -11
- package/dist/modules/dexbot_state_recovery.js +32 -78
- package/dist/modules/dexbot_state_recovery.js.map +1 -1
- package/dist/modules/env.js +3 -7
- package/dist/modules/env.js.map +1 -1
- package/dist/modules/fund_registry.d.ts.map +1 -1
- package/dist/modules/fund_registry.js +12 -24
- package/dist/modules/fund_registry.js.map +1 -1
- package/dist/modules/general_settings.js +10 -16
- package/dist/modules/general_settings.js.map +1 -1
- package/dist/modules/graceful_shutdown.d.ts.map +1 -1
- package/dist/modules/graceful_shutdown.js +12 -19
- 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 +27 -65
- package/dist/modules/key_store.js.map +1 -1
- package/dist/modules/launcher/bot_supervisor.d.ts +1 -1
- package/dist/modules/launcher/bot_supervisor.d.ts.map +1 -1
- package/dist/modules/launcher/bot_supervisor.js +89 -118
- package/dist/modules/launcher/bot_supervisor.js.map +1 -1
- package/dist/modules/launcher/child_env.js +1 -5
- package/dist/modules/launcher/child_env.js.map +1 -1
- package/dist/modules/launcher/credential_bootstrap.js +22 -31
- package/dist/modules/launcher/credential_bootstrap.js.map +1 -1
- package/dist/modules/launcher/credential_daemon.js +37 -75
- package/dist/modules/launcher/credential_daemon.js.map +1 -1
- package/dist/modules/launcher/credential_secret.js +2 -37
- package/dist/modules/launcher/credential_secret.js.map +1 -1
- package/dist/modules/launcher/foreign_cred_daemon.js +25 -31
- package/dist/modules/launcher/foreign_cred_daemon.js.map +1 -1
- package/dist/modules/launcher/headless_password.js +10 -12
- package/dist/modules/launcher/headless_password.js.map +1 -1
- package/dist/modules/launcher/launch_modes.js +3 -9
- package/dist/modules/launcher/launch_modes.js.map +1 -1
- package/dist/modules/launcher/market_adapter_runtime.d.ts +1 -1
- package/dist/modules/launcher/market_adapter_runtime.d.ts.map +1 -1
- package/dist/modules/launcher/market_adapter_runtime.js +25 -35
- package/dist/modules/launcher/market_adapter_runtime.js.map +1 -1
- package/dist/modules/launcher/market_adapter_watchdog.d.ts.map +1 -1
- package/dist/modules/launcher/market_adapter_watchdog.js +42 -45
- package/dist/modules/launcher/market_adapter_watchdog.js.map +1 -1
- package/dist/modules/launcher/monolithic_runtime.d.ts +1 -1
- package/dist/modules/launcher/monolithic_runtime.d.ts.map +1 -1
- package/dist/modules/launcher/monolithic_runtime.js +67 -138
- package/dist/modules/launcher/monolithic_runtime.js.map +1 -1
- package/dist/modules/launcher/runtime_entry.d.ts +1 -11
- package/dist/modules/launcher/runtime_entry.d.ts.map +1 -1
- package/dist/modules/launcher/runtime_entry.js +12 -15
- package/dist/modules/launcher/runtime_entry.js.map +1 -1
- package/dist/modules/launcher/status_reporting.d.ts +1 -1
- package/dist/modules/launcher/status_reporting.d.ts.map +1 -1
- package/dist/modules/launcher/status_reporting.js +15 -36
- package/dist/modules/launcher/status_reporting.js.map +1 -1
- package/dist/modules/launcher/supervisor_control.js +4 -9
- package/dist/modules/launcher/supervisor_control.js.map +1 -1
- package/dist/modules/logger.d.ts +1 -1
- package/dist/modules/logger.d.ts.map +1 -1
- package/dist/modules/logger.js +3 -38
- package/dist/modules/logger.js.map +1 -1
- package/dist/modules/market_adapter_whitelist.js +9 -18
- package/dist/modules/market_adapter_whitelist.js.map +1 -1
- package/dist/modules/node_failure_ledger.js +1 -3
- package/dist/modules/node_failure_ledger.js.map +1 -1
- package/dist/modules/node_health_cache.d.ts.map +1 -1
- package/dist/modules/node_health_cache.js +15 -25
- 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 -43
- package/dist/modules/node_manager.js.map +1 -1
- package/dist/modules/order/accounting.d.ts.map +1 -1
- package/dist/modules/order/accounting.js +102 -118
- package/dist/modules/order/accounting.js.map +1 -1
- package/dist/modules/order/async_lock.d.ts +3 -15
- package/dist/modules/order/async_lock.d.ts.map +1 -1
- package/dist/modules/order/async_lock.js +6 -26
- package/dist/modules/order/async_lock.js.map +1 -1
- package/dist/modules/order/export.js +34 -75
- package/dist/modules/order/export.js.map +1 -1
- package/dist/modules/order/format.d.ts +1 -3
- package/dist/modules/order/format.d.ts.map +1 -1
- package/dist/modules/order/format.js +4 -24
- package/dist/modules/order/format.js.map +1 -1
- package/dist/modules/order/grid.d.ts +3 -3
- package/dist/modules/order/grid.d.ts.map +1 -1
- package/dist/modules/order/grid.js +206 -262
- package/dist/modules/order/grid.js.map +1 -1
- package/dist/modules/order/grid_reconcile.d.ts.map +1 -1
- package/dist/modules/order/grid_reconcile.js +77 -94
- package/dist/modules/order/grid_reconcile.js.map +1 -1
- package/dist/modules/order/grid_reconcile_internal.d.ts.map +1 -1
- package/dist/modules/order/grid_reconcile_internal.js +117 -149
- package/dist/modules/order/grid_reconcile_internal.js.map +1 -1
- package/dist/modules/order/index.d.ts.map +1 -1
- package/dist/modules/order/index.js +11 -45
- package/dist/modules/order/index.js.map +1 -1
- package/dist/modules/order/logger.js +28 -69
- package/dist/modules/order/logger.js.map +1 -1
- package/dist/modules/order/logger_state.d.ts.map +1 -1
- package/dist/modules/order/logger_state.js +3 -4
- package/dist/modules/order/logger_state.js.map +1 -1
- package/dist/modules/order/manager.d.ts +10 -0
- package/dist/modules/order/manager.d.ts.map +1 -1
- package/dist/modules/order/manager.js +131 -151
- package/dist/modules/order/manager.js.map +1 -1
- package/dist/modules/order/processed_fill_store.js +2 -7
- package/dist/modules/order/processed_fill_store.js.map +1 -1
- package/dist/modules/order/strategy.js +23 -25
- package/dist/modules/order/strategy.js.map +1 -1
- package/dist/modules/order/sync_engine.d.ts +27 -0
- package/dist/modules/order/sync_engine.d.ts.map +1 -1
- package/dist/modules/order/sync_engine.js +232 -181
- package/dist/modules/order/sync_engine.js.map +1 -1
- package/dist/modules/order/utils/math.d.ts +1 -25
- package/dist/modules/order/utils/math.d.ts.map +1 -1
- package/dist/modules/order/utils/math.js +49 -172
- package/dist/modules/order/utils/math.js.map +1 -1
- package/dist/modules/order/utils/order.d.ts +46 -2
- package/dist/modules/order/utils/order.d.ts.map +1 -1
- package/dist/modules/order/utils/order.js +165 -143
- package/dist/modules/order/utils/order.js.map +1 -1
- package/dist/modules/order/utils/system.d.ts +3 -1
- package/dist/modules/order/utils/system.d.ts.map +1 -1
- package/dist/modules/order/utils/system.js +152 -211
- package/dist/modules/order/utils/system.js.map +1 -1
- package/dist/modules/order/utils/timeout.js +1 -4
- package/dist/modules/order/utils/timeout.js.map +1 -1
- package/dist/modules/order/utils/validate.js +91 -142
- package/dist/modules/order/utils/validate.js.map +1 -1
- package/dist/modules/order/utils/withPoolRef.js +21 -61
- package/dist/modules/order/utils/withPoolRef.js.map +1 -1
- package/dist/modules/order/working_grid.js +6 -9
- package/dist/modules/order/working_grid.js.map +1 -1
- package/dist/modules/path_api.d.ts.map +1 -1
- package/dist/modules/path_api.js +8 -11
- package/dist/modules/path_api.js.map +1 -1
- package/dist/modules/paths.d.ts.map +1 -1
- package/dist/modules/paths.js +61 -67
- package/dist/modules/paths.js.map +1 -1
- package/dist/modules/process_discovery.js +13 -21
- package/dist/modules/process_discovery.js.map +1 -1
- package/dist/modules/runtime.js +7 -11
- package/dist/modules/runtime.js.map +1 -1
- package/dist/modules/runtime_settings.d.ts.map +1 -1
- package/dist/modules/runtime_settings.js +14 -16
- package/dist/modules/runtime_settings.js.map +1 -1
- package/dist/modules/settings_merge.js +1 -3
- package/dist/modules/settings_merge.js.map +1 -1
- package/dist/modules/socket_json_client.js +3 -5
- package/dist/modules/socket_json_client.js.map +1 -1
- package/dist/modules/storage/browser_adapter.js +1 -4
- package/dist/modules/storage/browser_adapter.js.map +1 -1
- package/dist/modules/storage/index.d.ts +3 -2
- package/dist/modules/storage/index.d.ts.map +1 -1
- package/dist/modules/storage/index.js +5 -8
- package/dist/modules/storage/index.js.map +1 -1
- package/dist/modules/storage/node_adapter.d.ts +3 -4
- package/dist/modules/storage/node_adapter.d.ts.map +1 -1
- package/dist/modules/storage/node_adapter.js +12 -16
- package/dist/modules/storage/node_adapter.js.map +1 -1
- package/dist/modules/storage/types.js +1 -2
- package/dist/modules/types.d.ts +0 -6
- package/dist/modules/types.d.ts.map +1 -1
- package/dist/modules/types.js +1 -2
- package/dist/modules/types.js.map +1 -1
- package/dist/modules/utils/base58check.js +8 -15
- package/dist/modules/utils/base58check.js.map +1 -1
- package/dist/modules/utils/build_dir.js +3 -7
- package/dist/modules/utils/build_dir.js.map +1 -1
- package/dist/modules/utils/errors.js +1 -5
- package/dist/modules/utils/errors.js.map +1 -1
- package/dist/modules/utils/math_utils.d.ts +1 -1
- package/dist/modules/utils/math_utils.d.ts.map +1 -1
- package/dist/modules/utils/math_utils.js +2 -7
- package/dist/modules/utils/math_utils.js.map +1 -1
- package/dist/modules/validate_profiles.d.ts.map +1 -1
- package/dist/modules/validate_profiles.js +18 -25
- package/dist/modules/validate_profiles.js.map +1 -1
- package/dist/pm2.d.ts +4 -70
- package/dist/pm2.d.ts.map +1 -1
- package/dist/pm2.js +106 -132
- package/dist/pm2.js.map +1 -1
- package/dist/scripts/analyze-git.js +13 -17
- package/dist/scripts/analyze-git.js.map +1 -1
- package/dist/scripts/analyze-orders.d.ts.map +1 -1
- package/dist/scripts/analyze-orders.js +48 -63
- package/dist/scripts/analyze-orders.js.map +1 -1
- package/dist/scripts/diagnose-kibana-candles.d.ts.map +1 -1
- package/dist/scripts/diagnose-kibana-candles.js +2 -1
- package/dist/scripts/diagnose-kibana-candles.js.map +1 -1
- package/dist/scripts/diagnose-pool-history.d.ts.map +1 -1
- package/dist/scripts/diagnose-pool-history.js +2 -1
- 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 +2 -2
- package/dist/scripts/divergence-calc.js.map +1 -1
- package/dist/scripts/fix-err-message.js +17 -22
- package/dist/scripts/fix-err-message.js.map +1 -1
- package/dist/scripts/generate_lp_chart.d.ts.map +1 -1
- package/dist/scripts/generate_lp_chart.js +7 -15
- package/dist/scripts/generate_lp_chart.js.map +1 -1
- package/dist/scripts/generate_mainnet_corpus_report.d.ts.map +1 -1
- package/dist/scripts/generate_mainnet_corpus_report.js +3 -2
- package/dist/scripts/generate_mainnet_corpus_report.js.map +1 -1
- package/dist/scripts/generate_market_adapter_whitelist.d.ts.map +1 -1
- package/dist/scripts/generate_market_adapter_whitelist.js +18 -24
- package/dist/scripts/generate_market_adapter_whitelist.js.map +1 -1
- package/dist/scripts/native_release_gates.js +15 -19
- package/dist/scripts/native_release_gates.js.map +1 -1
- package/dist/scripts/print_grid.d.ts.map +1 -1
- package/dist/scripts/print_grid.js +2 -2
- package/dist/scripts/print_grid.js.map +1 -1
- package/dist/scripts/run-tests.js +12 -17
- package/dist/scripts/run-tests.js.map +1 -1
- package/dist/scripts/runner.d.ts.map +1 -1
- package/dist/scripts/runner.js +18 -20
- package/dist/scripts/runner.js.map +1 -1
- package/dist/scripts/sync-version.js +2 -2
- package/dist/scripts/sync-version.js.map +1 -1
- package/dist/scripts/test-credit-renewal.d.ts.map +1 -1
- package/dist/scripts/test-credit-renewal.js +4 -3
- package/dist/scripts/test-credit-renewal.js.map +1 -1
- package/dist/scripts/update.js +77 -89
- package/dist/scripts/update.js.map +1 -1
- package/dist/scripts/validate_bots.d.ts.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 +12 -17
- package/dist/scripts/verify-browser-bundle.js.map +1 -1
- package/dist/unlock.d.ts +0 -30
- package/dist/unlock.d.ts.map +1 -1
- package/dist/unlock.js +95 -143
- package/dist/unlock.js.map +1 -1
- package/package.json +5 -8
- package/scripts/README.md +1 -1
- package/scripts/create-bot-symlinks.sh +2 -2
- package/dist/modules/utils/fs_utils.d.ts +0 -18
- package/dist/modules/utils/fs_utils.d.ts.map +0 -1
- package/dist/modules/utils/fs_utils.js +0 -32
- package/dist/modules/utils/fs_utils.js.map +0 -1
- package/dist/scripts/migrate_bot_keys.d.ts +0 -3
- package/dist/scripts/migrate_bot_keys.d.ts.map +0 -1
- package/dist/scripts/migrate_bot_keys.js +0 -225
- package/dist/scripts/migrate_bot_keys.js.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* modules/chain_orders.ts - Blockchain Interaction Layer
|
|
4
3
|
*
|
|
@@ -106,86 +105,25 @@
|
|
|
106
105
|
*
|
|
107
106
|
* ===============================================================================
|
|
108
107
|
*/
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
113
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
114
|
-
}
|
|
115
|
-
Object.defineProperty(o, k2, desc);
|
|
116
|
-
}) : (function(o, m, k, k2) {
|
|
117
|
-
if (k2 === undefined) k2 = k;
|
|
118
|
-
o[k2] = m[k];
|
|
119
|
-
}));
|
|
120
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
121
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
122
|
-
}) : function(o, v) {
|
|
123
|
-
o["default"] = v;
|
|
124
|
-
});
|
|
125
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
126
|
-
var ownKeys = function(o) {
|
|
127
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
128
|
-
var ar = [];
|
|
129
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
130
|
-
return ar;
|
|
131
|
-
};
|
|
132
|
-
return ownKeys(o);
|
|
133
|
-
};
|
|
134
|
-
return function (mod) {
|
|
135
|
-
if (mod && mod.__esModule) return mod;
|
|
136
|
-
var result = {};
|
|
137
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
138
|
-
__setModuleDefault(result, mod);
|
|
139
|
-
return result;
|
|
140
|
-
};
|
|
141
|
-
})();
|
|
142
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
143
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
144
|
-
};
|
|
145
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
146
|
-
exports.BroadcastUncertainError = exports.FILL_PROCESSING_MODE = void 0;
|
|
147
|
-
exports.selectAccount = selectAccount;
|
|
148
|
-
exports.setPreferredAccount = setPreferredAccount;
|
|
149
|
-
exports.resolveAccountId = resolveAccountId;
|
|
150
|
-
exports.resolveAccountName = resolveAccountName;
|
|
151
|
-
exports.readOpenOrders = readOpenOrders;
|
|
152
|
-
exports.readOpenOrdersWithMeta = readOpenOrdersWithMeta;
|
|
153
|
-
exports.readOpenOrdersWithMetaSafe = readOpenOrdersWithMetaSafe;
|
|
154
|
-
exports.readOpenOrdersGuarded = readOpenOrdersGuarded;
|
|
155
|
-
exports.readSingleOrder = readSingleOrder;
|
|
156
|
-
exports.batchReadOrders = batchReadOrders;
|
|
157
|
-
exports.listenForFills = listenForFills;
|
|
158
|
-
exports.updateOrder = updateOrder;
|
|
159
|
-
exports.createOrder = createOrder;
|
|
160
|
-
exports.cancelOrder = cancelOrder;
|
|
161
|
-
exports.getOnChainAssetBalances = getOnChainAssetBalances;
|
|
162
|
-
exports.getFillProcessingMode = getFillProcessingMode;
|
|
163
|
-
exports.buildUpdateOrderOp = buildUpdateOrderOp;
|
|
164
|
-
exports.buildCreateOrderOp = buildCreateOrderOp;
|
|
165
|
-
exports.buildCancelOrderOp = buildCancelOrderOp;
|
|
166
|
-
exports.buildLiquidityPoolExchangeOp = buildLiquidityPoolExchangeOp;
|
|
167
|
-
exports.executeBatch = executeBatch;
|
|
168
|
-
exports.wasRecentlyOwnCancelled = wasRecentlyOwnCancelled;
|
|
169
|
-
exports.recordOwnCancel = recordOwnCancel;
|
|
170
|
-
exports.broadcastTxWithClassification = broadcastTxWithClassification;
|
|
171
|
-
const client = __importStar(require("./bitshares_client"));
|
|
108
|
+
import { createRequire } from 'node:module';
|
|
109
|
+
const require = createRequire(import.meta.url);
|
|
110
|
+
import * as client from './bitshares_client.js';
|
|
172
111
|
const { BitShares, createAccountClient, waitForConnected, withTimeout } = client;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const errors_1 = require("./utils/errors");
|
|
112
|
+
import { floatToBlockchainInt, blockchainToFloat, normalizeInt, validateOrderAmountsWithinLimits } from './order/utils/math.js';
|
|
113
|
+
import { FILL_PROCESSING, TIMING, NATIVE_CLIENT, DAEMON_CODES } from './constants.js';
|
|
114
|
+
import * as Format from './order/format.js';
|
|
115
|
+
import AsyncLock from './order/async_lock.js';
|
|
116
|
+
import { readInput } from './order/utils/system.js';
|
|
117
|
+
import * as chainKeys from './chain_keys.js';
|
|
118
|
+
import { getKeyStore } from './key_store.js';
|
|
119
|
+
import { BroadcastUncertainError } from './dexbot_credential_client.js';
|
|
120
|
+
import { classifyBroadcastFailure } from './broadcast_failure.js';
|
|
121
|
+
import Logger from './logger.js';
|
|
122
|
+
import { getErrorMessage } from './utils/errors.js';
|
|
185
123
|
function getNodeManager() { return require('./bitshares_client').getNodeManager(); }
|
|
186
124
|
const { toFiniteNumber } = Format;
|
|
187
|
-
const chainOrdersLogger = new
|
|
188
|
-
const { ORDER_EVENTS } =
|
|
125
|
+
const chainOrdersLogger = new Logger('ChainOrders');
|
|
126
|
+
const { ORDER_EVENTS } = NATIVE_CLIENT;
|
|
189
127
|
// Ring buffer of order ids the local process just cancelled.
|
|
190
128
|
// Used by the fill consumer to ignore a fill/cancel-history entry that is
|
|
191
129
|
// really just the propagation of the bot's own broadcast cancel op. Entries
|
|
@@ -232,15 +170,14 @@ function wasRecentlyOwnCancelled(orderId) {
|
|
|
232
170
|
* - 'history': Use fill event data directly to match order_id with account_orders (preferred, faster)
|
|
233
171
|
* - 'open': Fetch open orders from blockchain and sync (backup method, more API calls)
|
|
234
172
|
*/
|
|
235
|
-
const FILL_PROCESSING_MODE =
|
|
236
|
-
exports.FILL_PROCESSING_MODE = FILL_PROCESSING_MODE;
|
|
173
|
+
const FILL_PROCESSING_MODE = FILL_PROCESSING.MODE;
|
|
237
174
|
// AsyncLock instances for preventing race conditions
|
|
238
175
|
// _subscriptionLock: Serializes access to accountSubscriptions map
|
|
239
176
|
// _preferredAccountLock: Serializes access to preferredAccount global state
|
|
240
177
|
// _resolutionLock: Serializes account resolution calls and caching
|
|
241
|
-
const _subscriptionLock = new
|
|
242
|
-
const _preferredAccountLock = new
|
|
243
|
-
const _resolutionLock = new
|
|
178
|
+
const _subscriptionLock = new AsyncLock();
|
|
179
|
+
const _preferredAccountLock = new AsyncLock();
|
|
180
|
+
const _resolutionLock = new AsyncLock();
|
|
244
181
|
// Cache for account resolutions (name -> id and id -> name)
|
|
245
182
|
const _accountResolutionCache = new Map();
|
|
246
183
|
/**
|
|
@@ -270,7 +207,7 @@ async function _getAssetPrecision(assetRef) {
|
|
|
270
207
|
}
|
|
271
208
|
}
|
|
272
209
|
catch (e) {
|
|
273
|
-
throw new Error(`CRITICAL: Could not resolve precision for asset ${assetRef}. Halting operation to prevent scaling errors. Cause: ${
|
|
210
|
+
throw new Error(`CRITICAL: Could not resolve precision for asset ${assetRef}. Halting operation to prevent scaling errors. Cause: ${getErrorMessage(e)}`);
|
|
274
211
|
}
|
|
275
212
|
throw new Error(`CRITICAL: Could not resolve precision for asset ${assetRef}. Halting operation to prevent scaling errors. Cause: asset not found or precision missing.`);
|
|
276
213
|
}
|
|
@@ -416,7 +353,7 @@ async function _ensureAccountSubscriber(accountName, userCallback = null) {
|
|
|
416
353
|
// Filter for fill-related operations
|
|
417
354
|
const fills = updates.filter((update) => {
|
|
418
355
|
const op = update.op;
|
|
419
|
-
return op && op[0] ===
|
|
356
|
+
return op && op[0] === FILL_PROCESSING.OPERATION_TYPE; // operation type for fill_order
|
|
420
357
|
});
|
|
421
358
|
if (fills.length > 0) {
|
|
422
359
|
// Call each registered user callback with the fills array
|
|
@@ -427,18 +364,18 @@ async function _ensureAccountSubscriber(accountName, userCallback = null) {
|
|
|
427
364
|
}
|
|
428
365
|
catch (e) {
|
|
429
366
|
failures.push(e);
|
|
430
|
-
chainOrdersLogger.error(`chain_orders listener error ${
|
|
367
|
+
chainOrdersLogger.error(`chain_orders listener error ${getErrorMessage(e)}`);
|
|
431
368
|
}
|
|
432
369
|
}
|
|
433
370
|
if (failures.length > 0) {
|
|
434
|
-
const err = new Error(`Fill listener delivery failed for ${failures.length} callback(s): ${failures.map((e) =>
|
|
371
|
+
const err = new Error(`Fill listener delivery failed for ${failures.length} callback(s): ${failures.map((e) => getErrorMessage(e) || String(e)).join('; ')}`);
|
|
435
372
|
err.causes = failures;
|
|
436
373
|
throw err;
|
|
437
374
|
}
|
|
438
375
|
}
|
|
439
376
|
};
|
|
440
377
|
try {
|
|
441
|
-
await withTimeout(BitShares.subscribe('account', bsCallback, accountName),
|
|
378
|
+
await withTimeout(BitShares.subscribe('account', bsCallback, accountName), NATIVE_CLIENT.SUBSCRIPTIONS.SUBSCRIBE_TIMEOUT_MS, 'BitShares.subscribe');
|
|
442
379
|
}
|
|
443
380
|
catch (subscribeErr) {
|
|
444
381
|
// Roll back any partial native-subscription state set up before the
|
|
@@ -453,7 +390,7 @@ async function _ensureAccountSubscriber(accountName, userCallback = null) {
|
|
|
453
390
|
}
|
|
454
391
|
catch (rollbackErr) {
|
|
455
392
|
chainOrdersLogger.warn(`Failed to roll back partial subscription for ${accountName} after error: ` +
|
|
456
|
-
`${
|
|
393
|
+
`${getErrorMessage(rollbackErr)}`);
|
|
457
394
|
}
|
|
458
395
|
}
|
|
459
396
|
throw subscribeErr;
|
|
@@ -480,7 +417,7 @@ async function selectAccount() {
|
|
|
480
417
|
accountNames.forEach((name, index) => {
|
|
481
418
|
console.log(`${index + 1}. ${name}`);
|
|
482
419
|
});
|
|
483
|
-
const choiceStr = await
|
|
420
|
+
const choiceStr = await readInput('Select account number: ');
|
|
484
421
|
const choice = parseInt(choiceStr, 10) - 1;
|
|
485
422
|
if (choice < 0 || choice >= accountNames.length) {
|
|
486
423
|
throw new Error('Invalid account selection.');
|
|
@@ -499,7 +436,7 @@ async function selectAccount() {
|
|
|
499
436
|
}
|
|
500
437
|
}
|
|
501
438
|
catch (e) {
|
|
502
|
-
console.error(`Failed to resolve account ID for ${selectedAccount}: ${
|
|
439
|
+
console.error(`Failed to resolve account ID for ${selectedAccount}: ${getErrorMessage(e)}`);
|
|
503
440
|
}
|
|
504
441
|
if (selectedId) {
|
|
505
442
|
await setPreferredAccount(selectedId, selectedAccount);
|
|
@@ -514,14 +451,14 @@ async function selectAccount() {
|
|
|
514
451
|
* @returns {boolean} True if value is a daemon signing token
|
|
515
452
|
*/
|
|
516
453
|
function isDaemonSigningToken(value) {
|
|
517
|
-
return
|
|
454
|
+
return getKeyStore().isDaemonSigningKey(value);
|
|
518
455
|
}
|
|
519
456
|
/**
|
|
520
457
|
* Execute blockchain operations via the credential daemon.
|
|
521
458
|
* @param {string} accountName - Account name
|
|
522
459
|
* @param {Object} signingToken - Daemon signing token with socketPath, sessionId, botHmacSecret
|
|
523
|
-
* @param {Array<import('./types').CreatedOperation>} operations - Array of operation objects
|
|
524
|
-
* @returns {Promise<import('./types').BroadcastResult>} Broadcast result
|
|
460
|
+
* @param {Array<import('./types.js').CreatedOperation>} operations - Array of operation objects
|
|
461
|
+
* @returns {Promise<import('./types.js').BroadcastResult>} Broadcast result
|
|
525
462
|
*/
|
|
526
463
|
async function executeViaDaemonToken(accountName, signingToken, operations, extraOptions = {}) {
|
|
527
464
|
const nodeManager = getNodeManager();
|
|
@@ -531,9 +468,9 @@ async function executeViaDaemonToken(accountName, signingToken, operations, extr
|
|
|
531
468
|
if (healthyNodes.length > 0 && nodeManager && !opts.fallbackNodes && !opts.nodeUrl) {
|
|
532
469
|
opts.nodeUrl = healthyNodes[0];
|
|
533
470
|
opts.fallbackNodes = fallbackNodes;
|
|
534
|
-
opts.onNodeFailed = (nodeUrl) => nodeManager.reportNodeFailure(nodeUrl,
|
|
471
|
+
opts.onNodeFailed = (nodeUrl) => nodeManager.reportNodeFailure(nodeUrl, DAEMON_CODES.BROADCAST_DEADLINE, 'broadcast');
|
|
535
472
|
}
|
|
536
|
-
return
|
|
473
|
+
return getKeyStore().executeOperations(accountName, operations, signingToken, opts);
|
|
537
474
|
}
|
|
538
475
|
/**
|
|
539
476
|
* Fetch a single limit order by id from the blockchain.
|
|
@@ -560,7 +497,7 @@ async function executeViaDaemonToken(accountName, signingToken, operations, extr
|
|
|
560
497
|
* @returns {Promise<Object|null>} Raw chain order object, or null if not found
|
|
561
498
|
* @throws {Error} On connection or RPC failure
|
|
562
499
|
*/
|
|
563
|
-
async function readSingleOrder(orderId, timeoutMs =
|
|
500
|
+
async function readSingleOrder(orderId, timeoutMs = TIMING.CONNECTION_TIMEOUT_MS) {
|
|
564
501
|
if (!orderId || typeof orderId !== 'string')
|
|
565
502
|
return null;
|
|
566
503
|
await waitForConnected(timeoutMs);
|
|
@@ -589,7 +526,7 @@ async function readSingleOrder(orderId, timeoutMs = constants_1.TIMING.CONNECTIO
|
|
|
589
526
|
* @param {number} [timeoutMs] - Connection timeout in milliseconds
|
|
590
527
|
* @returns {Promise<Map<string, Object|null>>} Map of orderId → raw order or null
|
|
591
528
|
*/
|
|
592
|
-
async function batchReadOrders(orderIds, timeoutMs =
|
|
529
|
+
async function batchReadOrders(orderIds, timeoutMs = TIMING.CONNECTION_TIMEOUT_MS) {
|
|
593
530
|
if (!Array.isArray(orderIds) || orderIds.length === 0)
|
|
594
531
|
return new Map();
|
|
595
532
|
const uniqueIds = [...new Set(orderIds.filter((id) => id && typeof id === 'string'))];
|
|
@@ -623,7 +560,7 @@ async function batchReadOrders(orderIds, timeoutMs = constants_1.TIMING.CONNECTI
|
|
|
623
560
|
* @param {boolean} suppress_log - Whether to suppress the log
|
|
624
561
|
* @returns {Promise<Array>} Array of raw order objects from chain
|
|
625
562
|
*/
|
|
626
|
-
async function readOpenOrders(accountId = null, timeoutMs =
|
|
563
|
+
async function readOpenOrders(accountId = null, timeoutMs = TIMING.CONNECTION_TIMEOUT_MS, suppress_log = true) {
|
|
627
564
|
const { orders } = await readOpenOrdersWithMeta(accountId, timeoutMs, suppress_log);
|
|
628
565
|
return orders;
|
|
629
566
|
}
|
|
@@ -638,7 +575,7 @@ async function readOpenOrders(accountId = null, timeoutMs = constants_1.TIMING.C
|
|
|
638
575
|
* @param {boolean} [suppress_log] - Whether to suppress the log
|
|
639
576
|
* @returns {Promise<{orders: Array, truncated: boolean}>} Raw order objects plus truncation flag
|
|
640
577
|
*/
|
|
641
|
-
async function readOpenOrdersWithMetaSafe(chainOrdersModule, accountId = null, timeoutMs =
|
|
578
|
+
async function readOpenOrdersWithMetaSafe(chainOrdersModule, accountId = null, timeoutMs = TIMING.CONNECTION_TIMEOUT_MS, suppress_log = true) {
|
|
642
579
|
if (chainOrdersModule && typeof chainOrdersModule.readOpenOrdersWithMeta === 'function') {
|
|
643
580
|
return await chainOrdersModule.readOpenOrdersWithMeta(accountId, timeoutMs, suppress_log);
|
|
644
581
|
}
|
|
@@ -698,7 +635,7 @@ async function readOpenOrdersGuarded(chainOrdersModule, accountId = null, option
|
|
|
698
635
|
* @param {boolean} suppress_log - Whether to suppress the log
|
|
699
636
|
* @returns {Promise<{orders: Array, truncated: boolean}>} Raw order objects plus truncation flag
|
|
700
637
|
*/
|
|
701
|
-
async function readOpenOrdersWithMeta(accountId = null, timeoutMs =
|
|
638
|
+
async function readOpenOrdersWithMeta(accountId = null, timeoutMs = TIMING.CONNECTION_TIMEOUT_MS, suppress_log = true) {
|
|
702
639
|
await waitForConnected(timeoutMs);
|
|
703
640
|
try {
|
|
704
641
|
let accId = accountId;
|
|
@@ -724,7 +661,7 @@ async function readOpenOrdersWithMeta(accountId = null, timeoutMs = constants_1.
|
|
|
724
661
|
return { orders, truncated };
|
|
725
662
|
}
|
|
726
663
|
catch (error) {
|
|
727
|
-
chainOrdersLogger.error(`Error reading open orders: ${
|
|
664
|
+
chainOrdersLogger.error(`Error reading open orders: ${getErrorMessage(error)}`);
|
|
728
665
|
throw error;
|
|
729
666
|
}
|
|
730
667
|
}
|
|
@@ -769,7 +706,7 @@ async function listenForFills(accountRef, callback) {
|
|
|
769
706
|
accountId = await resolveAccountId(accountName);
|
|
770
707
|
}
|
|
771
708
|
if (accountId) {
|
|
772
|
-
readOpenOrders(accountId,
|
|
709
|
+
readOpenOrders(accountId, TIMING.CONNECTION_TIMEOUT_MS, true).catch((error) => chainOrdersLogger.error(`Error loading account for listening: ${getErrorMessage(error)}`));
|
|
773
710
|
}
|
|
774
711
|
else {
|
|
775
712
|
chainOrdersLogger.warn('Unable to derive account id before listening for fills; skipping open-order prefetch.');
|
|
@@ -798,14 +735,14 @@ async function listenForFills(accountRef, callback) {
|
|
|
798
735
|
}
|
|
799
736
|
}
|
|
800
737
|
catch (e) {
|
|
801
|
-
chainOrdersLogger.warn(`Unsubscribe failed: ${
|
|
738
|
+
chainOrdersLogger.warn(`Unsubscribe failed: ${getErrorMessage(e)}`);
|
|
802
739
|
}
|
|
803
740
|
accountSubscriptions.delete(accountName);
|
|
804
741
|
}
|
|
805
742
|
});
|
|
806
743
|
}
|
|
807
744
|
catch (e) {
|
|
808
|
-
chainOrdersLogger.error(`Error unsubscribing listenForFills ${
|
|
745
|
+
chainOrdersLogger.error(`Error unsubscribing listenForFills ${getErrorMessage(e)}`);
|
|
809
746
|
}
|
|
810
747
|
};
|
|
811
748
|
}
|
|
@@ -840,7 +777,7 @@ async function buildUpdateOrderOp(accountName, orderId, newParams, cachedOrder =
|
|
|
840
777
|
const sellPrecision = await _getAssetPrecision(sellAssetId);
|
|
841
778
|
const receivePrecision = await _getAssetPrecision(receiveAssetId);
|
|
842
779
|
const currentSellInt = toFiniteNumber(order.for_sale);
|
|
843
|
-
const currentSellFloat =
|
|
780
|
+
const currentSellFloat = blockchainToFloat(currentSellInt, sellPrecision);
|
|
844
781
|
const priceRatioBase = order.sell_price.base.amount;
|
|
845
782
|
const priceRatioQuote = order.sell_price.quote.amount;
|
|
846
783
|
const currentReceiveInt = Math.round((currentSellInt * priceRatioQuote) / priceRatioBase);
|
|
@@ -851,12 +788,12 @@ async function buildUpdateOrderOp(accountName, orderId, newParams, cachedOrder =
|
|
|
851
788
|
let newSellFloat;
|
|
852
789
|
if (newParams.amountToSell !== undefined && newParams.amountToSell !== null) {
|
|
853
790
|
newSellFloat = newParams.amountToSell;
|
|
854
|
-
newSellInt =
|
|
791
|
+
newSellInt = floatToBlockchainInt(newSellFloat, sellPrecision);
|
|
855
792
|
}
|
|
856
793
|
else {
|
|
857
794
|
// Keep current amount exactly as-is on-chain, bypassing float conversion
|
|
858
795
|
newSellInt = currentSellInt;
|
|
859
|
-
newSellFloat =
|
|
796
|
+
newSellFloat = blockchainToFloat(currentSellInt, sellPrecision);
|
|
860
797
|
}
|
|
861
798
|
// Determine an initial receive amount for price-change detection.
|
|
862
799
|
// Policy:
|
|
@@ -865,7 +802,7 @@ async function buildUpdateOrderOp(accountName, orderId, newParams, cachedOrder =
|
|
|
865
802
|
// - Else: keep the existing on-chain price by scaling receive with sell.
|
|
866
803
|
let candidateReceiveInt;
|
|
867
804
|
if (newParams.minToReceive !== undefined && newParams.minToReceive !== null) {
|
|
868
|
-
candidateReceiveInt =
|
|
805
|
+
candidateReceiveInt = floatToBlockchainInt(newParams.minToReceive, receivePrecision);
|
|
869
806
|
}
|
|
870
807
|
else if (newParams.newPrice !== undefined && newParams.newPrice !== null) {
|
|
871
808
|
const price = toFiniteNumber(newParams.newPrice);
|
|
@@ -873,14 +810,14 @@ async function buildUpdateOrderOp(accountName, orderId, newParams, cachedOrder =
|
|
|
873
810
|
const receiveFloat = (newParams.orderType === 'sell')
|
|
874
811
|
? (sellFloat * price)
|
|
875
812
|
: (sellFloat / price);
|
|
876
|
-
candidateReceiveInt =
|
|
813
|
+
candidateReceiveInt = floatToBlockchainInt(receiveFloat, receivePrecision);
|
|
877
814
|
}
|
|
878
815
|
else {
|
|
879
816
|
candidateReceiveInt = Math.round((newSellInt * priceRatioQuote) / priceRatioBase);
|
|
880
817
|
}
|
|
881
818
|
// Validate amounts before converting to blockchain integers / computing deltas
|
|
882
|
-
const candidateReceiveFloat =
|
|
883
|
-
if (!
|
|
819
|
+
const candidateReceiveFloat = blockchainToFloat(candidateReceiveInt, receivePrecision);
|
|
820
|
+
if (!validateOrderAmountsWithinLimits(newSellFloat, candidateReceiveFloat, sellPrecision, receivePrecision)) {
|
|
884
821
|
throw new Error(`Cannot update order: calculated amounts exceed blockchain limits. ` +
|
|
885
822
|
`Sell: ${newSellFloat}, Receive: ${candidateReceiveFloat}. ` +
|
|
886
823
|
`This typically happens with extreme price values or mixed absolute/relative price bounds that diverge too far. ` +
|
|
@@ -895,8 +832,8 @@ async function buildUpdateOrderOp(accountName, orderId, newParams, cachedOrder =
|
|
|
895
832
|
// This happens when newAmountToSell was rounded, causing floatToBlockchainInt
|
|
896
833
|
// to produce a different value than what's currently on-chain.
|
|
897
834
|
if (Math.abs(deltaSellInt) === 1 && newParams.amountToSell !== undefined && newParams.amountToSell !== null) {
|
|
898
|
-
const roundedNewSellInt =
|
|
899
|
-
const roundedCurrentSellInt =
|
|
835
|
+
const roundedNewSellInt = normalizeInt(newSellInt, sellPrecision);
|
|
836
|
+
const roundedCurrentSellInt = normalizeInt(currentSellInt, sellPrecision);
|
|
900
837
|
// If they match after rounding to precision, use the current amount (delta = 0)
|
|
901
838
|
if (roundedNewSellInt === roundedCurrentSellInt || Math.abs(roundedNewSellInt - roundedCurrentSellInt) <= 1) {
|
|
902
839
|
newSellInt = currentSellInt;
|
|
@@ -906,14 +843,14 @@ async function buildUpdateOrderOp(accountName, orderId, newParams, cachedOrder =
|
|
|
906
843
|
// First, compute the receive amount with the current delta (not adjusted yet)
|
|
907
844
|
let newReceiveInt;
|
|
908
845
|
if (newParams.minToReceive !== undefined && newParams.minToReceive !== null) {
|
|
909
|
-
newReceiveInt =
|
|
846
|
+
newReceiveInt = floatToBlockchainInt(newParams.minToReceive, receivePrecision);
|
|
910
847
|
}
|
|
911
848
|
else if (newParams.newPrice !== undefined && newParams.newPrice !== null) {
|
|
912
849
|
const price = toFiniteNumber(newParams.newPrice);
|
|
913
850
|
const receiveFloat = (newParams.orderType === 'sell')
|
|
914
851
|
? (newSellFloat * price)
|
|
915
852
|
: (newSellFloat / price);
|
|
916
|
-
newReceiveInt =
|
|
853
|
+
newReceiveInt = floatToBlockchainInt(receiveFloat, receivePrecision);
|
|
917
854
|
}
|
|
918
855
|
else {
|
|
919
856
|
// Keep existing on-chain price ratio.
|
|
@@ -949,23 +886,23 @@ async function buildUpdateOrderOp(accountName, orderId, newParams, cachedOrder =
|
|
|
949
886
|
const adjustedSellInt = currentSellInt + deltaSellInt;
|
|
950
887
|
// Recompute the final receive amount with the adjusted sell amount
|
|
951
888
|
if (newParams.minToReceive !== undefined && newParams.minToReceive !== null) {
|
|
952
|
-
newReceiveInt =
|
|
889
|
+
newReceiveInt = floatToBlockchainInt(newParams.minToReceive, receivePrecision);
|
|
953
890
|
}
|
|
954
891
|
else if (newParams.newPrice !== undefined && newParams.newPrice !== null) {
|
|
955
892
|
const price = toFiniteNumber(newParams.newPrice);
|
|
956
|
-
const adjustedSellFloat =
|
|
893
|
+
const adjustedSellFloat = blockchainToFloat(adjustedSellInt, sellPrecision);
|
|
957
894
|
const receiveFloat = (newParams.orderType === 'sell')
|
|
958
895
|
? (adjustedSellFloat * price)
|
|
959
896
|
: (adjustedSellFloat / price);
|
|
960
|
-
newReceiveInt =
|
|
897
|
+
newReceiveInt = floatToBlockchainInt(receiveFloat, receivePrecision);
|
|
961
898
|
}
|
|
962
899
|
else {
|
|
963
900
|
// Keep existing on-chain price ratio.
|
|
964
901
|
newReceiveInt = Math.round((adjustedSellInt * priceRatioQuote) / priceRatioBase);
|
|
965
902
|
}
|
|
966
|
-
const adjustedSellFloat =
|
|
967
|
-
const finalReceiveFloat =
|
|
968
|
-
if (!
|
|
903
|
+
const adjustedSellFloat = blockchainToFloat(adjustedSellInt, sellPrecision);
|
|
904
|
+
const finalReceiveFloat = blockchainToFloat(newReceiveInt, receivePrecision);
|
|
905
|
+
if (!validateOrderAmountsWithinLimits(adjustedSellFloat, finalReceiveFloat, sellPrecision, receivePrecision)) {
|
|
969
906
|
throw new Error(`Cannot update order: calculated amounts exceed blockchain limits. ` +
|
|
970
907
|
`Sell: ${adjustedSellFloat}, Receive: ${finalReceiveFloat}. ` +
|
|
971
908
|
`Consider adjusting minPrice/maxPrice configuration.`);
|
|
@@ -974,7 +911,7 @@ async function buildUpdateOrderOp(accountName, orderId, newParams, cachedOrder =
|
|
|
974
911
|
op: {
|
|
975
912
|
op_name: 'limit_order_update',
|
|
976
913
|
op_data: {
|
|
977
|
-
fee: { amount: 0, asset_id:
|
|
914
|
+
fee: { amount: 0, asset_id: NATIVE_CLIENT.CHAIN.CORE_ASSET_ID },
|
|
978
915
|
seller: accId,
|
|
979
916
|
order: orderId,
|
|
980
917
|
new_price: {
|
|
@@ -1015,8 +952,8 @@ async function broadcastTxWithClassification(tx, accountName, operations = []) {
|
|
|
1015
952
|
return await tx.broadcast();
|
|
1016
953
|
}
|
|
1017
954
|
catch (err) {
|
|
1018
|
-
if (
|
|
1019
|
-
throw new
|
|
955
|
+
if (classifyBroadcastFailure(err) === 'uncertain') {
|
|
956
|
+
throw new BroadcastUncertainError(`Direct-key broadcast uncertain for ${accountName}: ${getErrorMessage(err)}`, { operations: operations.length > 0 ? operations : null, accountName, timeoutMs: null });
|
|
1020
957
|
}
|
|
1021
958
|
throw err;
|
|
1022
959
|
}
|
|
@@ -1058,7 +995,7 @@ async function updateOrder(accountName, privateKey, orderId, newParams, extraOpt
|
|
|
1058
995
|
return { success: true, orderId };
|
|
1059
996
|
}
|
|
1060
997
|
catch (error) {
|
|
1061
|
-
chainOrdersLogger.error(`Error updating order: ${
|
|
998
|
+
chainOrdersLogger.error(`Error updating order: ${getErrorMessage(error)}`);
|
|
1062
999
|
throw error;
|
|
1063
1000
|
}
|
|
1064
1001
|
}
|
|
@@ -1084,13 +1021,13 @@ async function buildCreateOrderOp(accountName, amountToSell, sellAssetId, minToR
|
|
|
1084
1021
|
}
|
|
1085
1022
|
const sellPrecision = await _getAssetPrecision(sellAssetId);
|
|
1086
1023
|
const receivePrecision = await _getAssetPrecision(receiveAssetId);
|
|
1087
|
-
const amountToSellInt =
|
|
1088
|
-
const minToReceiveInt =
|
|
1024
|
+
const amountToSellInt = floatToBlockchainInt(amountToSell, sellPrecision);
|
|
1025
|
+
const minToReceiveInt = floatToBlockchainInt(minToReceive, receivePrecision);
|
|
1089
1026
|
// CRITICAL: Validate order amounts before creating operation
|
|
1090
1027
|
// This prevents "Assert Exception: min_to_receive.amount > 0" errors from BitShares
|
|
1091
1028
|
// when order sizes are too small and round to 0 after precision conversion
|
|
1092
1029
|
// Returns null instead of throwing to allow caller to skip invalid orders gracefully
|
|
1093
|
-
if (!
|
|
1030
|
+
if (!validateOrderAmountsWithinLimits(amountToSell, minToReceive, sellPrecision, receivePrecision)) {
|
|
1094
1031
|
chainOrdersLogger.warn(`Order skipped: amounts would round to 0 on blockchain\n` +
|
|
1095
1032
|
` Float values: sell=${amountToSell}, receive=${minToReceive}\n` +
|
|
1096
1033
|
` Blockchain integers: sell=${amountToSellInt} (prec ${sellPrecision}), receive=${minToReceiveInt} (prec ${receivePrecision})\n` +
|
|
@@ -1100,7 +1037,7 @@ async function buildCreateOrderOp(accountName, amountToSell, sellAssetId, minToR
|
|
|
1100
1037
|
const op = {
|
|
1101
1038
|
op_name: 'limit_order_create',
|
|
1102
1039
|
op_data: {
|
|
1103
|
-
fee: { amount: 0, asset_id:
|
|
1040
|
+
fee: { amount: 0, asset_id: NATIVE_CLIENT.CHAIN.CORE_ASSET_ID },
|
|
1104
1041
|
seller: accId,
|
|
1105
1042
|
amount_to_sell: { amount: amountToSellInt, asset_id: sellAssetId },
|
|
1106
1043
|
min_to_receive: { amount: minToReceiveInt, asset_id: receiveAssetId },
|
|
@@ -1152,7 +1089,7 @@ async function createOrder(accountName, privateKey, amountToSell, sellAssetId, m
|
|
|
1152
1089
|
return result;
|
|
1153
1090
|
}
|
|
1154
1091
|
catch (error) {
|
|
1155
|
-
chainOrdersLogger.error(`Error creating limit order: ${
|
|
1092
|
+
chainOrdersLogger.error(`Error creating limit order: ${getErrorMessage(error)}`);
|
|
1156
1093
|
throw error;
|
|
1157
1094
|
}
|
|
1158
1095
|
}
|
|
@@ -1170,7 +1107,7 @@ async function buildCancelOrderOp(accountName, orderId) {
|
|
|
1170
1107
|
return {
|
|
1171
1108
|
op_name: 'limit_order_cancel',
|
|
1172
1109
|
op_data: {
|
|
1173
|
-
fee: { amount: 0, asset_id:
|
|
1110
|
+
fee: { amount: 0, asset_id: NATIVE_CLIENT.CHAIN.CORE_ASSET_ID },
|
|
1174
1111
|
fee_paying_account: accId,
|
|
1175
1112
|
order: orderId
|
|
1176
1113
|
}
|
|
@@ -1212,7 +1149,7 @@ async function cancelOrder(accountName, privateKey, orderId, extraOptions = {})
|
|
|
1212
1149
|
catch (error) {
|
|
1213
1150
|
if (accountId) {
|
|
1214
1151
|
try {
|
|
1215
|
-
const { orders: openOrders, truncated } = await readOpenOrdersWithMeta(accountId,
|
|
1152
|
+
const { orders: openOrders, truncated } = await readOpenOrdersWithMeta(accountId, TIMING.CONNECTION_TIMEOUT_MS, true);
|
|
1216
1153
|
// Only a NON-EMPTY, NON-TRUNCATED read is authoritative: the
|
|
1217
1154
|
// order being absent from a live account snapshot confirms the
|
|
1218
1155
|
// cancellation landed. An empty read is ambiguous (the node may
|
|
@@ -1233,7 +1170,7 @@ async function cancelOrder(accountName, privateKey, orderId, extraOptions = {})
|
|
|
1233
1170
|
// cancelled order was the account's only order) without
|
|
1234
1171
|
// trusting a lagging node's empty window.
|
|
1235
1172
|
try {
|
|
1236
|
-
const probe = await readSingleOrder(String(orderId),
|
|
1173
|
+
const probe = await readSingleOrder(String(orderId), TIMING.CONNECTION_TIMEOUT_MS);
|
|
1237
1174
|
if (probe === null)
|
|
1238
1175
|
confirmedAbsent = true;
|
|
1239
1176
|
}
|
|
@@ -1258,7 +1195,7 @@ async function cancelOrder(accountName, privateKey, orderId, extraOptions = {})
|
|
|
1258
1195
|
// Fall through to the original error.
|
|
1259
1196
|
}
|
|
1260
1197
|
}
|
|
1261
|
-
chainOrdersLogger.error(`Error cancelling order: ${
|
|
1198
|
+
chainOrdersLogger.error(`Error cancelling order: ${getErrorMessage(error)}`);
|
|
1262
1199
|
throw error;
|
|
1263
1200
|
}
|
|
1264
1201
|
}
|
|
@@ -1310,7 +1247,7 @@ async function executeBatch(accountName, privateKey, operations, extraOptions =
|
|
|
1310
1247
|
};
|
|
1311
1248
|
}
|
|
1312
1249
|
catch (error) {
|
|
1313
|
-
chainOrdersLogger.error(`Error executing batch transaction: ${
|
|
1250
|
+
chainOrdersLogger.error(`Error executing batch transaction: ${getErrorMessage(error)}`);
|
|
1314
1251
|
throw error;
|
|
1315
1252
|
}
|
|
1316
1253
|
}
|
|
@@ -1384,7 +1321,7 @@ async function getOnChainAssetBalances(accountRef, assets, options = {}) {
|
|
|
1384
1321
|
}
|
|
1385
1322
|
}
|
|
1386
1323
|
catch (dealErr) {
|
|
1387
|
-
chainOrdersLogger.warn(`getOnChainAssetBalances: failed to fetch credit deals for ${accountRef}: ${
|
|
1324
|
+
chainOrdersLogger.warn(`getOnChainAssetBalances: failed to fetch credit deals for ${accountRef}: ${getErrorMessage(dealErr)}`);
|
|
1388
1325
|
}
|
|
1389
1326
|
}
|
|
1390
1327
|
// If assets omitted, build list from balances and limit_orders
|
|
@@ -1414,7 +1351,7 @@ async function getOnChainAssetBalances(accountRef, assets, options = {}) {
|
|
|
1414
1351
|
}
|
|
1415
1352
|
}
|
|
1416
1353
|
catch (e) {
|
|
1417
|
-
chainOrdersLogger.warn(`lookup_asset_symbols failed for ${a}: ${
|
|
1354
|
+
chainOrdersLogger.warn(`lookup_asset_symbols failed for ${a}: ${getErrorMessage(e)}`);
|
|
1418
1355
|
}
|
|
1419
1356
|
// try to get precision and symbol
|
|
1420
1357
|
let precision = null;
|
|
@@ -1427,7 +1364,7 @@ async function getOnChainAssetBalances(accountRef, assets, options = {}) {
|
|
|
1427
1364
|
}
|
|
1428
1365
|
}
|
|
1429
1366
|
catch (e) {
|
|
1430
|
-
chainOrdersLogger.warn(`Failed to fetch asset data for ${aid}: ${
|
|
1367
|
+
chainOrdersLogger.warn(`Failed to fetch asset data for ${aid}: ${getErrorMessage(e)}`);
|
|
1431
1368
|
}
|
|
1432
1369
|
if (precision === null) {
|
|
1433
1370
|
chainOrdersLogger.error(`CRITICAL: Could not determine precision for asset ${aid}. Skipping balance entry to prevent massive scaling errors.`);
|
|
@@ -1435,14 +1372,14 @@ async function getOnChainAssetBalances(accountRef, assets, options = {}) {
|
|
|
1435
1372
|
}
|
|
1436
1373
|
const freeRaw = freeInt.get(String(aid)) || 0;
|
|
1437
1374
|
const lockedRaw = lockedInt.get(String(aid)) || 0;
|
|
1438
|
-
const free =
|
|
1439
|
-
const locked =
|
|
1375
|
+
const free = blockchainToFloat(freeRaw, precision);
|
|
1376
|
+
const locked = blockchainToFloat(lockedRaw, precision);
|
|
1440
1377
|
out[String(a)] = { assetId: String(aid), symbol, precision, freeRaw, lockedRaw, free, locked, total: free + locked };
|
|
1441
1378
|
}
|
|
1442
1379
|
return out;
|
|
1443
1380
|
}
|
|
1444
1381
|
catch (err) {
|
|
1445
|
-
chainOrdersLogger.error(`getOnChainAssetBalances failed: ${
|
|
1382
|
+
chainOrdersLogger.error(`getOnChainAssetBalances failed: ${getErrorMessage(err)}`);
|
|
1446
1383
|
return {};
|
|
1447
1384
|
}
|
|
1448
1385
|
}
|
|
@@ -1460,7 +1397,7 @@ function buildLiquidityPoolExchangeOp(accountId, poolId, sellAmountInt, sellAsse
|
|
|
1460
1397
|
return {
|
|
1461
1398
|
op_name: 'liquidity_pool_exchange',
|
|
1462
1399
|
op_data: {
|
|
1463
|
-
fee: { amount: 0, asset_id:
|
|
1400
|
+
fee: { amount: 0, asset_id: NATIVE_CLIENT.CHAIN.CORE_ASSET_ID },
|
|
1464
1401
|
account: accountId,
|
|
1465
1402
|
pool: poolId,
|
|
1466
1403
|
amount_to_sell: { amount: sellAmountInt, asset_id: sellAssetId },
|
|
@@ -1476,5 +1413,5 @@ function buildLiquidityPoolExchangeOp(accountId, poolId, sellAmountInt, sellAsse
|
|
|
1476
1413
|
function getFillProcessingMode() {
|
|
1477
1414
|
return FILL_PROCESSING_MODE;
|
|
1478
1415
|
}
|
|
1479
|
-
|
|
1416
|
+
export { selectAccount, setPreferredAccount, resolveAccountId, resolveAccountName, readOpenOrders, readOpenOrdersWithMeta, readOpenOrdersWithMetaSafe, readOpenOrdersGuarded, readSingleOrder, batchReadOrders, listenForFills, updateOrder, createOrder, cancelOrder, getOnChainAssetBalances, getFillProcessingMode, FILL_PROCESSING_MODE, buildUpdateOrderOp, buildCreateOrderOp, buildCancelOrderOp, buildLiquidityPoolExchangeOp, executeBatch, wasRecentlyOwnCancelled, recordOwnCancel, BroadcastUncertainError, broadcastTxWithClassification };
|
|
1480
1417
|
//# sourceMappingURL=chain_orders.js.map
|