@nktkas/hyperliquid 0.25.7 → 0.25.9

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 (543) hide show
  1. package/CONTRIBUTING.md +26 -19
  2. package/README.md +57 -5
  3. package/esm/bin/cli.js +2 -1
  4. package/esm/bin/cli.js.map +1 -1
  5. package/esm/src/api/_common_schemas.d.ts +19 -0
  6. package/esm/src/api/_common_schemas.d.ts.map +1 -1
  7. package/esm/src/api/_common_schemas.js +15 -0
  8. package/esm/src/api/_common_schemas.js.map +1 -1
  9. package/esm/src/api/exchange/_base/_execute.d.ts +6 -7
  10. package/esm/src/api/exchange/_base/_execute.d.ts.map +1 -1
  11. package/esm/src/api/exchange/_base/_execute.js +67 -43
  12. package/esm/src/api/exchange/_base/_execute.js.map +1 -1
  13. package/esm/src/api/exchange/_base/_types.d.ts +0 -7
  14. package/esm/src/api/exchange/_base/_types.d.ts.map +1 -1
  15. package/esm/src/api/exchange/_base/mod.d.ts +0 -2
  16. package/esm/src/api/exchange/_base/mod.d.ts.map +1 -1
  17. package/esm/src/api/exchange/_base/mod.js +0 -2
  18. package/esm/src/api/exchange/_base/mod.js.map +1 -1
  19. package/esm/src/api/exchange/agentEnableDexAbstraction.d.ts.map +1 -1
  20. package/esm/src/api/exchange/agentEnableDexAbstraction.js +14 -7
  21. package/esm/src/api/exchange/agentEnableDexAbstraction.js.map +1 -1
  22. package/esm/src/api/exchange/approveAgent.d.ts.map +1 -1
  23. package/esm/src/api/exchange/approveAgent.js +16 -8
  24. package/esm/src/api/exchange/approveAgent.js.map +1 -1
  25. package/esm/src/api/exchange/approveBuilderFee.d.ts.map +1 -1
  26. package/esm/src/api/exchange/approveBuilderFee.js +16 -8
  27. package/esm/src/api/exchange/approveBuilderFee.js.map +1 -1
  28. package/esm/src/api/exchange/batchModify.d.ts.map +1 -1
  29. package/esm/src/api/exchange/batchModify.js +16 -10
  30. package/esm/src/api/exchange/batchModify.js.map +1 -1
  31. package/esm/src/api/exchange/cDeposit.d.ts.map +1 -1
  32. package/esm/src/api/exchange/cDeposit.js +16 -8
  33. package/esm/src/api/exchange/cDeposit.js.map +1 -1
  34. package/esm/src/api/exchange/cSignerAction.d.ts.map +1 -1
  35. package/esm/src/api/exchange/cSignerAction.js +15 -8
  36. package/esm/src/api/exchange/cSignerAction.js.map +1 -1
  37. package/esm/src/api/exchange/cValidatorAction.d.ts.map +1 -1
  38. package/esm/src/api/exchange/cValidatorAction.js +15 -8
  39. package/esm/src/api/exchange/cValidatorAction.js.map +1 -1
  40. package/esm/src/api/exchange/cWithdraw.d.ts.map +1 -1
  41. package/esm/src/api/exchange/cWithdraw.js +16 -8
  42. package/esm/src/api/exchange/cWithdraw.js.map +1 -1
  43. package/esm/src/api/exchange/cancel.d.ts.map +1 -1
  44. package/esm/src/api/exchange/cancel.js +16 -10
  45. package/esm/src/api/exchange/cancel.js.map +1 -1
  46. package/esm/src/api/exchange/cancelByCloid.d.ts.map +1 -1
  47. package/esm/src/api/exchange/cancelByCloid.js +16 -10
  48. package/esm/src/api/exchange/cancelByCloid.js.map +1 -1
  49. package/esm/src/api/exchange/claimRewards.d.ts.map +1 -1
  50. package/esm/src/api/exchange/claimRewards.js +14 -7
  51. package/esm/src/api/exchange/claimRewards.js.map +1 -1
  52. package/esm/src/api/exchange/convertToMultiSigUser.d.ts.map +1 -1
  53. package/esm/src/api/exchange/convertToMultiSigUser.js +16 -8
  54. package/esm/src/api/exchange/convertToMultiSigUser.js.map +1 -1
  55. package/esm/src/api/exchange/createSubAccount.d.ts.map +1 -1
  56. package/esm/src/api/exchange/createSubAccount.js +15 -8
  57. package/esm/src/api/exchange/createSubAccount.js.map +1 -1
  58. package/esm/src/api/exchange/createVault.d.ts.map +1 -1
  59. package/esm/src/api/exchange/createVault.js +15 -8
  60. package/esm/src/api/exchange/createVault.js.map +1 -1
  61. package/esm/src/api/exchange/evmUserModify.d.ts +1 -1
  62. package/esm/src/api/exchange/evmUserModify.d.ts.map +1 -1
  63. package/esm/src/api/exchange/evmUserModify.js +16 -9
  64. package/esm/src/api/exchange/evmUserModify.js.map +1 -1
  65. package/esm/src/api/exchange/linkStakingUser.d.ts +112 -0
  66. package/esm/src/api/exchange/linkStakingUser.d.ts.map +1 -0
  67. package/esm/src/api/exchange/linkStakingUser.js +99 -0
  68. package/esm/src/api/exchange/linkStakingUser.js.map +1 -0
  69. package/esm/src/api/exchange/modify.d.ts.map +1 -1
  70. package/esm/src/api/exchange/modify.js +16 -10
  71. package/esm/src/api/exchange/modify.js.map +1 -1
  72. package/esm/src/api/exchange/multiSig.d.ts +81 -0
  73. package/esm/src/api/exchange/multiSig.d.ts.map +1 -1
  74. package/esm/src/api/exchange/multiSig.js +17 -16
  75. package/esm/src/api/exchange/multiSig.js.map +1 -1
  76. package/esm/src/api/exchange/noop.d.ts.map +1 -1
  77. package/esm/src/api/exchange/noop.js +14 -7
  78. package/esm/src/api/exchange/noop.js.map +1 -1
  79. package/esm/src/api/exchange/order.d.ts.map +1 -1
  80. package/esm/src/api/exchange/order.js +16 -10
  81. package/esm/src/api/exchange/order.js.map +1 -1
  82. package/esm/src/api/exchange/perpDeploy.d.ts +58 -0
  83. package/esm/src/api/exchange/perpDeploy.d.ts.map +1 -1
  84. package/esm/src/api/exchange/perpDeploy.js +33 -8
  85. package/esm/src/api/exchange/perpDeploy.js.map +1 -1
  86. package/esm/src/api/exchange/registerReferrer.d.ts.map +1 -1
  87. package/esm/src/api/exchange/registerReferrer.js +15 -8
  88. package/esm/src/api/exchange/registerReferrer.js.map +1 -1
  89. package/esm/src/api/exchange/reserveRequestWeight.d.ts.map +1 -1
  90. package/esm/src/api/exchange/reserveRequestWeight.js +15 -8
  91. package/esm/src/api/exchange/reserveRequestWeight.js.map +1 -1
  92. package/esm/src/api/exchange/scheduleCancel.js +16 -10
  93. package/esm/src/api/exchange/scheduleCancel.js.map +1 -1
  94. package/esm/src/api/exchange/sendAsset.d.ts.map +1 -1
  95. package/esm/src/api/exchange/sendAsset.js +16 -8
  96. package/esm/src/api/exchange/sendAsset.js.map +1 -1
  97. package/esm/src/api/exchange/setDisplayName.d.ts.map +1 -1
  98. package/esm/src/api/exchange/setDisplayName.js +15 -8
  99. package/esm/src/api/exchange/setDisplayName.js.map +1 -1
  100. package/esm/src/api/exchange/setReferrer.d.ts.map +1 -1
  101. package/esm/src/api/exchange/setReferrer.js +15 -8
  102. package/esm/src/api/exchange/setReferrer.js.map +1 -1
  103. package/esm/src/api/exchange/spotDeploy.d.ts.map +1 -1
  104. package/esm/src/api/exchange/spotDeploy.js +15 -8
  105. package/esm/src/api/exchange/spotDeploy.js.map +1 -1
  106. package/esm/src/api/exchange/spotSend.d.ts.map +1 -1
  107. package/esm/src/api/exchange/spotSend.js +16 -8
  108. package/esm/src/api/exchange/spotSend.js.map +1 -1
  109. package/esm/src/api/exchange/spotUser.d.ts.map +1 -1
  110. package/esm/src/api/exchange/spotUser.js +15 -8
  111. package/esm/src/api/exchange/spotUser.js.map +1 -1
  112. package/esm/src/api/exchange/subAccountModify.d.ts.map +1 -1
  113. package/esm/src/api/exchange/subAccountModify.js +15 -8
  114. package/esm/src/api/exchange/subAccountModify.js.map +1 -1
  115. package/esm/src/api/exchange/subAccountSpotTransfer.d.ts.map +1 -1
  116. package/esm/src/api/exchange/subAccountSpotTransfer.js +15 -8
  117. package/esm/src/api/exchange/subAccountSpotTransfer.js.map +1 -1
  118. package/esm/src/api/exchange/subAccountTransfer.d.ts.map +1 -1
  119. package/esm/src/api/exchange/subAccountTransfer.js +15 -8
  120. package/esm/src/api/exchange/subAccountTransfer.js.map +1 -1
  121. package/esm/src/api/exchange/tokenDelegate.d.ts.map +1 -1
  122. package/esm/src/api/exchange/tokenDelegate.js +16 -8
  123. package/esm/src/api/exchange/tokenDelegate.js.map +1 -1
  124. package/esm/src/api/exchange/twapCancel.d.ts.map +1 -1
  125. package/esm/src/api/exchange/twapCancel.js +16 -10
  126. package/esm/src/api/exchange/twapCancel.js.map +1 -1
  127. package/esm/src/api/exchange/twapOrder.d.ts.map +1 -1
  128. package/esm/src/api/exchange/twapOrder.js +16 -10
  129. package/esm/src/api/exchange/twapOrder.js.map +1 -1
  130. package/esm/src/api/exchange/updateIsolatedMargin.d.ts.map +1 -1
  131. package/esm/src/api/exchange/updateIsolatedMargin.js +16 -10
  132. package/esm/src/api/exchange/updateIsolatedMargin.js.map +1 -1
  133. package/esm/src/api/exchange/updateLeverage.d.ts.map +1 -1
  134. package/esm/src/api/exchange/updateLeverage.js +16 -10
  135. package/esm/src/api/exchange/updateLeverage.js.map +1 -1
  136. package/esm/src/api/exchange/usdClassTransfer.d.ts.map +1 -1
  137. package/esm/src/api/exchange/usdClassTransfer.js +16 -8
  138. package/esm/src/api/exchange/usdClassTransfer.js.map +1 -1
  139. package/esm/src/api/exchange/usdSend.d.ts.map +1 -1
  140. package/esm/src/api/exchange/usdSend.js +16 -8
  141. package/esm/src/api/exchange/usdSend.js.map +1 -1
  142. package/esm/src/api/exchange/userDexAbstraction.d.ts.map +1 -1
  143. package/esm/src/api/exchange/userDexAbstraction.js +16 -8
  144. package/esm/src/api/exchange/userDexAbstraction.js.map +1 -1
  145. package/esm/src/api/exchange/vaultDistribute.d.ts.map +1 -1
  146. package/esm/src/api/exchange/vaultDistribute.js +15 -8
  147. package/esm/src/api/exchange/vaultDistribute.js.map +1 -1
  148. package/esm/src/api/exchange/vaultModify.d.ts.map +1 -1
  149. package/esm/src/api/exchange/vaultModify.js +15 -8
  150. package/esm/src/api/exchange/vaultModify.js.map +1 -1
  151. package/esm/src/api/exchange/vaultTransfer.d.ts.map +1 -1
  152. package/esm/src/api/exchange/vaultTransfer.js +15 -8
  153. package/esm/src/api/exchange/vaultTransfer.js.map +1 -1
  154. package/esm/src/api/exchange/withdraw3.d.ts.map +1 -1
  155. package/esm/src/api/exchange/withdraw3.js +16 -8
  156. package/esm/src/api/exchange/withdraw3.js.map +1 -1
  157. package/esm/src/api/exchange/~client.d.ts +31 -3
  158. package/esm/src/api/exchange/~client.d.ts.map +1 -1
  159. package/esm/src/api/exchange/~client.js +27 -4
  160. package/esm/src/api/exchange/~client.js.map +1 -1
  161. package/esm/src/api/exchange/~mod.d.ts +1 -0
  162. package/esm/src/api/exchange/~mod.d.ts.map +1 -1
  163. package/esm/src/api/exchange/~mod.js +1 -0
  164. package/esm/src/api/exchange/~mod.js.map +1 -1
  165. package/esm/src/api/info/allPerpMetas.d.ts +5 -0
  166. package/esm/src/api/info/allPerpMetas.d.ts.map +1 -1
  167. package/esm/src/api/info/meta.d.ts +5 -0
  168. package/esm/src/api/info/meta.d.ts.map +1 -1
  169. package/esm/src/api/info/meta.js +2 -0
  170. package/esm/src/api/info/meta.js.map +1 -1
  171. package/esm/src/api/info/metaAndAssetCtxs.d.ts +5 -0
  172. package/esm/src/api/info/metaAndAssetCtxs.d.ts.map +1 -1
  173. package/esm/src/api/info/perpDexs.d.ts +4 -0
  174. package/esm/src/api/info/perpDexs.d.ts.map +1 -1
  175. package/esm/src/api/info/perpDexs.js +5 -0
  176. package/esm/src/api/info/perpDexs.js.map +1 -1
  177. package/esm/src/api/info/spotClearinghouseState.d.ts +0 -5
  178. package/esm/src/api/info/spotClearinghouseState.d.ts.map +1 -1
  179. package/esm/src/api/info/spotClearinghouseState.js +2 -14
  180. package/esm/src/api/info/spotClearinghouseState.js.map +1 -1
  181. package/esm/src/api/info/userFees.d.ts +27 -2
  182. package/esm/src/api/info/userFees.d.ts.map +1 -1
  183. package/esm/src/api/info/userFees.js +29 -1
  184. package/esm/src/api/info/userFees.js.map +1 -1
  185. package/esm/src/api/info/webData2.d.ts +6 -0
  186. package/esm/src/api/info/webData2.d.ts.map +1 -1
  187. package/esm/src/api/info/~client.d.ts +9 -1
  188. package/esm/src/api/info/~client.d.ts.map +1 -1
  189. package/esm/src/api/subscription/spotState.d.ts +91 -0
  190. package/esm/src/api/subscription/spotState.d.ts.map +1 -0
  191. package/esm/src/api/subscription/spotState.js +58 -0
  192. package/esm/src/api/subscription/spotState.js.map +1 -0
  193. package/esm/src/api/subscription/userEvents.d.ts +166 -141
  194. package/esm/src/api/subscription/userEvents.d.ts.map +1 -1
  195. package/esm/src/api/subscription/userEvents.js +6 -1
  196. package/esm/src/api/subscription/userEvents.js.map +1 -1
  197. package/esm/src/api/subscription/webData2.d.ts +5 -0
  198. package/esm/src/api/subscription/webData2.d.ts.map +1 -1
  199. package/esm/src/api/subscription/~client.d.ts +22 -0
  200. package/esm/src/api/subscription/~client.d.ts.map +1 -1
  201. package/esm/src/api/subscription/~client.js +23 -0
  202. package/esm/src/api/subscription/~client.js.map +1 -1
  203. package/esm/src/api/subscription/~mod.d.ts +1 -0
  204. package/esm/src/api/subscription/~mod.d.ts.map +1 -1
  205. package/esm/src/api/subscription/~mod.js +1 -0
  206. package/esm/src/api/subscription/~mod.js.map +1 -1
  207. package/esm/src/signing/_signTypedData.d.ts +1 -1
  208. package/esm/src/signing/_signTypedData.d.ts.map +1 -1
  209. package/esm/src/signing/_signTypedData.js +1 -1
  210. package/esm/src/signing/_signTypedData.js.map +1 -1
  211. package/esm/src/transport/websocket/_hyperliquid_event_target.d.ts +7 -0
  212. package/esm/src/transport/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  213. package/esm/src/transport/websocket/_hyperliquid_event_target.js.map +1 -1
  214. package/esm/src/transport/websocket/_websocket_async_request.d.ts.map +1 -1
  215. package/esm/src/transport/websocket/_websocket_async_request.js +6 -0
  216. package/esm/src/transport/websocket/_websocket_async_request.js.map +1 -1
  217. package/esm/src/utils/{_minimalEIP712Signer.d.ts → _eip712.d.ts} +16 -1
  218. package/esm/src/utils/_eip712.d.ts.map +1 -0
  219. package/esm/src/utils/{_minimalEIP712Signer.js → _eip712.js} +14 -11
  220. package/esm/src/utils/_eip712.js.map +1 -0
  221. package/esm/src/utils/_format.d.ts +3 -4
  222. package/esm/src/utils/_format.d.ts.map +1 -1
  223. package/esm/src/utils/_format.js +98 -88
  224. package/esm/src/utils/_format.js.map +1 -1
  225. package/esm/src/utils/_recover.d.ts +89 -0
  226. package/esm/src/utils/_recover.d.ts.map +1 -0
  227. package/esm/src/utils/_recover.js +119 -0
  228. package/esm/src/utils/_recover.js.map +1 -0
  229. package/esm/src/utils/mod.d.ts +1 -0
  230. package/esm/src/utils/mod.d.ts.map +1 -1
  231. package/esm/src/utils/mod.js +1 -0
  232. package/esm/src/utils/mod.js.map +1 -1
  233. package/package.json +3 -2
  234. package/script/bin/cli.js +2 -1
  235. package/script/bin/cli.js.map +1 -1
  236. package/script/src/api/_common_schemas.d.ts +19 -0
  237. package/script/src/api/_common_schemas.d.ts.map +1 -1
  238. package/script/src/api/_common_schemas.js +16 -1
  239. package/script/src/api/_common_schemas.js.map +1 -1
  240. package/script/src/api/exchange/_base/_execute.d.ts +6 -7
  241. package/script/src/api/exchange/_base/_execute.d.ts.map +1 -1
  242. package/script/src/api/exchange/_base/_execute.js +67 -43
  243. package/script/src/api/exchange/_base/_execute.js.map +1 -1
  244. package/script/src/api/exchange/_base/_types.d.ts +0 -7
  245. package/script/src/api/exchange/_base/_types.d.ts.map +1 -1
  246. package/script/src/api/exchange/_base/mod.d.ts +0 -2
  247. package/script/src/api/exchange/_base/mod.d.ts.map +1 -1
  248. package/script/src/api/exchange/_base/mod.js +0 -2
  249. package/script/src/api/exchange/_base/mod.js.map +1 -1
  250. package/script/src/api/exchange/agentEnableDexAbstraction.d.ts.map +1 -1
  251. package/script/src/api/exchange/agentEnableDexAbstraction.js +14 -7
  252. package/script/src/api/exchange/agentEnableDexAbstraction.js.map +1 -1
  253. package/script/src/api/exchange/approveAgent.d.ts.map +1 -1
  254. package/script/src/api/exchange/approveAgent.js +15 -7
  255. package/script/src/api/exchange/approveAgent.js.map +1 -1
  256. package/script/src/api/exchange/approveBuilderFee.d.ts.map +1 -1
  257. package/script/src/api/exchange/approveBuilderFee.js +15 -7
  258. package/script/src/api/exchange/approveBuilderFee.js.map +1 -1
  259. package/script/src/api/exchange/batchModify.d.ts.map +1 -1
  260. package/script/src/api/exchange/batchModify.js +16 -10
  261. package/script/src/api/exchange/batchModify.js.map +1 -1
  262. package/script/src/api/exchange/cDeposit.d.ts.map +1 -1
  263. package/script/src/api/exchange/cDeposit.js +15 -7
  264. package/script/src/api/exchange/cDeposit.js.map +1 -1
  265. package/script/src/api/exchange/cSignerAction.d.ts.map +1 -1
  266. package/script/src/api/exchange/cSignerAction.js +15 -8
  267. package/script/src/api/exchange/cSignerAction.js.map +1 -1
  268. package/script/src/api/exchange/cValidatorAction.d.ts.map +1 -1
  269. package/script/src/api/exchange/cValidatorAction.js +15 -8
  270. package/script/src/api/exchange/cValidatorAction.js.map +1 -1
  271. package/script/src/api/exchange/cWithdraw.d.ts.map +1 -1
  272. package/script/src/api/exchange/cWithdraw.js +15 -7
  273. package/script/src/api/exchange/cWithdraw.js.map +1 -1
  274. package/script/src/api/exchange/cancel.d.ts.map +1 -1
  275. package/script/src/api/exchange/cancel.js +16 -10
  276. package/script/src/api/exchange/cancel.js.map +1 -1
  277. package/script/src/api/exchange/cancelByCloid.d.ts.map +1 -1
  278. package/script/src/api/exchange/cancelByCloid.js +16 -10
  279. package/script/src/api/exchange/cancelByCloid.js.map +1 -1
  280. package/script/src/api/exchange/claimRewards.d.ts.map +1 -1
  281. package/script/src/api/exchange/claimRewards.js +14 -7
  282. package/script/src/api/exchange/claimRewards.js.map +1 -1
  283. package/script/src/api/exchange/convertToMultiSigUser.d.ts.map +1 -1
  284. package/script/src/api/exchange/convertToMultiSigUser.js +15 -7
  285. package/script/src/api/exchange/convertToMultiSigUser.js.map +1 -1
  286. package/script/src/api/exchange/createSubAccount.d.ts.map +1 -1
  287. package/script/src/api/exchange/createSubAccount.js +15 -8
  288. package/script/src/api/exchange/createSubAccount.js.map +1 -1
  289. package/script/src/api/exchange/createVault.d.ts.map +1 -1
  290. package/script/src/api/exchange/createVault.js +15 -8
  291. package/script/src/api/exchange/createVault.js.map +1 -1
  292. package/script/src/api/exchange/evmUserModify.d.ts +1 -1
  293. package/script/src/api/exchange/evmUserModify.d.ts.map +1 -1
  294. package/script/src/api/exchange/evmUserModify.js +16 -9
  295. package/script/src/api/exchange/evmUserModify.js.map +1 -1
  296. package/script/src/api/exchange/linkStakingUser.d.ts +112 -0
  297. package/script/src/api/exchange/linkStakingUser.d.ts.map +1 -0
  298. package/script/src/api/exchange/linkStakingUser.js +136 -0
  299. package/script/src/api/exchange/linkStakingUser.js.map +1 -0
  300. package/script/src/api/exchange/modify.d.ts.map +1 -1
  301. package/script/src/api/exchange/modify.js +16 -10
  302. package/script/src/api/exchange/modify.js.map +1 -1
  303. package/script/src/api/exchange/multiSig.d.ts +81 -0
  304. package/script/src/api/exchange/multiSig.d.ts.map +1 -1
  305. package/script/src/api/exchange/multiSig.js +17 -16
  306. package/script/src/api/exchange/multiSig.js.map +1 -1
  307. package/script/src/api/exchange/noop.d.ts.map +1 -1
  308. package/script/src/api/exchange/noop.js +14 -7
  309. package/script/src/api/exchange/noop.js.map +1 -1
  310. package/script/src/api/exchange/order.d.ts.map +1 -1
  311. package/script/src/api/exchange/order.js +16 -10
  312. package/script/src/api/exchange/order.js.map +1 -1
  313. package/script/src/api/exchange/perpDeploy.d.ts +58 -0
  314. package/script/src/api/exchange/perpDeploy.d.ts.map +1 -1
  315. package/script/src/api/exchange/perpDeploy.js +33 -8
  316. package/script/src/api/exchange/perpDeploy.js.map +1 -1
  317. package/script/src/api/exchange/registerReferrer.d.ts.map +1 -1
  318. package/script/src/api/exchange/registerReferrer.js +15 -8
  319. package/script/src/api/exchange/registerReferrer.js.map +1 -1
  320. package/script/src/api/exchange/reserveRequestWeight.d.ts.map +1 -1
  321. package/script/src/api/exchange/reserveRequestWeight.js +15 -8
  322. package/script/src/api/exchange/reserveRequestWeight.js.map +1 -1
  323. package/script/src/api/exchange/scheduleCancel.js +16 -10
  324. package/script/src/api/exchange/scheduleCancel.js.map +1 -1
  325. package/script/src/api/exchange/sendAsset.d.ts.map +1 -1
  326. package/script/src/api/exchange/sendAsset.js +15 -7
  327. package/script/src/api/exchange/sendAsset.js.map +1 -1
  328. package/script/src/api/exchange/setDisplayName.d.ts.map +1 -1
  329. package/script/src/api/exchange/setDisplayName.js +15 -8
  330. package/script/src/api/exchange/setDisplayName.js.map +1 -1
  331. package/script/src/api/exchange/setReferrer.d.ts.map +1 -1
  332. package/script/src/api/exchange/setReferrer.js +15 -8
  333. package/script/src/api/exchange/setReferrer.js.map +1 -1
  334. package/script/src/api/exchange/spotDeploy.d.ts.map +1 -1
  335. package/script/src/api/exchange/spotDeploy.js +15 -8
  336. package/script/src/api/exchange/spotDeploy.js.map +1 -1
  337. package/script/src/api/exchange/spotSend.d.ts.map +1 -1
  338. package/script/src/api/exchange/spotSend.js +15 -7
  339. package/script/src/api/exchange/spotSend.js.map +1 -1
  340. package/script/src/api/exchange/spotUser.d.ts.map +1 -1
  341. package/script/src/api/exchange/spotUser.js +15 -8
  342. package/script/src/api/exchange/spotUser.js.map +1 -1
  343. package/script/src/api/exchange/subAccountModify.d.ts.map +1 -1
  344. package/script/src/api/exchange/subAccountModify.js +15 -8
  345. package/script/src/api/exchange/subAccountModify.js.map +1 -1
  346. package/script/src/api/exchange/subAccountSpotTransfer.d.ts.map +1 -1
  347. package/script/src/api/exchange/subAccountSpotTransfer.js +15 -8
  348. package/script/src/api/exchange/subAccountSpotTransfer.js.map +1 -1
  349. package/script/src/api/exchange/subAccountTransfer.d.ts.map +1 -1
  350. package/script/src/api/exchange/subAccountTransfer.js +15 -8
  351. package/script/src/api/exchange/subAccountTransfer.js.map +1 -1
  352. package/script/src/api/exchange/tokenDelegate.d.ts.map +1 -1
  353. package/script/src/api/exchange/tokenDelegate.js +15 -7
  354. package/script/src/api/exchange/tokenDelegate.js.map +1 -1
  355. package/script/src/api/exchange/twapCancel.d.ts.map +1 -1
  356. package/script/src/api/exchange/twapCancel.js +16 -10
  357. package/script/src/api/exchange/twapCancel.js.map +1 -1
  358. package/script/src/api/exchange/twapOrder.d.ts.map +1 -1
  359. package/script/src/api/exchange/twapOrder.js +16 -10
  360. package/script/src/api/exchange/twapOrder.js.map +1 -1
  361. package/script/src/api/exchange/updateIsolatedMargin.d.ts.map +1 -1
  362. package/script/src/api/exchange/updateIsolatedMargin.js +16 -10
  363. package/script/src/api/exchange/updateIsolatedMargin.js.map +1 -1
  364. package/script/src/api/exchange/updateLeverage.d.ts.map +1 -1
  365. package/script/src/api/exchange/updateLeverage.js +16 -10
  366. package/script/src/api/exchange/updateLeverage.js.map +1 -1
  367. package/script/src/api/exchange/usdClassTransfer.d.ts.map +1 -1
  368. package/script/src/api/exchange/usdClassTransfer.js +15 -7
  369. package/script/src/api/exchange/usdClassTransfer.js.map +1 -1
  370. package/script/src/api/exchange/usdSend.d.ts.map +1 -1
  371. package/script/src/api/exchange/usdSend.js +15 -7
  372. package/script/src/api/exchange/usdSend.js.map +1 -1
  373. package/script/src/api/exchange/userDexAbstraction.d.ts.map +1 -1
  374. package/script/src/api/exchange/userDexAbstraction.js +15 -7
  375. package/script/src/api/exchange/userDexAbstraction.js.map +1 -1
  376. package/script/src/api/exchange/vaultDistribute.d.ts.map +1 -1
  377. package/script/src/api/exchange/vaultDistribute.js +15 -8
  378. package/script/src/api/exchange/vaultDistribute.js.map +1 -1
  379. package/script/src/api/exchange/vaultModify.d.ts.map +1 -1
  380. package/script/src/api/exchange/vaultModify.js +15 -8
  381. package/script/src/api/exchange/vaultModify.js.map +1 -1
  382. package/script/src/api/exchange/vaultTransfer.d.ts.map +1 -1
  383. package/script/src/api/exchange/vaultTransfer.js +15 -8
  384. package/script/src/api/exchange/vaultTransfer.js.map +1 -1
  385. package/script/src/api/exchange/withdraw3.d.ts.map +1 -1
  386. package/script/src/api/exchange/withdraw3.js +15 -7
  387. package/script/src/api/exchange/withdraw3.js.map +1 -1
  388. package/script/src/api/exchange/~client.d.ts +31 -3
  389. package/script/src/api/exchange/~client.d.ts.map +1 -1
  390. package/script/src/api/exchange/~client.js +29 -6
  391. package/script/src/api/exchange/~client.js.map +1 -1
  392. package/script/src/api/exchange/~mod.d.ts +1 -0
  393. package/script/src/api/exchange/~mod.d.ts.map +1 -1
  394. package/script/src/api/exchange/~mod.js +1 -0
  395. package/script/src/api/exchange/~mod.js.map +1 -1
  396. package/script/src/api/info/allPerpMetas.d.ts +5 -0
  397. package/script/src/api/info/allPerpMetas.d.ts.map +1 -1
  398. package/script/src/api/info/meta.d.ts +5 -0
  399. package/script/src/api/info/meta.d.ts.map +1 -1
  400. package/script/src/api/info/meta.js +2 -0
  401. package/script/src/api/info/meta.js.map +1 -1
  402. package/script/src/api/info/metaAndAssetCtxs.d.ts +5 -0
  403. package/script/src/api/info/metaAndAssetCtxs.d.ts.map +1 -1
  404. package/script/src/api/info/perpDexs.d.ts +4 -0
  405. package/script/src/api/info/perpDexs.d.ts.map +1 -1
  406. package/script/src/api/info/perpDexs.js +5 -0
  407. package/script/src/api/info/perpDexs.js.map +1 -1
  408. package/script/src/api/info/spotClearinghouseState.d.ts +0 -5
  409. package/script/src/api/info/spotClearinghouseState.d.ts.map +1 -1
  410. package/script/src/api/info/spotClearinghouseState.js +2 -14
  411. package/script/src/api/info/spotClearinghouseState.js.map +1 -1
  412. package/script/src/api/info/userFees.d.ts +27 -2
  413. package/script/src/api/info/userFees.d.ts.map +1 -1
  414. package/script/src/api/info/userFees.js +29 -1
  415. package/script/src/api/info/userFees.js.map +1 -1
  416. package/script/src/api/info/webData2.d.ts +6 -0
  417. package/script/src/api/info/webData2.d.ts.map +1 -1
  418. package/script/src/api/info/~client.d.ts +9 -1
  419. package/script/src/api/info/~client.d.ts.map +1 -1
  420. package/script/src/api/subscription/spotState.d.ts +91 -0
  421. package/script/src/api/subscription/spotState.d.ts.map +1 -0
  422. package/script/src/api/subscription/spotState.js +95 -0
  423. package/script/src/api/subscription/spotState.js.map +1 -0
  424. package/script/src/api/subscription/userEvents.d.ts +166 -141
  425. package/script/src/api/subscription/userEvents.d.ts.map +1 -1
  426. package/script/src/api/subscription/userEvents.js +6 -1
  427. package/script/src/api/subscription/userEvents.js.map +1 -1
  428. package/script/src/api/subscription/webData2.d.ts +5 -0
  429. package/script/src/api/subscription/webData2.d.ts.map +1 -1
  430. package/script/src/api/subscription/~client.d.ts +22 -0
  431. package/script/src/api/subscription/~client.d.ts.map +1 -1
  432. package/script/src/api/subscription/~client.js +23 -0
  433. package/script/src/api/subscription/~client.js.map +1 -1
  434. package/script/src/api/subscription/~mod.d.ts +1 -0
  435. package/script/src/api/subscription/~mod.d.ts.map +1 -1
  436. package/script/src/api/subscription/~mod.js +1 -0
  437. package/script/src/api/subscription/~mod.js.map +1 -1
  438. package/script/src/signing/_signTypedData.d.ts +1 -1
  439. package/script/src/signing/_signTypedData.d.ts.map +1 -1
  440. package/script/src/signing/_signTypedData.js +1 -1
  441. package/script/src/signing/_signTypedData.js.map +1 -1
  442. package/script/src/transport/websocket/_hyperliquid_event_target.d.ts +7 -0
  443. package/script/src/transport/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  444. package/script/src/transport/websocket/_hyperliquid_event_target.js.map +1 -1
  445. package/script/src/transport/websocket/_websocket_async_request.d.ts.map +1 -1
  446. package/script/src/transport/websocket/_websocket_async_request.js +6 -0
  447. package/script/src/transport/websocket/_websocket_async_request.js.map +1 -1
  448. package/script/src/utils/{_minimalEIP712Signer.d.ts → _eip712.d.ts} +16 -1
  449. package/script/src/utils/_eip712.d.ts.map +1 -0
  450. package/script/src/utils/{_minimalEIP712Signer.js → _eip712.js} +14 -9
  451. package/script/src/utils/_eip712.js.map +1 -0
  452. package/script/src/utils/_format.d.ts +3 -4
  453. package/script/src/utils/_format.d.ts.map +1 -1
  454. package/script/src/utils/_format.js +98 -88
  455. package/script/src/utils/_format.js.map +1 -1
  456. package/script/src/utils/_recover.d.ts +89 -0
  457. package/script/src/utils/_recover.d.ts.map +1 -0
  458. package/script/src/utils/_recover.js +156 -0
  459. package/script/src/utils/_recover.js.map +1 -0
  460. package/script/src/utils/mod.d.ts +1 -0
  461. package/script/src/utils/mod.d.ts.map +1 -1
  462. package/script/src/utils/mod.js +1 -0
  463. package/script/src/utils/mod.js.map +1 -1
  464. package/src/bin/cli.ts +2 -1
  465. package/src/src/api/_common_schemas.ts +34 -0
  466. package/src/src/api/exchange/_base/_execute.ts +73 -49
  467. package/src/src/api/exchange/_base/_types.ts +0 -7
  468. package/src/src/api/exchange/_base/mod.ts +0 -2
  469. package/src/src/api/exchange/agentEnableDexAbstraction.ts +14 -9
  470. package/src/src/api/exchange/approveAgent.ts +15 -12
  471. package/src/src/api/exchange/approveBuilderFee.ts +15 -12
  472. package/src/src/api/exchange/batchModify.ts +16 -13
  473. package/src/src/api/exchange/cDeposit.ts +15 -12
  474. package/src/src/api/exchange/cSignerAction.ts +15 -10
  475. package/src/src/api/exchange/cValidatorAction.ts +15 -10
  476. package/src/src/api/exchange/cWithdraw.ts +15 -12
  477. package/src/src/api/exchange/cancel.ts +16 -13
  478. package/src/src/api/exchange/cancelByCloid.ts +16 -13
  479. package/src/src/api/exchange/claimRewards.ts +14 -9
  480. package/src/src/api/exchange/convertToMultiSigUser.ts +15 -12
  481. package/src/src/api/exchange/createSubAccount.ts +15 -10
  482. package/src/src/api/exchange/createVault.ts +15 -10
  483. package/src/src/api/exchange/evmUserModify.ts +16 -11
  484. package/src/src/api/exchange/linkStakingUser.ts +157 -0
  485. package/src/src/api/exchange/modify.ts +16 -13
  486. package/src/src/api/exchange/multiSig.ts +17 -23
  487. package/src/src/api/exchange/noop.ts +14 -9
  488. package/src/src/api/exchange/order.ts +16 -13
  489. package/src/src/api/exchange/perpDeploy.ts +61 -10
  490. package/src/src/api/exchange/registerReferrer.ts +15 -10
  491. package/src/src/api/exchange/reserveRequestWeight.ts +15 -10
  492. package/src/src/api/exchange/scheduleCancel.ts +16 -13
  493. package/src/src/api/exchange/sendAsset.ts +15 -12
  494. package/src/src/api/exchange/setDisplayName.ts +15 -10
  495. package/src/src/api/exchange/setReferrer.ts +15 -10
  496. package/src/src/api/exchange/spotDeploy.ts +15 -10
  497. package/src/src/api/exchange/spotSend.ts +15 -12
  498. package/src/src/api/exchange/spotUser.ts +15 -10
  499. package/src/src/api/exchange/subAccountModify.ts +15 -10
  500. package/src/src/api/exchange/subAccountSpotTransfer.ts +15 -10
  501. package/src/src/api/exchange/subAccountTransfer.ts +15 -10
  502. package/src/src/api/exchange/tokenDelegate.ts +15 -12
  503. package/src/src/api/exchange/twapCancel.ts +16 -13
  504. package/src/src/api/exchange/twapOrder.ts +16 -13
  505. package/src/src/api/exchange/updateIsolatedMargin.ts +16 -13
  506. package/src/src/api/exchange/updateLeverage.ts +16 -13
  507. package/src/src/api/exchange/usdClassTransfer.ts +15 -12
  508. package/src/src/api/exchange/usdSend.ts +15 -12
  509. package/src/src/api/exchange/userDexAbstraction.ts +15 -12
  510. package/src/src/api/exchange/vaultDistribute.ts +15 -10
  511. package/src/src/api/exchange/vaultModify.ts +15 -10
  512. package/src/src/api/exchange/vaultTransfer.ts +15 -10
  513. package/src/src/api/exchange/withdraw3.ts +15 -12
  514. package/src/src/api/exchange/~client.ts +30 -5
  515. package/src/src/api/exchange/~mod.ts +1 -0
  516. package/src/src/api/info/meta.ts +7 -0
  517. package/src/src/api/info/perpDexs.ts +10 -0
  518. package/src/src/api/info/spotClearinghouseState.ts +3 -33
  519. package/src/src/api/info/userFees.ts +46 -1
  520. package/src/src/api/subscription/spotState.ts +96 -0
  521. package/src/src/api/subscription/userEvents.ts +11 -1
  522. package/src/src/api/subscription/~client.ts +25 -0
  523. package/src/src/api/subscription/~mod.ts +1 -0
  524. package/src/src/signing/_signTypedData.ts +1 -1
  525. package/src/src/transport/websocket/_hyperliquid_event_target.ts +7 -0
  526. package/src/src/transport/websocket/_websocket_async_request.ts +6 -0
  527. package/src/src/utils/{_minimalEIP712Signer.ts → _eip712.ts} +22 -29
  528. package/src/src/utils/_format.ts +99 -98
  529. package/src/src/utils/_recover.ts +178 -0
  530. package/src/src/utils/mod.ts +1 -0
  531. package/esm/src/api/exchange/_base/_sequential.d.ts +0 -30
  532. package/esm/src/api/exchange/_base/_sequential.d.ts.map +0 -1
  533. package/esm/src/api/exchange/_base/_sequential.js +0 -69
  534. package/esm/src/api/exchange/_base/_sequential.js.map +0 -1
  535. package/esm/src/utils/_minimalEIP712Signer.d.ts.map +0 -1
  536. package/esm/src/utils/_minimalEIP712Signer.js.map +0 -1
  537. package/script/src/api/exchange/_base/_sequential.d.ts +0 -30
  538. package/script/src/api/exchange/_base/_sequential.d.ts.map +0 -1
  539. package/script/src/api/exchange/_base/_sequential.js +0 -72
  540. package/script/src/api/exchange/_base/_sequential.js.map +0 -1
  541. package/script/src/utils/_minimalEIP712Signer.d.ts.map +0 -1
  542. package/script/src/utils/_minimalEIP712Signer.js.map +0 -1
  543. package/src/src/api/exchange/_base/_sequential.ts +0 -82
