@nktkas/hyperliquid 0.24.3 → 0.25.0-beta.2

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 (358) hide show
  1. package/README.md +141 -32
  2. package/esm/mod.d.ts +11 -11
  3. package/esm/mod.d.ts.map +1 -1
  4. package/esm/mod.js +2 -1
  5. package/esm/mod.js.map +1 -0
  6. package/esm/src/clients/exchange.d.ts +29 -25
  7. package/esm/src/clients/exchange.d.ts.map +1 -1
  8. package/esm/src/clients/exchange.js +54 -53
  9. package/esm/src/clients/exchange.js.map +1 -0
  10. package/esm/src/clients/info.d.ts +80 -20
  11. package/esm/src/clients/info.d.ts.map +1 -1
  12. package/esm/src/clients/info.js +312 -73
  13. package/esm/src/clients/info.js.map +1 -0
  14. package/esm/src/clients/multiSign.d.ts +11 -7
  15. package/esm/src/clients/multiSign.d.ts.map +1 -1
  16. package/esm/src/clients/multiSign.js +2 -1
  17. package/esm/src/clients/multiSign.js.map +1 -0
  18. package/esm/src/clients/subscription.d.ts +9 -9
  19. package/esm/src/clients/subscription.d.ts.map +1 -1
  20. package/esm/src/clients/subscription.js +29 -27
  21. package/esm/src/clients/subscription.js.map +1 -0
  22. package/esm/src/{base.d.ts → errors.d.ts} +1 -1
  23. package/esm/src/errors.d.ts.map +1 -0
  24. package/esm/src/{base.js → errors.js} +1 -0
  25. package/esm/src/errors.js.map +1 -0
  26. package/esm/src/schemas/_base.d.ts +14 -0
  27. package/esm/src/schemas/_base.d.ts.map +1 -0
  28. package/esm/src/schemas/_base.js +15 -0
  29. package/esm/src/schemas/_base.js.map +1 -0
  30. package/esm/src/schemas/exchange/requests.d.ts +8953 -0
  31. package/esm/src/schemas/exchange/requests.d.ts.map +1 -0
  32. package/esm/src/schemas/exchange/requests.js +1414 -0
  33. package/esm/src/schemas/exchange/requests.js.map +1 -0
  34. package/esm/src/schemas/exchange/responses.d.ts +567 -0
  35. package/esm/src/schemas/exchange/responses.d.ts.map +1 -0
  36. package/esm/src/schemas/exchange/responses.js +244 -0
  37. package/esm/src/schemas/exchange/responses.js.map +1 -0
  38. package/esm/src/schemas/explorer/requests.d.ts +44 -0
  39. package/esm/src/schemas/explorer/requests.d.ts.map +1 -0
  40. package/esm/src/schemas/explorer/requests.js +33 -0
  41. package/esm/src/schemas/explorer/requests.js.map +1 -0
  42. package/esm/src/schemas/explorer/responses.d.ts +360 -0
  43. package/esm/src/schemas/explorer/responses.d.ts.map +1 -0
  44. package/esm/src/schemas/explorer/responses.js +57 -0
  45. package/esm/src/schemas/explorer/responses.js.map +1 -0
  46. package/esm/src/schemas/info/accounts.d.ts +2159 -0
  47. package/esm/src/schemas/info/accounts.d.ts.map +1 -0
  48. package/esm/src/schemas/info/accounts.js +623 -0
  49. package/esm/src/schemas/info/accounts.js.map +1 -0
  50. package/esm/src/schemas/info/assets.d.ts +974 -0
  51. package/esm/src/schemas/info/assets.d.ts.map +1 -0
  52. package/esm/src/schemas/info/assets.js +285 -0
  53. package/esm/src/schemas/info/assets.js.map +1 -0
  54. package/esm/src/schemas/info/markets.d.ts +155 -0
  55. package/esm/src/schemas/info/markets.d.ts.map +1 -0
  56. package/esm/src/schemas/info/markets.js +70 -0
  57. package/esm/src/schemas/info/markets.js.map +1 -0
  58. package/esm/src/schemas/info/orders.d.ts +957 -0
  59. package/esm/src/schemas/info/orders.d.ts.map +1 -0
  60. package/esm/src/schemas/info/orders.js +298 -0
  61. package/esm/src/schemas/info/orders.js.map +1 -0
  62. package/esm/src/schemas/info/requests.d.ts +924 -0
  63. package/esm/src/schemas/info/requests.d.ts.map +1 -0
  64. package/esm/src/schemas/info/requests.js +687 -0
  65. package/esm/src/schemas/info/requests.js.map +1 -0
  66. package/esm/src/schemas/info/validators.d.ts +326 -0
  67. package/esm/src/schemas/info/validators.d.ts.map +1 -0
  68. package/esm/src/schemas/info/validators.js +126 -0
  69. package/esm/src/schemas/info/validators.js.map +1 -0
  70. package/esm/src/schemas/info/vaults.d.ts +447 -0
  71. package/esm/src/schemas/info/vaults.d.ts.map +1 -0
  72. package/esm/src/schemas/info/vaults.js +111 -0
  73. package/esm/src/schemas/info/vaults.js.map +1 -0
  74. package/esm/src/schemas/mod.d.ts +101 -0
  75. package/esm/src/schemas/mod.d.ts.map +1 -0
  76. package/esm/src/schemas/mod.js +115 -0
  77. package/esm/src/schemas/mod.js.map +1 -0
  78. package/esm/src/schemas/subscriptions/requests.d.ts +332 -0
  79. package/esm/src/schemas/subscriptions/requests.d.ts.map +1 -0
  80. package/esm/src/schemas/subscriptions/requests.js +259 -0
  81. package/esm/src/schemas/subscriptions/requests.js.map +1 -0
  82. package/esm/src/schemas/subscriptions/responses.d.ts +3643 -0
  83. package/esm/src/schemas/subscriptions/responses.d.ts.map +1 -0
  84. package/esm/src/schemas/subscriptions/responses.js +234 -0
  85. package/esm/src/schemas/subscriptions/responses.js.map +1 -0
  86. package/esm/src/signing/_signTypedData/ethers.js +1 -0
  87. package/esm/src/signing/_signTypedData/ethers.js.map +1 -0
  88. package/esm/src/signing/_signTypedData/mod.js +1 -0
  89. package/esm/src/signing/_signTypedData/mod.js.map +1 -0
  90. package/esm/src/signing/_signTypedData/private_key.js +1 -0
  91. package/esm/src/signing/_signTypedData/private_key.js.map +1 -0
  92. package/esm/src/signing/_signTypedData/viem.js +1 -0
  93. package/esm/src/signing/_signTypedData/viem.js.map +1 -0
  94. package/esm/src/signing/mod.d.ts +109 -29
  95. package/esm/src/signing/mod.d.ts.map +1 -1
  96. package/esm/src/signing/mod.js +136 -29
  97. package/esm/src/signing/mod.js.map +1 -0
  98. package/esm/src/transports/base.d.ts +4 -4
  99. package/esm/src/transports/base.d.ts.map +1 -1
  100. package/esm/src/transports/base.js +3 -2
  101. package/esm/src/transports/base.js.map +1 -0
  102. package/esm/src/transports/http/http_transport.d.ts +3 -2
  103. package/esm/src/transports/http/http_transport.d.ts.map +1 -1
  104. package/esm/src/transports/http/http_transport.js +1 -0
  105. package/esm/src/transports/http/http_transport.js.map +1 -0
  106. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
  107. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  108. package/esm/src/transports/websocket/_hyperliquid_event_target.js +1 -0
  109. package/esm/src/transports/websocket/_hyperliquid_event_target.js.map +1 -0
  110. package/esm/src/transports/websocket/_reconnecting_websocket.js +1 -0
  111. package/esm/src/transports/websocket/_reconnecting_websocket.js.map +1 -0
  112. package/esm/src/transports/websocket/_websocket_async_request.js +1 -0
  113. package/esm/src/transports/websocket/_websocket_async_request.js.map +1 -0
  114. package/esm/src/transports/websocket/websocket_transport.d.ts +9 -1
  115. package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  116. package/esm/src/transports/websocket/websocket_transport.js +4 -0
  117. package/esm/src/transports/websocket/websocket_transport.js.map +1 -0
  118. package/package.json +6 -5
  119. package/script/mod.d.ts +11 -11
  120. package/script/mod.d.ts.map +1 -1
  121. package/script/mod.js +2 -1
  122. package/script/mod.js.map +1 -0
  123. package/script/src/clients/exchange.d.ts +29 -25
  124. package/script/src/clients/exchange.d.ts.map +1 -1
  125. package/script/src/clients/exchange.js +60 -59
  126. package/script/src/clients/exchange.js.map +1 -0
  127. package/script/src/clients/info.d.ts +80 -20
  128. package/script/src/clients/info.d.ts.map +1 -1
  129. package/script/src/clients/info.js +312 -73
  130. package/script/src/clients/info.js.map +1 -0
  131. package/script/src/clients/multiSign.d.ts +11 -7
  132. package/script/src/clients/multiSign.d.ts.map +1 -1
  133. package/script/src/clients/multiSign.js +2 -1
  134. package/script/src/clients/multiSign.js.map +1 -0
  135. package/script/src/clients/subscription.d.ts +9 -9
  136. package/script/src/clients/subscription.d.ts.map +1 -1
  137. package/script/src/clients/subscription.js +29 -27
  138. package/script/src/clients/subscription.js.map +1 -0
  139. package/script/src/{base.d.ts → errors.d.ts} +1 -1
  140. package/script/src/errors.d.ts.map +1 -0
  141. package/script/src/{base.js → errors.js} +1 -0
  142. package/script/src/errors.js.map +1 -0
  143. package/script/src/schemas/_base.d.ts +14 -0
  144. package/script/src/schemas/_base.d.ts.map +1 -0
  145. package/script/src/schemas/_base.js +51 -0
  146. package/script/src/schemas/_base.js.map +1 -0
  147. package/script/src/schemas/exchange/requests.d.ts +8953 -0
  148. package/script/src/schemas/exchange/requests.d.ts.map +1 -0
  149. package/script/src/schemas/exchange/requests.js +1450 -0
  150. package/script/src/schemas/exchange/requests.js.map +1 -0
  151. package/script/src/schemas/exchange/responses.d.ts +567 -0
  152. package/script/src/schemas/exchange/responses.d.ts.map +1 -0
  153. package/script/src/schemas/exchange/responses.js +280 -0
  154. package/script/src/schemas/exchange/responses.js.map +1 -0
  155. package/script/src/schemas/explorer/requests.d.ts +44 -0
  156. package/script/src/schemas/explorer/requests.d.ts.map +1 -0
  157. package/script/src/schemas/explorer/requests.js +69 -0
  158. package/script/src/schemas/explorer/requests.js.map +1 -0
  159. package/script/src/schemas/explorer/responses.d.ts +360 -0
  160. package/script/src/schemas/explorer/responses.d.ts.map +1 -0
  161. package/script/src/schemas/explorer/responses.js +93 -0
  162. package/script/src/schemas/explorer/responses.js.map +1 -0
  163. package/script/src/schemas/info/accounts.d.ts +2159 -0
  164. package/script/src/schemas/info/accounts.d.ts.map +1 -0
  165. package/script/src/schemas/info/accounts.js +659 -0
  166. package/script/src/schemas/info/accounts.js.map +1 -0
  167. package/script/src/schemas/info/assets.d.ts +974 -0
  168. package/script/src/schemas/info/assets.d.ts.map +1 -0
  169. package/script/src/schemas/info/assets.js +321 -0
  170. package/script/src/schemas/info/assets.js.map +1 -0
  171. package/script/src/schemas/info/markets.d.ts +155 -0
  172. package/script/src/schemas/info/markets.d.ts.map +1 -0
  173. package/script/src/schemas/info/markets.js +106 -0
  174. package/script/src/schemas/info/markets.js.map +1 -0
  175. package/script/src/schemas/info/orders.d.ts +957 -0
  176. package/script/src/schemas/info/orders.d.ts.map +1 -0
  177. package/script/src/schemas/info/orders.js +334 -0
  178. package/script/src/schemas/info/orders.js.map +1 -0
  179. package/script/src/schemas/info/requests.d.ts +924 -0
  180. package/script/src/schemas/info/requests.d.ts.map +1 -0
  181. package/script/src/schemas/info/requests.js +724 -0
  182. package/script/src/schemas/info/requests.js.map +1 -0
  183. package/script/src/schemas/info/validators.d.ts +326 -0
  184. package/script/src/schemas/info/validators.d.ts.map +1 -0
  185. package/script/src/schemas/info/validators.js +162 -0
  186. package/script/src/schemas/info/validators.js.map +1 -0
  187. package/script/src/schemas/info/vaults.d.ts +447 -0
  188. package/script/src/schemas/info/vaults.d.ts.map +1 -0
  189. package/script/src/schemas/info/vaults.js +147 -0
  190. package/script/src/schemas/info/vaults.js.map +1 -0
  191. package/script/src/schemas/mod.d.ts +101 -0
  192. package/script/src/schemas/mod.d.ts.map +1 -0
  193. package/script/src/schemas/mod.js +157 -0
  194. package/script/src/schemas/mod.js.map +1 -0
  195. package/script/src/schemas/subscriptions/requests.d.ts +332 -0
  196. package/script/src/schemas/subscriptions/requests.d.ts.map +1 -0
  197. package/script/src/schemas/subscriptions/requests.js +295 -0
  198. package/script/src/schemas/subscriptions/requests.js.map +1 -0
  199. package/script/src/schemas/subscriptions/responses.d.ts +3643 -0
  200. package/script/src/schemas/subscriptions/responses.d.ts.map +1 -0
  201. package/script/src/schemas/subscriptions/responses.js +270 -0
  202. package/script/src/schemas/subscriptions/responses.js.map +1 -0
  203. package/script/src/signing/_signTypedData/ethers.js +1 -0
  204. package/script/src/signing/_signTypedData/ethers.js.map +1 -0
  205. package/script/src/signing/_signTypedData/mod.js +1 -0
  206. package/script/src/signing/_signTypedData/mod.js.map +1 -0
  207. package/script/src/signing/_signTypedData/private_key.js +1 -0
  208. package/script/src/signing/_signTypedData/private_key.js.map +1 -0
  209. package/script/src/signing/_signTypedData/viem.js +1 -0
  210. package/script/src/signing/_signTypedData/viem.js.map +1 -0
  211. package/script/src/signing/mod.d.ts +109 -29
  212. package/script/src/signing/mod.d.ts.map +1 -1
  213. package/script/src/signing/mod.js +138 -33
  214. package/script/src/signing/mod.js.map +1 -0
  215. package/script/src/transports/base.d.ts +4 -4
  216. package/script/src/transports/base.d.ts.map +1 -1
  217. package/script/src/transports/base.js +4 -3
  218. package/script/src/transports/base.js.map +1 -0
  219. package/script/src/transports/http/http_transport.d.ts +3 -2
  220. package/script/src/transports/http/http_transport.d.ts.map +1 -1
  221. package/script/src/transports/http/http_transport.js +1 -0
  222. package/script/src/transports/http/http_transport.js.map +1 -0
  223. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
  224. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  225. package/script/src/transports/websocket/_hyperliquid_event_target.js +1 -0
  226. package/script/src/transports/websocket/_hyperliquid_event_target.js.map +1 -0
  227. package/script/src/transports/websocket/_reconnecting_websocket.js +1 -0
  228. package/script/src/transports/websocket/_reconnecting_websocket.js.map +1 -0
  229. package/script/src/transports/websocket/_websocket_async_request.js +1 -0
  230. package/script/src/transports/websocket/_websocket_async_request.js.map +1 -0
  231. package/script/src/transports/websocket/websocket_transport.d.ts +9 -1
  232. package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  233. package/script/src/transports/websocket/websocket_transport.js +4 -0
  234. package/script/src/transports/websocket/websocket_transport.js.map +1 -0
  235. package/src/mod.ts +28 -0
  236. package/src/src/clients/exchange.ts +2246 -0
  237. package/src/src/clients/info.ts +2076 -0
  238. package/src/src/clients/multiSign.ts +183 -0
  239. package/src/src/clients/subscription.ts +841 -0
  240. package/src/src/errors.ts +7 -0
  241. package/src/src/schemas/_base.ts +43 -0
  242. package/src/src/schemas/exchange/requests.ts +3057 -0
  243. package/src/src/schemas/exchange/responses.ts +540 -0
  244. package/src/src/schemas/explorer/requests.ts +65 -0
  245. package/src/src/schemas/explorer/responses.ts +138 -0
  246. package/src/src/schemas/info/accounts.ts +1490 -0
  247. package/src/src/schemas/info/assets.ts +693 -0
  248. package/src/src/schemas/info/markets.ts +171 -0
  249. package/src/src/schemas/info/orders.ts +597 -0
  250. package/src/src/schemas/info/requests.ts +1369 -0
  251. package/src/src/schemas/info/validators.ts +299 -0
  252. package/src/src/schemas/info/vaults.ts +262 -0
  253. package/src/src/schemas/mod.ts +121 -0
  254. package/src/src/schemas/subscriptions/requests.ts +504 -0
  255. package/src/src/schemas/subscriptions/responses.ts +576 -0
  256. package/src/src/signing/_signTypedData/ethers.ts +59 -0
  257. package/src/src/signing/_signTypedData/mod.ts +121 -0
  258. package/src/src/signing/_signTypedData/private_key.ts +229 -0
  259. package/src/src/signing/_signTypedData/viem.ts +55 -0
  260. package/src/src/signing/mod.ts +572 -0
  261. package/src/src/transports/base.ts +54 -0
  262. package/src/src/transports/http/http_transport.ts +208 -0
  263. package/src/src/transports/websocket/_hyperliquid_event_target.ts +118 -0
  264. package/src/src/transports/websocket/_reconnecting_websocket.ts +404 -0
  265. package/src/src/transports/websocket/_websocket_async_request.ts +229 -0
  266. package/src/src/transports/websocket/websocket_transport.ts +394 -0
  267. package/esm/src/base.d.ts.map +0 -1
  268. package/esm/src/signing/_sorter.d.ts +0 -127
  269. package/esm/src/signing/_sorter.d.ts.map +0 -1
  270. package/esm/src/signing/_sorter.js +0 -693
  271. package/esm/src/types/exchange/requests.d.ts +0 -1345
  272. package/esm/src/types/exchange/requests.d.ts.map +0 -1
  273. package/esm/src/types/exchange/requests.js +0 -1
  274. package/esm/src/types/exchange/responses.d.ts +0 -233
  275. package/esm/src/types/exchange/responses.d.ts.map +0 -1
  276. package/esm/src/types/exchange/responses.js +0 -1
  277. package/esm/src/types/explorer/requests.d.ts +0 -32
  278. package/esm/src/types/explorer/requests.d.ts.map +0 -1
  279. package/esm/src/types/explorer/requests.js +0 -1
  280. package/esm/src/types/explorer/responses.d.ts +0 -58
  281. package/esm/src/types/explorer/responses.d.ts.map +0 -1
  282. package/esm/src/types/explorer/responses.js +0 -1
  283. package/esm/src/types/info/accounts.d.ts +0 -864
  284. package/esm/src/types/info/accounts.d.ts.map +0 -1
  285. package/esm/src/types/info/accounts.js +0 -1
  286. package/esm/src/types/info/assets.d.ts +0 -354
  287. package/esm/src/types/info/assets.d.ts.map +0 -1
  288. package/esm/src/types/info/assets.js +0 -1
  289. package/esm/src/types/info/markets.d.ts +0 -79
  290. package/esm/src/types/info/markets.d.ts.map +0 -1
  291. package/esm/src/types/info/markets.js +0 -1
  292. package/esm/src/types/info/orders.d.ts +0 -266
  293. package/esm/src/types/info/orders.d.ts.map +0 -1
  294. package/esm/src/types/info/orders.js +0 -1
  295. package/esm/src/types/info/requests.d.ts +0 -640
  296. package/esm/src/types/info/requests.d.ts.map +0 -1
  297. package/esm/src/types/info/requests.js +0 -1
  298. package/esm/src/types/info/validators.d.ts +0 -147
  299. package/esm/src/types/info/validators.d.ts.map +0 -1
  300. package/esm/src/types/info/validators.js +0 -1
  301. package/esm/src/types/info/vaults.d.ts +0 -119
  302. package/esm/src/types/info/vaults.d.ts.map +0 -1
  303. package/esm/src/types/info/vaults.js +0 -1
  304. package/esm/src/types/mod.d.ts +0 -38
  305. package/esm/src/types/mod.d.ts.map +0 -1
  306. package/esm/src/types/mod.js +0 -24
  307. package/esm/src/types/subscriptions/requests.d.ts +0 -154
  308. package/esm/src/types/subscriptions/requests.d.ts.map +0 -1
  309. package/esm/src/types/subscriptions/requests.js +0 -1
  310. package/esm/src/types/subscriptions/responses.d.ts +0 -238
  311. package/esm/src/types/subscriptions/responses.d.ts.map +0 -1
  312. package/esm/src/types/subscriptions/responses.js +0 -1
  313. package/script/src/base.d.ts.map +0 -1
  314. package/script/src/signing/_sorter.d.ts +0 -127
  315. package/script/src/signing/_sorter.d.ts.map +0 -1
  316. package/script/src/signing/_sorter.js +0 -696
  317. package/script/src/types/exchange/requests.d.ts +0 -1345
  318. package/script/src/types/exchange/requests.d.ts.map +0 -1
  319. package/script/src/types/exchange/requests.js +0 -2
  320. package/script/src/types/exchange/responses.d.ts +0 -233
  321. package/script/src/types/exchange/responses.d.ts.map +0 -1
  322. package/script/src/types/exchange/responses.js +0 -2
  323. package/script/src/types/explorer/requests.d.ts +0 -32
  324. package/script/src/types/explorer/requests.d.ts.map +0 -1
  325. package/script/src/types/explorer/requests.js +0 -2
  326. package/script/src/types/explorer/responses.d.ts +0 -58
  327. package/script/src/types/explorer/responses.d.ts.map +0 -1
  328. package/script/src/types/explorer/responses.js +0 -2
  329. package/script/src/types/info/accounts.d.ts +0 -864
  330. package/script/src/types/info/accounts.d.ts.map +0 -1
  331. package/script/src/types/info/accounts.js +0 -2
  332. package/script/src/types/info/assets.d.ts +0 -354
  333. package/script/src/types/info/assets.d.ts.map +0 -1
  334. package/script/src/types/info/assets.js +0 -2
  335. package/script/src/types/info/markets.d.ts +0 -79
  336. package/script/src/types/info/markets.d.ts.map +0 -1
  337. package/script/src/types/info/markets.js +0 -2
  338. package/script/src/types/info/orders.d.ts +0 -266
  339. package/script/src/types/info/orders.d.ts.map +0 -1
  340. package/script/src/types/info/orders.js +0 -2
  341. package/script/src/types/info/requests.d.ts +0 -640
  342. package/script/src/types/info/requests.d.ts.map +0 -1
  343. package/script/src/types/info/requests.js +0 -2
  344. package/script/src/types/info/validators.d.ts +0 -147
  345. package/script/src/types/info/validators.d.ts.map +0 -1
  346. package/script/src/types/info/validators.js +0 -2
  347. package/script/src/types/info/vaults.d.ts +0 -119
  348. package/script/src/types/info/vaults.d.ts.map +0 -1
  349. package/script/src/types/info/vaults.js +0 -2
  350. package/script/src/types/mod.d.ts +0 -38
  351. package/script/src/types/mod.d.ts.map +0 -1
  352. package/script/src/types/mod.js +0 -25
  353. package/script/src/types/subscriptions/requests.d.ts +0 -154
  354. package/script/src/types/subscriptions/requests.d.ts.map +0 -1
  355. package/script/src/types/subscriptions/requests.js +0 -2
  356. package/script/src/types/subscriptions/responses.d.ts +0 -238
  357. package/script/src/types/subscriptions/responses.d.ts.map +0 -1
  358. package/script/src/types/subscriptions/responses.js +0 -2
