@reefclaw/connect 0.1.11 → 0.1.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 (397) hide show
  1. package/assets/bridge/gateway/heartbeat-cron.d.ts +27 -0
  2. package/assets/bridge/gateway/heartbeat-cron.js +85 -0
  3. package/assets/bridge/providers/gateway.d.ts +2 -0
  4. package/assets/bridge/providers/gateway.js +57 -16
  5. package/assets/bridge/setup.js +6 -51
  6. package/dist/deps.js +2 -2
  7. package/dist/plugin.js +35 -7
  8. package/package.json +1 -1
  9. package/assets/plugin/audit/mode-transition-audit.d.ts +0 -11
  10. package/assets/plugin/audit/mode-transition-audit.js +0 -29
  11. package/assets/plugin/balance-utils.d.ts +0 -36
  12. package/assets/plugin/balance-utils.js +0 -98
  13. package/assets/plugin/ccxt/binance-ban-gate.d.ts +0 -47
  14. package/assets/plugin/ccxt/binance-ban-gate.js +0 -420
  15. package/assets/plugin/ccxt/binance-private.d.ts +0 -346
  16. package/assets/plugin/ccxt/binance-private.js +0 -1525
  17. package/assets/plugin/ccxt/binance-public.d.ts +0 -34
  18. package/assets/plugin/ccxt/binance-public.js +0 -180
  19. package/assets/plugin/ccxt/intel-public.d.ts +0 -25
  20. package/assets/plugin/ccxt/intel-public.js +0 -80
  21. package/assets/plugin/ccxt/public-market-data-api.d.ts +0 -26
  22. package/assets/plugin/ccxt/public-market-data-api.js +0 -23
  23. package/assets/plugin/config/agent-config-client.d.ts +0 -77
  24. package/assets/plugin/config/agent-config-client.js +0 -188
  25. package/assets/plugin/config/agent-config-poller.d.ts +0 -32
  26. package/assets/plugin/config/agent-config-poller.js +0 -101
  27. package/assets/plugin/config/brackets-config.d.ts +0 -22
  28. package/assets/plugin/config/brackets-config.js +0 -58
  29. package/assets/plugin/config/entitlement-gate.d.ts +0 -51
  30. package/assets/plugin/config/entitlement-gate.js +0 -137
  31. package/assets/plugin/config/gate-store.d.ts +0 -18
  32. package/assets/plugin/config/gate-store.js +0 -61
  33. package/assets/plugin/config/plugin-config-io.d.ts +0 -222
  34. package/assets/plugin/config/plugin-config-io.js +0 -126
  35. package/assets/plugin/config/position-review-config.d.ts +0 -35
  36. package/assets/plugin/config/position-review-config.js +0 -105
  37. package/assets/plugin/config/tool-gate.d.ts +0 -53
  38. package/assets/plugin/config/tool-gate.js +0 -128
  39. package/assets/plugin/config/user-data-stream-config.d.ts +0 -89
  40. package/assets/plugin/config/user-data-stream-config.js +0 -239
  41. package/assets/plugin/connector-supervisor.d.ts +0 -36
  42. package/assets/plugin/connector-supervisor.js +0 -149
  43. package/assets/plugin/exchange-adapter.d.ts +0 -65
  44. package/assets/plugin/exchange-adapter.js +0 -4
  45. package/assets/plugin/index.d.ts +0 -30
  46. package/assets/plugin/index.js +0 -2756
  47. package/assets/plugin/ingest/pending-entry-metadata.d.ts +0 -74
  48. package/assets/plugin/ingest/pending-entry-metadata.js +0 -236
  49. package/assets/plugin/ingest/position-auto-capture.d.ts +0 -171
  50. package/assets/plugin/ingest/position-auto-capture.js +0 -709
  51. package/assets/plugin/ingest/position-decisions-client.d.ts +0 -327
  52. package/assets/plugin/ingest/position-decisions-client.js +0 -306
  53. package/assets/plugin/ingest/readiness-reporter.d.ts +0 -42
  54. package/assets/plugin/ingest/readiness-reporter.js +0 -163
  55. package/assets/plugin/ingest/reconcile-db-vs-exchange.d.ts +0 -51
  56. package/assets/plugin/ingest/reconcile-db-vs-exchange.js +0 -170
  57. package/assets/plugin/ingest/reconciler-cleanup.d.ts +0 -37
  58. package/assets/plugin/ingest/reconciler-cleanup.js +0 -147
  59. package/assets/plugin/ingest/rest-gap-filler.d.ts +0 -191
  60. package/assets/plugin/ingest/rest-gap-filler.js +0 -565
  61. package/assets/plugin/ingest/touched-symbols-store.d.ts +0 -25
  62. package/assets/plugin/ingest/touched-symbols-store.js +0 -96
  63. package/assets/plugin/ingest/trade-store-client.d.ts +0 -40
  64. package/assets/plugin/ingest/trade-store-client.js +0 -125
  65. package/assets/plugin/ingest/ws-ingest.d.ts +0 -43
  66. package/assets/plugin/ingest/ws-ingest.js +0 -126
  67. package/assets/plugin/learning/setup-family.d.ts +0 -21
  68. package/assets/plugin/learning/setup-family.js +0 -103
  69. package/assets/plugin/lifecycle/install-signal-handlers.d.ts +0 -33
  70. package/assets/plugin/lifecycle/install-signal-handlers.js +0 -112
  71. package/assets/plugin/lifecycle/shutdown-coordinator.d.ts +0 -43
  72. package/assets/plugin/lifecycle/shutdown-coordinator.js +0 -131
  73. package/assets/plugin/lifecycle/trading-operation-lock.d.ts +0 -17
  74. package/assets/plugin/lifecycle/trading-operation-lock.js +0 -14
  75. package/assets/plugin/live/bracket-id.d.ts +0 -26
  76. package/assets/plugin/live/bracket-id.js +0 -112
  77. package/assets/plugin/live/bracket-ledger.d.ts +0 -54
  78. package/assets/plugin/live/bracket-ledger.js +0 -267
  79. package/assets/plugin/live/bracket-manager.d.ts +0 -82
  80. package/assets/plugin/live/bracket-manager.js +0 -478
  81. package/assets/plugin/live/bracket-params.d.ts +0 -22
  82. package/assets/plugin/live/bracket-params.js +0 -124
  83. package/assets/plugin/live/bracket-reconciler.d.ts +0 -95
  84. package/assets/plugin/live/bracket-reconciler.js +0 -573
  85. package/assets/plugin/live/bracket-types.d.ts +0 -102
  86. package/assets/plugin/live/bracket-types.js +0 -8
  87. package/assets/plugin/live/deposit-tracker.d.ts +0 -62
  88. package/assets/plugin/live/deposit-tracker.js +0 -97
  89. package/assets/plugin/live/emergency-controls.d.ts +0 -32
  90. package/assets/plugin/live/emergency-controls.js +0 -226
  91. package/assets/plugin/live/exchange-errors.d.ts +0 -12
  92. package/assets/plugin/live/exchange-errors.js +0 -130
  93. package/assets/plugin/live/exchange-info-cache.d.ts +0 -37
  94. package/assets/plugin/live/exchange-info-cache.js +0 -134
  95. package/assets/plugin/live/fact-subscriber.d.ts +0 -78
  96. package/assets/plugin/live/fact-subscriber.js +0 -182
  97. package/assets/plugin/live/fill-price.d.ts +0 -13
  98. package/assets/plugin/live/fill-price.js +0 -37
  99. package/assets/plugin/live/intent-journal.d.ts +0 -42
  100. package/assets/plugin/live/intent-journal.js +0 -122
  101. package/assets/plugin/live/listen-key-manager.d.ts +0 -70
  102. package/assets/plugin/live/listen-key-manager.js +0 -169
  103. package/assets/plugin/live/live-adapter.d.ts +0 -319
  104. package/assets/plugin/live/live-adapter.js +0 -1906
  105. package/assets/plugin/live/live-balance-enricher.d.ts +0 -32
  106. package/assets/plugin/live/live-balance-enricher.js +0 -104
  107. package/assets/plugin/live/live-bracket-api.d.ts +0 -13
  108. package/assets/plugin/live/live-bracket-api.js +0 -20
  109. package/assets/plugin/live/live-state-store.d.ts +0 -194
  110. package/assets/plugin/live/live-state-store.js +0 -450
  111. package/assets/plugin/live/local-signal-service.d.ts +0 -57
  112. package/assets/plugin/live/local-signal-service.js +0 -151
  113. package/assets/plugin/live/local-strategy-evaluator.d.ts +0 -62
  114. package/assets/plugin/live/local-strategy-evaluator.js +0 -131
  115. package/assets/plugin/live/microstructure-assembler.d.ts +0 -54
  116. package/assets/plugin/live/microstructure-assembler.js +0 -148
  117. package/assets/plugin/live/order-poller.d.ts +0 -29
  118. package/assets/plugin/live/order-poller.js +0 -125
  119. package/assets/plugin/live/position-state-store.d.ts +0 -87
  120. package/assets/plugin/live/position-state-store.js +0 -237
  121. package/assets/plugin/live/proposal-decision-listener.d.ts +0 -70
  122. package/assets/plugin/live/proposal-decision-listener.js +0 -292
  123. package/assets/plugin/live/proposal-manager.d.ts +0 -76
  124. package/assets/plugin/live/proposal-manager.js +0 -140
  125. package/assets/plugin/live/rate-limiter.d.ts +0 -47
  126. package/assets/plugin/live/rate-limiter.js +0 -159
  127. package/assets/plugin/live/reconciler.d.ts +0 -39
  128. package/assets/plugin/live/reconciler.js +0 -175
  129. package/assets/plugin/live/setup-buckets.d.ts +0 -7
  130. package/assets/plugin/live/setup-buckets.js +0 -33
  131. package/assets/plugin/live/slippage-tracker.d.ts +0 -45
  132. package/assets/plugin/live/slippage-tracker.js +0 -78
  133. package/assets/plugin/live/stop-watcher.d.ts +0 -67
  134. package/assets/plugin/live/stop-watcher.js +0 -218
  135. package/assets/plugin/live/user-data-active-probe.d.ts +0 -54
  136. package/assets/plugin/live/user-data-active-probe.js +0 -180
  137. package/assets/plugin/live/user-data-stream-controller.d.ts +0 -200
  138. package/assets/plugin/live/user-data-stream-controller.js +0 -579
  139. package/assets/plugin/live/user-data-stream-ws.d.ts +0 -22
  140. package/assets/plugin/live/user-data-stream-ws.js +0 -63
  141. package/assets/plugin/live/user-data-stream.d.ts +0 -243
  142. package/assets/plugin/live/user-data-stream.js +0 -704
  143. package/assets/plugin/logger.d.ts +0 -2
  144. package/assets/plugin/logger.js +0 -2
  145. package/assets/plugin/mfe.d.ts +0 -21
  146. package/assets/plugin/mfe.js +0 -68
  147. package/assets/plugin/onboarding/mode-ladder.d.ts +0 -1
  148. package/assets/plugin/onboarding/mode-ladder.js +0 -3
  149. package/assets/plugin/onboarding/runtime.d.ts +0 -90
  150. package/assets/plugin/onboarding/runtime.js +0 -184
  151. package/assets/plugin/openclaw.plugin.json +0 -92
  152. package/assets/plugin/paper-adapter.d.ts +0 -24
  153. package/assets/plugin/paper-adapter.js +0 -91
  154. package/assets/plugin/persistence/state-manager.d.ts +0 -66
  155. package/assets/plugin/persistence/state-manager.js +0 -222
  156. package/assets/plugin/pinned-plan.d.ts +0 -9
  157. package/assets/plugin/pinned-plan.js +0 -23
  158. package/assets/plugin/portfolio/reentry-tracker.d.ts +0 -36
  159. package/assets/plugin/portfolio/reentry-tracker.js +0 -127
  160. package/assets/plugin/portfolio/wave9-admission.d.ts +0 -67
  161. package/assets/plugin/portfolio/wave9-admission.js +0 -262
  162. package/assets/plugin/portfolio/wave9-policy.d.ts +0 -36
  163. package/assets/plugin/portfolio/wave9-policy.js +0 -183
  164. package/assets/plugin/risk/pre-trade-check.d.ts +0 -38
  165. package/assets/plugin/risk/pre-trade-check.js +0 -345
  166. package/assets/plugin/risk/pre-trade-types.d.ts +0 -60
  167. package/assets/plugin/risk/pre-trade-types.js +0 -3
  168. package/assets/plugin/shadow/shadow-tracker.d.ts +0 -36
  169. package/assets/plugin/shadow/shadow-tracker.js +0 -151
  170. package/assets/plugin/shadow/types.d.ts +0 -42
  171. package/assets/plugin/shadow/types.js +0 -20
  172. package/assets/plugin/shared/indicators-extended.d.ts +0 -52
  173. package/assets/plugin/shared/indicators-extended.js +0 -291
  174. package/assets/plugin/shared/indicators.d.ts +0 -15
  175. package/assets/plugin/shared/indicators.js +0 -114
  176. package/assets/plugin/signals/conditions/registry.d.ts +0 -16
  177. package/assets/plugin/signals/conditions/registry.js +0 -1333
  178. package/assets/plugin/signals/conditions/types.d.ts +0 -1
  179. package/assets/plugin/signals/conditions/types.js +0 -4
  180. package/assets/plugin/signals/direction-rules.d.ts +0 -3
  181. package/assets/plugin/signals/direction-rules.js +0 -24
  182. package/assets/plugin/signals/entry-rules.d.ts +0 -6
  183. package/assets/plugin/signals/entry-rules.js +0 -33
  184. package/assets/plugin/signals/serialize-context.d.ts +0 -4
  185. package/assets/plugin/signals/serialize-context.js +0 -39
  186. package/assets/plugin/signals/stop-rules.d.ts +0 -3
  187. package/assets/plugin/signals/stop-rules.js +0 -48
  188. package/assets/plugin/signals/strategy-adapter.d.ts +0 -47
  189. package/assets/plugin/signals/strategy-adapter.js +0 -209
  190. package/assets/plugin/signals/types.d.ts +0 -1
  191. package/assets/plugin/signals/types.js +0 -8
  192. package/assets/plugin/simulator/exchange-simulator.d.ts +0 -105
  193. package/assets/plugin/simulator/exchange-simulator.js +0 -759
  194. package/assets/plugin/simulator/fill-engine.d.ts +0 -53
  195. package/assets/plugin/simulator/fill-engine.js +0 -280
  196. package/assets/plugin/simulator/paper-market-feed.d.ts +0 -26
  197. package/assets/plugin/simulator/paper-market-feed.js +0 -104
  198. package/assets/plugin/simulator/realistic-fills.d.ts +0 -59
  199. package/assets/plugin/simulator/realistic-fills.js +0 -175
  200. package/assets/plugin/simulator/types.d.ts +0 -228
  201. package/assets/plugin/simulator/types.js +0 -43
  202. package/assets/plugin/strategy/builtin-strategies.d.ts +0 -2
  203. package/assets/plugin/strategy/builtin-strategies.js +0 -113
  204. package/assets/plugin/strategy/condition-registry.d.ts +0 -3
  205. package/assets/plugin/strategy/condition-registry.js +0 -153
  206. package/assets/plugin/strategy/evaluator.d.ts +0 -70
  207. package/assets/plugin/strategy/evaluator.js +0 -98
  208. package/assets/plugin/tools/assessment-validation.d.ts +0 -141
  209. package/assets/plugin/tools/assessment-validation.js +0 -473
  210. package/assets/plugin/tools/attach-brackets.d.ts +0 -39
  211. package/assets/plugin/tools/attach-brackets.js +0 -564
  212. package/assets/plugin/tools/audit-bracket-protection.d.ts +0 -49
  213. package/assets/plugin/tools/audit-bracket-protection.js +0 -683
  214. package/assets/plugin/tools/bracket-control.d.ts +0 -12
  215. package/assets/plugin/tools/bracket-control.js +0 -35
  216. package/assets/plugin/tools/cancel-all-orders.d.ts +0 -9
  217. package/assets/plugin/tools/cancel-all-orders.js +0 -8
  218. package/assets/plugin/tools/cancel-order.d.ts +0 -14
  219. package/assets/plugin/tools/cancel-order.js +0 -60
  220. package/assets/plugin/tools/check-position-health.d.ts +0 -46
  221. package/assets/plugin/tools/check-position-health.js +0 -194
  222. package/assets/plugin/tools/clear-exchange-credentials.d.ts +0 -24
  223. package/assets/plugin/tools/clear-exchange-credentials.js +0 -70
  224. package/assets/plugin/tools/close-position.d.ts +0 -45
  225. package/assets/plugin/tools/close-position.js +0 -722
  226. package/assets/plugin/tools/create-order.d.ts +0 -82
  227. package/assets/plugin/tools/create-order.js +0 -1544
  228. package/assets/plugin/tools/exit-gate.d.ts +0 -58
  229. package/assets/plugin/tools/exit-gate.js +0 -162
  230. package/assets/plugin/tools/fetch-balance.d.ts +0 -5
  231. package/assets/plugin/tools/fetch-balance.js +0 -4
  232. package/assets/plugin/tools/fetch-ohlcv.d.ts +0 -11
  233. package/assets/plugin/tools/fetch-ohlcv.js +0 -8
  234. package/assets/plugin/tools/fetch-open-orders.d.ts +0 -7
  235. package/assets/plugin/tools/fetch-open-orders.js +0 -4
  236. package/assets/plugin/tools/fetch-positions.d.ts +0 -7
  237. package/assets/plugin/tools/fetch-positions.js +0 -4
  238. package/assets/plugin/tools/fetch-ticker.d.ts +0 -11
  239. package/assets/plugin/tools/fetch-ticker.js +0 -5
  240. package/assets/plugin/tools/get-agent-profile.d.ts +0 -4
  241. package/assets/plugin/tools/get-agent-profile.js +0 -6
  242. package/assets/plugin/tools/get-analytics.d.ts +0 -6
  243. package/assets/plugin/tools/get-analytics.js +0 -7
  244. package/assets/plugin/tools/get-backtest.d.ts +0 -12
  245. package/assets/plugin/tools/get-backtest.js +0 -91
  246. package/assets/plugin/tools/get-basis.d.ts +0 -7
  247. package/assets/plugin/tools/get-basis.js +0 -7
  248. package/assets/plugin/tools/get-bracket-config.d.ts +0 -11
  249. package/assets/plugin/tools/get-bracket-config.js +0 -24
  250. package/assets/plugin/tools/get-cascade-risk.d.ts +0 -7
  251. package/assets/plugin/tools/get-cascade-risk.js +0 -8
  252. package/assets/plugin/tools/get-crypto-metrics.d.ts +0 -18
  253. package/assets/plugin/tools/get-crypto-metrics.js +0 -62
  254. package/assets/plugin/tools/get-cvd.d.ts +0 -6
  255. package/assets/plugin/tools/get-cvd.js +0 -6
  256. package/assets/plugin/tools/get-divergences.d.ts +0 -6
  257. package/assets/plugin/tools/get-divergences.js +0 -6
  258. package/assets/plugin/tools/get-funding-context.d.ts +0 -6
  259. package/assets/plugin/tools/get-funding-context.js +0 -16
  260. package/assets/plugin/tools/get-liquidation-levels.d.ts +0 -7
  261. package/assets/plugin/tools/get-liquidation-levels.js +0 -7
  262. package/assets/plugin/tools/get-liquidation-pulse.d.ts +0 -9
  263. package/assets/plugin/tools/get-liquidation-pulse.js +0 -22
  264. package/assets/plugin/tools/get-market-breadth.d.ts +0 -6
  265. package/assets/plugin/tools/get-market-breadth.js +0 -8
  266. package/assets/plugin/tools/get-market-intel.d.ts +0 -19
  267. package/assets/plugin/tools/get-market-intel.js +0 -116
  268. package/assets/plugin/tools/get-market-structure.d.ts +0 -47
  269. package/assets/plugin/tools/get-market-structure.js +0 -198
  270. package/assets/plugin/tools/get-my-mined-patterns.d.ts +0 -20
  271. package/assets/plugin/tools/get-my-mined-patterns.js +0 -61
  272. package/assets/plugin/tools/get-my-proposed-learnings.d.ts +0 -20
  273. package/assets/plugin/tools/get-my-proposed-learnings.js +0 -55
  274. package/assets/plugin/tools/get-my-recent-reviews.d.ts +0 -22
  275. package/assets/plugin/tools/get-my-recent-reviews.js +0 -66
  276. package/assets/plugin/tools/get-orderbook.d.ts +0 -21
  277. package/assets/plugin/tools/get-orderbook.js +0 -32
  278. package/assets/plugin/tools/get-pattern-scan.d.ts +0 -7
  279. package/assets/plugin/tools/get-pattern-scan.js +0 -8
  280. package/assets/plugin/tools/get-regime.d.ts +0 -6
  281. package/assets/plugin/tools/get-regime.js +0 -7
  282. package/assets/plugin/tools/get-relevant-learnings.d.ts +0 -21
  283. package/assets/plugin/tools/get-relevant-learnings.js +0 -65
  284. package/assets/plugin/tools/get-resting-liquidity.d.ts +0 -6
  285. package/assets/plugin/tools/get-resting-liquidity.js +0 -11
  286. package/assets/plugin/tools/get-risk-scenario.d.ts +0 -29
  287. package/assets/plugin/tools/get-risk-scenario.js +0 -47
  288. package/assets/plugin/tools/get-risk-summary.d.ts +0 -51
  289. package/assets/plugin/tools/get-risk-summary.js +0 -118
  290. package/assets/plugin/tools/get-sentiment.d.ts +0 -4
  291. package/assets/plugin/tools/get-sentiment.js +0 -6
  292. package/assets/plugin/tools/get-session-review.d.ts +0 -7
  293. package/assets/plugin/tools/get-session-review.js +0 -8
  294. package/assets/plugin/tools/get-setup-detail.d.ts +0 -7
  295. package/assets/plugin/tools/get-setup-detail.js +0 -322
  296. package/assets/plugin/tools/get-signals.d.ts +0 -15
  297. package/assets/plugin/tools/get-signals.js +0 -54
  298. package/assets/plugin/tools/get-sizing.d.ts +0 -6
  299. package/assets/plugin/tools/get-sizing.js +0 -6
  300. package/assets/plugin/tools/get-trade-feedback.d.ts +0 -7
  301. package/assets/plugin/tools/get-trade-feedback.js +0 -8
  302. package/assets/plugin/tools/get-trade-flow.d.ts +0 -7
  303. package/assets/plugin/tools/get-trade-flow.js +0 -7
  304. package/assets/plugin/tools/get-volume-analysis.d.ts +0 -21
  305. package/assets/plugin/tools/get-volume-analysis.js +0 -74
  306. package/assets/plugin/tools/get-volume-profile.d.ts +0 -7
  307. package/assets/plugin/tools/get-volume-profile.js +0 -7
  308. package/assets/plugin/tools/get-wave9-status.d.ts +0 -127
  309. package/assets/plugin/tools/get-wave9-status.js +0 -796
  310. package/assets/plugin/tools/helpers.d.ts +0 -26
  311. package/assets/plugin/tools/helpers.js +0 -39
  312. package/assets/plugin/tools/intel-api.d.ts +0 -34
  313. package/assets/plugin/tools/intel-api.js +0 -119
  314. package/assets/plugin/tools/intel-cache.d.ts +0 -25
  315. package/assets/plugin/tools/intel-cache.js +0 -148
  316. package/assets/plugin/tools/list-strategies.d.ts +0 -17
  317. package/assets/plugin/tools/list-strategies.js +0 -23
  318. package/assets/plugin/tools/modify-stop.d.ts +0 -21
  319. package/assets/plugin/tools/modify-stop.js +0 -120
  320. package/assets/plugin/tools/modify-target.d.ts +0 -21
  321. package/assets/plugin/tools/modify-target.js +0 -110
  322. package/assets/plugin/tools/propose-learning.d.ts +0 -22
  323. package/assets/plugin/tools/propose-learning.js +0 -65
  324. package/assets/plugin/tools/query-review-outcomes.d.ts +0 -30
  325. package/assets/plugin/tools/query-review-outcomes.js +0 -64
  326. package/assets/plugin/tools/query-trades.d.ts +0 -21
  327. package/assets/plugin/tools/query-trades.js +0 -37
  328. package/assets/plugin/tools/record-position-reviews.d.ts +0 -38
  329. package/assets/plugin/tools/record-position-reviews.js +0 -147
  330. package/assets/plugin/tools/save-strategy.d.ts +0 -16
  331. package/assets/plugin/tools/save-strategy.js +0 -46
  332. package/assets/plugin/tools/scan-pairs.d.ts +0 -22
  333. package/assets/plugin/tools/scan-pairs.js +0 -234
  334. package/assets/plugin/tools/score-setup.d.ts +0 -31
  335. package/assets/plugin/tools/score-setup.js +0 -268
  336. package/assets/plugin/tools/set-bracket-requirement.d.ts +0 -18
  337. package/assets/plugin/tools/set-bracket-requirement.js +0 -81
  338. package/assets/plugin/tools/set-exchange-credentials.d.ts +0 -25
  339. package/assets/plugin/tools/set-exchange-credentials.js +0 -80
  340. package/assets/plugin/tools/set-trading-mode.d.ts +0 -26
  341. package/assets/plugin/tools/set-trading-mode.js +0 -135
  342. package/assets/plugin/tools/test-exchange-credentials.d.ts +0 -16
  343. package/assets/plugin/tools/test-exchange-credentials.js +0 -100
  344. package/assets/plugin/tools/toggle-strategy.d.ts +0 -8
  345. package/assets/plugin/tools/toggle-strategy.js +0 -15
  346. package/assets/plugin/trading-params-cache.d.ts +0 -26
  347. package/assets/plugin/trading-params-cache.js +0 -52
  348. package/assets/plugin/types.d.ts +0 -134
  349. package/assets/plugin/types.js +0 -7
  350. package/assets/plugin/util/plugin-paths.d.ts +0 -3
  351. package/assets/plugin/util/plugin-paths.js +0 -15
  352. package/assets/plugin/venues/hyperliquid/hl-balance.d.ts +0 -116
  353. package/assets/plugin/venues/hyperliquid/hl-balance.js +0 -145
  354. package/assets/plugin/venues/hyperliquid/hl-bracket-coordinator.d.ts +0 -123
  355. package/assets/plugin/venues/hyperliquid/hl-bracket-coordinator.js +0 -533
  356. package/assets/plugin/venues/hyperliquid/hl-brackets.d.ts +0 -102
  357. package/assets/plugin/venues/hyperliquid/hl-brackets.js +0 -172
  358. package/assets/plugin/venues/hyperliquid/hl-cloid.d.ts +0 -22
  359. package/assets/plugin/venues/hyperliquid/hl-cloid.js +0 -82
  360. package/assets/plugin/venues/hyperliquid/hl-info-cache.d.ts +0 -46
  361. package/assets/plugin/venues/hyperliquid/hl-info-cache.js +0 -125
  362. package/assets/plugin/venues/hyperliquid/hl-live-adapter.d.ts +0 -146
  363. package/assets/plugin/venues/hyperliquid/hl-live-adapter.js +0 -728
  364. package/assets/plugin/venues/hyperliquid/hl-precision.d.ts +0 -61
  365. package/assets/plugin/venues/hyperliquid/hl-precision.js +0 -176
  366. package/assets/plugin/venues/hyperliquid/hl-private.d.ts +0 -88
  367. package/assets/plugin/venues/hyperliquid/hl-private.js +0 -357
  368. package/assets/plugin/venues/hyperliquid/hl-public.d.ts +0 -79
  369. package/assets/plugin/venues/hyperliquid/hl-public.js +0 -436
  370. package/assets/plugin/venues/hyperliquid/hl-rate-gate.d.ts +0 -57
  371. package/assets/plugin/venues/hyperliquid/hl-rate-gate.js +0 -220
  372. package/assets/plugin/venues/hyperliquid/hl-user-stream.d.ts +0 -90
  373. package/assets/plugin/venues/hyperliquid/hl-user-stream.js +0 -220
  374. package/assets/plugin/venues/registry.d.ts +0 -38
  375. package/assets/plugin/venues/registry.js +0 -46
  376. package/assets/plugin/venues/symbols.d.ts +0 -43
  377. package/assets/plugin/venues/symbols.js +0 -107
  378. package/assets/plugin/wave9/live-account-capture.d.ts +0 -67
  379. package/assets/plugin/wave9/live-account-capture.js +0 -435
  380. package/assets/plugin/wave9/live-autonomous-protection.d.ts +0 -39
  381. package/assets/plugin/wave9/live-autonomous-protection.js +0 -112
  382. package/assets/plugin/wave9/live-durable-reconciliation-scheduler.d.ts +0 -33
  383. package/assets/plugin/wave9/live-durable-reconciliation-scheduler.js +0 -115
  384. package/assets/plugin/wave9/live-execution-ledger.d.ts +0 -107
  385. package/assets/plugin/wave9/live-execution-ledger.js +0 -498
  386. package/assets/plugin/wave9/live-position-confirmation.d.ts +0 -18
  387. package/assets/plugin/wave9/live-position-confirmation.js +0 -111
  388. package/assets/plugin/wave9/live-residual-protection.d.ts +0 -18
  389. package/assets/plugin/wave9/live-residual-protection.js +0 -250
  390. package/assets/plugin/wave9/live-startup-reconciliation.d.ts +0 -38
  391. package/assets/plugin/wave9/live-startup-reconciliation.js +0 -454
  392. package/assets/plugin/wave9/live-symbol-ownership.d.ts +0 -20
  393. package/assets/plugin/wave9/live-symbol-ownership.js +0 -132
  394. package/assets/plugin/wave9/paper-admission-guard.d.ts +0 -199
  395. package/assets/plugin/wave9/paper-admission-guard.js +0 -650
  396. package/assets/plugin/wave9/usdm-evidence-provider.d.ts +0 -42
  397. package/assets/plugin/wave9/usdm-evidence-provider.js +0 -133
