dexbot 1.4.10 → 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.
Files changed (502) hide show
  1. package/README.md +6 -5
  2. package/dist/analysis/chart_utils.d.ts.map +1 -1
  3. package/dist/analysis/chart_utils.js +9 -18
  4. package/dist/analysis/chart_utils.js.map +1 -1
  5. package/dist/analysis/math_utils.d.ts.map +1 -1
  6. package/dist/analysis/math_utils.js +6 -16
  7. package/dist/analysis/math_utils.js.map +1 -1
  8. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts +1 -1
  9. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +1 -1
  10. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +31 -38
  11. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +1 -1
  12. package/dist/analysis/trend_detection/hurst_analyzer.js +7 -10
  13. package/dist/analysis/trend_detection/hurst_analyzer.js.map +1 -1
  14. package/dist/analysis/trend_detection/kalman_trend_analyzer.js +10 -14
  15. package/dist/analysis/trend_detection/kalman_trend_analyzer.js.map +1 -1
  16. package/dist/analysis/trend_detection/kalman_velocity_smoothing.js +10 -15
  17. package/dist/analysis/trend_detection/kalman_velocity_smoothing.js.map +1 -1
  18. package/dist/analysis/trend_detection/permutation_entropy_analyzer.js +7 -10
  19. package/dist/analysis/trend_detection/permutation_entropy_analyzer.js.map +1 -1
  20. package/dist/bot.d.ts.map +1 -1
  21. package/dist/bot.js +4 -12
  22. package/dist/bot.js.map +1 -1
  23. package/dist/credential-daemon.d.ts +0 -1
  24. package/dist/credential-daemon.d.ts.map +1 -1
  25. package/dist/credential-daemon.js +3 -123
  26. package/dist/credential-daemon.js.map +1 -1
  27. package/dist/dexbot.d.ts +0 -87
  28. package/dist/dexbot.d.ts.map +1 -1
  29. package/dist/dexbot.js +54 -23
  30. package/dist/dexbot.js.map +1 -1
  31. package/dist/market_adapter/ama_signal_runner.js +8 -9
  32. package/dist/market_adapter/ama_signal_runner.js.map +1 -1
  33. package/dist/market_adapter/candle_utils.js +1 -7
  34. package/dist/market_adapter/candle_utils.js.map +1 -1
  35. package/dist/market_adapter/core/asymmetric_bounds.js +1 -4
  36. package/dist/market_adapter/core/asymmetric_bounds.js.map +1 -1
  37. package/dist/market_adapter/core/config_normalizers.js +5 -9
  38. package/dist/market_adapter/core/config_normalizers.js.map +1 -1
  39. package/dist/market_adapter/core/kibana_candles.js +8 -15
  40. package/dist/market_adapter/core/kibana_candles.js.map +1 -1
  41. package/dist/market_adapter/core/kibana_client.js +7 -13
  42. package/dist/market_adapter/core/kibana_client.js.map +1 -1
  43. package/dist/market_adapter/core/kibana_market_candles.js +6 -12
  44. package/dist/market_adapter/core/kibana_market_candles.js.map +1 -1
  45. package/dist/market_adapter/core/market_adapter_service.d.ts +2 -0
  46. package/dist/market_adapter/core/market_adapter_service.d.ts.map +1 -1
  47. package/dist/market_adapter/core/market_adapter_service.js +100 -101
  48. package/dist/market_adapter/core/market_adapter_service.js.map +1 -1
  49. package/dist/market_adapter/core/strategies/ama.js +5 -10
  50. package/dist/market_adapter/core/strategies/ama.js.map +1 -1
  51. package/dist/market_adapter/core/strategies/ama_slope_model.js +21 -24
  52. package/dist/market_adapter/core/strategies/ama_slope_model.js.map +1 -1
  53. package/dist/market_adapter/core/strategies/atr/calculator.js +3 -5
  54. package/dist/market_adapter/core/strategies/atr/calculator.js.map +1 -1
  55. package/dist/market_adapter/core/strategies/collateral_manager.js +4 -6
  56. package/dist/market_adapter/core/strategies/collateral_manager.js.map +1 -1
  57. package/dist/market_adapter/core/strategies/regime_gate.js +15 -22
  58. package/dist/market_adapter/core/strategies/regime_gate.js.map +1 -1
  59. package/dist/market_adapter/index.d.ts +23 -23
  60. package/dist/market_adapter/index.d.ts.map +1 -1
  61. package/dist/market_adapter/index.js +24 -82
  62. package/dist/market_adapter/index.js.map +1 -1
  63. package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js +2 -1
  64. package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js.map +1 -1
  65. package/dist/market_adapter/inputs/fetch_lp_data.d.ts.map +1 -1
  66. package/dist/market_adapter/inputs/fetch_lp_data.js +59 -98
  67. package/dist/market_adapter/inputs/fetch_lp_data.js.map +1 -1
  68. package/dist/market_adapter/inputs/kibana_source.js +11 -17
  69. package/dist/market_adapter/inputs/kibana_source.js.map +1 -1
  70. package/dist/market_adapter/interval_utils.js +1 -2
  71. package/dist/market_adapter/interval_utils.js.map +1 -1
  72. package/dist/market_adapter/log_format.js +1 -7
  73. package/dist/market_adapter/log_format.js.map +1 -1
  74. package/dist/market_adapter/lp_chart_core.js +20 -22
  75. package/dist/market_adapter/lp_chart_core.js.map +1 -1
  76. package/dist/market_adapter/lp_chart_runner.d.ts +1 -1
  77. package/dist/market_adapter/lp_chart_runner.d.ts.map +1 -1
  78. package/dist/market_adapter/lp_chart_runner.js +41 -57
  79. package/dist/market_adapter/lp_chart_runner.js.map +1 -1
  80. package/dist/market_adapter/lp_chart_strategy_loader.js +30 -34
  81. package/dist/market_adapter/lp_chart_strategy_loader.js.map +1 -1
  82. package/dist/market_adapter/market_adapter.d.ts +2 -2
  83. package/dist/market_adapter/market_adapter.d.ts.map +1 -1
  84. package/dist/market_adapter/market_adapter.js +163 -222
  85. package/dist/market_adapter/market_adapter.js.map +1 -1
  86. package/dist/market_adapter/merge_lp_data.js +17 -18
  87. package/dist/market_adapter/merge_lp_data.js.map +1 -1
  88. package/dist/market_adapter/test_helpers.js +3 -14
  89. package/dist/market_adapter/test_helpers.js.map +1 -1
  90. package/dist/market_adapter/utils/adapter_client.js +7 -16
  91. package/dist/market_adapter/utils/adapter_client.js.map +1 -1
  92. package/dist/market_adapter/utils/atomic_write.js +3 -5
  93. package/dist/market_adapter/utils/atomic_write.js.map +1 -1
  94. package/dist/market_adapter/utils/chain.d.ts.map +1 -1
  95. package/dist/market_adapter/utils/chain.js +9 -17
  96. package/dist/market_adapter/utils/chain.js.map +1 -1
  97. package/dist/market_adapter/utils/data_discovery.js +8 -10
  98. package/dist/market_adapter/utils/data_discovery.js.map +1 -1
  99. package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts.map +1 -1
  100. package/dist/market_adapter/utils/dynamic_grid_snapshot.js +11 -14
  101. package/dist/market_adapter/utils/dynamic_grid_snapshot.js.map +1 -1
  102. package/dist/market_adapter/utils/file_lock.js +14 -19
  103. package/dist/market_adapter/utils/file_lock.js.map +1 -1
  104. package/dist/market_adapter/utils/native_history.js +8 -14
  105. package/dist/market_adapter/utils/native_history.js.map +1 -1
  106. package/dist/market_adapter/utils/paths.js +3 -6
  107. package/dist/market_adapter/utils/paths.js.map +1 -1
  108. package/dist/modules/account_bots.d.ts +1 -1
  109. package/dist/modules/account_bots.d.ts.map +1 -1
  110. package/dist/modules/account_bots.js +90 -97
  111. package/dist/modules/account_bots.js.map +1 -1
  112. package/dist/modules/account_orders.d.ts +0 -9
  113. package/dist/modules/account_orders.d.ts.map +1 -1
  114. package/dist/modules/account_orders.js +26 -121
  115. package/dist/modules/account_orders.js.map +1 -1
  116. package/dist/modules/authority_resolver.js +12 -18
  117. package/dist/modules/authority_resolver.js.map +1 -1
  118. package/dist/modules/bitshares-native/chain_client.js +16 -21
  119. package/dist/modules/bitshares-native/chain_client.js.map +1 -1
  120. package/dist/modules/bitshares-native/crypto/ecc.browser.js +12 -72
  121. package/dist/modules/bitshares-native/crypto/ecc.browser.js.map +1 -1
  122. package/dist/modules/bitshares-native/crypto/ecc.js +13 -40
  123. package/dist/modules/bitshares-native/crypto/ecc.js.map +1 -1
  124. package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts.map +1 -1
  125. package/dist/modules/bitshares-native/crypto/ecc_selector.js +5 -6
  126. package/dist/modules/bitshares-native/crypto/ecc_selector.js.map +1 -1
  127. package/dist/modules/bitshares-native/index.d.ts +8 -8
  128. package/dist/modules/bitshares-native/index.d.ts.map +1 -1
  129. package/dist/modules/bitshares-native/index.js +11 -68
  130. package/dist/modules/bitshares-native/index.js.map +1 -1
  131. package/dist/modules/bitshares-native/lru_cache.js +3 -6
  132. package/dist/modules/bitshares-native/lru_cache.js.map +1 -1
  133. package/dist/modules/bitshares-native/resolvers.js +9 -11
  134. package/dist/modules/bitshares-native/resolvers.js.map +1 -1
  135. package/dist/modules/bitshares-native/serial/chain_constants.js +3 -28
  136. package/dist/modules/bitshares-native/serial/chain_constants.js.map +1 -1
  137. package/dist/modules/bitshares-native/serial/index.d.ts +4 -4
  138. package/dist/modules/bitshares-native/serial/index.d.ts.map +1 -1
  139. package/dist/modules/bitshares-native/serial/index.js +5 -46
  140. package/dist/modules/bitshares-native/serial/index.js.map +1 -1
  141. package/dist/modules/bitshares-native/serial/operations.d.ts +98 -98
  142. package/dist/modules/bitshares-native/serial/operations.d.ts.map +1 -1
  143. package/dist/modules/bitshares-native/serial/operations.js +372 -473
  144. package/dist/modules/bitshares-native/serial/operations.js.map +1 -1
  145. package/dist/modules/bitshares-native/serial/serializer.js +3 -8
  146. package/dist/modules/bitshares-native/serial/serializer.js.map +1 -1
  147. package/dist/modules/bitshares-native/serial/types.js +9 -74
  148. package/dist/modules/bitshares-native/serial/types.js.map +1 -1
  149. package/dist/modules/bitshares-native/signing_client.d.ts.map +1 -1
  150. package/dist/modules/bitshares-native/signing_client.js +11 -48
  151. package/dist/modules/bitshares-native/signing_client.js.map +1 -1
  152. package/dist/modules/bitshares-native/subscriptions.d.ts.map +1 -1
  153. package/dist/modules/bitshares-native/subscriptions.js +24 -27
  154. package/dist/modules/bitshares-native/subscriptions.js.map +1 -1
  155. package/dist/modules/bitshares-native/transport.d.ts.map +1 -1
  156. package/dist/modules/bitshares-native/transport.js +14 -26
  157. package/dist/modules/bitshares-native/transport.js.map +1 -1
  158. package/dist/modules/bitshares-native/tx/builder.js +29 -72
  159. package/dist/modules/bitshares-native/tx/builder.js.map +1 -1
  160. package/dist/modules/bitshares-native/tx/tx_cache.js +12 -21
  161. package/dist/modules/bitshares-native/tx/tx_cache.js.map +1 -1
  162. package/dist/modules/bitshares_client.d.ts +21 -0
  163. package/dist/modules/bitshares_client.d.ts.map +1 -1
  164. package/dist/modules/bitshares_client.js +32 -86
  165. package/dist/modules/bitshares_client.js.map +1 -1
  166. package/dist/modules/bot_settings.d.ts.map +1 -1
  167. package/dist/modules/bot_settings.js +30 -49
  168. package/dist/modules/bot_settings.js.map +1 -1
  169. package/dist/modules/bots_file_lock.d.ts.map +1 -1
  170. package/dist/modules/bots_file_lock.js +5 -13
  171. package/dist/modules/bots_file_lock.js.map +1 -1
  172. package/dist/modules/broadcast_failure.js +1 -3
  173. package/dist/modules/broadcast_failure.js.map +1 -1
  174. package/dist/modules/chain_keys.d.ts +4 -9
  175. package/dist/modules/chain_keys.d.ts.map +1 -1
  176. package/dist/modules/chain_keys.js +77 -182
  177. package/dist/modules/chain_keys.js.map +1 -1
  178. package/dist/modules/chain_orders.d.ts +2 -2
  179. package/dist/modules/chain_orders.d.ts.map +1 -1
  180. package/dist/modules/chain_orders.js +81 -144
  181. package/dist/modules/chain_orders.js.map +1 -1
  182. package/dist/modules/config.d.ts.map +1 -1
  183. package/dist/modules/config.js +23 -28
  184. package/dist/modules/config.js.map +1 -1
  185. package/dist/modules/constants.d.ts +4 -14
  186. package/dist/modules/constants.d.ts.map +1 -1
  187. package/dist/modules/constants.js +46 -78
  188. package/dist/modules/constants.js.map +1 -1
  189. package/dist/modules/cr_planner.js +15 -26
  190. package/dist/modules/cr_planner.js.map +1 -1
  191. package/dist/modules/credential_policy.d.ts +3 -6
  192. package/dist/modules/credential_policy.d.ts.map +1 -1
  193. package/dist/modules/credential_policy.js +62 -153
  194. package/dist/modules/credential_policy.js.map +1 -1
  195. package/dist/modules/credential_runtime.d.ts +1 -1
  196. package/dist/modules/credential_runtime.d.ts.map +1 -1
  197. package/dist/modules/credential_runtime.js +34 -41
  198. package/dist/modules/credential_runtime.js.map +1 -1
  199. package/dist/modules/credential_session_cache.d.ts +1 -1
  200. package/dist/modules/credential_session_cache.d.ts.map +1 -1
  201. package/dist/modules/credential_session_cache.js +5 -42
  202. package/dist/modules/credential_session_cache.js.map +1 -1
  203. package/dist/modules/credit_runtime.d.ts.map +1 -1
  204. package/dist/modules/credit_runtime.js +126 -162
  205. package/dist/modules/credit_runtime.js.map +1 -1
  206. package/dist/modules/crypto/browser_provider.d.ts +1 -1
  207. package/dist/modules/crypto/browser_provider.d.ts.map +1 -1
  208. package/dist/modules/crypto/browser_provider.js +7 -11
  209. package/dist/modules/crypto/browser_provider.js.map +1 -1
  210. package/dist/modules/crypto/index.d.ts +6 -6
  211. package/dist/modules/crypto/index.d.ts.map +1 -1
  212. package/dist/modules/crypto/index.js +12 -30
  213. package/dist/modules/crypto/index.js.map +1 -1
  214. package/dist/modules/crypto/node_provider.d.ts +1 -1
  215. package/dist/modules/crypto/node_provider.d.ts.map +1 -1
  216. package/dist/modules/crypto/node_provider.js +3 -5
  217. package/dist/modules/crypto/node_provider.js.map +1 -1
  218. package/dist/modules/crypto/provider.js +1 -2
  219. package/dist/modules/crypto/pure_ripemd160.js +1 -3
  220. package/dist/modules/crypto/pure_ripemd160.js.map +1 -1
  221. package/dist/modules/crypto/pure_scrypt.js +1 -4
  222. package/dist/modules/crypto/pure_scrypt.js.map +1 -1
  223. package/dist/modules/crypto/pure_secp256k1.d.ts +1 -1
  224. package/dist/modules/crypto/pure_secp256k1.d.ts.map +1 -1
  225. package/dist/modules/crypto/pure_secp256k1.js +1 -16
  226. package/dist/modules/crypto/pure_secp256k1.js.map +1 -1
  227. package/dist/modules/crypto/sync.d.ts.map +1 -1
  228. package/dist/modules/crypto/sync.js +16 -17
  229. package/dist/modules/crypto/sync.js.map +1 -1
  230. package/dist/modules/daemon_node_health.js +14 -16
  231. package/dist/modules/daemon_node_health.js.map +1 -1
  232. package/dist/modules/dexbot_class.d.ts +19 -14
  233. package/dist/modules/dexbot_class.d.ts.map +1 -1
  234. package/dist/modules/dexbot_class.js +127 -164
  235. package/dist/modules/dexbot_class.js.map +1 -1
  236. package/dist/modules/dexbot_cow_runtime.d.ts +28 -27
  237. package/dist/modules/dexbot_cow_runtime.d.ts.map +1 -1
  238. package/dist/modules/dexbot_cow_runtime.js +55 -45
  239. package/dist/modules/dexbot_cow_runtime.js.map +1 -1
  240. package/dist/modules/dexbot_credential_client.d.ts +6 -2
  241. package/dist/modules/dexbot_credential_client.d.ts.map +1 -1
  242. package/dist/modules/dexbot_credential_client.js +21 -31
  243. package/dist/modules/dexbot_credential_client.js.map +1 -1
  244. package/dist/modules/dexbot_fill_runtime.d.ts +23 -23
  245. package/dist/modules/dexbot_fill_runtime.d.ts.map +1 -1
  246. package/dist/modules/dexbot_fill_runtime.js +119 -77
  247. package/dist/modules/dexbot_fill_runtime.js.map +1 -1
  248. package/dist/modules/dexbot_maintenance_runtime.d.ts +46 -38
  249. package/dist/modules/dexbot_maintenance_runtime.d.ts.map +1 -1
  250. package/dist/modules/dexbot_maintenance_runtime.js +81 -81
  251. package/dist/modules/dexbot_maintenance_runtime.js.map +1 -1
  252. package/dist/modules/dexbot_startup_runtime.d.ts +3 -3
  253. package/dist/modules/dexbot_startup_runtime.d.ts.map +1 -1
  254. package/dist/modules/dexbot_startup_runtime.js +43 -81
  255. package/dist/modules/dexbot_startup_runtime.js.map +1 -1
  256. package/dist/modules/dexbot_state_recovery.d.ts +11 -11
  257. package/dist/modules/dexbot_state_recovery.js +32 -78
  258. package/dist/modules/dexbot_state_recovery.js.map +1 -1
  259. package/dist/modules/env.js +3 -7
  260. package/dist/modules/env.js.map +1 -1
  261. package/dist/modules/fund_registry.d.ts.map +1 -1
  262. package/dist/modules/fund_registry.js +12 -24
  263. package/dist/modules/fund_registry.js.map +1 -1
  264. package/dist/modules/general_settings.js +10 -16
  265. package/dist/modules/general_settings.js.map +1 -1
  266. package/dist/modules/graceful_shutdown.d.ts.map +1 -1
  267. package/dist/modules/graceful_shutdown.js +12 -19
  268. package/dist/modules/graceful_shutdown.js.map +1 -1
  269. package/dist/modules/key_store.d.ts.map +1 -1
  270. package/dist/modules/key_store.js +27 -65
  271. package/dist/modules/key_store.js.map +1 -1
  272. package/dist/modules/launcher/bot_supervisor.d.ts +1 -1
  273. package/dist/modules/launcher/bot_supervisor.d.ts.map +1 -1
  274. package/dist/modules/launcher/bot_supervisor.js +89 -118
  275. package/dist/modules/launcher/bot_supervisor.js.map +1 -1
  276. package/dist/modules/launcher/child_env.js +1 -5
  277. package/dist/modules/launcher/child_env.js.map +1 -1
  278. package/dist/modules/launcher/credential_bootstrap.js +22 -31
  279. package/dist/modules/launcher/credential_bootstrap.js.map +1 -1
  280. package/dist/modules/launcher/credential_daemon.js +37 -75
  281. package/dist/modules/launcher/credential_daemon.js.map +1 -1
  282. package/dist/modules/launcher/credential_secret.js +2 -37
  283. package/dist/modules/launcher/credential_secret.js.map +1 -1
  284. package/dist/modules/launcher/foreign_cred_daemon.js +25 -31
  285. package/dist/modules/launcher/foreign_cred_daemon.js.map +1 -1
  286. package/dist/modules/launcher/headless_password.js +10 -12
  287. package/dist/modules/launcher/headless_password.js.map +1 -1
  288. package/dist/modules/launcher/launch_modes.js +3 -9
  289. package/dist/modules/launcher/launch_modes.js.map +1 -1
  290. package/dist/modules/launcher/market_adapter_runtime.d.ts +1 -1
  291. package/dist/modules/launcher/market_adapter_runtime.d.ts.map +1 -1
  292. package/dist/modules/launcher/market_adapter_runtime.js +25 -35
  293. package/dist/modules/launcher/market_adapter_runtime.js.map +1 -1
  294. package/dist/modules/launcher/market_adapter_watchdog.d.ts.map +1 -1
  295. package/dist/modules/launcher/market_adapter_watchdog.js +42 -45
  296. package/dist/modules/launcher/market_adapter_watchdog.js.map +1 -1
  297. package/dist/modules/launcher/monolithic_runtime.d.ts +3 -2
  298. package/dist/modules/launcher/monolithic_runtime.d.ts.map +1 -1
  299. package/dist/modules/launcher/monolithic_runtime.js +97 -138
  300. package/dist/modules/launcher/monolithic_runtime.js.map +1 -1
  301. package/dist/modules/launcher/runtime_entry.d.ts +1 -11
  302. package/dist/modules/launcher/runtime_entry.d.ts.map +1 -1
  303. package/dist/modules/launcher/runtime_entry.js +12 -15
  304. package/dist/modules/launcher/runtime_entry.js.map +1 -1
  305. package/dist/modules/launcher/status_reporting.d.ts +1 -1
  306. package/dist/modules/launcher/status_reporting.d.ts.map +1 -1
  307. package/dist/modules/launcher/status_reporting.js +15 -36
  308. package/dist/modules/launcher/status_reporting.js.map +1 -1
  309. package/dist/modules/launcher/supervisor_control.js +4 -9
  310. package/dist/modules/launcher/supervisor_control.js.map +1 -1
  311. package/dist/modules/logger.d.ts +1 -1
  312. package/dist/modules/logger.d.ts.map +1 -1
  313. package/dist/modules/logger.js +3 -38
  314. package/dist/modules/logger.js.map +1 -1
  315. package/dist/modules/market_adapter_whitelist.js +9 -18
  316. package/dist/modules/market_adapter_whitelist.js.map +1 -1
  317. package/dist/modules/node_failure_ledger.js +1 -3
  318. package/dist/modules/node_failure_ledger.js.map +1 -1
  319. package/dist/modules/node_health_cache.d.ts.map +1 -1
  320. package/dist/modules/node_health_cache.js +15 -25
  321. package/dist/modules/node_health_cache.js.map +1 -1
  322. package/dist/modules/node_manager.d.ts +1 -1
  323. package/dist/modules/node_manager.d.ts.map +1 -1
  324. package/dist/modules/node_manager.js +44 -43
  325. package/dist/modules/node_manager.js.map +1 -1
  326. package/dist/modules/order/accounting.d.ts.map +1 -1
  327. package/dist/modules/order/accounting.js +102 -118
  328. package/dist/modules/order/accounting.js.map +1 -1
  329. package/dist/modules/order/async_lock.d.ts +3 -15
  330. package/dist/modules/order/async_lock.d.ts.map +1 -1
  331. package/dist/modules/order/async_lock.js +6 -26
  332. package/dist/modules/order/async_lock.js.map +1 -1
  333. package/dist/modules/order/export.js +34 -75
  334. package/dist/modules/order/export.js.map +1 -1
  335. package/dist/modules/order/format.d.ts +1 -3
  336. package/dist/modules/order/format.d.ts.map +1 -1
  337. package/dist/modules/order/format.js +4 -24
  338. package/dist/modules/order/format.js.map +1 -1
  339. package/dist/modules/order/grid.d.ts +8 -8
  340. package/dist/modules/order/grid.d.ts.map +1 -1
  341. package/dist/modules/order/grid.js +254 -266
  342. package/dist/modules/order/grid.js.map +1 -1
  343. package/dist/modules/order/grid_reconcile.d.ts.map +1 -1
  344. package/dist/modules/order/grid_reconcile.js +77 -94
  345. package/dist/modules/order/grid_reconcile.js.map +1 -1
  346. package/dist/modules/order/grid_reconcile_internal.d.ts.map +1 -1
  347. package/dist/modules/order/grid_reconcile_internal.js +117 -149
  348. package/dist/modules/order/grid_reconcile_internal.js.map +1 -1
  349. package/dist/modules/order/index.d.ts.map +1 -1
  350. package/dist/modules/order/index.js +11 -45
  351. package/dist/modules/order/index.js.map +1 -1
  352. package/dist/modules/order/logger.d.ts +0 -8
  353. package/dist/modules/order/logger.d.ts.map +1 -1
  354. package/dist/modules/order/logger.js +28 -141
  355. package/dist/modules/order/logger.js.map +1 -1
  356. package/dist/modules/order/logger_state.d.ts.map +1 -1
  357. package/dist/modules/order/logger_state.js +3 -4
  358. package/dist/modules/order/logger_state.js.map +1 -1
  359. package/dist/modules/order/manager.d.ts +10 -79
  360. package/dist/modules/order/manager.d.ts.map +1 -1
  361. package/dist/modules/order/manager.js +131 -247
  362. package/dist/modules/order/manager.js.map +1 -1
  363. package/dist/modules/order/processed_fill_store.js +2 -7
  364. package/dist/modules/order/processed_fill_store.js.map +1 -1
  365. package/dist/modules/order/strategy.js +23 -25
  366. package/dist/modules/order/strategy.js.map +1 -1
  367. package/dist/modules/order/sync_engine.d.ts +27 -0
  368. package/dist/modules/order/sync_engine.d.ts.map +1 -1
  369. package/dist/modules/order/sync_engine.js +232 -181
  370. package/dist/modules/order/sync_engine.js.map +1 -1
  371. package/dist/modules/order/utils/math.d.ts +1 -25
  372. package/dist/modules/order/utils/math.d.ts.map +1 -1
  373. package/dist/modules/order/utils/math.js +49 -172
  374. package/dist/modules/order/utils/math.js.map +1 -1
  375. package/dist/modules/order/utils/order.d.ts +46 -2
  376. package/dist/modules/order/utils/order.d.ts.map +1 -1
  377. package/dist/modules/order/utils/order.js +165 -143
  378. package/dist/modules/order/utils/order.js.map +1 -1
  379. package/dist/modules/order/utils/system.d.ts +3 -1
  380. package/dist/modules/order/utils/system.d.ts.map +1 -1
  381. package/dist/modules/order/utils/system.js +152 -211
  382. package/dist/modules/order/utils/system.js.map +1 -1
  383. package/dist/modules/order/utils/timeout.js +1 -4
  384. package/dist/modules/order/utils/timeout.js.map +1 -1
  385. package/dist/modules/order/utils/validate.js +91 -142
  386. package/dist/modules/order/utils/validate.js.map +1 -1
  387. package/dist/modules/order/utils/withPoolRef.js +21 -61
  388. package/dist/modules/order/utils/withPoolRef.js.map +1 -1
  389. package/dist/modules/order/working_grid.js +6 -9
  390. package/dist/modules/order/working_grid.js.map +1 -1
  391. package/dist/modules/path_api.d.ts.map +1 -1
  392. package/dist/modules/path_api.js +8 -11
  393. package/dist/modules/path_api.js.map +1 -1
  394. package/dist/modules/paths.d.ts.map +1 -1
  395. package/dist/modules/paths.js +61 -67
  396. package/dist/modules/paths.js.map +1 -1
  397. package/dist/modules/process_discovery.d.ts.map +1 -1
  398. package/dist/modules/process_discovery.js +14 -23
  399. package/dist/modules/process_discovery.js.map +1 -1
  400. package/dist/modules/runtime.js +7 -11
  401. package/dist/modules/runtime.js.map +1 -1
  402. package/dist/modules/runtime_settings.d.ts.map +1 -1
  403. package/dist/modules/runtime_settings.js +14 -16
  404. package/dist/modules/runtime_settings.js.map +1 -1
  405. package/dist/modules/settings_merge.js +1 -3
  406. package/dist/modules/settings_merge.js.map +1 -1
  407. package/dist/modules/socket_json_client.js +3 -5
  408. package/dist/modules/socket_json_client.js.map +1 -1
  409. package/dist/modules/storage/browser_adapter.js +1 -4
  410. package/dist/modules/storage/browser_adapter.js.map +1 -1
  411. package/dist/modules/storage/index.d.ts +3 -2
  412. package/dist/modules/storage/index.d.ts.map +1 -1
  413. package/dist/modules/storage/index.js +5 -8
  414. package/dist/modules/storage/index.js.map +1 -1
  415. package/dist/modules/storage/node_adapter.d.ts +3 -4
  416. package/dist/modules/storage/node_adapter.d.ts.map +1 -1
  417. package/dist/modules/storage/node_adapter.js +12 -16
  418. package/dist/modules/storage/node_adapter.js.map +1 -1
  419. package/dist/modules/storage/types.js +1 -2
  420. package/dist/modules/types.d.ts +0 -6
  421. package/dist/modules/types.d.ts.map +1 -1
  422. package/dist/modules/types.js +1 -2
  423. package/dist/modules/types.js.map +1 -1
  424. package/dist/modules/utils/base58check.js +8 -15
  425. package/dist/modules/utils/base58check.js.map +1 -1
  426. package/dist/modules/utils/build_dir.js +3 -7
  427. package/dist/modules/utils/build_dir.js.map +1 -1
  428. package/dist/modules/utils/errors.js +1 -5
  429. package/dist/modules/utils/errors.js.map +1 -1
  430. package/dist/modules/utils/math_utils.d.ts +1 -1
  431. package/dist/modules/utils/math_utils.d.ts.map +1 -1
  432. package/dist/modules/utils/math_utils.js +2 -7
  433. package/dist/modules/utils/math_utils.js.map +1 -1
  434. package/dist/modules/validate_profiles.d.ts.map +1 -1
  435. package/dist/modules/validate_profiles.js +18 -25
  436. package/dist/modules/validate_profiles.js.map +1 -1
  437. package/dist/pm2.d.ts +4 -70
  438. package/dist/pm2.d.ts.map +1 -1
  439. package/dist/pm2.js +106 -132
  440. package/dist/pm2.js.map +1 -1
  441. package/dist/scripts/analyze-git.js +13 -17
  442. package/dist/scripts/analyze-git.js.map +1 -1
  443. package/dist/scripts/analyze-orders.d.ts.map +1 -1
  444. package/dist/scripts/analyze-orders.js +48 -63
  445. package/dist/scripts/analyze-orders.js.map +1 -1
  446. package/dist/scripts/diagnose-kibana-candles.d.ts.map +1 -1
  447. package/dist/scripts/diagnose-kibana-candles.js +2 -1
  448. package/dist/scripts/diagnose-kibana-candles.js.map +1 -1
  449. package/dist/scripts/diagnose-pool-history.d.ts.map +1 -1
  450. package/dist/scripts/diagnose-pool-history.js +2 -1
  451. package/dist/scripts/diagnose-pool-history.js.map +1 -1
  452. package/dist/scripts/divergence-calc.d.ts.map +1 -1
  453. package/dist/scripts/divergence-calc.js +2 -2
  454. package/dist/scripts/divergence-calc.js.map +1 -1
  455. package/dist/scripts/fix-err-message.js +17 -22
  456. package/dist/scripts/fix-err-message.js.map +1 -1
  457. package/dist/scripts/generate_lp_chart.d.ts.map +1 -1
  458. package/dist/scripts/generate_lp_chart.js +7 -15
  459. package/dist/scripts/generate_lp_chart.js.map +1 -1
  460. package/dist/scripts/generate_mainnet_corpus_report.d.ts.map +1 -1
  461. package/dist/scripts/generate_mainnet_corpus_report.js +3 -2
  462. package/dist/scripts/generate_mainnet_corpus_report.js.map +1 -1
  463. package/dist/scripts/generate_market_adapter_whitelist.d.ts.map +1 -1
  464. package/dist/scripts/generate_market_adapter_whitelist.js +18 -24
  465. package/dist/scripts/generate_market_adapter_whitelist.js.map +1 -1
  466. package/dist/scripts/native_release_gates.js +15 -19
  467. package/dist/scripts/native_release_gates.js.map +1 -1
  468. package/dist/scripts/print_grid.d.ts.map +1 -1
  469. package/dist/scripts/print_grid.js +2 -2
  470. package/dist/scripts/print_grid.js.map +1 -1
  471. package/dist/scripts/run-tests.js +12 -17
  472. package/dist/scripts/run-tests.js.map +1 -1
  473. package/dist/scripts/runner.d.ts.map +1 -1
  474. package/dist/scripts/runner.js +18 -20
  475. package/dist/scripts/runner.js.map +1 -1
  476. package/dist/scripts/sync-version.js +2 -2
  477. package/dist/scripts/sync-version.js.map +1 -1
  478. package/dist/scripts/test-credit-renewal.d.ts.map +1 -1
  479. package/dist/scripts/test-credit-renewal.js +4 -3
  480. package/dist/scripts/test-credit-renewal.js.map +1 -1
  481. package/dist/scripts/update.js +93 -95
  482. package/dist/scripts/update.js.map +1 -1
  483. package/dist/scripts/validate_bots.d.ts.map +1 -1
  484. package/dist/scripts/validate_bots.js +2 -2
  485. package/dist/scripts/validate_bots.js.map +1 -1
  486. package/dist/scripts/verify-browser-bundle.js +12 -17
  487. package/dist/scripts/verify-browser-bundle.js.map +1 -1
  488. package/dist/unlock.d.ts +0 -30
  489. package/dist/unlock.d.ts.map +1 -1
  490. package/dist/unlock.js +258 -222
  491. package/dist/unlock.js.map +1 -1
  492. package/package.json +5 -8
  493. package/scripts/README.md +1 -1
  494. package/scripts/create-bot-symlinks.sh +2 -2
  495. package/dist/modules/utils/fs_utils.d.ts +0 -18
  496. package/dist/modules/utils/fs_utils.d.ts.map +0 -1
  497. package/dist/modules/utils/fs_utils.js +0 -32
  498. package/dist/modules/utils/fs_utils.js.map +0 -1
  499. package/dist/scripts/migrate_bot_keys.d.ts +0 -3
  500. package/dist/scripts/migrate_bot_keys.d.ts.map +0 -1
  501. package/dist/scripts/migrate_bot_keys.js +0 -225
  502. 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
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
110
- if (k2 === undefined) k2 = k;
111
- var desc = Object.getOwnPropertyDescriptor(m, k);
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
- const math_1 = require("./order/utils/math");
174
- const constants_1 = require("./constants");
175
- const Format = __importStar(require("./order/format"));
176
- const async_lock_1 = __importDefault(require("./order/async_lock"));
177
- const system_1 = require("./order/utils/system");
178
- const chainKeys = __importStar(require("./chain_keys"));
179
- const key_store_1 = require("./key_store");
180
- const dexbot_credential_client_1 = require("./dexbot_credential_client");
181
- Object.defineProperty(exports, "BroadcastUncertainError", { enumerable: true, get: function () { return dexbot_credential_client_1.BroadcastUncertainError; } });
182
- const broadcast_failure_1 = require("./broadcast_failure");
183
- const logger_1 = __importDefault(require("./logger"));
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 logger_1.default('ChainOrders');
188
- const { ORDER_EVENTS } = constants_1.NATIVE_CLIENT;
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 = constants_1.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 async_lock_1.default();
242
- const _preferredAccountLock = new async_lock_1.default();
243
- const _resolutionLock = new async_lock_1.default();
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: ${(0, errors_1.getErrorMessage)(e)}`);
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] === constants_1.FILL_PROCESSING.OPERATION_TYPE; // operation type for fill_order
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 ${(0, errors_1.getErrorMessage)(e)}`);
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) => (0, errors_1.getErrorMessage)(e) || String(e)).join('; ')}`);
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), constants_1.NATIVE_CLIENT.SUBSCRIPTIONS.SUBSCRIBE_TIMEOUT_MS, 'BitShares.subscribe');
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
- `${(0, errors_1.getErrorMessage)(rollbackErr)}`);
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 (0, system_1.readInput)('Select account number: ');
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}: ${(0, errors_1.getErrorMessage)(e)}`);
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 (0, key_store_1.getKeyStore)().isDaemonSigningKey(value);
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, 'BROADCAST_DEADLINE', 'broadcast');
471
+ opts.onNodeFailed = (nodeUrl) => nodeManager.reportNodeFailure(nodeUrl, DAEMON_CODES.BROADCAST_DEADLINE, 'broadcast');
535
472
  }
