@nktkas/hyperliquid 0.13.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +334 -107
  3. package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +9 -0
  4. package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +1 -0
  5. package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.js +2 -0
  6. package/esm/deps/jsr.io/@std/bytes/{1.0.4 → 1.0.5}/concat.d.ts +3 -1
  7. package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +1 -0
  8. package/esm/deps/jsr.io/@std/bytes/{1.0.4 → 1.0.5}/concat.js +1 -1
  9. package/esm/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts +9 -0
  10. package/esm/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts.map +1 -0
  11. package/esm/deps/jsr.io/@std/encoding/1.0.7/_types.js +2 -0
  12. package/esm/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.d.ts.map +1 -1
  13. package/esm/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.js +1 -1
  14. package/{script/deps/jsr.io/@std/encoding/1.0.6 → esm/deps/jsr.io/@std/encoding/1.0.7}/hex.d.ts +3 -1
  15. package/esm/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts.map +1 -0
  16. package/esm/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/hex.js +1 -1
  17. package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +9 -0
  18. package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +1 -0
  19. package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.js +2 -0
  20. package/esm/deps/jsr.io/@std/msgpack/{1.0.2 → 1.0.3}/encode.d.ts +3 -1
  21. package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +1 -0
  22. package/esm/deps/jsr.io/@std/msgpack/{1.0.2 → 1.0.3}/encode.js +2 -2
  23. package/esm/mod.d.ts +4 -12
  24. package/esm/mod.d.ts.map +1 -1
  25. package/esm/mod.js +2 -2
  26. package/{script/src/transports → esm/src}/base.d.ts +10 -13
  27. package/esm/src/base.d.ts.map +1 -0
  28. package/esm/src/base.js +14 -0
  29. package/esm/src/clients/event.d.ts +59 -18
  30. package/esm/src/clients/event.d.ts.map +1 -1
  31. package/esm/src/clients/event.js +74 -18
  32. package/esm/src/clients/public.d.ts +348 -53
  33. package/esm/src/clients/public.d.ts.map +1 -1
  34. package/esm/src/clients/public.js +349 -50
  35. package/esm/src/clients/wallet.d.ts +345 -73
  36. package/esm/src/clients/wallet.d.ts.map +1 -1
  37. package/esm/src/clients/wallet.js +979 -229
  38. package/esm/src/signing.d.ts +135 -0
  39. package/esm/src/signing.d.ts.map +1 -0
  40. package/esm/src/signing.js +188 -0
  41. package/esm/src/transports/http/http_transport.d.ts +1 -1
  42. package/esm/src/transports/http/http_transport.d.ts.map +1 -1
  43. package/esm/src/transports/http/http_transport.js +1 -1
  44. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +64 -0
  45. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -0
  46. package/esm/src/transports/websocket/_hyperliquid_event_target.js +52 -0
  47. package/esm/src/transports/websocket/{reconnecting_websocket.d.ts → _reconnecting_websocket.d.ts} +26 -26
  48. package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -0
  49. package/esm/src/transports/websocket/{reconnecting_websocket.js → _reconnecting_websocket.js} +91 -76
  50. package/{script/src/transports/websocket/websocket_request_dispatcher.d.ts → esm/src/transports/websocket/_websocket_request_dispatcher.d.ts} +3 -7
  51. package/esm/src/transports/websocket/_websocket_request_dispatcher.d.ts.map +1 -0
  52. package/esm/src/transports/websocket/{websocket_request_dispatcher.js → _websocket_request_dispatcher.js} +6 -10
  53. package/esm/src/transports/websocket/websocket_transport.d.ts +15 -21
  54. package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  55. package/esm/src/transports/websocket/websocket_transport.js +55 -52
  56. package/esm/src/types/exchange/requests.d.ts +298 -79
  57. package/esm/src/types/exchange/requests.d.ts.map +1 -1
  58. package/esm/src/types/exchange/responses.d.ts +38 -38
  59. package/esm/src/types/exchange/responses.d.ts.map +1 -1
  60. package/esm/src/types/explorer/requests.d.ts +23 -10
  61. package/esm/src/types/explorer/requests.d.ts.map +1 -1
  62. package/esm/src/types/explorer/responses.d.ts +45 -3
  63. package/esm/src/types/explorer/responses.d.ts.map +1 -1
  64. package/esm/src/types/info/accounts.d.ts +279 -189
  65. package/esm/src/types/info/accounts.d.ts.map +1 -1
  66. package/esm/src/types/info/assets.d.ts +191 -185
  67. package/esm/src/types/info/assets.d.ts.map +1 -1
  68. package/esm/src/types/info/delegations.d.ts +117 -0
  69. package/esm/src/types/info/delegations.d.ts.map +1 -0
  70. package/esm/src/types/info/orders.d.ts +94 -94
  71. package/esm/src/types/info/orders.d.ts.map +1 -1
  72. package/esm/src/types/info/requests.d.ts +192 -64
  73. package/esm/src/types/info/requests.d.ts.map +1 -1
  74. package/esm/src/types/info/vaults.d.ts +42 -85
  75. package/esm/src/types/info/vaults.d.ts.map +1 -1
  76. package/esm/src/types/mod.d.ts +14 -0
  77. package/esm/src/types/mod.d.ts.map +1 -0
  78. package/esm/src/types/subscriptions/requests.d.ts +11 -1
  79. package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
  80. package/{script/src/types/subscriptions/common.d.ts → esm/src/types/subscriptions/responses.d.ts} +18 -3
  81. package/esm/src/types/subscriptions/responses.d.ts.map +1 -0
  82. package/package.json +20 -4
  83. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +13 -3
  84. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +23 -13
  85. package/script/deps/jsr.io/@noble/hashes/1.7.1/src/_assert.js +55 -45
  86. package/script/deps/jsr.io/@noble/hashes/1.7.1/src/_u64.js +97 -87
  87. package/script/deps/jsr.io/@noble/hashes/1.7.1/src/crypto.js +14 -4
  88. package/script/deps/jsr.io/@noble/hashes/1.7.1/src/sha3.js +288 -278
  89. package/script/deps/jsr.io/@noble/hashes/1.7.1/src/utils.js +238 -228
  90. package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +9 -0
  91. package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +1 -0
  92. package/script/deps/jsr.io/@std/bytes/1.0.5/_types.js +13 -0
  93. package/script/deps/jsr.io/@std/bytes/{1.0.4 → 1.0.5}/concat.d.ts +3 -1
  94. package/script/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +1 -0
  95. package/script/deps/jsr.io/@std/bytes/1.0.5/concat.js +45 -0
  96. package/script/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts +9 -0
  97. package/script/deps/jsr.io/@std/encoding/1.0.7/_types.d.ts.map +1 -0
  98. package/script/deps/jsr.io/@std/encoding/1.0.7/_types.js +13 -0
  99. package/script/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.d.ts.map +1 -1
  100. package/script/deps/jsr.io/@std/encoding/1.0.7/_validate_binary_like.js +39 -0
  101. package/{esm/deps/jsr.io/@std/encoding/1.0.6 → script/deps/jsr.io/@std/encoding/1.0.7}/hex.d.ts +3 -1
  102. package/script/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts.map +1 -0
  103. package/script/deps/jsr.io/@std/encoding/1.0.7/hex.js +123 -0
  104. package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +9 -0
  105. package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +1 -0
  106. package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.js +13 -0
  107. package/script/deps/jsr.io/@std/msgpack/{1.0.2 → 1.0.3}/encode.d.ts +3 -1
  108. package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +1 -0
  109. package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.js +250 -0
  110. package/script/mod.d.ts +4 -12
  111. package/script/mod.d.ts.map +1 -1
  112. package/script/mod.js +21 -13
  113. package/{esm/src/transports → script/src}/base.d.ts +10 -13
  114. package/script/src/base.d.ts.map +1 -0
  115. package/script/src/base.js +29 -0
  116. package/script/src/clients/event.d.ts +59 -18
  117. package/script/src/clients/event.d.ts.map +1 -1
  118. package/script/src/clients/event.js +551 -485
  119. package/script/src/clients/public.d.ts +348 -53
  120. package/script/src/clients/public.d.ts.map +1 -1
  121. package/script/src/clients/public.js +1017 -708
  122. package/script/src/clients/wallet.d.ts +345 -73
  123. package/script/src/clients/wallet.d.ts.map +1 -1
  124. package/script/src/clients/wallet.js +1737 -977
  125. package/script/src/signing.d.ts +135 -0
  126. package/script/src/signing.d.ts.map +1 -0
  127. package/script/src/signing.js +203 -0
  128. package/script/src/transports/http/http_transport.d.ts +1 -1
  129. package/script/src/transports/http/http_transport.d.ts.map +1 -1
  130. package/script/src/transports/http/http_transport.js +174 -164
  131. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +64 -0
  132. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -0
  133. package/script/src/transports/websocket/_hyperliquid_event_target.js +66 -0
  134. package/script/src/transports/websocket/{reconnecting_websocket.d.ts → _reconnecting_websocket.d.ts} +26 -26
  135. package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -0
  136. package/script/src/transports/websocket/_reconnecting_websocket.js +400 -0
  137. package/{esm/src/transports/websocket/websocket_request_dispatcher.d.ts → script/src/transports/websocket/_websocket_request_dispatcher.d.ts} +3 -7
  138. package/script/src/transports/websocket/_websocket_request_dispatcher.d.ts.map +1 -0
  139. package/script/src/transports/websocket/_websocket_request_dispatcher.js +212 -0
  140. package/script/src/transports/websocket/websocket_transport.d.ts +15 -21
  141. package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  142. package/script/src/transports/websocket/websocket_transport.js +235 -222
  143. package/script/src/types/exchange/requests.d.ts +298 -79
  144. package/script/src/types/exchange/requests.d.ts.map +1 -1
  145. package/script/src/types/exchange/requests.js +12 -2
  146. package/script/src/types/exchange/responses.d.ts +38 -38
  147. package/script/src/types/exchange/responses.d.ts.map +1 -1
  148. package/script/src/types/exchange/responses.js +12 -2
  149. package/script/src/types/explorer/requests.d.ts +23 -10
  150. package/script/src/types/explorer/requests.d.ts.map +1 -1
  151. package/script/src/types/explorer/requests.js +12 -2
  152. package/script/src/types/explorer/responses.d.ts +45 -3
  153. package/script/src/types/explorer/responses.d.ts.map +1 -1
  154. package/script/src/types/explorer/responses.js +12 -2
  155. package/script/src/types/info/accounts.d.ts +279 -189
  156. package/script/src/types/info/accounts.d.ts.map +1 -1
  157. package/script/src/types/info/accounts.js +12 -2
  158. package/script/src/types/info/assets.d.ts +191 -185
  159. package/script/src/types/info/assets.d.ts.map +1 -1
  160. package/script/src/types/info/assets.js +12 -2
  161. package/script/src/types/info/delegations.d.ts +117 -0
  162. package/script/src/types/info/delegations.d.ts.map +1 -0
  163. package/script/src/types/info/delegations.js +12 -0
  164. package/script/src/types/info/orders.d.ts +94 -94
  165. package/script/src/types/info/orders.d.ts.map +1 -1
  166. package/script/src/types/info/orders.js +12 -2
  167. package/script/src/types/info/requests.d.ts +192 -64
  168. package/script/src/types/info/requests.d.ts.map +1 -1
  169. package/script/src/types/info/requests.js +12 -2
  170. package/script/src/types/info/vaults.d.ts +42 -85
  171. package/script/src/types/info/vaults.d.ts.map +1 -1
  172. package/script/src/types/info/vaults.js +12 -2
  173. package/script/src/types/mod.d.ts +14 -0
  174. package/script/src/types/mod.d.ts.map +1 -0
  175. package/script/src/types/mod.js +12 -0
  176. package/script/src/types/subscriptions/requests.d.ts +11 -1
  177. package/script/src/types/subscriptions/requests.d.ts.map +1 -1
  178. package/script/src/types/subscriptions/requests.js +12 -2
  179. package/{esm/src/types/subscriptions/common.d.ts → script/src/types/subscriptions/responses.d.ts} +18 -3
  180. package/script/src/types/subscriptions/responses.d.ts.map +1 -0
  181. package/script/src/types/subscriptions/responses.js +12 -0
  182. package/esm/deps/jsr.io/@std/bytes/1.0.4/concat.d.ts.map +0 -1
  183. package/esm/deps/jsr.io/@std/encoding/1.0.6/hex.d.ts.map +0 -1
  184. package/esm/deps/jsr.io/@std/msgpack/1.0.2/encode.d.ts.map +0 -1
  185. package/esm/src/transports/base.d.ts.map +0 -1
  186. package/esm/src/transports/base.js +0 -14
  187. package/esm/src/transports/websocket/hyperliquid_event_target.d.ts +0 -66
  188. package/esm/src/transports/websocket/hyperliquid_event_target.d.ts.map +0 -1
  189. package/esm/src/transports/websocket/hyperliquid_event_target.js +0 -33
  190. package/esm/src/transports/websocket/reconnecting_websocket.d.ts.map +0 -1
  191. package/esm/src/transports/websocket/websocket_request_dispatcher.d.ts.map +0 -1
  192. package/esm/src/types/common.d.ts +0 -3
  193. package/esm/src/types/common.d.ts.map +0 -1
  194. package/esm/src/types/exchange/common.d.ts +0 -36
  195. package/esm/src/types/exchange/common.d.ts.map +0 -1
  196. package/esm/src/types/explorer/common.d.ts +0 -37
  197. package/esm/src/types/explorer/common.d.ts.map +0 -1
  198. package/esm/src/types/subscriptions/common.d.ts.map +0 -1
  199. package/esm/src/types/subscriptions/common.js +0 -1
  200. package/esm/src/utils/key_sort.d.ts +0 -21
  201. package/esm/src/utils/key_sort.d.ts.map +0 -1
  202. package/esm/src/utils/key_sort.js +0 -124
  203. package/esm/src/utils/signing.d.ts +0 -109
  204. package/esm/src/utils/signing.d.ts.map +0 -1
  205. package/esm/src/utils/signing.js +0 -164
  206. package/script/deps/jsr.io/@std/bytes/1.0.4/concat.d.ts.map +0 -1
  207. package/script/deps/jsr.io/@std/bytes/1.0.4/concat.js +0 -35
  208. package/script/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.js +0 -29
  209. package/script/deps/jsr.io/@std/encoding/1.0.6/hex.d.ts.map +0 -1
  210. package/script/deps/jsr.io/@std/encoding/1.0.6/hex.js +0 -113
  211. package/script/deps/jsr.io/@std/msgpack/1.0.2/encode.d.ts.map +0 -1
  212. package/script/deps/jsr.io/@std/msgpack/1.0.2/encode.js +0 -240
  213. package/script/src/transports/base.d.ts.map +0 -1
  214. package/script/src/transports/base.js +0 -18
  215. package/script/src/transports/websocket/hyperliquid_event_target.d.ts +0 -66
  216. package/script/src/transports/websocket/hyperliquid_event_target.d.ts.map +0 -1
  217. package/script/src/transports/websocket/hyperliquid_event_target.js +0 -37
  218. package/script/src/transports/websocket/reconnecting_websocket.d.ts.map +0 -1
  219. package/script/src/transports/websocket/reconnecting_websocket.js +0 -374
  220. package/script/src/transports/websocket/websocket_request_dispatcher.d.ts.map +0 -1
  221. package/script/src/transports/websocket/websocket_request_dispatcher.js +0 -206
  222. package/script/src/types/common.d.ts +0 -3
  223. package/script/src/types/common.d.ts.map +0 -1
  224. package/script/src/types/common.js +0 -2
  225. package/script/src/types/exchange/common.d.ts +0 -36
  226. package/script/src/types/exchange/common.d.ts.map +0 -1
  227. package/script/src/types/exchange/common.js +0 -2
  228. package/script/src/types/explorer/common.d.ts +0 -37
  229. package/script/src/types/explorer/common.d.ts.map +0 -1
  230. package/script/src/types/explorer/common.js +0 -2
  231. package/script/src/types/subscriptions/common.d.ts.map +0 -1
  232. package/script/src/types/subscriptions/common.js +0 -2
  233. package/script/src/utils/key_sort.d.ts +0 -21
  234. package/script/src/utils/key_sort.d.ts.map +0 -1
  235. package/script/src/utils/key_sort.js +0 -127
  236. package/script/src/utils/signing.d.ts +0 -109
  237. package/script/src/utils/signing.d.ts.map +0 -1
  238. package/script/src/utils/signing.js +0 -172
  239. /package/esm/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.d.ts +0 -0
  240. /package/esm/src/types/{common.js → info/delegations.js} +0 -0
  241. /package/esm/src/types/{exchange/common.js → mod.js} +0 -0
  242. /package/esm/src/types/{explorer/common.js → subscriptions/responses.js} +0 -0
  243. /package/script/deps/jsr.io/@std/encoding/{1.0.6 → 1.0.7}/_validate_binary_like.d.ts +0 -0