@@ -1,357 +0,0 @@
1
- // Hyperliquid signed-action client — the HL mirror of `ccxt/binance-private.ts`.
2
- //
3
- // CONTRACTS THIS FILE INHERITS FROM THE BINANCE SIDE (non-negotiable — the shared
4
- // adapter-contract suite runs against both):
5
- // ★ null ≠ empty. EVERY read returns `null` on a FAILED fetch, never `[]`.
6
- // `[]` means "the exchange said: nothing". Callers make destructive decisions
7
- // (cancel a bracket, close a position, trust a snapshot) on that difference.
8
- // ★ Reads are pre-gated (`assertNotLimited`), order/cancel paths are NOT (an
9
- // exit must never be blocked by our own pacer) but every path arms the gate
10
- // via `noteError`.
11
- //
12
- // HYPERLIQUID-SPECIFIC LANDMINES (all verified live on testnet 2026-07-12):
13
- // ★ ccxt AUTO-MONETIZES an authed HL client — `initializeClient()` enrolls
14
- // CCXT's own builder fee (1bp/order) + referral code on the first signed call.
15
- // `options.{builderFee:false, refSet:true}` disables both. A test pins this.
16
- // ★ Market orders REQUIRE a reference price (ccxt derives the slippage cap from
17
- // it) — `createOrder(sym,'market',side,size)` with no price THROWS client-side.
18
- // There is no native market order on HL: it is an IOC limit at a bounded price.
19
- // ★ Signed actions carry a NONCE (epoch ms) and HL keeps only the 100 highest
20
- // per signer. Two actions signed in the same millisecond can collide → every
21
- // signed action goes through a monotonic-nonce MUTEX (one in-flight at a time,
22
- // strictly increasing ms). This is why `submitOrders` batches a bracket pair
23
- // into ONE action rather than firing two.
24
- // ★ Agent (API) wallets can only TRADE. `usdClassTransfer`/withdraw are
25
- // user-signed actions and fail with "Must deposit before performing actions"
26
- // when signed by an agent. We never call them.
27
- import { createRequire } from 'node:module';
28
- import { logger } from '../../logger.js';
29
- import { toCcxtSymbol } from '../symbols.js';
30
- import { assertNotLimited, noteError, noteSuccess, exchangeIpWeight, updateAddressBudget, } from './hl-rate-gate.js';
31
- import { isValidHlCloid } from './hl-cloid.js';
32
- // ccxt via CJS require — OpenClaw's ESM loader yields the wrong module shape
33
- // (same rationale as binance-private.ts / hl-public.ts).
34
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
- let ccxtCjs;
36
- try {
37
- const _require = createRequire(import.meta.url);
38
- ccxtCjs = _require('ccxt');
39
- }
40
- catch {
41
- // eslint-disable-next-line @typescript-eslint/no-require-imports
42
- ccxtCjs = require('ccxt');
43
- }
44
- const TAG = 'hl-private';
45
- /** The CCXT options that MUST be present on every authed HL client. Exported so
46
- * `hl-private.test.ts` can assert them — if a future ccxt bump changes the
47
- * option names, the test fails rather than the users paying a silent 1bp. */
48
- export const HL_REQUIRED_OPTIONS = {
49
- builderFee: false,
50
- refSet: true,
51
- };
52
- /**
53
- * Serializes every signed action behind a monotonic nonce.
54
- *
55
- * HL keeps the 100 highest nonces per signer and rejects repeats; two actions
56
- * signed inside the same millisecond can therefore collide and one is silently
57
- * lost. Rather than hand-rolling nonces (ccxt owns that), we guarantee that no
58
- * two signed actions are ever *issued* in the same millisecond from this process:
59
- * each waits for the previous to settle AND for the clock to advance.
60
- */
61
- class NonceMutex {
62
- chain = Promise.resolve();
63
- lastIssuedMs = 0;
64
- run(fn) {
65
- const next = this.chain.then(async () => {
66
- const now = Date.now();
67
- if (now <= this.lastIssuedMs) {
68
- // Same-ms collision guard: wait out the millisecond.
69
- await new Promise((r) => setTimeout(r, this.lastIssuedMs - now + 1));
70
- }
71
- this.lastIssuedMs = Date.now();
72
- return fn();
73
- });
74
- // Keep the chain alive even when a link rejects (otherwise one failed action
75
- // would poison every later one).
76
- this.chain = next.then(() => undefined, () => undefined);
77
- return next;
78
- }
79
- }
80
- export class HyperliquidPrivateApi {
81
- creds;
82
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
83
- exchange;
84
- mutex = new NonceMutex();
85
- marketsLoaded = false;
86
- constructor(creds) {
87
- this.creds = creds;
88
- if (!creds.walletAddress || !creds.agentPrivateKey) {
89
- throw new Error('HyperliquidPrivateApi requires walletAddress + agentPrivateKey');
90
- }
91
- this.exchange = new ccxtCjs.hyperliquid({
92
- walletAddress: creds.walletAddress,
93
- privateKey: creds.agentPrivateKey,
94
- options: { ...HL_REQUIRED_OPTIONS },
95
- enableRateLimit: true,
96
- });
97
- if (creds.testnet) {
98
- this.exchange.setSandboxMode(true);
99
- const url = JSON.stringify(this.exchange.urls?.api ?? '');
100
- if (!url.includes('testnet')) {
101
- throw new Error(`HL testnet requested but sandbox URL is not testnet: ${url.slice(0, 80)}`);
102
- }
103
- }
104
- logger.info(TAG, `Hyperliquid private API initialized (${creds.testnet ? 'TESTNET' : 'MAINNET'}, master ${creds.walletAddress.slice(0, 8)}…)`);
105
- }
106
- /** Exposed for the options-pin test + diagnostics. */
107
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
108
- getExchange() {
109
- return this.exchange;
110
- }
111
- async loadMarkets() {
112
- try {
113
- assertNotLimited('meta');
114
- await this.exchange.loadMarkets();
115
- noteSuccess('meta');
116
- this.marketsLoaded = true;
117
- return true;
118
- }
119
- catch (err) {
120
- noteError(err, 'loadMarkets');
121
- logger.error(TAG, `loadMarkets failed: ${msg(err)}`);
122
- return false;
123
- }
124
- }
125
- // ---- Reads (null on failure — NEVER []) ----
126
- /** Positions for the MASTER account. `null` = fetch failed (state unknown);
127
- * `[]` = the exchange confirmed flat. */
128
- async fetchPositions(symbol) {
129
- try {
130
- assertNotLimited('clearinghouseState');
131
- const symbols = symbol ? [toCcxtSymbol('hyperliquid', symbol)] : undefined;
132
- const raw = await this.exchange.fetchPositions(symbols);
133
- noteSuccess('clearinghouseState');
134
- if (!Array.isArray(raw))
135
- return null;
136
- return raw.filter((p) => Math.abs(Number(p.contracts ?? 0)) > 0);
137
- }
138
- catch (err) {
139
- noteError(err, 'fetchPositions');
140
- logger.error(TAG, `fetchPositions failed: ${msg(err)}`);
141
- return null;
142
- }
143
- }
144
- /** Open orders INCLUDING trigger/TPSL legs. CCXT's HL `fetchOpenOrders`
145
- * defaults to `frontendOpenOrders`, which is the only endpoint that returns
146
- * trigger orders (plan §3.6) — the analog of Binance's merged algo endpoints. */
147
- async fetchOpenOrders(symbol) {
148
- try {
149
- assertNotLimited('frontendOpenOrders');
150
- const s = symbol ? toCcxtSymbol('hyperliquid', symbol) : undefined;
151
- const raw = await this.exchange.fetchOpenOrders(s);
152
- noteSuccess('frontendOpenOrders');
153
- return Array.isArray(raw) ? raw : null;
154
- }
155
- catch (err) {
156
- noteError(err, 'fetchOpenOrders');
157
- logger.error(TAG, `fetchOpenOrders failed: ${msg(err)}`);
158
- return null;
159
- }
160
- }
161
- async fetchBalance() {
162
- try {
163
- assertNotLimited('clearinghouseState');
164
- const raw = await this.exchange.fetchBalance();
165
- noteSuccess('clearinghouseState');
166
- return raw ?? null;
167
- }
168
- catch (err) {
169
- noteError(err, 'fetchBalance');
170
- logger.error(TAG, `fetchBalance failed: ${msg(err)}`);
171
- return null;
172
- }
173
- }
174
- /** Per-order status — the liveness resolver's REST tier (Tier 2 of the
175
- * 3-tier rule). Weight 2. `null` = lookup FAILED (unknown), which callers
176
- * must treat as "do not act", NOT as "gone". */
177
- async fetchOrder(orderId, symbol) {
178
- try {
179
- assertNotLimited('orderStatus');
180
- const s = symbol ? toCcxtSymbol('hyperliquid', symbol) : undefined;
181
- const raw = await this.exchange.fetchOrder(orderId, s);
182
- noteSuccess('orderStatus');
183
- return raw ?? null;
184
- }
185
- catch (err) {
186
- noteError(err, 'fetchOrder');
187
- logger.warn(TAG, `fetchOrder(${orderId}) failed: ${msg(err)}`);
188
- return null;
189
- }
190
- }
191
- /** Own fills. WS is the authoritative ingress (plan + the audit-trail rule);
192
- * this is the gap-fill/truth-check path. NOTE: only the 10,000 most recent
193
- * fills exist server-side — deep history is NOT queryable on HL, which is why
194
- * the `trades` table must be WS-first. */
195
- async fetchMyTrades(symbol, since, limit = 100) {
196
- try {
197
- assertNotLimited('userFills');
198
- const s = symbol ? toCcxtSymbol('hyperliquid', symbol) : undefined;
199
- const raw = await this.exchange.fetchMyTrades(s, since, limit);
200
- noteSuccess('userFills');
201
- return Array.isArray(raw) ? raw : null;
202
- }
203
- catch (err) {
204
- noteError(err, 'fetchMyTrades');
205
- logger.error(TAG, `fetchMyTrades failed: ${msg(err)}`);
206
- return null;
207
- }
208
- }
209
- /** Refresh the ADDRESS action budget (the starvation guard). Weight 20 — call
210
- * every ~5 min, never per-heartbeat. */
211
- async refreshAddressBudget() {
212
- try {
213
- assertNotLimited('userRateLimit');
214
- const res = await this.rawInfo({ type: 'userRateLimit', user: this.creds.walletAddress });
215
- noteSuccess('userRateLimit');
216
- const used = Number(res?.nRequestsUsed);
217
- const cap = Number(res?.nRequestsCap);
218
- if (Number.isFinite(used) && Number.isFinite(cap)) {
219
- updateAddressBudget({ nRequestsUsed: used, nRequestsCap: cap });
220
- }
221
- }
222
- catch (err) {
223
- noteError(err, 'userRateLimit');
224
- logger.warn(TAG, `refreshAddressBudget failed: ${msg(err)}`);
225
- }
226
- }
227
- /** Raw `POST /info` — for the handful of reads CCXT doesn't expose
228
- * (userRateLimit, userNonFundingLedgerUpdates, portfolio). Never used for
229
- * signed actions. */
230
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
231
- async rawInfo(body) {
232
- const base = this.creds.testnet
233
- ? 'https://api.hyperliquid-testnet.xyz'
234
- : 'https://api.hyperliquid.xyz';
235
- const res = await fetch(`${base}/info`, {
236
- method: 'POST',
237
- headers: { 'content-type': 'application/json' },
238
- body: JSON.stringify(body),
239
- signal: AbortSignal.timeout(15_000),
240
- });
241
- if (!res.ok)
242
- throw new Error(`POST /info ${String(body.type)} → ${res.status}`);
243
- return res.json();
244
- }
245
- // ---- Signed actions (NEVER pre-gated; always nonce-serialized) ----
246
- /** Submit one order. Market orders are IOC-limit emulated — `price` is
247
- * MANDATORY (ccxt throws without it) and the caller must already have applied
248
- * the slippage bound + HL rounding (hl-precision). */
249
- async submitOrder(req) {
250
- if (req.cloid && !isValidHlCloid(req.cloid)) {
251
- throw new Error(`Invalid HL cloid ${req.cloid} — must be 0x + 32 hex chars`);
252
- }
253
- return this.mutex.run(async () => {
254
- try {
255
- const params = this.buildParams(req);
256
- const order = await this.exchange.createOrder(toCcxtSymbol('hyperliquid', req.symbol), req.type === 'market' ? 'market' : 'limit', req.side, req.amount, req.price, // ★ always passed — ccxt needs it even for 'market'
257
- params);
258
- noteSuccess('exchange', { ipWeight: exchangeIpWeight(1), addressActions: 1 });
259
- return order ?? null;
260
- }
261
- catch (err) {
262
- noteError(err, 'submitOrder');
263
- // Order paths RETHROW (the caller must see a rejection) — unlike reads,
264
- // which collapse to null.
265
- throw err;
266
- }
267
- });
268
- }
269
- /** Submit N orders as ONE signed action (one nonce, one `/exchange` call).
270
- * This is how a bracket pair (SL+TP) is placed: atomic-ish, and it costs 1 IP
271
- * weight unit but N address actions. */
272
- async submitOrders(reqs) {
273
- if (reqs.length === 0)
274
- return [];
275
- for (const r of reqs) {
276
- if (r.cloid && !isValidHlCloid(r.cloid)) {
277
- throw new Error(`Invalid HL cloid ${r.cloid} — must be 0x + 32 hex chars`);
278
- }
279
- }
280
- return this.mutex.run(async () => {
281
- try {
282
- const ccxtReqs = reqs.map((r) => ({
283
- symbol: toCcxtSymbol('hyperliquid', r.symbol),
284
- type: r.type === 'market' ? 'market' : 'limit',
285
- side: r.side,
286
- amount: r.amount,
287
- price: r.price,
288
- params: this.buildParams(r),
289
- }));
290
- const orders = await this.exchange.createOrders(ccxtReqs);
291
- noteSuccess('exchange', {
292
- ipWeight: exchangeIpWeight(reqs.length),
293
- addressActions: reqs.length, // ★ batches cost n against the ADDRESS budget
294
- });
295
- return Array.isArray(orders) ? orders : null;
296
- }
297
- catch (err) {
298
- noteError(err, 'submitOrders');
299
- throw err;
300
- }
301
- });
302
- }
303
- async cancelOrder(orderId, symbol) {
304
- return this.mutex.run(async () => {
305
- try {
306
- const res = await this.exchange.cancelOrder(orderId, toCcxtSymbol('hyperliquid', symbol));
307
- noteSuccess('exchange', { ipWeight: exchangeIpWeight(1), addressActions: 1 });
308
- return res ?? null;
309
- }
310
- catch (err) {
311
- noteError(err, 'cancelOrder');
312
- throw err;
313
- }
314
- });
315
- }
316
- /** Cancel by cloid — the bracket path's cancel (we always know our own cloid,
317
- * and it survives a restart because it is derived, not stored). */
318
- async cancelOrderByCloid(cloid, symbol) {
319
- return this.mutex.run(async () => {
320
- try {
321
- const res = await this.exchange.cancelOrder(cloid, toCcxtSymbol('hyperliquid', symbol), { clientOrderId: cloid });
322
- noteSuccess('exchange', { ipWeight: exchangeIpWeight(1), addressActions: 1 });
323
- return res ?? null;
324
- }
325
- catch (err) {
326
- noteError(err, 'cancelOrderByCloid');
327
- throw err;
328
- }
329
- });
330
- }
331
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
332
- buildParams(req) {
333
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
334
- const params = {};
335
- if (req.reduceOnly)
336
- params.reduceOnly = true;
337
- if (req.postOnly)
338
- params.postOnly = true; // → ALO
339
- if (req.cloid)
340
- params.clientOrderId = req.cloid;
341
- if (req.trigger) {
342
- // HL trigger orders fire on MARK price only (no workingType choice).
343
- params.triggerPrice = req.trigger.triggerPrice;
344
- if (req.trigger.tpsl === 'tp')
345
- params.takeProfitPrice = req.trigger.triggerPrice;
346
- else
347
- params.stopLossPrice = req.trigger.triggerPrice;
348
- }
349
- return params;
350
- }
351
- get isMarketsLoaded() {
352
- return this.marketsLoaded;
353
- }
354
- }
355
- function msg(err) {
356
- return err instanceof Error ? err.message : String(err);
357
- }
@@ -1,79 +0,0 @@
1
- import type { CcxtTicker, CcxtOHLCV } from '../../types.js';
2
- import type { OrderBookDepth } from '../../simulator/types.js';
3
- import type { PublicMarketDataApi } from '../../ccxt/public-market-data-api.js';
4
- export interface HyperliquidPublicApiOptions {
5
- testnet?: boolean;
6
- /** Test seam — injected ccxt exchange instance. */
7
- exchange?: any;
8
- fetchImpl?: typeof fetch;
9
- }
10
- export declare class HyperliquidPublicApi implements PublicMarketDataApi {
11
- private exchange;
12
- private readonly testnet;
13
- private readonly fetchImpl;
14
- private readonly tickerTtlMs;
15
- /** One upstream fetchTickers call serves every symbol within the TTL. */
16
- private tickersCache;
17
- private tickersInflight;
18
- /** Coin → mid from one weight-2 allMids call (fetchTicker's price source). */
19
- private midsCache;
20
- private midsInflight;
21
- constructor(opts?: HyperliquidPublicApiOptions);
22
- private baseUrl;
23
- /** Canonical/ccxt symbol → this venue's ccxt symbol, or null (logged) when
24
- * the symbol isn't a Hyperliquid USDC perp — a caller bug we surface
25
- * loudly rather than silently translating quote assets. */
26
- private venueSymbol;
27
- /** Fetch-all-tickers with a short TTL + inflight dedup. Returns a map keyed
28
- * by ccxt symbol, or null on failure. */
29
- private getTickers;
30
- /** Coin → mid price from one weight-2 `allMids` call (TTL-cached, inflight-
31
- * deduped; docs: hyperliquid.gitbook.io → Info endpoint → "Retrieve mids
32
- * for all coins"). Null on ANY failure — callers fall back to the full
33
- * snapshot path. Spot entries (`@<idx>` keys) parse fine and are simply
34
- * never looked up (we key by perp coin name). */
35
- private getMids;
36
- /** Fire-and-forget full-snapshot refresh once it ages past
37
- * FULL_SNAPSHOT_REFRESH_MS — fetchTicker must never block on the heavy
38
- * fetchTickers call when a fresh mid is available. getTickers' own
39
- * inflight dedup + error handling make this safe to kick repeatedly. */
40
- private maybeRefreshSnapshot;
41
- fetchTickerRaw(symbol: string): Promise<Record<string, any> | null>;
42
- /** Price from the weight-2 allMids fast path; volume/change context from
43
- * the last full snapshot (background-refreshed). Hyperliquid's asset
44
- * contexts carry mark/mid rather than a trade-tape bid/ask; absent fields
45
- * fall back to `last` with zero modeled spread — the paper fill engine
46
- * models slippage itself (same convention as IntelPublicApi). Falls back
47
- * to the original blocking full-snapshot path when allMids fails. */
48
- fetchTicker(symbol: string): Promise<CcxtTicker | null>;
49
- fetchFundingRate(symbol: string): Promise<Record<string, any> | null>;
50
- fetchOpenInterest(symbol: string): Promise<Record<string, any> | null>;
51
- /** l2Book — Hyperliquid serves at most 20 levels/side (plan §3.6). */
52
- fetchOrderBook(symbol: string, limit?: number): Promise<OrderBookDepth | null>;
53
- /** candleSnapshot — only the most recent 5000 candles exist per (coin,
54
- * interval) (plan §3.6); requests inside that window behave like Binance. */
55
- fetchOHLCV(symbol: string, timeframe?: string, limit?: number): Promise<CcxtOHLCV[] | null>;
56
- /** Probe Hyperliquid reachability from this host — the readiness gate's
57
- * venue signal, mirroring BinancePublicApi.probeReachability's outcome
58
- * shape. Hand-rolled POST /info `exchangeStatus` (weight 2) so the probe
59
- * has zero ccxt-method-shape dependence; the response's `time` field
60
- * (verified live 2026-07-11: `{"specialStatuses":null,"time":…}`) doubles
61
- * as the clock-drift source. Geo classification is best-effort — HL's
62
- * API-level geo behavior is UNVERIFIED (plan §3.9); a 403/451 maps to
63
- * geo_blocked, anything else non-2xx/network maps to unreachable. */
64
- probeReachability(): Promise<{
65
- outcome: 'reachable' | 'geo_blocked' | 'unreachable' | 'unknown';
66
- driftMs: number | null;
67
- }>;
68
- /** `meta` — the asset universe (szDecimals, maxLeverage, positional assetIndex).
69
- * Keyless info read, weight 20. Feeds HyperliquidInfoCache. Returns null on any
70
- * failure (never a partial universe — a half-loaded rules table would silently
71
- * reject orders). */
72
- fetchMeta(): Promise<any | null>;
73
- /** ★ MARK price — the price HL trigger orders fire on (there is no workingType
74
- * choice on this venue). Stop-distance validation and every trigger MUST use
75
- * this, never `last`: the mark is a CEX-composite median that can diverge from
76
- * HL's own last trade. Sourced from `metaAndAssetCtxs` (one weight-20 call
77
- * covers every asset). Returns null on failure — never a stale guess. */
78
- fetchMarkPrice(symbol: string): Promise<number | null>;
79
- }