@hfunlabs/hyperliquid 0.30.0-hfunlabs.1 → 0.30.2-hfunlabs.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 (397) hide show
  1. package/esm/_dnt.shims.d.ts +2 -0
  2. package/esm/_dnt.shims.d.ts.map +1 -0
  3. package/esm/_dnt.shims.js +58 -0
  4. package/esm/_dnt.shims.js.map +1 -0
  5. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.d.ts +195 -0
  6. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.d.ts.map +1 -0
  7. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.js +457 -0
  8. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.js.map +1 -0
  9. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.d.ts +90 -0
  10. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.d.ts.map +1 -0
  11. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.js +207 -0
  12. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.js.map +1 -0
  13. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.d.ts +159 -0
  14. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.d.ts.map +1 -0
  15. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.js +555 -0
  16. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.js.map +1 -0
  17. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.d.ts +325 -0
  18. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.d.ts.map +1 -0
  19. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.js +1222 -0
  20. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.js.map +1 -0
  21. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.d.ts +76 -0
  22. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.d.ts.map +1 -0
  23. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.js +283 -0
  24. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.js.map +1 -0
  25. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/utils.d.ts +103 -0
  26. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/utils.d.ts.map +1 -0
  27. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/utils.js +241 -0
  28. package/esm/deps/jsr.io/@noble/curves/2.0.1/src/utils.js.map +1 -0
  29. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_md.d.ts +49 -0
  30. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_md.d.ts.map +1 -0
  31. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_md.js +147 -0
  32. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_md.js.map +1 -0
  33. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.d.ts +55 -0
  34. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.d.ts.map +1 -0
  35. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.js +67 -0
  36. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.js.map +1 -0
  37. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.d.ts +36 -0
  38. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.d.ts.map +1 -0
  39. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.js +90 -0
  40. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.js.map +1 -0
  41. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.d.ts +199 -0
  42. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.d.ts.map +1 -0
  43. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.js +397 -0
  44. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.js.map +1 -0
  45. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.d.ts +58 -0
  46. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.d.ts.map +1 -0
  47. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.js +254 -0
  48. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.js.map +1 -0
  49. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/utils.d.ts +124 -0
  50. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/utils.d.ts.map +1 -0
  51. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/utils.js +243 -0
  52. package/esm/deps/jsr.io/@noble/hashes/2.0.1/src/utils.js.map +1 -0
  53. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.d.ts +44 -0
  54. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.d.ts.map +1 -0
  55. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.js +144 -0
  56. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.js.map +1 -0
  57. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.d.ts +38 -0
  58. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.d.ts.map +1 -0
  59. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.js +96 -0
  60. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.js.map +1 -0
  61. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.d.ts +23 -0
  62. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.d.ts.map +1 -0
  63. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.js +98 -0
  64. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.js.map +1 -0
  65. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.d.ts +300 -0
  66. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.d.ts.map +1 -0
  67. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.js +535 -0
  68. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.js.map +1 -0
  69. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.d.ts +98 -0
  70. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.d.ts.map +1 -0
  71. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.js +207 -0
  72. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.js.map +1 -0
  73. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.d.ts +78 -0
  74. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.d.ts.map +1 -0
  75. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.js +298 -0
  76. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.js.map +1 -0
  77. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.d.ts +6 -0
  78. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.d.ts.map +1 -0
  79. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js +6 -0
  80. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js.map +1 -0
  81. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.d.ts +66 -0
  82. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.d.ts.map +1 -0
  83. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.js +180 -0
  84. package/esm/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.js.map +1 -0
  85. package/esm/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.d.ts +877 -0
  86. package/esm/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.d.ts.map +1 -0
  87. package/esm/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.js +2001 -0
  88. package/esm/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.js.map +1 -0
  89. package/esm/deps/jsr.io/@scure/base/2.0.0/index.d.ts +294 -0
  90. package/esm/deps/jsr.io/@scure/base/2.0.0/index.d.ts.map +1 -0
  91. package/esm/deps/jsr.io/@scure/base/2.0.0/index.js +704 -0
  92. package/esm/deps/jsr.io/@scure/base/2.0.0/index.js.map +1 -0
  93. package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts +93 -0
  94. package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts.map +1 -0
  95. package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js +137 -0
  96. package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js.map +1 -0
  97. package/esm/src/api/exchange/_methods/_base/_nonce.d.ts +3 -2
  98. package/esm/src/api/exchange/_methods/_base/_nonce.d.ts.map +1 -1
  99. package/esm/src/api/exchange/_methods/_base/_nonce.js +3 -2
  100. package/esm/src/api/exchange/_methods/_base/_nonce.js.map +1 -1
  101. package/esm/src/api/exchange/_methods/_base/_semaphore.d.ts +7 -6
  102. package/esm/src/api/exchange/_methods/_base/_semaphore.d.ts.map +1 -1
  103. package/esm/src/api/exchange/_methods/_base/_semaphore.js +34 -47
  104. package/esm/src/api/exchange/_methods/_base/_semaphore.js.map +1 -1
  105. package/esm/src/api/exchange/_methods/_base/execute.d.ts +14 -3
  106. package/esm/src/api/exchange/_methods/_base/execute.d.ts.map +1 -1
  107. package/esm/src/api/exchange/_methods/_base/execute.js +44 -10
  108. package/esm/src/api/exchange/_methods/_base/execute.js.map +1 -1
  109. package/esm/src/api/exchange/_methods/batchModify.d.ts +6 -6
  110. package/esm/src/api/exchange/_methods/createVault.d.ts +5 -5
  111. package/esm/src/api/exchange/_methods/modify.d.ts +5 -5
  112. package/esm/src/api/exchange/_methods/order.d.ts +13 -13
  113. package/esm/src/api/exchange/_methods/order.d.ts.map +1 -1
  114. package/esm/src/api/exchange/_methods/order.js +4 -2
  115. package/esm/src/api/exchange/_methods/order.js.map +1 -1
  116. package/esm/src/api/exchange/client.d.ts +1 -1
  117. package/esm/src/api/exchange/client.d.ts.map +1 -1
  118. package/esm/src/api/exchange/client.js.map +1 -1
  119. package/esm/src/api/exchange/mod.d.ts +1 -1
  120. package/esm/src/api/exchange/mod.d.ts.map +1 -1
  121. package/esm/src/api/exchange/mod.js.map +1 -1
  122. package/esm/src/api/info/_methods/_base/commonSchemas.d.ts +8 -8
  123. package/esm/src/api/info/_methods/frontendOpenOrders.d.ts +3 -3
  124. package/esm/src/api/info/_methods/historicalOrders.d.ts +4 -4
  125. package/esm/src/api/info/_methods/l3Orders.d.ts +11 -11
  126. package/esm/src/api/info/_methods/l4Orders.d.ts +6 -6
  127. package/esm/src/api/info/_methods/openOrders.d.ts +3 -3
  128. package/esm/src/api/info/_methods/orderStatus.d.ts +5 -5
  129. package/esm/src/api/info/_methods/recentTrades.d.ts +2 -2
  130. package/esm/src/api/info/_methods/twapHistory.d.ts +4 -4
  131. package/esm/src/api/info/_methods/userFills.d.ts +3 -3
  132. package/esm/src/api/info/_methods/userFillsByTime.d.ts +4 -4
  133. package/esm/src/api/info/_methods/userFunding.d.ts +3 -3
  134. package/esm/src/api/info/_methods/userFunding.js +2 -2
  135. package/esm/src/api/info/_methods/userFunding.js.map +1 -1
  136. package/esm/src/api/info/_methods/userTwapSliceFills.d.ts +4 -4
  137. package/esm/src/api/info/_methods/userTwapSliceFillsByTime.d.ts +5 -5
  138. package/esm/src/api/info/_methods/webData2.d.ts +9 -9
  139. package/esm/src/api/subscription/_methods/assetCtxs.d.ts +2 -0
  140. package/esm/src/api/subscription/_methods/assetCtxs.d.ts.map +1 -1
  141. package/esm/src/api/subscription/_methods/assetCtxs.js.map +1 -1
  142. package/esm/src/api/subscription/_methods/clearinghouseState.d.ts +2 -0
  143. package/esm/src/api/subscription/_methods/clearinghouseState.d.ts.map +1 -1
  144. package/esm/src/api/subscription/_methods/clearinghouseState.js +2 -0
  145. package/esm/src/api/subscription/_methods/clearinghouseState.js.map +1 -1
  146. package/esm/src/api/subscription/_methods/explorerBlock.d.ts +2 -0
  147. package/esm/src/api/subscription/_methods/explorerBlock.d.ts.map +1 -1
  148. package/esm/src/api/subscription/_methods/explorerBlock.js +2 -0
  149. package/esm/src/api/subscription/_methods/explorerBlock.js.map +1 -1
  150. package/esm/src/api/subscription/_methods/explorerTxs.d.ts +2 -0
  151. package/esm/src/api/subscription/_methods/explorerTxs.d.ts.map +1 -1
  152. package/esm/src/api/subscription/_methods/explorerTxs.js +2 -0
  153. package/esm/src/api/subscription/_methods/explorerTxs.js.map +1 -1
  154. package/esm/src/api/subscription/_methods/openOrders.d.ts +5 -5
  155. package/esm/src/api/subscription/_methods/orderUpdates.d.ts +4 -4
  156. package/esm/src/api/subscription/_methods/trades.d.ts +3 -3
  157. package/esm/src/api/subscription/_methods/twapStates.d.ts +9 -4
  158. package/esm/src/api/subscription/_methods/twapStates.d.ts.map +1 -1
  159. package/esm/src/api/subscription/_methods/twapStates.js +6 -1
  160. package/esm/src/api/subscription/_methods/twapStates.js.map +1 -1
  161. package/esm/src/api/subscription/_methods/userEvents.d.ts +17 -17
  162. package/esm/src/api/subscription/_methods/userFills.d.ts +5 -5
  163. package/esm/src/api/subscription/_methods/userHistoricalOrders.d.ts +6 -6
  164. package/esm/src/api/subscription/_methods/userTwapHistory.d.ts +6 -6
  165. package/esm/src/api/subscription/_methods/userTwapSliceFills.d.ts +6 -6
  166. package/esm/src/api/subscription/_methods/webData2.d.ts +11 -11
  167. package/esm/src/signing/_privateKeySigner.js +1 -1
  168. package/esm/src/signing/_privateKeySigner.js.map +1 -1
  169. package/esm/src/signing/mod.js +1 -1
  170. package/esm/src/signing/mod.js.map +1 -1
  171. package/package.json +2 -3
  172. package/script/_dnt.shims.d.ts +2 -0
  173. package/script/_dnt.shims.d.ts.map +1 -0
  174. package/script/_dnt.shims.js +61 -0
  175. package/script/_dnt.shims.js.map +1 -0
  176. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.d.ts +195 -0
  177. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.d.ts.map +1 -0
  178. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.js +468 -0
  179. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.js.map +1 -0
  180. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.d.ts +90 -0
  181. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.d.ts.map +1 -0
  182. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.js +215 -0
  183. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.js.map +1 -0
  184. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.d.ts +159 -0
  185. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.d.ts.map +1 -0
  186. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.js +578 -0
  187. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.js.map +1 -0
  188. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.d.ts +325 -0
  189. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.d.ts.map +1 -0
  190. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.js +1232 -0
  191. package/script/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.js.map +1 -0
  192. package/script/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.d.ts +76 -0
  193. package/script/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.d.ts.map +1 -0
  194. package/script/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.js +286 -0
  195. package/script/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.js.map +1 -0
  196. package/script/deps/jsr.io/@noble/curves/2.0.1/src/utils.d.ts +103 -0
  197. package/script/deps/jsr.io/@noble/curves/2.0.1/src/utils.d.ts.map +1 -0
  198. package/script/deps/jsr.io/@noble/curves/2.0.1/src/utils.js +273 -0
  199. package/script/deps/jsr.io/@noble/curves/2.0.1/src/utils.js.map +1 -0
  200. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_md.d.ts +49 -0
  201. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_md.d.ts.map +1 -0
  202. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_md.js +153 -0
  203. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_md.js.map +1 -0
  204. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.d.ts +55 -0
  205. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.d.ts.map +1 -0
  206. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.js +90 -0
  207. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.js.map +1 -0
  208. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.d.ts +36 -0
  209. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.d.ts.map +1 -0
  210. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.js +95 -0
  211. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.js.map +1 -0
  212. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.d.ts +199 -0
  213. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.d.ts.map +1 -0
  214. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.js +439 -0
  215. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.js.map +1 -0
  216. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.d.ts +58 -0
  217. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.d.ts.map +1 -0
  218. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.js +259 -0
  219. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.js.map +1 -0
  220. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/utils.d.ts +124 -0
  221. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/utils.d.ts.map +1 -0
  222. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/utils.js +304 -0
  223. package/script/deps/jsr.io/@noble/hashes/2.0.1/src/utils.js.map +1 -0
  224. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.d.ts +44 -0
  225. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.d.ts.map +1 -0
  226. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.js +182 -0
  227. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.js.map +1 -0
  228. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.d.ts +38 -0
  229. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.d.ts.map +1 -0
  230. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.js +99 -0
  231. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.js.map +1 -0
  232. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.d.ts +23 -0
  233. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.d.ts.map +1 -0
  234. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.js +134 -0
  235. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.js.map +1 -0
  236. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.d.ts +300 -0
  237. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.d.ts.map +1 -0
  238. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.js +576 -0
  239. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.js.map +1 -0
  240. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.d.ts +98 -0
  241. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.d.ts.map +1 -0
  242. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.js +211 -0
  243. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.js.map +1 -0
  244. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.d.ts +78 -0
  245. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.d.ts.map +1 -0
  246. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.js +308 -0
  247. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.js.map +1 -0
  248. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.d.ts +6 -0
  249. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.d.ts.map +1 -0
  250. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js +21 -0
  251. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js.map +1 -0
  252. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.d.ts +66 -0
  253. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.d.ts.map +1 -0
  254. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.js +195 -0
  255. package/script/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.js.map +1 -0
  256. package/script/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.d.ts +877 -0
  257. package/script/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.d.ts.map +1 -0
  258. package/script/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.js +2032 -0
  259. package/script/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.js.map +1 -0
  260. package/script/deps/jsr.io/@scure/base/2.0.0/index.d.ts +294 -0
  261. package/script/deps/jsr.io/@scure/base/2.0.0/index.d.ts.map +1 -0
  262. package/script/deps/jsr.io/@scure/base/2.0.0/index.js +710 -0
  263. package/script/deps/jsr.io/@scure/base/2.0.0/index.js.map +1 -0
  264. package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts +93 -0
  265. package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts.map +1 -0
  266. package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js +141 -0
  267. package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js.map +1 -0
  268. package/script/src/api/exchange/_methods/_base/_nonce.d.ts +3 -2
  269. package/script/src/api/exchange/_methods/_base/_nonce.d.ts.map +1 -1
  270. package/script/src/api/exchange/_methods/_base/_nonce.js +4 -3
  271. package/script/src/api/exchange/_methods/_base/_nonce.js.map +1 -1
  272. package/script/src/api/exchange/_methods/_base/_semaphore.d.ts +7 -6
  273. package/script/src/api/exchange/_methods/_base/_semaphore.d.ts.map +1 -1
  274. package/script/src/api/exchange/_methods/_base/_semaphore.js +35 -50
  275. package/script/src/api/exchange/_methods/_base/_semaphore.js.map +1 -1
  276. package/script/src/api/exchange/_methods/_base/execute.d.ts +14 -3
  277. package/script/src/api/exchange/_methods/_base/execute.d.ts.map +1 -1
  278. package/script/src/api/exchange/_methods/_base/execute.js +43 -9
  279. package/script/src/api/exchange/_methods/_base/execute.js.map +1 -1
  280. package/script/src/api/exchange/_methods/batchModify.d.ts +6 -6
  281. package/script/src/api/exchange/_methods/createVault.d.ts +5 -5
  282. package/script/src/api/exchange/_methods/modify.d.ts +5 -5
  283. package/script/src/api/exchange/_methods/order.d.ts +13 -13
  284. package/script/src/api/exchange/_methods/order.d.ts.map +1 -1
  285. package/script/src/api/exchange/_methods/order.js +4 -2
  286. package/script/src/api/exchange/_methods/order.js.map +1 -1
  287. package/script/src/api/exchange/client.d.ts +1 -1
  288. package/script/src/api/exchange/client.d.ts.map +1 -1
  289. package/script/src/api/exchange/client.js.map +1 -1
  290. package/script/src/api/exchange/mod.d.ts +1 -1
  291. package/script/src/api/exchange/mod.d.ts.map +1 -1
  292. package/script/src/api/exchange/mod.js.map +1 -1
  293. package/script/src/api/info/_methods/_base/commonSchemas.d.ts +8 -8
  294. package/script/src/api/info/_methods/frontendOpenOrders.d.ts +3 -3
  295. package/script/src/api/info/_methods/historicalOrders.d.ts +4 -4
  296. package/script/src/api/info/_methods/l3Orders.d.ts +11 -11
  297. package/script/src/api/info/_methods/l4Orders.d.ts +6 -6
  298. package/script/src/api/info/_methods/openOrders.d.ts +3 -3
  299. package/script/src/api/info/_methods/orderStatus.d.ts +5 -5
  300. package/script/src/api/info/_methods/recentTrades.d.ts +2 -2
  301. package/script/src/api/info/_methods/twapHistory.d.ts +4 -4
  302. package/script/src/api/info/_methods/userFills.d.ts +3 -3
  303. package/script/src/api/info/_methods/userFillsByTime.d.ts +4 -4
  304. package/script/src/api/info/_methods/userFunding.d.ts +3 -3
  305. package/script/src/api/info/_methods/userFunding.js +2 -2
  306. package/script/src/api/info/_methods/userFunding.js.map +1 -1
  307. package/script/src/api/info/_methods/userTwapSliceFills.d.ts +4 -4
  308. package/script/src/api/info/_methods/userTwapSliceFillsByTime.d.ts +5 -5
  309. package/script/src/api/info/_methods/webData2.d.ts +9 -9
  310. package/script/src/api/subscription/_methods/assetCtxs.d.ts +2 -0
  311. package/script/src/api/subscription/_methods/assetCtxs.d.ts.map +1 -1
  312. package/script/src/api/subscription/_methods/assetCtxs.js.map +1 -1
  313. package/script/src/api/subscription/_methods/clearinghouseState.d.ts +2 -0
  314. package/script/src/api/subscription/_methods/clearinghouseState.d.ts.map +1 -1
  315. package/script/src/api/subscription/_methods/clearinghouseState.js +2 -0
  316. package/script/src/api/subscription/_methods/clearinghouseState.js.map +1 -1
  317. package/script/src/api/subscription/_methods/explorerBlock.d.ts +2 -0
  318. package/script/src/api/subscription/_methods/explorerBlock.d.ts.map +1 -1
  319. package/script/src/api/subscription/_methods/explorerBlock.js +2 -0
  320. package/script/src/api/subscription/_methods/explorerBlock.js.map +1 -1
  321. package/script/src/api/subscription/_methods/explorerTxs.d.ts +2 -0
  322. package/script/src/api/subscription/_methods/explorerTxs.d.ts.map +1 -1
  323. package/script/src/api/subscription/_methods/explorerTxs.js +2 -0
  324. package/script/src/api/subscription/_methods/explorerTxs.js.map +1 -1
  325. package/script/src/api/subscription/_methods/openOrders.d.ts +5 -5
  326. package/script/src/api/subscription/_methods/orderUpdates.d.ts +4 -4
  327. package/script/src/api/subscription/_methods/trades.d.ts +3 -3
  328. package/script/src/api/subscription/_methods/twapStates.d.ts +9 -4
  329. package/script/src/api/subscription/_methods/twapStates.d.ts.map +1 -1
  330. package/script/src/api/subscription/_methods/twapStates.js +6 -1
  331. package/script/src/api/subscription/_methods/twapStates.js.map +1 -1
  332. package/script/src/api/subscription/_methods/userEvents.d.ts +17 -17
  333. package/script/src/api/subscription/_methods/userFills.d.ts +5 -5
  334. package/script/src/api/subscription/_methods/userHistoricalOrders.d.ts +6 -6
  335. package/script/src/api/subscription/_methods/userTwapHistory.d.ts +6 -6
  336. package/script/src/api/subscription/_methods/userTwapSliceFills.d.ts +6 -6
  337. package/script/src/api/subscription/_methods/webData2.d.ts +11 -11
  338. package/script/src/signing/_privateKeySigner.js +3 -3
  339. package/script/src/signing/_privateKeySigner.js.map +1 -1
  340. package/script/src/signing/mod.js +2 -2
  341. package/script/src/signing/mod.js.map +1 -1
  342. package/src/_dnt.shims.ts +60 -0
  343. package/src/deps/jsr.io/@noble/curves/2.0.1/src/abstract/curve.ts +633 -0
  344. package/src/deps/jsr.io/@noble/curves/2.0.1/src/abstract/hash-to-curve.ts +292 -0
  345. package/src/deps/jsr.io/@noble/curves/2.0.1/src/abstract/modular.ts +621 -0
  346. package/src/deps/jsr.io/@noble/curves/2.0.1/src/abstract/weierstrass.ts +1562 -0
  347. package/src/deps/jsr.io/@noble/curves/2.0.1/src/secp256k1.ts +327 -0
  348. package/src/deps/jsr.io/@noble/curves/2.0.1/src/utils.ts +306 -0
  349. package/src/deps/jsr.io/@noble/hashes/2.0.1/src/_md.ts +156 -0
  350. package/src/deps/jsr.io/@noble/hashes/2.0.1/src/_u64.ts +91 -0
  351. package/src/deps/jsr.io/@noble/hashes/2.0.1/src/hmac.ts +94 -0
  352. package/src/deps/jsr.io/@noble/hashes/2.0.1/src/sha2.ts +469 -0
  353. package/src/deps/jsr.io/@noble/hashes/2.0.1/src/sha3.ts +295 -0
  354. package/src/deps/jsr.io/@noble/hashes/2.0.1/src/utils.ts +340 -0
  355. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/advanced/abi-mapper.ts +212 -0
  356. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/address.ts +100 -0
  357. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/rlp.ts +104 -0
  358. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx-internal.ts +626 -0
  359. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/tx.ts +274 -0
  360. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/core/typed-data.ts +391 -0
  361. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.ts +12 -0
  362. package/src/deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/utils.ts +233 -0
  363. package/src/deps/jsr.io/@paulmillr/micro-packed/0.8.0/src/index.ts +2196 -0
  364. package/src/deps/jsr.io/@scure/base/2.0.0/index.ts +857 -0
  365. package/src/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.ts +146 -0
  366. package/src/src/api/exchange/_methods/_base/_nonce.ts +3 -2
  367. package/src/src/api/exchange/_methods/_base/_semaphore.ts +34 -59
  368. package/src/src/api/exchange/_methods/_base/execute.ts +60 -12
  369. package/src/src/api/exchange/_methods/order.ts +5 -3
  370. package/src/src/api/exchange/client.ts +5 -1
  371. package/src/src/api/exchange/mod.ts +5 -1
  372. package/src/src/api/info/_methods/userFunding.ts +2 -2
  373. package/src/src/api/subscription/_methods/assetCtxs.ts +2 -0
  374. package/src/src/api/subscription/_methods/clearinghouseState.ts +2 -0
  375. package/src/src/api/subscription/_methods/explorerBlock.ts +2 -0
  376. package/src/src/api/subscription/_methods/explorerTxs.ts +2 -0
  377. package/src/src/api/subscription/_methods/twapStates.ts +9 -1
  378. package/src/src/signing/_privateKeySigner.ts +1 -1
  379. package/src/src/signing/mod.ts +1 -1
  380. package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts +0 -21
  381. package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts.map +0 -1
  382. package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.js +0 -292
  383. package/esm/deps/jsr.io/@std/msgpack/1.0.3/decode.js.map +0 -1
  384. package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts +0 -44
  385. package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts.map +0 -1
  386. package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.js +0 -46
  387. package/esm/deps/jsr.io/@std/msgpack/1.0.3/mod.js.map +0 -1
  388. package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts +0 -21
  389. package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.d.ts.map +0 -1
  390. package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.js +0 -295
  391. package/script/deps/jsr.io/@std/msgpack/1.0.3/decode.js.map +0 -1
  392. package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts +0 -44
  393. package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.d.ts.map +0 -1
  394. package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.js +0 -62
  395. package/script/deps/jsr.io/@std/msgpack/1.0.3/mod.js.map +0 -1
  396. package/src/deps/jsr.io/@std/msgpack/1.0.3/decode.ts +0 -391
  397. package/src/deps/jsr.io/@std/msgpack/1.0.3/mod.ts +0 -47