@@ -1,178 +1,188 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpTransport = exports.HttpRequestError = void 0;
4
- const base_js_1 = require("../base.js");
5
- /**
6
- * Error thrown when an HTTP response is deemed invalid:
7
- * - Non-200 status code
8
- * - Unexpected content type
9
- */
10
- class HttpRequestError extends base_js_1.TransportError {
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../../base.js"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.HttpTransport = exports.HttpRequestError = void 0;
13
+ const base_js_1 = require("../../base.js");
11
14
  /**
12
- * Creates a new HTTP request error.
13
- * @param response - The failed HTTP response.
14
- * @param responseBody - The raw response body content, if available.
15
+ * Error thrown when an HTTP response is deemed invalid:
16
+ * - Non-200 status code
17
+ * - Unexpected content type
15
18
  */
16
- constructor(response, responseBody) {
17
- let message = `HTTP request failed: status ${response.status}`;
18
- if (responseBody)
19
- message += `, body "${responseBody}"`;
20
- super(message);
21
- Object.defineProperty(this, "response", {
22
- enumerable: true,
23
- configurable: true,
24
- writable: true,
25
- value: response
26
- });
27
- Object.defineProperty(this, "responseBody", {
28
- enumerable: true,
29
- configurable: true,
30
- writable: true,
31
- value: responseBody
32
- });
33
- this.name = "HttpRequestError";
19
+ class HttpRequestError extends base_js_1.TransportError {
20
+ /**
21
+ * Creates a new HTTP request error.
22
+ * @param response - The failed HTTP response.
23
+ * @param responseBody - The raw response body content, if available.
24
+ */
25
+ constructor(response, responseBody) {
26
+ let message = `HTTP request failed: status ${response.status}`;
27
+ if (responseBody)
28
+ message += `, body "${responseBody}"`;
29
+ super(message);
30
+ Object.defineProperty(this, "response", {
31
+ enumerable: true,
32
+ configurable: true,
33
+ writable: true,
34
+ value: response
35
+ });
36
+ Object.defineProperty(this, "responseBody", {
37
+ enumerable: true,
38
+ configurable: true,
39
+ writable: true,
40
+ value: responseBody
41
+ });
42
+ this.name = "HttpRequestError";
43
+ }
34
44
  }
35
- }
36
- exports.HttpRequestError = HttpRequestError;
37
- /**
38
- * HTTP implementation of the REST transport interface.
39
- */
40
- class HttpTransport {
45
+ exports.HttpRequestError = HttpRequestError;
41
46
  /**
42
- * Creates a new HTTP transport instance.
43
- * @param options - Configuration options for the HTTP transport layer.
47
+ * HTTP implementation of the REST transport interface.
44
48
  */
45
- constructor(options) {
46
- Object.defineProperty(this, "url", {
47
- enumerable: true,
48
- configurable: true,
49
- writable: true,
50
- value: void 0
51
- });
52
- Object.defineProperty(this, "timeout", {
53
- enumerable: true,
54
- configurable: true,
55
- writable: true,
56
- value: void 0
57
- });
58
- Object.defineProperty(this, "fetchOptions", {
59
- enumerable: true,
60
- configurable: true,
61
- writable: true,
62
- value: void 0
63
- });
64
- Object.defineProperty(this, "onRequest", {
65
- enumerable: true,
66
- configurable: true,
67
- writable: true,
68
- value: void 0
69
- });
70
- Object.defineProperty(this, "onResponse", {
71
- enumerable: true,
72
- configurable: true,
73
- writable: true,
74
- value: void 0
75
- });
76
- /** Mapping of endpoint types to their API paths. */
77
- Object.defineProperty(this, "_endpointPaths", {
78
- enumerable: true,
79
- configurable: true,
80
- writable: true,
81
- value: {
82
- info: "/info",
83
- action: "/exchange",
84
- explorer: "/explorer",
49
+ class HttpTransport {
50
+ /**
51
+ * Creates a new HTTP transport instance.
52
+ * @param options - Configuration options for the HTTP transport layer.
53
+ */
54
+ constructor(options) {
55
+ Object.defineProperty(this, "url", {
56
+ enumerable: true,
57
+ configurable: true,
58
+ writable: true,
59
+ value: void 0
60
+ });
61
+ Object.defineProperty(this, "timeout", {
62
+ enumerable: true,
63
+ configurable: true,
64
+ writable: true,
65
+ value: void 0
66
+ });
67
+ Object.defineProperty(this, "fetchOptions", {
68
+ enumerable: true,
69
+ configurable: true,
70
+ writable: true,
71
+ value: void 0
72
+ });
73
+ Object.defineProperty(this, "onRequest", {
74
+ enumerable: true,
75
+ configurable: true,
76
+ writable: true,
77
+ value: void 0
78
+ });
79
+ Object.defineProperty(this, "onResponse", {
80
+ enumerable: true,
81
+ configurable: true,
82
+ writable: true,
83
+ value: void 0
84
+ });
85
+ /** Mapping of endpoint types to their API paths. */
86
+ Object.defineProperty(this, "_endpointPaths", {
87
+ enumerable: true,
88
+ configurable: true,
89
+ writable: true,
90
+ value: {
91
+ info: "/info",
92
+ action: "/exchange",
93
+ explorer: "/explorer",
94
+ }
95
+ });
96
+ this.url = options?.url ?? "https://api.hyperliquid.xyz";
97
+ this.timeout = options?.timeout === undefined ? 10_000 : options.timeout;
98
+ this.fetchOptions = options?.fetchOptions ?? {};
99
+ this.onRequest = options?.onRequest;
100
+ this.onResponse = options?.onResponse;
101
+ }
102
+ /**
103
+ * Sends a request to the Hyperliquid API via fetch.
104
+ * @param endpoint - The API endpoint to send the request to.
105
+ * @param payload - The payload to send with the request.
106
+ * @param signal - An optional abort signal.
107
+ * @returns A promise that resolves with parsed JSON response body.
108
+ * @throws {HttpRequestError} - Thrown when an HTTP response is deemed invalid.
109
+ * @throws May throw {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch#exceptions | fetch errors}.
110
+ */
111
+ async request(endpoint, payload, signal) {
112
+ // Construct a Request
113
+ const url = new URL(this._endpointPaths[endpoint], this.url);
114
+ const init = mergeRequestInit({
115
+ body: JSON.stringify(payload),
116
+ headers: {
117
+ "Accept-Encoding": "gzip, deflate, br, zstd",
118
+ "Connection": "keep-alive",
119
+ "Content-Type": "application/json",
120
+ },
121
+ keepalive: true,
122
+ method: "POST",
123
+ signal: this.timeout ? AbortSignal.timeout(this.timeout) : undefined,
124
+ }, this.fetchOptions, { signal });
125
+ let request = new Request(url, init);
126
+ // Call the onRequest callback, if provided
127
+ if (this.onRequest) {
128
+ const customRequest = await this.onRequest(request);
129
+ if (customRequest instanceof Request)
130
+ request = customRequest;
85
131
  }
86
- });
87
- this.url = options?.url ?? "https://api.hyperliquid.xyz";
88
- this.timeout = options?.timeout === undefined ? 10_000 : options.timeout;
89
- this.fetchOptions = options?.fetchOptions ?? {};
90
- this.onRequest = options?.onRequest;
91
- this.onResponse = options?.onResponse;
132
+ // Send the Request and wait for a Response
133
+ let response = await fetch(request);
134
+ // Call the onResponse callback, if provided
135
+ if (this.onResponse) {
136
+ const customResponse = await this.onResponse(response);
137
+ if (customResponse instanceof Response)
138
+ response = customResponse;
139
+ }
140
+ // Validate the Response
141
+ if (!response.ok || !response.headers.get("Content-Type")?.includes("application/json")) {
142
+ // Unload the response body to prevent memory leaks
143
+ const body = await response.text().catch(() => undefined);
144
+ throw new HttpRequestError(response, body);
145
+ }
146
+ // Parse and return the response body
147
+ return await response.json();
148
+ }
92
149
  }
150
+ exports.HttpTransport = HttpTransport;
93
151
  /**
94
- * Sends a request to the Hyperliquid API via fetch.
95
- * @param endpoint - The API endpoint to send the request to.
96
- * @param payload - The payload to send with the request.
97
- * @param signal - An optional abort signal.
98
- * @returns A promise that resolves with parsed JSON response body.
99
- * @throws {HttpRequestError} - Thrown when an HTTP response is deemed invalid.
100
- * @throws May throw {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch#exceptions | fetch errors}.
152
+ * Merges multiple `HeadersInit` objects into one.
153
+ * @param inits - A list of `HeadersInit` objects to merge.
154
+ * @returns A new `Headers` object that contains all headers from the input objects.
101
155
  */
102
- async request(endpoint, payload, signal) {
103
- // Construct a Request
104
- const url = new URL(this._endpointPaths[endpoint], this.url);
105
- const init = mergeRequestInit({
106
- body: JSON.stringify(payload),
107
- headers: {
108
- "Accept-Encoding": "gzip, deflate, br, zstd",
109
- "Connection": "keep-alive",
110
- "Content-Type": "application/json",
111
- },
112
- keepalive: true,
113
- method: "POST",
114
- signal: this.timeout ? AbortSignal.timeout(this.timeout) : undefined,
115
- }, this.fetchOptions, { signal });
116
- let request = new Request(url, init);
117
- // Call the onRequest callback, if provided
118
- if (this.onRequest) {
119
- const customRequest = await this.onRequest(request);
120
- if (customRequest instanceof Request)
121
- request = customRequest;
122
- }
123
- // Send the Request and wait for a Response
124
- let response = await fetch(request);
125
- // Call the onResponse callback, if provided
126
- if (this.onResponse) {
127
- const customResponse = await this.onResponse(response);
128
- if (customResponse instanceof Response)
129
- response = customResponse;
156
+ function mergeHeadersInit(...inits) {
157
+ if (inits.length === 0 || inits.length === 1) {
158
+ return new Headers(inits[0]);
130
159
  }
131
- // Validate the Response
132
- if (!response.ok || !response.headers.get("Content-Type")?.includes("application/json")) {
133
- // Unload the response body to prevent memory leaks
134
- const body = await response.text().catch(() => undefined);
135
- throw new HttpRequestError(response, body);
160
+ const merged = new Headers();
161
+ for (const headers of inits) {
162
+ const entries = Symbol.iterator in headers ? headers : Object.entries(headers);
163
+ for (const [key, value] of entries) {
164
+ merged.set(key, value);
165
+ }
136
166
  }
137
- // Parse and return the response body
138
- return await response.json();
139
- }
140
- }
141
- exports.HttpTransport = HttpTransport;
142
- /**
143
- * Merges multiple `HeadersInit` objects into one.
144
- * @param inits - A list of `HeadersInit` objects to merge.
145
- * @returns A new `Headers` object that contains all headers from the input objects.
146
- */
147
- function mergeHeadersInit(...inits) {
148
- if (inits.length === 0 || inits.length === 1) {
149
- return new Headers(inits[0]);
167
+ return merged;
150
168
  }
151
- const merged = new Headers();
152
- for (const headers of inits) {
153
- const entries = Symbol.iterator in headers ? headers : Object.entries(headers);
154
- for (const [key, value] of entries) {
155
- merged.set(key, value);
169
+ /**
170
+ * Merges multiple `RequestInit` objects into one.
171
+ * @param inits - A list of `RequestInit` objects to merge.
172
+ * @returns A new `RequestInit` object that contains all properties from the input objects.
173
+ */
174
+ function mergeRequestInit(...inits) {
175
+ const merged = inits.reduce((acc, init) => ({ ...acc, ...init }), {});
176
+ const headersList = inits.map((init) => init.headers)
177
+ .filter((headers) => typeof headers === "object");
178
+ if (headersList.length > 0) {
179
+ merged.headers = mergeHeadersInit(...headersList);
156
180
  }
181
+ const signals = inits.map((init) => init.signal)
182
+ .filter((signal) => signal instanceof AbortSignal);
183
+ if (signals.length > 0) {
184
+ merged.signal = signals.length > 1 ? AbortSignal.any(signals) : signals[0];
185
+ }
186
+ return merged;
157
187
  }
158
- return merged;
159
- }
160
- /**
161
- * Merges multiple `RequestInit` objects into one.
162
- * @param inits - A list of `RequestInit` objects to merge.
163
- * @returns A new `RequestInit` object that contains all properties from the input objects.
164
- */
165
- function mergeRequestInit(...inits) {
166
- const merged = inits.reduce((acc, init) => ({ ...acc, ...init }), {});
167
- const headersList = inits.map((init) => init.headers)
168
- .filter((headers) => typeof headers === "object");
169
- if (headersList.length > 0) {
170
- merged.headers = mergeHeadersInit(...headersList);
171
- }
172
- const signals = inits.map((init) => init.signal)
173
- .filter((signal) => signal instanceof AbortSignal);
174
- if (signals.length > 0) {
175
- merged.signal = signals.length > 1 ? AbortSignal.any(signals) : signals[0];
176
- }
177
- return merged;
178
- }
188
+ });
@@ -0,0 +1,64 @@
1
+ import { TypedEventTarget } from "../../../deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js";
2
+ import type { BlockDetails, TxDetails } from "../../types/explorer/responses.js";
3
+ /** Base system events and dynamic channel events for Hyperliquid WebSocket API. */
4
+ interface HyperliquidEventMap {
5
+ /** Subscription created/removed event. */
6
+ subscriptionResponse: CustomEvent<{
7
+ /** Type of subscription operation. */
8
+ method: "subscribe" | "unsubscribe";
9
+ /** Original subscription request. */
10
+ subscription: unknown;
11
+ }>;
12
+ /** Response to post request event. */
13
+ post: CustomEvent<{
14
+ /** Unique request identifier. */
15
+ id: number;
16
+ /** Server response. */
17
+ response:
18
+ /** Response containing requested information. */
19
+ {
20
+ /** Indicates that this is an informational response. */
21
+ type: "info";
22
+ /** Contains the information data. */
23
+ payload: {
24
+ /** Type of information being returned. */
25
+ type: string;
26
+ /** Information specific data. */
27
+ data: unknown;
28
+ };
29
+ }
30
+ /** Response containing action result. */
31
+ | {
32
+ /** Indicates that this is an action response. */
33
+ type: "action";
34
+ /** Contains the action result data. */
35
+ payload: {
36
+ /** Response status indicating success or failure of the action. */
37
+ status: "ok" | "err";
38
+ /** Success data or error message. */
39
+ response: {
40
+ /** Type of operation. */
41
+ type: string;
42
+ /** Specific data for the operation. */
43
+ data?: unknown;
44
+ } | string;
45
+ };
46
+ };
47
+ }>;
48
+ /** Error response for message event. */
49
+ error: CustomEvent<string>;
50
+ /** Pong response event. */
51
+ pong: CustomEvent<undefined>;
52
+ /** Block explorer update event. */
53
+ _explorerBlock: CustomEvent<Omit<BlockDetails, "txs">[]>;
54
+ /** Transaction explorer update event. */
55
+ _explorerTxs: CustomEvent<TxDetails[]>;
56
+ /** Subscribed channel event. */
57
+ [key: string]: CustomEvent<unknown>;
58
+ }
59
+ /** Listens for WebSocket messages and sends them as Hyperliquid typed events. */
60
+ export declare class HyperliquidEventTarget extends TypedEventTarget<HyperliquidEventMap> {
61
+ constructor(socket: WebSocket);
62
+ }
63
+ export {};
64
+ //# sourceMappingURL=_hyperliquid_event_target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_hyperliquid_event_target.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/websocket/_hyperliquid_event_target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oEAAoE,CAAC;AACtG,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAUjF,mFAAmF;AACnF,UAAU,mBAAmB;IACzB,0CAA0C;IAC1C,oBAAoB,EAAE,WAAW,CAAC;QAC9B,sCAAsC;QACtC,MAAM,EAAE,WAAW,GAAG,aAAa,CAAC;QACpC,qCAAqC;QACrC,YAAY,EAAE,OAAO,CAAC;KACzB,CAAC,CAAC;IAEH,sCAAsC;IACtC,IAAI,EAAE,WAAW,CAAC;QACd,iCAAiC;QACjC,EAAE,EAAE,MAAM,CAAC;QACX,uBAAuB;QACvB,QAAQ;QACJ,iDAAiD;QAC/C;YACE,wDAAwD;YACxD,IAAI,EAAE,MAAM,CAAC;YACb,qCAAqC;YACrC,OAAO,EAAE;gBACL,0CAA0C;gBAC1C,IAAI,EAAE,MAAM,CAAC;gBACb,iCAAiC;gBACjC,IAAI,EAAE,OAAO,CAAC;aACjB,CAAC;SACL;QACD,yCAAyC;WACvC;YACE,iDAAiD;YACjD,IAAI,EAAE,QAAQ,CAAC;YACf,uCAAuC;YACvC,OAAO,EAAE;gBACL,mEAAmE;gBACnE,MAAM,EAAE,IAAI,GAAG,KAAK,CAAC;gBACrB,qCAAqC;gBACrC,QAAQ,EACF;oBACE,yBAAyB;oBACzB,IAAI,EAAE,MAAM,CAAC;oBACb,uCAAuC;oBACvC,IAAI,CAAC,EAAE,OAAO,CAAC;iBAClB,GACC,MAAM,CAAC;aAChB,CAAC;SACL,CAAC;KACT,CAAC,CAAC;IAEH,wCAAwC;IACxC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAE3B,2BAA2B;IAC3B,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAE7B,mCAAmC;IACnC,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IAEzD,yCAAyC;IACzC,YAAY,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;IAEvC,gCAAgC;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;CACvC;AAED,iFAAiF;AACjF,qBAAa,sBAAuB,SAAQ,gBAAgB,CAAC,mBAAmB,CAAC;gBACjE,MAAM,EAAE,SAAS;CAiBhC"}
@@ -0,0 +1,66 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../../../deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.HyperliquidEventTarget = void 0;
13
+ const mod_js_1 = require("../../../deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js");
14
+ /** Listens for WebSocket messages and sends them as Hyperliquid typed events. */
15
+ class HyperliquidEventTarget extends mod_js_1.TypedEventTarget {
16
+ constructor(socket) {
17
+ super();
18
+ socket.addEventListener("message", (event) => {
19
+ try {
20
+ const msg = JSON.parse(event.data);
21
+ if (isHyperliquidMsg(msg)) {
22
+ this.dispatchEvent(new CustomEvent(msg.channel, { detail: msg.data }));
23
+ }
24
+ else if (isExplorerBlockMsg(msg)) {
25
+ this.dispatchEvent(new CustomEvent("_explorerBlock", { detail: msg }));
26
+ }
27
+ else if (isExplorerTxsMsg(msg)) {
28
+ this.dispatchEvent(new CustomEvent("_explorerTxs", { detail: msg }));
29
+ }
30
+ }
31
+ catch {
32
+ // Ignore JSON parsing errors
33
+ }
34
+ });
35
+ }
36
+ }
37
+ exports.HyperliquidEventTarget = HyperliquidEventTarget;
38
+ /** Type guard for Hyperliquid messages. */
39
+ function isHyperliquidMsg(value) {
40
+ return typeof value === "object" && value !== null &&
41
+ "channel" in value && typeof value.channel === "string";
42
+ }
43
+ /** Type guard for explorer block messages. */
44
+ function isExplorerBlockMsg(value) {
45
+ return Array.isArray(value) && value.length > 0 &&
46
+ value.every((block) => typeof block === "object" && block !== null && !Array.isArray(block) &&
47
+ "height" in block && typeof block.height === "number" &&
48
+ "blockTime" in block && typeof block.blockTime === "number" &&
49
+ "hash" in block && typeof block.hash === "string" &&
50
+ "proposer" in block && typeof block.proposer === "string" &&
51
+ "numTxs" in block && typeof block.numTxs === "number");
52
+ }
53
+ /** Type guard for explorer transactions messages. */
54
+ function isExplorerTxsMsg(value) {
55
+ return Array.isArray(value) && value.length > 0 &&
56
+ value.every((tx) => {
57
+ return typeof tx === "object" && tx !== null && !Array.isArray(tx) &&
58
+ "action" in tx && typeof tx.action === "object" && tx.action !== null &&
59
+ "block" in tx && typeof tx.block === "number" &&
60
+ "error" in tx && (typeof tx.error === "string" || tx.error === null) &&
61
+ "hash" in tx && typeof tx.hash === "string" &&
62
+ "time" in tx && typeof tx.time === "number" &&
63
+ "user" in tx && typeof tx.user === "string";
64
+ });
65
+ }
66
+ });
@@ -1,7 +1,6 @@
1
+ import { TransportError } from "../../base.js";
1
2
  type MaybePromise<T> = T | Promise<T>;
2
- /**
3
- * Configuration options for the `ReconnectingWebSocket`.
4
- */
3
+ /** Configuration options for the `ReconnectingWebSocket`. */
5
4
  export interface ReconnectingWebSocketOptions {
6
5
  /**
7
6
  * Maximum number of reconnection attempts.
@@ -33,15 +32,8 @@ export interface ReconnectingWebSocketOptions {
33
32
  * @defaultValue `new FIFOMessageBuffer()`
34
33
  */
35
34
  messageBuffer?: MessageBufferStrategy;
36
- /**
37
- * Custom WebSocket constructor to use.
38
- * @defaultValue `new WebSocket(url, protocols)`
39
- */
40
- WebSocketConstructor?: typeof WebSocket;
41
35
  }
42
- /**
43
- * Message buffer strategy interface.
44
- */
36
+ /** Message buffer strategy interface. */
45
37
  export interface MessageBufferStrategy {
46
38
  /** Array of buffered messages. */
47
39
  messages: (string | ArrayBufferLike | Blob | ArrayBufferView)[];
@@ -58,21 +50,27 @@ export interface MessageBufferStrategy {
58
50
  /** Clear all buffered messages. */
59
51
  clear(): void;
60
52
  }
53
+ /** Error thrown when reconnection problems occur. */
54
+ export declare class ReconnectingWebSocketError extends TransportError {
55
+ code: "RECONNECTION_LIMIT_REACHED" | "RECONNECTION_STOPPED_BY_USER" | "USER_INITIATED_CLOSE" | "UNKNOWN_ERROR";
56
+ originalError?: unknown | undefined;
57
+ constructor(code: "RECONNECTION_LIMIT_REACHED" | "RECONNECTION_STOPPED_BY_USER" | "USER_INITIATED_CLOSE" | "UNKNOWN_ERROR", originalError?: unknown | undefined);
58
+ }
61
59
  /**
62
60
  * A WebSocket that automatically reconnects when disconnected.
63
61
  * Fully compatible with standard WebSocket API.
64
62
  */
65
63
  export declare class ReconnectingWebSocket implements WebSocket {
66
64
  /** Controller for handling connection termination */
67
- protected terminationController: AbortController;
65
+ protected _terminationController: AbortController;
68
66
  /** WebSocket protocols */
69
- protected protocols?: string | string[];
67
+ protected _protocols?: string | string[];
70
68
  /** The underlying WebSocket instance */
71
- protected socket: WebSocket;
69
+ protected _socket: WebSocket;
72
70
  /** Current number of reconnection attempts */
73
- protected reconnectCount: number;
71
+ protected _reconnectCount: number;
74
72
  /** Array of registered event listeners */
75
- protected eventListeners: {
73
+ protected _eventListeners: {
76
74
  type: string;
77
75
  listener: EventListenerOrEventListenerObject;
78
76
  options?: boolean | AddEventListenerOptions;
@@ -96,23 +94,21 @@ export declare class ReconnectingWebSocket implements WebSocket {
96
94
  * @param timeout - The connection timeout in ms.
97
95
  * @returns A new WebSocket instance.
98
96
  */
99
- protected connectWithTimeout(url: string | URL, protocols: string | string[] | undefined, timeout: number): WebSocket;
100
- /**
101
- * Initializes the internal event listeners for the WebSocket.
102
- */
103
- protected initEventListeners(): void;
97
+ protected _connectWithTimeout(url: string | URL, protocols: string | string[] | undefined, timeout: number): WebSocket;
98
+ /** Initializes the internal event listeners for the WebSocket. */
99
+ protected _initEventListeners(): void;
104
100
  /**
105
101
  * Clean up internal resources.
106
102
  * @param reason - The reason for cleanup.
107
103
  */
108
- protected cleanup(reason: unknown): void;
104
+ protected _cleanup(reason: unknown): void;
109
105
  /**
110
106
  * Check if two event listeners are the same (just like EventTarget).
111
107
  * @param a - First event listener configuration.
112
108
  * @param b - Second event listener configuration.
113
109
  * @returns True if the listeners match.
114
110
  */
115
- protected isListenerMatch(a: {
111
+ protected _isListenerMatch(a: {
116
112
  type: string;
117
113
  listener: EventListenerOrEventListenerObject;
118
114
  options?: boolean | AddEventListenerOptions;
@@ -152,9 +148,13 @@ export declare class ReconnectingWebSocket implements WebSocket {
152
148
  * @note If the connection is not open, the data will be buffered and sent when the connection is established.
153
149
  */
154
150
  send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
155
- addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: ReconnectingWebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
156
- removeEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: ReconnectingWebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
151
+ addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: ((this: ReconnectingWebSocket, ev: WebSocketEventMap[K]) => any) | {
152
+ handleEvent: (event: WebSocketEventMap[K]) => any;
153
+ }, options?: boolean | AddEventListenerOptions): void;
154
+ removeEventListener<K extends keyof WebSocketEventMap>(type: K, listener: ((this: ReconnectingWebSocket, ev: WebSocketEventMap[K]) => any) | {
155
+ handleEvent: (event: WebSocketEventMap[K]) => any;
156
+ }, options?: boolean | EventListenerOptions): void;
157
157
  dispatchEvent(event: Event): boolean;
158
158
  }
159
159
  export {};
160
- //# sourceMappingURL=reconnecting_websocket.d.ts.map
160
+ //# sourceMappingURL=_reconnecting_websocket.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_reconnecting_websocket.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/websocket/_reconnecting_websocket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAEtC,6DAA6D;AAC7D,MAAM,WAAW,4BAA4B;IACzC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,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