@@ -119,18 +119,21 @@ export async function modify(
119
119
  params: DeepImmutable<ModifyParameters>,
120
120
  opts?: ModifyOptions,
121
121
  ): Promise<SuccessResponse> {
122
- const action = parser(ModifyRequest.entries.action)({
123
- type: "modify",
124
- ...params,
122
+ const request = parser(ModifyRequest)({
123
+ action: {
124
+ type: "modify",
125
+ ...params,
126
+ },
127
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
128
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
129
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
130
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
131
+ v: 27,
132
+ },
133
+ vaultAddress: opts?.vaultAddress ?? config.defaultVaultAddress,
134
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
135
+ ? config.defaultExpiresAfter
136
+ : await config.defaultExpiresAfter?.(),
125
137
  });
126
-
127
- const vaultAddress_ = opts?.vaultAddress ?? config.defaultVaultAddress;
128
- const vaultAddress = parser(v.optional(Address))(vaultAddress_);
129
-
130
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
131
- ? config.defaultExpiresAfter
132
- : await config.defaultExpiresAfter?.();
133
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
134
-
135
- return await executeL1Action(config, { action, vaultAddress, expiresAfter }, opts?.signal);
138
+ return await executeL1Action(config, request, opts?.signal);
136
139
  }
@@ -282,28 +282,22 @@ export async function multiSig<
282
282
  ): Promise<T> {
283
283
  const { nonce, ...params } = paramsAndNonce;
284
284
 
285
- const action = parser(MultiSigRequest.entries.action)({
286
- type: "multiSig",
287
- signatureChainId: await getSignatureChainId(config),
288
- ...params,
289
- });
290
-
291
- const vaultAddress_ = opts?.vaultAddress ?? config.defaultVaultAddress;
292
- const vaultAddress = parser(v.optional(Address))(vaultAddress_);
293
-
294
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
295
- ? config.defaultExpiresAfter
296
- : await config.defaultExpiresAfter?.();
297
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
298
-
299
- return await executeMultiSigAction(
300
- config,
301
- {
302
- action,
303
- vaultAddress,
304
- expiresAfter,
305
- nonce: Number(nonce),
285
+ const request = parser(MultiSigRequest)({
286
+ action: {
287
+ type: "multiSig",
288
+ signatureChainId: await getSignatureChainId(config),
289
+ ...params,
306
290
  },
307
- opts?.signal,
308
- );
291
+ nonce,
292
+ signature: { // Placeholder; actual signature generated in `executeMultiSigAction`
293
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
294
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
295
+ v: 27,
296
+ },
297
+ vaultAddress: opts?.vaultAddress ?? config.defaultVaultAddress,
298
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
299
+ ? config.defaultExpiresAfter
300
+ : await config.defaultExpiresAfter?.(),
301
+ });
302
+ return await executeMultiSigAction(config, request, opts?.signal);
309
303
  }
@@ -84,14 +84,19 @@ export async function noop(
84
84
  config: ExchangeRequestConfig | MultiSignRequestConfig,
85
85
  opts?: NoopOptions,
86
86
  ): Promise<SuccessResponse> {
87
- const action = parser(NoopRequest.entries.action)({
88
- type: "noop",
87
+ const request = parser(NoopRequest)({
88
+ action: {
89
+ type: "noop",
90
+ },
91
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
92
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
93
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
94
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
95
+ v: 27,
96
+ },
97
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
98
+ ? config.defaultExpiresAfter
99
+ : await config.defaultExpiresAfter?.(),
89
100
  });
90
-
91
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
92
- ? config.defaultExpiresAfter
93
- : await config.defaultExpiresAfter?.();
94
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
95
-
96
- return await executeL1Action(config, { action, expiresAfter }, opts?.signal);
101
+ return await executeL1Action(config, request, opts?.signal);
97
102
  }
@@ -330,18 +330,21 @@ export async function order(
330
330
  params: DeepImmutable<OrderParameters>,
331
331
  opts?: OrderOptions,
332
332
  ): Promise<OrderSuccessResponse> {
333
- const action = parser(OrderRequest.entries.action)({
334
- type: "order",
335
- ...params,
333
+ const request = parser(OrderRequest)({
334
+ action: {
335
+ type: "order",
336
+ ...params,
337
+ },
338
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
339
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
340
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
341
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
342
+ v: 27,
343
+ },
344
+ vaultAddress: opts?.vaultAddress ?? config.defaultVaultAddress,
345
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
346
+ ? config.defaultExpiresAfter
347
+ : await config.defaultExpiresAfter?.(),
336
348
  });
337
-
338
- const vaultAddress_ = opts?.vaultAddress ?? config.defaultVaultAddress;
339
- const vaultAddress = parser(v.optional(Address))(vaultAddress_);
340
-
341
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
342
- ? config.defaultExpiresAfter
343
- : await config.defaultExpiresAfter?.();
344
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
345
-
346
- return await executeL1Action(config, { action, vaultAddress, expiresAfter }, opts?.signal);
349
+ return await executeL1Action(config, request, opts?.signal);
347
350
  }
@@ -239,6 +239,52 @@ export const PerpDeployRequest = /* @__PURE__ */ (() => {
239
239
  }),
240
240
  v.description("Set open interest caps variant"),
241
241
  ),
242
+ v.pipe(
243
+ v.object({
244
+ /** Type of action. */
245
+ type: v.pipe(
246
+ v.literal("perpDeploy"),
247
+ v.description("Type of action."),
248
+ ),
249
+ /** A modification to sub-deployer permissions. */
250
+ setSubDeployers: v.pipe(
251
+ v.object({
252
+ /** Name of the DEX. */
253
+ dex: v.pipe(
254
+ v.string(),
255
+ v.description("Name of the DEX."),
256
+ ),
257
+ /** A modification to sub-deployer permissions. */
258
+ subDeployers: v.pipe(
259
+ v.array(
260
+ v.object({
261
+ /** Corresponds to a variant of PerpDeployAction. */
262
+ variant: v.pipe(
263
+ v.string(),
264
+ v.description("Corresponds to a variant of PerpDeployAction."),
265
+ ),
266
+ /** Sub-deployer address. */
267
+ user: v.pipe(
268
+ Address,
269
+ v.description("Sub-deployer address."),
270
+ ),
271
+ /** Add or remove the subDeployer from the authorized set for the action variant. */
272
+ allowed: v.pipe(
273
+ v.boolean(),
274
+ v.description(
275
+ "Add or remove the subDeployer from the authorized set for the action variant.",
276
+ ),
277
+ ),
278
+ }),
279
+ ),
280
+ v.description("A modification to sub-deployer permissions."),
281
+ ),
282
+ }),
283
+ v.description("A modification to sub-deployer permissions."),
284
+ ),
285
+ }),
286
+ v.description("Set open interest caps variant"),
287
+ ),
242
288
  ]),