@@ -0,0 +1,146 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+
4
+ /** Internal node for the FIFO waiting queue. */
5
+ interface Node {
6
+ res: () => void;
7
+ next: Node | undefined;
8
+ }
9
+
10
+ /**
11
+ * A counting semaphore for limiting concurrent access to a resource.
12
+ *
13
+ * @experimental **UNSTABLE**: New API, yet to be vetted.
14
+ *
15
+ * @example Usage
16
+ * ```ts
17
+ * import { Semaphore } from "@std/async/unstable-semaphore";
18
+ *
19
+ * const sem = new Semaphore(2);
20
+ * {
21
+ * using _permit = await sem.acquire();
22
+ * // critical section
23
+ * } // permit is automatically released when exiting the block
24
+ * ```
25
+ */
26
+ export class Semaphore {
27
+ #max: number;
28
+ /** Current number of available permits. */
29
+ #count: number;
30
+ /** Head of the waiting queue. */
31
+ #head: Node | undefined;
32
+ /** Tail of the waiting queue. */
33
+ #tail: Node | undefined;
34
+
35
+ /**
36
+ * Creates a new semaphore with the specified number of permits.
37
+ *
38
+ * @param max Maximum concurrent permits. Defaults to 1 (mutex).
39
+ */
40
+ constructor(max: number = 1) {
41
+ if (max < 1) {
42
+ throw new TypeError(
43
+ `Cannot create semaphore as 'max' must be at least 1: current value is ${max}`,
44
+ );
45
+ }
46
+ this.#count = this.#max = max;
47
+ }
48
+
49
+ /**
50
+ * Acquires a permit, waiting if none are available.
51
+ *
52
+ * @example Usage
53
+ * ```ts no-assert
54
+ * import { Semaphore } from "@std/async/unstable-semaphore";
55
+ *
56
+ * const sem = new Semaphore(1);
57
+ * await sem.acquire();
58
+ * try {
59
+ * // critical section
60
+ * } finally {
61
+ * sem.release();
62
+ * }
63
+ * ```
64
+ *
65
+ * @example Using `using` statement
66
+ * ```ts no-assert
67
+ * import { Semaphore } from "@std/async/unstable-semaphore";
68
+ *
69
+ * const sem = new Semaphore(1);
70
+ * {
71
+ * using _permit = await sem.acquire();
72
+ * // critical section
73
+ * } // permit is automatically released when exiting the block
74
+ * ```
75
+ *
76
+ * @returns A promise that resolves to a {@linkcode Disposable} when a permit is acquired.
77
+ */
78
+ acquire(): Promise<Disposable> {
79
+ const disposable: Disposable = { [Symbol.dispose]: () => this.release() };
80
+ if (this.#count > 0) {
81
+ this.#count--;
82
+ return Promise.resolve(disposable);
83
+ }
84
+ return new Promise((res) => {
85
+ const node: Node = { res: () => res(disposable), next: undefined };
86
+ if (this.#tail) {
87
+ this.#tail = this.#tail.next = node;
88
+ } else {
89
+ this.#head = this.#tail = node;
90
+ }
91
+ });
92
+ }
93
+
94
+ /**
95
+ * Tries to acquire a permit without waiting.
96
+ *
97
+ * @example Usage
98
+ * ```ts no-assert
99
+ * import { Semaphore } from "@std/async/unstable-semaphore";
100
+ *
101
+ * const sem = new Semaphore(1);
102
+ * const permit = sem.tryAcquire();
103
+ * if (permit) {
104
+ * using _ = permit;
105
+ * // critical section
106
+ * } else {
107
+ * // resource is busy
108
+ * }
109
+ * ```
110
+ *
111
+ * @returns A {@linkcode Disposable} if a permit was acquired, `undefined` otherwise.
112
+ */
113
+ tryAcquire(): Disposable | undefined {
114
+ if (this.#count > 0) {
115
+ this.#count--;
116
+ return { [Symbol.dispose]: () => this.release() };
117
+ }
118
+ return undefined;
119
+ }
120
+
121
+ /**
122
+ * Releases a permit, allowing the next waiter to proceed.
123
+ *
124
+ * @example Usage
125
+ * ```ts no-assert
126
+ * import { Semaphore } from "@std/async/unstable-semaphore";
127
+ *
128
+ * const sem = new Semaphore(1);
129
+ * await sem.acquire();
130
+ * try {
131
+ * // critical section
132
+ * } finally {
133
+ * sem.release();
134
+ * }
135
+ * ```
136
+ */
137
+ release(): void {
138
+ if (this.#head) {
139
+ this.#head.res();
140
+ this.#head = this.#head.next;
141
+ if (!this.#head) this.#tail = undefined;
142
+ } else if (this.#count < this.#max) {
143
+ this.#count++;
144
+ }
145
+ }
146
+ }
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Nonce manager for generating unique nonces per wallet address and network.
3
+ *
3
4
  * Uses lazy cleanup: removes entries when Date.now() > lastNonce.
4
5
  */
5
6
  class NonceManager {
@@ -24,5 +25,5 @@ class NonceManager {
24
25
  }
25
26
  }
26
27
 
27
- /** Default nonce manager, used when custom nonceManager is not provided in config. */
28
- export const defaultNonceManager = /* @__PURE__ */ new NonceManager();
28
+ /** Global nonce manager instance. */
29
+ export const globalNonceManager = /* @__PURE__ */ new NonceManager();
@@ -1,67 +1,32 @@
1
- // ============================================================
2
- // Semaphore
3
- // ============================================================
4
-
5
- // TODO: Replace with @std/async/semaphore if the PR (https://github.com/denoland/std/pull/6894) will be merged
6
-
7
- interface Node {
8
- res: () => void;
9
- next: Node | undefined;
10
- }
11
-
12
- export class Semaphore {
13
- #max: number;
14
- #count: number;
15
- #head: Node | undefined;
16
- #tail: Node | undefined;
17
-
18
- constructor(max: number = 1) {
19
- if (max < 1) {
20
- throw new TypeError(
21
- `Cannot create semaphore as 'max' must be at least 1: current value is ${max}`,
22
- );
23
- }
24
- this.#count = this.#max = max;
25
- }
26
-
27
- acquire(): Promise<void> {
28
- if (this.#count > 0) {
29
- this.#count--;
30
- return Promise.resolve();
31
- }
32
- return new Promise((res) => {
33
- const node: Node = { res, next: undefined };
34
- if (this.#tail) {
35
- this.#tail = this.#tail.next = node;
36
- } else {
37
- this.#head = this.#tail = node;
38
- }
39
- });
40
- }
41
-
42
- release(): void {
43
- if (this.#head) {
44
- this.#head.res();
45
- this.#head = this.#head.next;
46
- if (!this.#head) this.#tail = undefined;
47
- } else if (this.#count < this.#max) {
48
- this.#count++;
49
- }
50
- }
51
- }
52
-
53
- // ============================================================
54
- // RefCounted Registry
55
- // ============================================================
1
+ import { Semaphore } from "../../../../../deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js";
56
2
 
3
+ /**
4
+ * A reference-counted registry for lazily creating and reusing per-key values.
5
+ *
6
+ * @template K - Map key type.
7
+ * @template V - Stored value type.
8
+ */
57
9
  class RefCountedRegistry<K, V> {
58
10
  #map = new Map<K, { value: V; refs: number }>();
59
11
  #factory: () => V;
60
12
 
13
+ /**
14
+ * Creates a new registry instance.
15
+ *
16
+ * @param factory - Factory function used to create a new value when a key is first referenced.
17
+ */
61
18
  constructor(factory: () => V) {
62
19
  this.#factory = factory;
63
20
  }
64
21
 
22
+ /**
23
+ * Increments the reference count for a key and returns its value.
24
+ *
25
+ * If the key is not present, a new value is created via the factory.
26
+ *
27
+ * @param key - Registry key.
28
+ * @returns The value associated with the key.
29
+ */
65
30
  ref(key: K): V {
66
31
  let entry = this.#map.get(key);
67
32
  if (!entry) {
@@ -72,6 +37,13 @@ class RefCountedRegistry<K, V> {
72
37
  return entry.value;
73
38
  }
74
39
 
40
+ /**
41
+ * Decrements the reference count for a key.
42
+ *
43
+ * When the count reaches zero, the entry is removed.
44
+ *
45
+ * @param key - Registry key.
46
+ */
75
47
  unref(key: K): void {
76
48
  const entry = this.#map.get(key);
77
49
  if (!entry) return;
@@ -81,12 +53,15 @@ class RefCountedRegistry<K, V> {
81
53
  }
82
54
  }
83
55
 
84
- // ============================================================
85
- // Helper
86
- // ============================================================
87
-
88
56
  const semaphores = new RefCountedRegistry(() => new Semaphore(1));
89
57
 
58
+ /**
59
+ * Acquires a lock for the given key, executes the provided async function, and releases the lock.
60
+ *
61
+ * @param key The key to lock on.
62
+ * @param fn The async function to execute while holding the lock.
63
+ * @returns The result of the async function.
64
+ */
90
65
  export async function withLock<K, T>(key: K, fn: () => Promise<T>): Promise<T> {
91
66
  const semaphore = semaphores.ref(key);
92
67
  await semaphore.acquire();
@@ -10,7 +10,7 @@ import {
10
10
  signUserSignedAction,
11
11
  } from "../../../../signing/mod.js";
12
12
  import { assertSuccessResponse } from "./errors.js";
13
- import { defaultNonceManager } from "./_nonce.js";
13
+ import { globalNonceManager } from "./_nonce.js";
14
14
  import { withLock } from "./_semaphore.js";
15
15
  import type { SignatureSchema } from "./commonSchemas.js";
16
16
 
@@ -81,8 +81,20 @@ export interface ExchangeMultiSigConfig<T extends IRequestTransport = IRequestTr
81
81
  multiSigUser: `0x${string}`;
82
82
  }
83
83
 
84
+ /**
85
+ * Configuration for external signing Exchange API requests.
86
+ * Use this when signing is handled externally (e.g., by a gRPC server or HSM).
87
+ * The transport receives unsigned action payloads and is responsible for signing.
88
+ */
89
+ export interface ExchangeExternalSigningConfig<T extends IRequestTransport = IRequestTransport> extends BaseConfig<T> {
90
+ /** Marks this config as external signing mode. */
91
+ externalSigning: true;
92
+ /** The user address for nonce management. */
93
+ userAddress: `0x${string}`;
94
+ }
95
+
84
96
  /** Union type for all Exchange API configurations. */
85
- export type ExchangeConfig = ExchangeSingleWalletConfig | ExchangeMultiSigConfig;
97
+ export type ExchangeConfig = ExchangeSingleWalletConfig | ExchangeMultiSigConfig | ExchangeExternalSigningConfig;
86
98
 
87
99
  // =============================================================
88
100
  // Execute L1 Action
@@ -90,7 +102,7 @@ export type ExchangeConfig = ExchangeSingleWalletConfig | ExchangeMultiSigConfig
90
102
 
91
103
  /**
92
104
  * Execute an L1 action on the Hyperliquid Exchange.
93
- * Handles both single-wallet and multi-sig signing.
105
+ * Handles single-wallet, multi-sig, and external signing.
94
106
  */
95
107
  export async function executeL1Action<T>(
96
108
  config: ExchangeConfig,
@@ -102,13 +114,14 @@ export async function executeL1Action<T>(
102
114
  },
103
115
  ): Promise<T> {
104
116
  const { transport } = config;
105
- const leader = getLeader(config);
106
- const walletAddress = await getWalletAddress(leader);
117
+ const walletAddress = "externalSigning" in config
118
+ ? v.parse(Address, config.userAddress)
119
+ : await getWalletAddress(getLeader(config));
107
120
 
108
121
  // Semaphore ensures requests arrive at server in nonce order (prevents out-of-order delivery)
109
122
  const key = `${walletAddress}:${transport.isTestnet}`;
110
123
  return await withLock(key, async () => {
111
- const nonce = await (config.nonceManager?.(walletAddress) ?? defaultNonceManager.getNonce(key));
124
+ const nonce = await (config.nonceManager?.(walletAddress) ?? globalNonceManager.getNonce(key));
112
125
 
113
126
  // Validate and resolve options
114
127
  const vaultAddress = v.parse(
@@ -124,7 +137,22 @@ export async function executeL1Action<T>(
124
137
  );
125
138
  const signal = options?.signal;
126
139
 
140
+ // Handle external signing - send unsigned action to transport
141
+ if ("externalSigning" in config) {
142
+ const response = await transport.request("exchange", {
143
+ action,
144
+ nonce,
145
+ vaultAddress,
146
+ expiresAfter,
147
+ isTestnet: transport.isTestnet,
148
+ userAddress: walletAddress,
149
+ }, signal);
150
+ assertSuccessResponse(response);
151
+ return response as T;
152
+ }
153
+
127
154
  // Sign action (multi-sig or single wallet)
155
+ const leader = getLeader(config);
128
156
  const [finalAction, signature] = "wallet" in config
129
157
  ? [
130
158
  action,
@@ -168,7 +196,7 @@ function getNonceFieldName(types: Record<string, { name: string; type: string }[
168
196
 
169
197
  /**
170
198
  * Execute a user-signed action (EIP-712) on the Hyperliquid Exchange.
171
- * Handles both single-wallet and multi-sig signing.
199
+ * Handles single-wallet, multi-sig, and external signing.
172
200
  * Automatically adds signatureChainId, hyperliquidChain, and nonce/time.
173
201
  */
174
202
  export async function executeUserSignedAction<T>(
@@ -180,27 +208,43 @@ export async function executeUserSignedAction<T>(
180
208
  },
181
209
  ): Promise<T> {
182
210
  const { transport } = config;
183
- const leader = getLeader(config);
184
- const walletAddress = await getWalletAddress(leader);
211
+ const walletAddress = "externalSigning" in config
212
+ ? v.parse(Address, config.userAddress)
213
+ : await getWalletAddress(getLeader(config));
185
214
 
186
215
  // Semaphore ensures requests arrive at server in nonce order (prevents out-of-order delivery)
187
216
  const key = `${walletAddress}:${transport.isTestnet}`;
188
217
  return withLock(key, async () => {
189
- const nonce = await (config.nonceManager?.(walletAddress) ?? defaultNonceManager.getNonce(key));
218
+ const nonce = await (config.nonceManager?.(walletAddress) ?? globalNonceManager.getNonce(key));
190
219
  const signal = options?.signal;
191
220
 
192
221
  // Add system fields for user-signed actions
193
222
  const { type, ...restAction } = action;
194
223
  const nonceFieldName = getNonceFieldName(types);
224
+ const signatureChainId = await getSignatureChainId(config);
195
225
  const fullAction = { // key order is important for multi-sig
196
226
  type,
197
- signatureChainId: await getSignatureChainId(config),
227
+ signatureChainId,
198
228
  hyperliquidChain: transport.isTestnet ? "Testnet" : "Mainnet",
199
229
  ...restAction,
200
230
  [nonceFieldName]: nonce,
201
231
  };
202
232
 
233
+ // Handle external signing - send unsigned action with types to transport
234
+ if ("externalSigning" in config) {
235
+ const response = await transport.request("exchange", {
236
+ action: fullAction,
237
+ types,
238
+ nonce,
239
+ isTestnet: transport.isTestnet,
240
+ userAddress: walletAddress,
241
+ }, signal);
242
+ assertSuccessResponse(response);
243
+ return response as T;
244
+ }
245
+
203
246
  // Sign action (multi-sig or single wallet)
247
+ const leader = getLeader(config);
204
248
  const [finalAction, signature] = "wallet" in config
205
249
  ? [fullAction, await signUserSignedAction({ wallet: leader, action: fullAction, types })]
206
250
  : await signMultiSigUserSigned(config, fullAction, types, walletAddress, nonce);
@@ -334,7 +378,7 @@ async function signMultiSigUserSigned(
334
378
  // =============================================================
335
379
 
336
380
  /** Get the leader wallet (first signer for the single wallet, or multi-sig). */
337
- function getLeader(config: ExchangeConfig): AbstractWallet {
381
+ function getLeader(config: ExchangeSingleWalletConfig | ExchangeMultiSigConfig): AbstractWallet {
338
382
  return "wallet" in config ? config.wallet : config.signers[0];
339
383
  }
340
384
 
@@ -346,5 +390,9 @@ async function getSignatureChainId(config: ExchangeConfig): Promise<`0x${string}
346
390
  : config.signatureChainId;
347
391
  return v.parse(Hex, id);
348
392
  }
393
+ // External signing defaults to chain ID 1 (mainnet) if not specified
394
+ if ("externalSigning" in config) {
395
+ return "0x1";
396
+ }
349
397
  return getWalletChainId(getLeader(config));
350
398
  }
@@ -141,11 +141,11 @@ export const OrderRequest = /* @__PURE__ */ (() => {
141
141
  Address,
142
142
  v.description("Builder address."),
143
143
  ),
144
- /** Builder fee in 0.1bps (1 = 0.0001%). */
144
+ /** Builder fee in 0.1bps (1 = 0.0001%). Max 100 for perps (0.1%), 1000 for spot (1%). */
145
145
  f: v.pipe(
146
146
  UnsignedInteger,
147
- v.maxValue(100),
148
- v.description("Builder fee in 0.1bps (1 = 0.0001%)."),
147
+ v.maxValue(1000),
148
+ v.description("Builder fee in 0.1bps (1 = 0.0001%). Max 100 for perps (0.1%), 1000 for spot (1%)."),
149
149
  ),
150
150
  })),
151
151
  v.description("Builder fee."),
@@ -259,6 +259,8 @@ export const OrderResponse = /* @__PURE__ */ (() => {
259
259
  v.description("Error message."),
260
260
  ),
261
261
  }),
262
+ v.literal("waitingForFill"),
263
+ v.literal("waitingForTrigger"),
262
264
  ]),
263
265
  ),
264
266
  v.description("Array of statuses for each placed order."),
@@ -681,7 +681,11 @@ export class ExchangeClient<C extends ExchangeConfig = ExchangeSingleWalletConfi
681
681
  // Type Re-exports
682
682
  // =============================================================
683
683
 
684
- export type { ExchangeMultiSigConfig, ExchangeSingleWalletConfig } from "./_methods/_base/execute.js";
684
+ export type {
685
+ ExchangeExternalSigningConfig,
686
+ ExchangeMultiSigConfig,
687
+ ExchangeSingleWalletConfig,
688
+ } from "./_methods/_base/execute.js";
685
689
  export { ApiRequestError } from "./_methods/_base/errors.js";
686
690
 
687
691
  export type {
@@ -37,7 +37,11 @@
37
37
  * @module
38
38
  */
39
39
 
40
- export type { ExchangeMultiSigConfig, ExchangeSingleWalletConfig } from "./_methods/_base/execute.js";
40
+ export type {
41
+ ExchangeExternalSigningConfig,
42
+ ExchangeMultiSigConfig,
43
+ ExchangeSingleWalletConfig,
44
+ } from "./_methods/_base/execute.js";
41
45
  export { ApiRequestError } from "./_methods/_base/errors.js";
42
46
 
43
47
  export * from "./_methods/agentEnableDexAbstraction.js";
@@ -25,7 +25,7 @@ export const UserFundingRequest = /* @__PURE__ */ (() => {
25
25
  ),
26
26
  /** Start time (in ms since epoch). */
27
27
  startTime: v.pipe(
28
- UnsignedInteger,
28
+ v.nullish(UnsignedInteger),
29
29
  v.description("Start time (in ms since epoch)."),
30
30
  ),
31
31
  /** End time (in ms since epoch). */
@@ -131,7 +131,7 @@ export type UserFundingParameters = Omit<v.InferInput<typeof UserFundingRequest>
131
131
  *
132
132
  * const data = await userFunding(
133
133
  * { transport },
134
- * { user: "0x...", startTime: Date.now() - 1000 * 60 * 60 * 24 },
134
+ * { user: "0x..." },
135
135
  * );
136
136
  * ```
137
137
  *
@@ -80,6 +80,8 @@ export type AssetCtxsParameters = Omit<v.InferInput<typeof AssetCtxsRequest>, "t
80
80
  * (data) => console.log(data),
81
81
  * );
82
82
  * ```
83
+ *
84
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
83
85
  */
84
86
  export function assetCtxs(
85
87
  config: SubscriptionConfig,
@@ -92,6 +92,8 @@ export type ClearinghouseStateParameters = Omit<v.InferInput<typeof Clearinghous
92
92
  * (data) => console.log(data),
93
93
  * );
94
94
  * ```
95
+ *
96
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
95
97
  */
96
98
  export function clearinghouseState(
97
99
  config: SubscriptionConfig,
@@ -89,6 +89,8 @@ import type { ISubscription } from "../../../transport/mod.js";
89
89
  * (data) => console.log(data),
90
90
  * );
91
91
  * ```
92
+ *
93
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
92
94
  */
93
95
  export function explorerBlock(
94
96
  config: SubscriptionConfig,
@@ -59,6 +59,8 @@ import type { ISubscription } from "../../../transport/mod.js";
59
59
  * (data) => console.log(data),
60
60
  * );
61
61
  * ```
62
+ *
63
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
62
64
  */
63
65
  export function explorerTxs(
64
66
  config: SubscriptionConfig,
@@ -21,6 +21,11 @@ export const TwapStatesRequest = /* @__PURE__ */ (() => {
21
21
  Address,
22
22
  v.description("User address."),
23
23
  ),
24
+ /** DEX name (empty string for main dex). */
25
+ dex: v.pipe(
26
+ v.optional(v.string()),
27
+ v.description("DEX name (empty string for main dex)."),
28
+ ),
24
29
  }),
25
30
  v.description("Subscribe to TWAP states updates for a specific user."),
26
31
  );
@@ -87,6 +92,8 @@ export type TwapStatesParameters = Omit<v.InferInput<typeof TwapStatesRequest>,
87
92
  * (data) => console.log(data),
88
93
  * );
89
94
  * ```
95
+ *
96
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
90
97
  */
91
98
  export function twapStates(
92
99
  config: SubscriptionConfig,
@@ -96,9 +103,10 @@ export function twapStates(
96
103
  const payload = v.parse(TwapStatesRequest, {
97
104
  type: "twapStates",
98
105
  ...params,
106
+ dex: params.dex ?? "", // same value as in response
99
107
  });
100
108
  return config.transport.subscribe<TwapStatesEvent>(payload.type, payload, (e) => {
101
- if (e.detail.user === payload.user) {
109
+ if (e.detail.user === payload.user && e.detail.dex === payload.dex) {
102
110
  listener(e.detail);
103
111
  }
104
112
  });
@@ -1,4 +1,4 @@
1
- import { addr, signTyped } from "micro-eth-signer";
1
+ import { addr, signTyped } from "../../deps/jsr.io/@paulmillr/micro-eth-signer/0.18.1/src/index.js";
2
2
  import type { AbstractViemLocalAccount } from "./_abstractWallet.js";
3
3
 
4
4
  /**
@@ -63,7 +63,7 @@
63
63
 
64
64
  import { keccak_256 } from "@noble/hashes/sha3.js";
65
65
  import { bytesToHex, concatBytes, hexToBytes } from "@noble/hashes/utils.js";
66
- import { encode as encodeMsgpack, type ValueType } from "../../deps/jsr.io/@std/msgpack/1.0.3/mod.js";
66
+ import { encode as encodeMsgpack, type ValueType } from "../../deps/jsr.io/@std/msgpack/1.0.3/encode.js";
67
67
  import { type AbstractWallet, type Signature, signTypedData } from "./_abstractWallet.js";
68
68
 
69
69
  export {
@@ -1,21 +0,0 @@
1
- import type { ValueType } from "./encode.js";
2
- /**
3
- * Decode a value from the {@link https://msgpack.org/ | MessagePack} binary format.
4
- *
5
- * If the input is not in valid message pack format, an error will be thrown.
6
- *
7
- * @example Usage
8
- * ```ts
9
- * import { decode } from "@std/msgpack/decode";
10
- * import { assertEquals } from "@std/assert";
11
- *
12
- * const encoded = new Uint8Array([163, 72, 105, 33]);
13
- *
14
- * assertEquals(decode(encoded), "Hi!");
15
- * ```
16
- *
17
- * @param data MessagePack binary data.
18
- * @returns Decoded value from the MessagePack binary data.
19
- */
20
- export declare function decode(data: Uint8Array): ValueType;
21
- //# sourceMappingURL=decode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/msgpack/1.0.3/decode.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAclD"}