536
- return (0, key_store_1.getKeyStore)().executeOperations(accountName, operations, signingToken, opts);
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 = constants_1.TIMING.CONNECTION_TIMEOUT_MS) {
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 = constants_1.TIMING.CONNECTION_TIMEOUT_MS) {
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 = constants_1.TIMING.CONNECTION_TIMEOUT_MS, suppress_log = true) {
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 = constants_1.TIMING.CONNECTION_TIMEOUT_MS, suppress_log = true) {
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 = constants_1.TIMING.CONNECTION_TIMEOUT_MS, suppress_log = true) {
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: ${(0, errors_1.getErrorMessage)(error)}`);
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, 30000, true).catch((error) => chainOrdersLogger.error(`Error loading account for listening: ${(0, errors_1.getErrorMessage)(error)}`));
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: ${(0, errors_1.getErrorMessage)(e)}`);
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 ${(0, errors_1.getErrorMessage)(e)}`);
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 = (0, math_1.blockchainToFloat)(currentSellInt, sellPrecision);
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 = (0, math_1.floatToBlockchainInt)(newSellFloat, sellPrecision);
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 = (0, math_1.blockchainToFloat)(currentSellInt, sellPrecision);
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 = (0, math_1.floatToBlockchainInt)(newParams.minToReceive, receivePrecision);
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 = (0, math_1.floatToBlockchainInt)(receiveFloat, receivePrecision);
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 = (0, math_1.blockchainToFloat)(candidateReceiveInt, receivePrecision);
883
- if (!(0, math_1.validateOrderAmountsWithinLimits)(newSellFloat, candidateReceiveFloat, sellPrecision, receivePrecision)) {
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 = (0, math_1.normalizeInt)(newSellInt, sellPrecision);
899
- const roundedCurrentSellInt = (0, math_1.normalizeInt)(currentSellInt, sellPrecision);
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 = (0, math_1.floatToBlockchainInt)(newParams.minToReceive, receivePrecision);
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 = (0, math_1.floatToBlockchainInt)(receiveFloat, receivePrecision);
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 = (0, math_1.floatToBlockchainInt)(newParams.minToReceive, receivePrecision);
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 = (0, math_1.blockchainToFloat)(adjustedSellInt, sellPrecision);
893
+ const adjustedSellFloat = blockchainToFloat(adjustedSellInt, sellPrecision);
957
894
  const receiveFloat = (newParams.orderType === 'sell')
958
895
  ? (adjustedSellFloat * price)
959
896
  : (adjustedSellFloat / price);
960
- newReceiveInt = (0, math_1.floatToBlockchainInt)(receiveFloat, receivePrecision);
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 = (0, math_1.blockchainToFloat)(adjustedSellInt, sellPrecision);
967
- const finalReceiveFloat = (0, math_1.blockchainToFloat)(newReceiveInt, receivePrecision);
968
- if (!(0, math_1.validateOrderAmountsWithinLimits)(adjustedSellFloat, finalReceiveFloat, sellPrecision, receivePrecision)) {
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: constants_1.NATIVE_CLIENT.CHAIN.CORE_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 ((0, broadcast_failure_1.classifyBroadcastFailure)(err) === 'uncertain') {
1019
- throw new dexbot_credential_client_1.BroadcastUncertainError(`Direct-key broadcast uncertain for ${accountName}: ${(0, errors_1.getErrorMessage)(err)}`, { operations: operations.length > 0 ? operations : null, accountName, timeoutMs: null });
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: ${(0, errors_1.getErrorMessage)(error)}`);
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 = (0, math_1.floatToBlockchainInt)(amountToSell, sellPrecision);
1088
- const minToReceiveInt = (0, math_1.floatToBlockchainInt)(minToReceive, receivePrecision);
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 (!(0, math_1.validateOrderAmountsWithinLimits)(amountToSell, minToReceive, sellPrecision, receivePrecision)) {
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: constants_1.NATIVE_CLIENT.CHAIN.CORE_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: ${(0, errors_1.getErrorMessage)(error)}`);
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: constants_1.NATIVE_CLIENT.CHAIN.CORE_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, constants_1.TIMING.CONNECTION_TIMEOUT_MS, true);
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), constants_1.TIMING.CONNECTION_TIMEOUT_MS);
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: ${(0, errors_1.getErrorMessage)(error)}`);
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: ${(0, errors_1.getErrorMessage)(error)}`);
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}: ${(0, errors_1.getErrorMessage)(dealErr)}`);
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}: ${(0, errors_1.getErrorMessage)(e)}`);
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}: ${(0, errors_1.getErrorMessage)(e)}`);
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 = (0, math_1.blockchainToFloat)(freeRaw, precision);
1439
- const locked = (0, math_1.blockchainToFloat)(lockedRaw, precision);
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: ${(0, errors_1.getErrorMessage)(err)}`);
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: constants_1.NATIVE_CLIENT.CHAIN.CORE_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
- module.exports = { 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: dexbot_credential_client_1.BroadcastUncertainError, broadcastTxWithClassification };
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