243
289
  v.description("Action to perform."),
244
290
  ),
@@ -317,15 +363,20 @@ export async function perpDeploy(
317
363
  params: DeepImmutable<PerpDeployParameters>,
318
364
  opts?: PerpDeployOptions,
319
365
  ): Promise<SuccessResponse> {
320
- const action = parser(PerpDeployRequest.entries.action)({
321
- type: "perpDeploy",
322
- ...params,
366
+ const request = parser(PerpDeployRequest)({
367
+ action: {
368
+ type: "perpDeploy",
369
+ ...params,
370
+ },
371
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
372
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
373
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
374
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
375
+ v: 27,
376
+ },
377
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
378
+ ? config.defaultExpiresAfter
379
+ : await config.defaultExpiresAfter?.(),
323
380
  });
324
-
325
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
326
- ? config.defaultExpiresAfter
327
- : await config.defaultExpiresAfter?.();
328
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
329
-
330
- return await executeL1Action(config, { action, expiresAfter }, opts?.signal);
381
+ return await executeL1Action(config, request, opts?.signal);
331
382
  }
@@ -97,15 +97,20 @@ export async function registerReferrer(
97
97
  params: DeepImmutable<RegisterReferrerParameters>,
98
98
  opts?: RegisterReferrerOptions,
99
99
  ): Promise<SuccessResponse> {
100
- const action = parser(RegisterReferrerRequest.entries.action)({
101
- type: "registerReferrer",
102
- ...params,
100
+ const request = parser(RegisterReferrerRequest)({
101
+ action: {
102
+ type: "registerReferrer",
103
+ ...params,
104
+ },
105
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
106
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
107
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
108
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
109
+ v: 27,
110
+ },
111
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
112
+ ? config.defaultExpiresAfter
113
+ : await config.defaultExpiresAfter?.(),
103
114
  });
104
-
105
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
106
- ? config.defaultExpiresAfter
107
- : await config.defaultExpiresAfter?.();
108
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
109
-
110
- return await executeL1Action(config, { action, expiresAfter }, opts?.signal);
115
+ return await executeL1Action(config, request, opts?.signal);
111
116
  }
@@ -96,15 +96,20 @@ export async function reserveRequestWeight(
96
96
  params: DeepImmutable<ReserveRequestWeightParameters>,
97
97
  opts?: ReserveRequestWeightOptions,
98
98
  ): Promise<SuccessResponse> {
99
- const action = parser(ReserveRequestWeightRequest.entries.action)({
100
- type: "reserveRequestWeight",
101
- ...params,
99
+ const request = parser(ReserveRequestWeightRequest)({
100
+ action: {
101
+ type: "reserveRequestWeight",
102
+ ...params,
103
+ },
104
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
105
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
106
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
107
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
108
+ v: 27,
109
+ },
110
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
111
+ ? config.defaultExpiresAfter
112
+ : await config.defaultExpiresAfter?.(),
102
113
  });
103
-
104
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
105
- ? config.defaultExpiresAfter
106
- : await config.defaultExpiresAfter?.();
107
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
108
-
109
- return await executeL1Action(config, { action, expiresAfter }, opts?.signal);
114
+ return await executeL1Action(config, request, opts?.signal);
110
115
  }
@@ -125,18 +125,21 @@ export async function scheduleCancel(
125
125
  const params = isFirstArgParams ? paramsOrOpts : {};
126
126
  const opts = isFirstArgParams ? maybeOpts : paramsOrOpts as ScheduleCancelOptions;
127
127
 
128
- const action = parser(ScheduleCancelRequest.entries.action)({
129
- type: "scheduleCancel",
130
- ...params,
128
+ const request = parser(ScheduleCancelRequest)({
129
+ action: {
130
+ type: "scheduleCancel",
131
+ ...params,
132
+ },
133
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
134
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
135
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
136
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
137
+ v: 27,
138
+ },
139
+ vaultAddress: opts?.vaultAddress ?? config.defaultVaultAddress,
140
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
141
+ ? config.defaultExpiresAfter
142
+ : await config.defaultExpiresAfter?.(),
131
143
  });
132
-
133
- const vaultAddress_ = opts?.vaultAddress ?? config.defaultVaultAddress;
134
- const vaultAddress = parser(v.optional(Address))(vaultAddress_);
135
-
136
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
137
- ? config.defaultExpiresAfter
138
- : await config.defaultExpiresAfter?.();
139
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
140
-
141
- return await executeL1Action(config, { action, vaultAddress, expiresAfter }, opts?.signal);
144
+ return await executeL1Action(config, request, opts?.signal);
142
145
  }
@@ -6,7 +6,6 @@ import {
6
6
  type ExtractRequestAction,
7
7
  type ExtractRequestOptions,
8
8
  getSignatureChainId,
9
- globalNonceManager,
10
9
  type MultiSignRequestConfig,
11
10
  Signature,
12
11
  } from "./_base/mod.js";
@@ -153,16 +152,20 @@ export async function sendAsset(
153
152
  params: DeepImmutable<SendAssetParameters>,
154
153
  opts?: SendAssetOptions,
155
154
  ): Promise<SuccessResponse> {
156
- const action = parser(SendAssetRequest.entries.action)({
157
- type: "sendAsset",
158
- hyperliquidChain: config.transport.isTestnet ? "Testnet" : "Mainnet",
159
- signatureChainId: await getSignatureChainId(config),
160
- nonce: globalNonceManager.getNonce(),
161
- ...params,
155
+ const request = parser(SendAssetRequest)({
156
+ action: {
157
+ type: "sendAsset",
158
+ hyperliquidChain: config.transport.isTestnet ? "Testnet" : "Mainnet",
159
+ signatureChainId: await getSignatureChainId(config),
160
+ nonce: 0, // Placeholder; actual nonce generated in `executeUserSignedAction` to prevent race conditions
161
+ ...params,
162
+ },
163
+ nonce: 0, // Placeholder; actual nonce generated in `executeUserSignedAction` to prevent race conditions
164
+ signature: { // Placeholder; actual signature generated in `executeUserSignedAction`
165
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
166
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
167
+ v: 27,
168
+ },
162
169
  });
163
- return await executeUserSignedAction(
164
- config,
165
- { action, types: SendAssetTypes },
166
- opts?.signal,
167
- );
170
+ return await executeUserSignedAction(config, request, SendAssetTypes, opts?.signal);
168
171
  }
@@ -103,15 +103,20 @@ export async function setDisplayName(
103
103
  params: DeepImmutable<SetDisplayNameParameters>,
104
104
  opts?: SetDisplayNameOptions,
105
105
  ): Promise<SuccessResponse> {
106
- const action = parser(SetDisplayNameRequest.entries.action)({
107
- type: "setDisplayName",
108
- ...params,
106
+ const request = parser(SetDisplayNameRequest)({
107
+ action: {
108
+ type: "setDisplayName",
109
+ ...params,
110
+ },
111
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
112
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
113
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
114
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
115
+ v: 27,
116
+ },
117
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
118
+ ? config.defaultExpiresAfter
119
+ : await config.defaultExpiresAfter?.(),
109
120
  });
110
-
111
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
112
- ? config.defaultExpiresAfter
113
- : await config.defaultExpiresAfter?.();
114
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
115
-
116
- return await executeL1Action(config, { action, expiresAfter }, opts?.signal);
121
+ return await executeL1Action(config, request, opts?.signal);
117
122
  }
@@ -97,15 +97,20 @@ export async function setReferrer(
97
97
  params: DeepImmutable<SetReferrerParameters>,
98
98
  opts?: SetReferrerOptions,
99
99
  ): Promise<SuccessResponse> {
100
- const action = parser(SetReferrerRequest.entries.action)({
101
- type: "setReferrer",
102
- ...params,
100
+ const request = parser(SetReferrerRequest)({
101
+ action: {
102
+ type: "setReferrer",
103
+ ...params,
104
+ },
105
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
106
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
107
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
108
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
109
+ v: 27,
110
+ },
111
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
112
+ ? config.defaultExpiresAfter
113
+ : await config.defaultExpiresAfter?.(),
103
114
  });
104
-
105
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
106
- ? config.defaultExpiresAfter
107
- : await config.defaultExpiresAfter?.();
108
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
109
-
110
- return await executeL1Action(config, { action, expiresAfter }, opts?.signal);
115
+ return await executeL1Action(config, request, opts?.signal);
111
116
  }
@@ -339,15 +339,20 @@ export async function spotDeploy(
339
339
  params: DeepImmutable<SpotDeployParameters>,
340
340
  opts?: SpotDeployOptions,
341
341
  ): Promise<SuccessResponse> {
342
- const action = parser(SpotDeployRequest.entries.action)({
343
- type: "spotDeploy",
344
- ...params,
342
+ const request = parser(SpotDeployRequest)({
343
+ action: {
344
+ type: "spotDeploy",
345
+ ...params,
346
+ },
347
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
348
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
349
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
350
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
351
+ v: 27,
352
+ },
353
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
354
+ ? config.defaultExpiresAfter
355
+ : await config.defaultExpiresAfter?.(),
345
356
  });
346
-
347
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
348
- ? config.defaultExpiresAfter
349
- : await config.defaultExpiresAfter?.();
350
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
351
-
352
- return await executeL1Action(config, { action, expiresAfter }, opts?.signal);
357
+ return await executeL1Action(config, request, opts?.signal);
353
358
  }
@@ -6,7 +6,6 @@ import {
6
6
  type ExtractRequestAction,
7
7
  type ExtractRequestOptions,
8
8
  getSignatureChainId,
9
- globalNonceManager,
10
9
  type MultiSignRequestConfig,
11
10
  Signature,
12
11
  } from "./_base/mod.js";
@@ -133,16 +132,20 @@ export async function spotSend(
133
132
  params: DeepImmutable<SpotSendParameters>,
134
133
  opts?: SpotSendOptions,
135
134
  ): Promise<SuccessResponse> {
136
- const action = parser(SpotSendRequest.entries.action)({
137
- type: "spotSend",
138
- hyperliquidChain: config.transport.isTestnet ? "Testnet" : "Mainnet",
139
- signatureChainId: await getSignatureChainId(config),
140
- time: globalNonceManager.getNonce(),
141
- ...params,
135
+ const request = parser(SpotSendRequest)({
136
+ action: {
137
+ type: "spotSend",
138
+ hyperliquidChain: config.transport.isTestnet ? "Testnet" : "Mainnet",
139
+ signatureChainId: await getSignatureChainId(config),
140
+ time: 0, // Placeholder; actual nonce generated in `executeUserSignedAction` to prevent race conditions
141
+ ...params,
142
+ },
143
+ nonce: 0, // Placeholder; actual nonce generated in `executeUserSignedAction` to prevent race conditions
144
+ signature: { // Placeholder; actual signature generated in `executeUserSignedAction`
145
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
146
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
147
+ v: 27,
148
+ },
142
149
  });
143
- return await executeUserSignedAction(
144
- config,
145
- { action, types: SpotSendTypes },
146
- opts?.signal,
147
- );
150
+ return await executeUserSignedAction(config, request, SpotSendTypes, opts?.signal);
148
151
  }
@@ -102,15 +102,20 @@ export async function spotUser(
102
102
  params: DeepImmutable<SpotUserParameters>,
103
103
  opts?: SpotUserOptions,
104
104
  ): Promise<SuccessResponse> {
105
- const action = parser(SpotUserRequest.entries.action)({
106
- type: "spotUser",
107
- ...params,
105
+ const request = parser(SpotUserRequest)({
106
+ action: {
107
+ type: "spotUser",
108
+ ...params,
109
+ },
110
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
111
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
112
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
113
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
114
+ v: 27,
115
+ },
116
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
117
+ ? config.defaultExpiresAfter
118
+ : await config.defaultExpiresAfter?.(),
108
119
  });
109
-
110
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
111
- ? config.defaultExpiresAfter
112
- : await config.defaultExpiresAfter?.();
113
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
114
-
115
- return await executeL1Action(config, { action, expiresAfter }, opts?.signal);
120
+ return await executeL1Action(config, request, opts?.signal);
116
121
  }
@@ -102,15 +102,20 @@ export async function subAccountModify(
102
102
  params: DeepImmutable<SubAccountModifyParameters>,
103
103
  opts?: SubAccountModifyOptions,
104
104
  ): Promise<SuccessResponse> {
105
- const action = parser(SubAccountModifyRequest.entries.action)({
106
- type: "subAccountModify",
107
- ...params,
105
+ const request = parser(SubAccountModifyRequest)({
106
+ action: {
107
+ type: "subAccountModify",
108
+ ...params,
109
+ },
110
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
111
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
112
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
113
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
114
+ v: 27,
115
+ },
116
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
117
+ ? config.defaultExpiresAfter
118
+ : await config.defaultExpiresAfter?.(),
108
119
  });
109
-
110
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
111
- ? config.defaultExpiresAfter
112
- : await config.defaultExpiresAfter?.();
113
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
114
-
115
- return await executeL1Action(config, { action, expiresAfter }, opts?.signal);
120
+ return await executeL1Action(config, request, opts?.signal);
116
121
  }
@@ -116,15 +116,20 @@ export async function subAccountSpotTransfer(
116
116
  params: DeepImmutable<SubAccountSpotTransferParameters>,
117
117
  opts?: SubAccountSpotTransferOptions,
118
118
  ): Promise<SuccessResponse> {
119
- const action = parser(SubAccountSpotTransferRequest.entries.action)({
120
- type: "subAccountSpotTransfer",
121
- ...params,
119
+ const request = parser(SubAccountSpotTransferRequest)({
120
+ action: {
121
+ type: "subAccountSpotTransfer",
122
+ ...params,
123
+ },
124
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
125
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
126
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
127
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
128
+ v: 27,
129
+ },
130
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
131
+ ? config.defaultExpiresAfter
132
+ : await config.defaultExpiresAfter?.(),
122
133
  });
123
-
124
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
125
- ? config.defaultExpiresAfter
126
- : await config.defaultExpiresAfter?.();
127
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
128
-
129
- return await executeL1Action(config, { action, expiresAfter }, opts?.signal);
134
+ return await executeL1Action(config, request, opts?.signal);
130
135
  }
@@ -106,15 +106,20 @@ export async function subAccountTransfer(
106
106
  params: DeepImmutable<SubAccountTransferParameters>,
107
107
  opts?: SubAccountTransferOptions,
108
108
  ): Promise<SuccessResponse> {
109
- const action = parser(SubAccountTransferRequest.entries.action)({
110
- type: "subAccountTransfer",
111
- ...params,
109
+ const request = parser(SubAccountTransferRequest)({
110
+ action: {
111
+ type: "subAccountTransfer",
112
+ ...params,
113
+ },
114
+ nonce: 0, // Placeholder; actual nonce generated in `executeL1Action`
115
+ signature: { // Placeholder; actual signature generated in `executeL1Action`
116
+ r: "0x0000000000000000000000000000000000000000000000000000000000000000",
117
+ s: "0x0000000000000000000000000000000000000000000000000000000000000000",
118
+ v: 27,
119
+ },
120
+ expiresAfter: typeof config.defaultExpiresAfter === "number"
121
+ ? config.defaultExpiresAfter
122
+ : await config.defaultExpiresAfter?.(),
112
123
  });
113
-
114
- const expiresAfter_ = typeof config.defaultExpiresAfter === "number"
115
- ? config.defaultExpiresAfter
116
- : await config.defaultExpiresAfter?.();
117
- const expiresAfter = parser(v.optional(UnsignedInteger))(expiresAfter_);
118
-
119
- return await executeL1Action(config, { action, expiresAfter }, opts?.signal);
124
+ return await executeL1Action(config, request, opts?.signal);
120
125
  }