@@ -0,0 +1,394 @@
1
+ import { TransportError } from "../base.js";
2
+ import type { IRequestTransport, ISubscriptionTransport, Subscription } from "../base.js";
3
+ import {
4
+ type MessageBufferStrategy,
5
+ ReconnectingWebSocket,
6
+ ReconnectingWebSocketError,
7
+ type ReconnectingWebSocketOptions,
8
+ } from "./_reconnecting_websocket.js";
9
+ import { HyperliquidEventTarget } from "./_hyperliquid_event_target.js";
10
+ import { WebSocketAsyncRequest } from "./_websocket_async_request.js";
11
+
12
+ export { type MessageBufferStrategy, ReconnectingWebSocketError, type ReconnectingWebSocketOptions };
13
+
14
+ /** Configuration options for the WebSocket transport layer. */
15
+ export interface WebSocketTransportOptions {
16
+ /**
17
+ * The WebSocket URL.
18
+ * - Mainnet:
19
+ * - API: `wss://api.hyperliquid.xyz/ws`
20
+ * - Explorer: `wss://rpc.hyperliquid.xyz/ws`
21
+ * - Testnet:
22
+ * - API: `wss://api.hyperliquid-testnet.xyz/ws`
23
+ * - Explorer: `wss://rpc.hyperliquid-testnet.xyz/ws`
24
+ * @defaultValue `wss://api.hyperliquid.xyz/ws`
25
+ */
26
+ url?: string | URL;
27
+
28
+ /**
29
+ * Indicates this transport uses testnet endpoint.
30
+ * @defaultValue `false`
31
+ */
32
+ isTestnet?: boolean;
33
+
34
+ /**
35
+ * Timeout for requests in ms.
36
+ * Set to `null` to disable.
37
+ * @defaultValue `10_000`
38
+ */
39
+ timeout?: number | null;
40
+
41
+ /** Keep-alive configuration. */
42
+ keepAlive?: {
43
+ /**
44
+ * Interval between sending ping messages in ms.
45
+ * Set to `null` to disable.
46
+ * @defaultValue `30_000`
47
+ */
48
+ interval?: number | null;
49
+
50
+ /**
51
+ * Timeout for the ping request in ms.
52
+ * Set to `null` to disable.
53
+ * @defaultValue same as {@link timeout} for requests.
54
+ */
55
+ timeout?: number | null;
56
+ };
57
+
58
+ /** Reconnection policy configuration for closed connections. */
59
+ reconnect?: ReconnectingWebSocketOptions;
60
+
61
+ /**
62
+ * Enable automatic event resubscription after reconnection.
63
+ * @defaultValue `true`
64
+ */
65
+ autoResubscribe?: boolean;
66
+ }
67
+
68
+ /** Error thrown when a WebSocket request fails. */
69
+ export class WebSocketRequestError extends TransportError {
70
+ constructor(message?: string, options?: ErrorOptions) {
71
+ super(message, options);
72
+ this.name = "WebSocketRequestError";
73
+ }
74
+ }
75
+
76
+ /** WebSocket implementation of the REST and Subscription transport interfaces. */
77
+ export class WebSocketTransport implements IRequestTransport, ISubscriptionTransport, AsyncDisposable {
78
+ protected _wsRequester: WebSocketAsyncRequest;
79
+ protected _hlEvents: HyperliquidEventTarget;
80
+ protected _keepAliveTimeout: ReturnType<typeof setTimeout> | null = null;
81
+ protected _subscriptions: Map<
82
+ string, // Unique identifier based on the payload
83
+ {
84
+ listeners: Map<
85
+ (data: CustomEvent) => void, // Event listener function
86
+ () => Promise<void> // Unsubscribe function
87
+ >;
88
+ promise: Promise<unknown>; // Subscription request promise
89
+ resubscribeAbortController?: AbortController; // To monitor reconnection errors
90
+ }
91
+ > = new Map();
92
+ protected _isReconnecting = false;
93
+
94
+ /** Indicates this transport uses testnet endpoint. */
95
+ isTestnet: boolean;
96
+
97
+ /**
98
+ * Request timeout in ms.
99
+ * Set to `null` to disable.
100
+ */
101
+ timeout: number | null;
102
+
103
+ /** Keep-alive configuration. */
104
+ keepAlive: {
105
+ /**
106
+ * Interval between sending ping messages in ms.
107
+ * Set to `null` to disable.
108
+ */
109
+ interval: number | null;
110
+
111
+ /**
112
+ * Timeout for the ping request in ms.
113
+ * Set to `null` to disable.
114
+ */
115
+ timeout?: number | null;
116
+ };
117
+
118
+ /** Enable automatic resubscription after reconnection. */
119
+ autoResubscribe: boolean;
120
+
121
+ /** The WebSocket that is used for communication. */
122
+ readonly socket: ReconnectingWebSocket;
123
+
124
+ /**
125
+ * Creates a new WebSocket transport instance.
126
+ * @param options - Configuration options for the WebSocket transport layer.
127
+ */
128
+ constructor(options?: WebSocketTransportOptions) {
129
+ this.socket = new ReconnectingWebSocket(
130
+ options?.url ?? "wss://api.hyperliquid.xyz/ws",
131
+ undefined,
132
+ options?.reconnect,
133
+ );
134
+ this._hlEvents = new HyperliquidEventTarget(this.socket);
135
+ this._wsRequester = new WebSocketAsyncRequest(this.socket, this._hlEvents);
136
+
137
+ this.isTestnet = options?.isTestnet ?? false;
138
+ this.timeout = options?.timeout === undefined ? 10_000 : options.timeout;
139
+ this.keepAlive = {
140
+ interval: options?.keepAlive?.interval === undefined ? 30_000 : options.keepAlive?.interval,
141
+ timeout: options?.keepAlive?.timeout === undefined ? this.timeout : options.keepAlive?.timeout,
142
+ };
143
+ this.autoResubscribe = options?.autoResubscribe ?? true;
144
+
145
+ // Initialize listeners
146
+ this.socket.addEventListener("open", () => {
147
+ this._keepAliveStart();
148
+ this._resubscribeStart();
149
+ });
150
+ this.socket.addEventListener("close", () => {
151
+ this._keepAliveStop();
152
+ this._resubscribeStop();
153
+ this._isReconnecting = true;
154
+ });
155
+ }
156
+
157
+ /**
158
+ * Sends a request to the Hyperliquid API via WebSocket.
159
+ *
160
+ * Note: Explorer requests are not supported in the Hyperliquid WebSocket API.
161
+ *
162
+ * @param endpoint - The API endpoint to send the request to (`explorer` requests are not supported).
163
+ * @param payload - The payload to send with the request.
164
+ * @param signal - An {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | AbortSignal}. If this option is set, the request can be canceled by calling {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort | abort()} on the corresponding {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/AbortController | AbortController}.
165
+ * @returns A promise that resolves with parsed JSON response body.
166
+ *
167
+ * @throws {WebSocketRequestError} - An error that occurs when a WebSocket request fails.
168
+ */
169
+ async request<T>(type: "info" | "exchange", payload: unknown, signal?: AbortSignal): Promise<T> {
170
+ try {
171
+ const timeoutSignal = this.timeout ? AbortSignal.timeout(this.timeout) : undefined;
172
+ const combinedSignal = signal && timeoutSignal
173
+ ? AbortSignal.any([signal, timeoutSignal])
174
+ : signal ?? timeoutSignal;
175
+
176
+ return await this._wsRequester.request(
177
+ "post",
178
+ {
179
+ type: type === "exchange" ? "action" : type,
180
+ payload,
181
+ },
182
+ combinedSignal,
183
+ );
184
+ } catch (error) {
185
+ if (error instanceof TransportError) throw error; // Re-throw known errors
186
+ throw new WebSocketRequestError(
187
+ `Unknown error while making a WebSocket request: ${error}`,
188
+ { cause: error },
189
+ );
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Subscribes to a Hyperliquid event channel.
195
+ * Sends a subscription request to the server and listens for events.
196
+ *
197
+ * @param channel - The event channel to listen to.
198
+ * @param payload - A payload to send with the subscription request.
199
+ * @param listener - A function to call when the event is dispatched.
200
+ * @returns A promise that resolves with a {@link Subscription} object to manage the subscription lifecycle.
201
+ *
202
+ * @throws {WebSocketRequestError} - An error that occurs when a WebSocket request fails.
203
+ */
204
+ async subscribe<T>(
205
+ channel: string,
206
+ payload: unknown,
207
+ listener: (data: CustomEvent<T>) => void,
208
+ ): Promise<Subscription> {
209
+ try {
210
+ // Create a unique identifier for the subscription
211
+ const id = WebSocketAsyncRequest.requestToId(payload);
212
+
213
+ // Initialize new subscription, if it doesn't exist
214
+ let subscription = this._subscriptions.get(id);
215
+ if (!subscription) {
216
+ // Send subscription request
217
+ const promise = this._wsRequester.request("subscribe", payload);
218
+
219
+ // Cache subscription info
220
+ subscription = {
221
+ listeners: new Map(),
222
+ promise,
223
+ resubscribeAbortController: new AbortController(),
224
+ };
225
+ this._subscriptions.set(id, subscription);
226
+ }
227
+
228
+ // Initialize new listener, if it doesn't exist
229
+ let unsubscribe = subscription.listeners.get(listener);
230
+ if (!unsubscribe) {
231
+ // Create new unsubscribe function
232
+ unsubscribe = async () => {
233
+ try {
234
+ // Remove listener and cleanup
235
+ this._hlEvents.removeEventListener(channel, listener as EventListener);
236
+ const subscription = this._subscriptions.get(id);
237
+ subscription?.listeners.delete(listener);
238
+
239
+ // If no listeners remain, remove subscription entirely
240
+ if (subscription?.listeners.size === 0) {
241
+ // Cleanup subscription
242
+ this._subscriptions.delete(id);
243
+
244
+ // If the socket is open, send unsubscription request
245
+ if (this.socket.readyState === ReconnectingWebSocket.OPEN) {
246
+ await this._wsRequester.request("unsubscribe", payload);
247
+ }
248
+ }
249
+ } catch (error) {
250
+ if (error instanceof TransportError) throw error; // Re-throw known errors
251
+ throw new WebSocketRequestError(
252
+ `Unknown error while unsubscribing from a WebSocket channel: ${error}`,
253
+ { cause: error },
254
+ );
255
+ }
256
+ };
257
+
258
+ // Add listener and cache unsubscribe function
259
+ this._hlEvents.addEventListener(channel, listener as EventListener);
260
+ subscription.listeners.set(listener, unsubscribe);
261
+ }
262
+
263
+ // Wait for the initial subscription request to complete
264
+ await subscription.promise;
265
+
266
+ // Return subscription control object
267
+ return {
268
+ unsubscribe,
269
+ resubscribeSignal: subscription.resubscribeAbortController?.signal,
270
+ };
271
+ } catch (error) {
272
+ if (error instanceof TransportError) throw error; // Re-throw known errors
273
+ throw new WebSocketRequestError(
274
+ `Unknown error while subscribing to a WebSocket channel: ${error}`,
275
+ { cause: error },
276
+ );
277
+ }
278
+ }
279
+
280
+ /**
281
+ * Waits until the WebSocket connection is ready.
282
+ * @param signal - An {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | AbortSignal}. If this option is set, the promise can be canceled by calling {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort | abort()} on the corresponding {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/AbortController | AbortController}.
283
+ * @returns A promise that resolves when the connection is ready.
284
+ */
285
+ ready(signal?: AbortSignal): Promise<void> {
286
+ return new Promise((resolve, reject) => {
287
+ const combinedSignal = signal
288
+ ? AbortSignal.any([this.socket.reconnectAbortController.signal, signal])
289
+ : this.socket.reconnectAbortController.signal;
290
+
291
+ if (combinedSignal.aborted) return reject(combinedSignal.reason);
292
+ if (this.socket.readyState === ReconnectingWebSocket.OPEN) return resolve();
293
+
294
+ const handleOpen = () => {
295
+ combinedSignal.removeEventListener("abort", handleAbort);
296
+ resolve();
297
+ };
298
+ const handleAbort = () => {
299
+ this.socket.removeEventListener("open", handleOpen);
300
+ reject(combinedSignal.reason);
301
+ };
302
+
303
+ this.socket.addEventListener("open", handleOpen, { once: true });
304
+ combinedSignal.addEventListener("abort", handleAbort, { once: true });
305
+ });
306
+ }
307
+
308
+ /**
309
+ * Closes the WebSocket connection and waits until it is fully closed.
310
+ * @param signal - An {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | AbortSignal}. If this option is set, the promise can be canceled by calling {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort | abort()} on the corresponding {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/AbortController | AbortController}.
311
+ * @returns A promise that resolves when the connection is fully closed.
312
+ */
313
+ close(signal?: AbortSignal): Promise<void> {
314
+ return new Promise((resolve, reject) => {
315
+ if (signal?.aborted) return reject(signal.reason);
316
+ if (this.socket.readyState === ReconnectingWebSocket.CLOSED) return resolve();
317
+
318
+ const handleClose = () => {
319
+ signal?.removeEventListener("abort", handleAbort);
320
+ resolve();
321
+ };
322
+ const handleAbort = () => {
323
+ this.socket.removeEventListener("close", handleClose);
324
+ reject(signal?.reason);
325
+ };
326
+
327
+ this.socket.addEventListener("close", handleClose, { once: true });
328
+ signal?.addEventListener("abort", handleAbort, { once: true });
329
+
330
+ this.socket.close();
331
+ });
332
+ }
333
+
334
+ /** Keep the connection alive. Sends ping only when necessary. */
335
+ protected _keepAliveStart(): void {
336
+ if (this.keepAlive.interval === null || this._keepAliveTimeout) return;
337
+
338
+ const tick = async () => {
339
+ if (
340
+ this.socket.readyState !== ReconnectingWebSocket.OPEN || !this._keepAliveTimeout ||
341
+ this.keepAlive.interval === null
342
+ ) return;
343
+
344
+ // Check if the last request was sent more than the keep-alive interval ago
345
+ if (Date.now() - this._wsRequester.lastRequestTime >= this.keepAlive.interval) {
346
+ const timeoutSignal = this.keepAlive.timeout ? AbortSignal.timeout(this.keepAlive.timeout) : undefined;
347
+ await this._wsRequester.request("ping", timeoutSignal)
348
+ .catch(() => undefined); // Ignore errors
349
+ }
350
+
351
+ // Schedule the next ping
352
+ if (
353
+ this.socket.readyState === ReconnectingWebSocket.OPEN && this._keepAliveTimeout &&
354
+ this.keepAlive.interval !== null
355
+ ) {
356
+ const nextDelay = this.keepAlive.interval - (Date.now() - this._wsRequester.lastRequestTime);
357
+ this._keepAliveTimeout = setTimeout(tick, nextDelay);
358
+ }
359
+ };
360
+
361
+ this._keepAliveTimeout = setTimeout(tick, this.keepAlive.interval);
362
+ }
363
+ protected _keepAliveStop(): void {
364
+ if (this._keepAliveTimeout !== null) {
365
+ clearTimeout(this._keepAliveTimeout);
366
+ this._keepAliveTimeout = null;
367
+ }
368
+ }
369
+
370
+ /** Resubscribe to all existing subscriptions if auto-resubscribe is enabled. */
371
+ protected _resubscribeStart(): void {
372
+ if (this.autoResubscribe && this._isReconnecting) {
373
+ for (const [id, subscriptionInfo] of this._subscriptions.entries()) {
374
+ subscriptionInfo.promise = this._wsRequester.request("subscribe", JSON.parse(id))
375
+ .catch((error) => {
376
+ subscriptionInfo.resubscribeAbortController?.abort(error);
377
+ });
378
+ }
379
+ }
380
+ }
381
+ protected _resubscribeStop(): void {
382
+ if (!this.autoResubscribe || this.socket.reconnectAbortController.signal.aborted) {
383
+ for (const subscriptionInfo of this._subscriptions.values()) {
384
+ for (const [_, unsubscribe] of subscriptionInfo.listeners) {
385
+ unsubscribe(); // does not cause an error if used when the connection is closed
386
+ }
387
+ }
388
+ }
389
+ }
390
+
391
+ async [Symbol.asyncDispose](): Promise<void> {
392
+ await this.close();
393
+ }
394
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/src/base.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,qBAAa,gBAAiB,SAAQ,KAAK;gBAC3B,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIvD"}
@@ -1,127 +0,0 @@
1
- import type { ApproveAgentRequest, ApproveBuilderFeeRequest, BatchModifyRequest, CancelByCloidRequest, CancelRequest, CDepositRequest, ClaimRewardsRequest, ConvertToMultiSigUserRequest, ConvertToMultiSigUserRequestWithoutStringify, CreateSubAccountRequest, CreateVaultRequest, CSignerActionRequest, CValidatorActionRequest, CWithdrawRequest, EvmUserModifyRequest, ModifyRequest, MultiSigRequest, NoopRequest, OrderRequest, PerpDeployRequest, RegisterReferrerRequest, ReserveRequestWeightRequest, ScheduleCancelRequest, SendAssetRequest, SetDisplayNameRequest, SetReferrerRequest, SpotDeployRequest, SpotSendRequest, SpotUserRequest, SubAccountModifyRequest, SubAccountSpotTransferRequest, SubAccountTransferRequest, TokenDelegateRequest, TwapCancelRequest, TwapOrderRequest, UpdateIsolatedMarginRequest, UpdateLeverageRequest, UsdClassTransferRequest, UsdSendRequest, VaultDistributeRequest, VaultModifyRequest, VaultTransferRequest, Withdraw3Request } from "../types/mod.js";
2
- /** @see https://github.com/microsoft/TypeScript/issues/13923#issuecomment-2191862501 */
3
- type DeepImmutable<T> = {
4
- readonly [K in keyof T]: DeepImmutable<T[K]>;
5
- };
6
- /** Action sorter and formatter for correct signature generation. */
7
- export declare const actionSorter: {
8
- approveAgent: (action: DeepImmutable<ApproveAgentRequest["action"]>) => ApproveAgentRequest["action"];
9
- approveBuilderFee: (action: DeepImmutable<ApproveBuilderFeeRequest["action"]>) => ApproveBuilderFeeRequest["action"];
10
- batchModify: (action: DeepImmutable<BatchModifyRequest["action"]>) => BatchModifyRequest["action"];
11
- cancel: (action: DeepImmutable<CancelRequest["action"]>) => CancelRequest["action"];
12
- cancelByCloid: (action: DeepImmutable<CancelByCloidRequest["action"]>) => CancelByCloidRequest["action"];
13
- cDeposit: (action: DeepImmutable<CDepositRequest["action"]>) => CDepositRequest["action"];
14
- claimRewards: (action: DeepImmutable<ClaimRewardsRequest["action"]>) => ClaimRewardsRequest["action"];
15
- convertToMultiSigUser: (action: DeepImmutable<ConvertToMultiSigUserRequest["action"] | ConvertToMultiSigUserRequestWithoutStringify["action"]>) => ConvertToMultiSigUserRequest["action"];
16
- createSubAccount: (action: DeepImmutable<CreateSubAccountRequest["action"]>) => CreateSubAccountRequest["action"];
17
- createVault: (action: DeepImmutable<CreateVaultRequest["action"]>) => CreateVaultRequest["action"];
18
- CSignerAction: (action: DeepImmutable<CSignerActionRequest["action"]>) => CSignerActionRequest["action"];
19
- CValidatorAction: (action: DeepImmutable<CValidatorActionRequest["action"]>) => CValidatorActionRequest["action"];
20
- cWithdraw: (action: DeepImmutable<CWithdrawRequest["action"]>) => CWithdrawRequest["action"];
21
- evmUserModify: (action: DeepImmutable<EvmUserModifyRequest["action"]>) => EvmUserModifyRequest["action"];
22
- modify: (action: DeepImmutable<ModifyRequest["action"]>) => ModifyRequest["action"];
23
- multiSig: (action: DeepImmutable<MultiSigRequest["action"]>) => MultiSigRequest["action"];
24
- noop: (action: DeepImmutable<NoopRequest["action"]>) => NoopRequest["action"];
25
- order: (action: DeepImmutable<OrderRequest["action"]>) => OrderRequest["action"];
26
- perpDeploy: (action: DeepImmutable<PerpDeployRequest["action"]>) => PerpDeployRequest["action"];
27
- registerReferrer: (action: DeepImmutable<RegisterReferrerRequest["action"]>) => RegisterReferrerRequest["action"];
28
- reserveRequestWeight: (action: DeepImmutable<ReserveRequestWeightRequest["action"]>) => ReserveRequestWeightRequest["action"];
29
- scheduleCancel: (action: DeepImmutable<ScheduleCancelRequest["action"]>) => ScheduleCancelRequest["action"];
30
- sendAsset: (action: DeepImmutable<SendAssetRequest["action"]>) => SendAssetRequest["action"];
31
- setDisplayName: (action: DeepImmutable<SetDisplayNameRequest["action"]>) => SetDisplayNameRequest["action"];
32
- setReferrer: (action: DeepImmutable<SetReferrerRequest["action"]>) => SetReferrerRequest["action"];
33
- spotDeploy: (action: DeepImmutable<SpotDeployRequest["action"]>) => SpotDeployRequest["action"];
34
- spotSend: (action: DeepImmutable<SpotSendRequest["action"]>) => SpotSendRequest["action"];
35
- spotUser: (action: DeepImmutable<SpotUserRequest["action"]>) => SpotUserRequest["action"];
36
- subAccountModify: (action: DeepImmutable<SubAccountModifyRequest["action"]>) => SubAccountModifyRequest["action"];
37
- subAccountSpotTransfer: (action: DeepImmutable<SubAccountSpotTransferRequest["action"]>) => SubAccountSpotTransferRequest["action"];
38
- subAccountTransfer: (action: DeepImmutable<SubAccountTransferRequest["action"]>) => SubAccountTransferRequest["action"];
39
- tokenDelegate: (action: DeepImmutable<TokenDelegateRequest["action"]>) => TokenDelegateRequest["action"];
40
- twapCancel: (action: DeepImmutable<TwapCancelRequest["action"]>) => TwapCancelRequest["action"];
41
- twapOrder: (action: DeepImmutable<TwapOrderRequest["action"]>) => TwapOrderRequest["action"];
42
- updateIsolatedMargin: (action: DeepImmutable<UpdateIsolatedMarginRequest["action"]>) => UpdateIsolatedMarginRequest["action"];
43
- updateLeverage: (action: DeepImmutable<UpdateLeverageRequest["action"]>) => UpdateLeverageRequest["action"];
44
- usdClassTransfer: (action: DeepImmutable<UsdClassTransferRequest["action"]>) => UsdClassTransferRequest["action"];
45
- usdSend: (action: DeepImmutable<UsdSendRequest["action"]>) => UsdSendRequest["action"];
46
- vaultDistribute: (action: DeepImmutable<VaultDistributeRequest["action"]>) => VaultDistributeRequest["action"];
47
- vaultModify: (action: DeepImmutable<VaultModifyRequest["action"]>) => VaultModifyRequest["action"];
48
- vaultTransfer: (action: DeepImmutable<VaultTransferRequest["action"]>) => VaultTransferRequest["action"];
49
- withdraw3: (action: DeepImmutable<Withdraw3Request["action"]>) => Withdraw3Request["action"];
50
- };
51
- /** EIP-712 type definitions for user-signed actions. */
52
- export declare const userSignedActionEip712Types: {
53
- approveAgent: {
54
- "HyperliquidTransaction:ApproveAgent": {
55
- name: string;
56
- type: string;
57
- }[];
58
- };
59
- approveBuilderFee: {
60
- "HyperliquidTransaction:ApproveBuilderFee": {
61
- name: string;
62
- type: string;
63
- }[];
64
- };
65
- cDeposit: {
66
- "HyperliquidTransaction:CDeposit": {
67
- name: string;
68
- type: string;
69
- }[];
70
- };
71
- convertToMultiSigUser: {
72
- "HyperliquidTransaction:ConvertToMultiSigUser": {
73
- name: string;
74
- type: string;
75
- }[];
76
- };
77
- cWithdraw: {
78
- "HyperliquidTransaction:CWithdraw": {
79
- name: string;
80
- type: string;
81
- }[];
82
- };
83
- multiSig: {
84
- "HyperliquidTransaction:SendMultiSig": {
85
- name: string;
86
- type: string;
87
- }[];
88
- };
89
- sendAsset: {
90
- "HyperliquidTransaction:SendAsset": {
91
- name: string;
92
- type: string;
93
- }[];
94
- };
95
- spotSend: {
96
- "HyperliquidTransaction:SpotSend": {
97
- name: string;
98
- type: string;
99
- }[];
100
- };
101
- tokenDelegate: {
102
- "HyperliquidTransaction:TokenDelegate": {
103
- name: string;
104
- type: string;
105
- }[];
106
- };
107
- usdClassTransfer: {
108
- "HyperliquidTransaction:UsdClassTransfer": {
109
- name: string;
110
- type: string;
111
- }[];
112
- };
113
- usdSend: {
114
- "HyperliquidTransaction:UsdSend": {
115
- name: string;
116
- type: string;
117
- }[];
118
- };
119
- withdraw3: {
120
- "HyperliquidTransaction:Withdraw": {
121
- name: string;
122
- type: string;
123
- }[];
124
- };
125
- };
126
- export {};
127
- //# sourceMappingURL=_sorter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_sorter.d.ts","sourceRoot":"","sources":["../../../src/src/signing/_sorter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,4BAA4B,EAC5B,4CAA4C,EAC5C,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,6BAA6B,EAC7B,yBAAyB,EACzB,oBAAoB,E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