@nktkas/hyperliquid 0.22.2 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/README.md +47 -49
  2. package/esm/src/base.d.ts +4 -1
  3. package/esm/src/base.d.ts.map +1 -1
  4. package/esm/src/base.js +2 -2
  5. package/esm/src/clients/exchange.d.ts +289 -207
  6. package/esm/src/clients/exchange.d.ts.map +1 -1
  7. package/esm/src/clients/exchange.js +605 -410
  8. package/esm/src/clients/info.d.ts +137 -41
  9. package/esm/src/clients/info.d.ts.map +1 -1
  10. package/esm/src/clients/info.js +124 -28
  11. package/esm/src/clients/multiSign.d.ts +285 -204
  12. package/esm/src/clients/multiSign.d.ts.map +1 -1
  13. package/esm/src/clients/multiSign.js +521 -493
  14. package/esm/src/clients/subscription.d.ts +38 -3
  15. package/esm/src/clients/subscription.d.ts.map +1 -1
  16. package/esm/src/clients/subscription.js +36 -3
  17. package/esm/src/signing/{_ethers.d.ts → _signTypedData/ethers.d.ts} +1 -1
  18. package/esm/src/signing/_signTypedData/ethers.d.ts.map +1 -0
  19. package/esm/src/signing/_signTypedData/mod.d.ts +35 -0
  20. package/esm/src/signing/_signTypedData/mod.d.ts.map +1 -0
  21. package/esm/src/signing/_signTypedData/mod.js +59 -0
  22. package/esm/src/signing/_signTypedData/private_key.d.ts +26 -0
  23. package/esm/src/signing/_signTypedData/private_key.d.ts.map +1 -0
  24. package/esm/src/signing/_signTypedData/private_key.js +144 -0
  25. package/esm/src/signing/{_viem.d.ts → _signTypedData/viem.d.ts} +2 -2
  26. package/esm/src/signing/_signTypedData/viem.d.ts.map +1 -0
  27. package/{script/src/signing/_window.d.ts → esm/src/signing/_signTypedData/window.d.ts} +18 -12
  28. package/esm/src/signing/_signTypedData/window.d.ts.map +1 -0
  29. package/esm/src/signing/{_window.js → _signTypedData/window.js} +3 -2
  30. package/esm/src/signing/_sorter.d.ts +56 -82
  31. package/esm/src/signing/_sorter.d.ts.map +1 -1
  32. package/esm/src/signing/_sorter.js +36 -49
  33. package/esm/src/signing/mod.d.ts +151 -130
  34. package/esm/src/signing/mod.d.ts.map +1 -1
  35. package/esm/src/signing/mod.js +182 -228
  36. package/esm/src/transports/base.d.ts +1 -1
  37. package/esm/src/transports/base.d.ts.map +1 -1
  38. package/esm/src/transports/base.js +2 -2
  39. package/esm/src/transports/http/http_transport.d.ts +9 -15
  40. package/esm/src/transports/http/http_transport.d.ts.map +1 -1
  41. package/esm/src/transports/http/http_transport.js +64 -59
  42. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
  43. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  44. package/esm/src/transports/websocket/_hyperliquid_event_target.js +1 -1
  45. package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
  46. package/esm/src/transports/websocket/_reconnecting_websocket.js +17 -4
  47. package/esm/src/transports/websocket/_websocket_async_request.d.ts +0 -9
  48. package/esm/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
  49. package/esm/src/transports/websocket/_websocket_async_request.js +14 -20
  50. package/esm/src/transports/websocket/websocket_transport.d.ts +8 -4
  51. package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  52. package/esm/src/transports/websocket/websocket_transport.js +83 -54
  53. package/esm/src/types/exchange/requests.d.ts +27 -51
  54. package/esm/src/types/exchange/requests.d.ts.map +1 -1
  55. package/esm/src/types/explorer/requests.d.ts +5 -8
  56. package/esm/src/types/explorer/requests.d.ts.map +1 -1
  57. package/esm/src/types/info/accounts.d.ts +5 -5
  58. package/esm/src/types/info/accounts.d.ts.map +1 -1
  59. package/esm/src/types/info/delegations.d.ts +1 -1
  60. package/esm/src/types/info/delegations.d.ts.map +1 -1
  61. package/esm/src/types/info/orders.d.ts +1 -1
  62. package/esm/src/types/info/orders.d.ts.map +1 -1
  63. package/esm/src/types/info/requests.d.ts +49 -96
  64. package/esm/src/types/info/requests.d.ts.map +1 -1
  65. package/esm/src/types/subscriptions/requests.d.ts +72 -18
  66. package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
  67. package/esm/src/types/subscriptions/responses.d.ts +2 -0
  68. package/esm/src/types/subscriptions/responses.d.ts.map +1 -1
  69. package/package.json +8 -5
  70. package/script/mod.js +13 -23
  71. package/script/src/base.d.ts +4 -1
  72. package/script/src/base.d.ts.map +1 -1
  73. package/script/src/base.js +10 -20
  74. package/script/src/clients/exchange.d.ts +289 -207
  75. package/script/src/clients/exchange.d.ts.map +1 -1
  76. package/script/src/clients/exchange.js +2000 -1815
  77. package/script/src/clients/info.d.ts +137 -41
  78. package/script/src/clients/info.d.ts.map +1 -1
  79. package/script/src/clients/info.js +1296 -1210
  80. package/script/src/clients/multiSign.d.ts +285 -204
  81. package/script/src/clients/multiSign.d.ts.map +1 -1
  82. package/script/src/clients/multiSign.js +2043 -2025
  83. package/script/src/clients/subscription.d.ts +38 -3
  84. package/script/src/clients/subscription.d.ts.map +1 -1
  85. package/script/src/clients/subscription.js +568 -545
  86. package/script/src/signing/{_ethers.d.ts → _signTypedData/ethers.d.ts} +1 -1
  87. package/script/src/signing/_signTypedData/ethers.d.ts.map +1 -0
  88. package/script/src/signing/_signTypedData/ethers.js +16 -0
  89. package/script/src/signing/_signTypedData/mod.d.ts +35 -0
  90. package/script/src/signing/_signTypedData/mod.d.ts.map +1 -0
  91. package/script/src/signing/_signTypedData/mod.js +67 -0
  92. package/script/src/signing/_signTypedData/private_key.d.ts +26 -0
  93. package/script/src/signing/_signTypedData/private_key.d.ts.map +1 -0
  94. package/script/src/signing/_signTypedData/private_key.js +148 -0
  95. package/script/src/signing/{_viem.d.ts → _signTypedData/viem.d.ts} +2 -2
  96. package/script/src/signing/_signTypedData/viem.d.ts.map +1 -0
  97. package/script/src/signing/_signTypedData/viem.js +9 -0
  98. package/{esm/src/signing/_window.d.ts → script/src/signing/_signTypedData/window.d.ts} +18 -12
  99. package/script/src/signing/_signTypedData/window.d.ts.map +1 -0
  100. package/script/src/signing/_signTypedData/window.js +34 -0
  101. package/script/src/signing/_sorter.d.ts +56 -82
  102. package/script/src/signing/_sorter.d.ts.map +1 -1
  103. package/script/src/signing/_sorter.js +655 -678
  104. package/script/src/signing/mod.d.ts +151 -130
  105. package/script/src/signing/mod.d.ts.map +1 -1
  106. package/script/src/signing/mod.js +286 -342
  107. package/script/src/transports/base.d.ts +1 -1
  108. package/script/src/transports/base.d.ts.map +1 -1
  109. package/script/src/transports/base.js +11 -21
  110. package/script/src/transports/http/http_transport.d.ts +9 -15
  111. package/script/src/transports/http/http_transport.d.ts.map +1 -1
  112. package/script/src/transports/http/http_transport.js +97 -102
  113. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
  114. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  115. package/script/src/transports/websocket/_hyperliquid_event_target.js +51 -61
  116. package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
  117. package/script/src/transports/websocket/_reconnecting_websocket.js +271 -268
  118. package/script/src/transports/websocket/_websocket_async_request.d.ts +0 -9
  119. package/script/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
  120. package/script/src/transports/websocket/_websocket_async_request.js +157 -174
  121. package/script/src/transports/websocket/websocket_transport.d.ts +8 -4
  122. package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  123. package/script/src/transports/websocket/websocket_transport.js +209 -189
  124. package/script/src/types/exchange/requests.d.ts +27 -51
  125. package/script/src/types/exchange/requests.d.ts.map +1 -1
  126. package/script/src/types/exchange/requests.js +2 -12
  127. package/script/src/types/exchange/responses.js +2 -12
  128. package/script/src/types/explorer/requests.d.ts +5 -8
  129. package/script/src/types/explorer/requests.d.ts.map +1 -1
  130. package/script/src/types/explorer/requests.js +2 -12
  131. package/script/src/types/explorer/responses.js +2 -12
  132. package/script/src/types/info/accounts.d.ts +5 -5
  133. package/script/src/types/info/accounts.d.ts.map +1 -1
  134. package/script/src/types/info/accounts.js +2 -12
  135. package/script/src/types/info/assets.js +2 -12
  136. package/script/src/types/info/delegations.d.ts +1 -1
  137. package/script/src/types/info/delegations.d.ts.map +1 -1
  138. package/script/src/types/info/delegations.js +2 -12
  139. package/script/src/types/info/markets.js +2 -12
  140. package/script/src/types/info/orders.d.ts +1 -1
  141. package/script/src/types/info/orders.d.ts.map +1 -1
  142. package/script/src/types/info/orders.js +2 -12
  143. package/script/src/types/info/requests.d.ts +49 -96
  144. package/script/src/types/info/requests.d.ts.map +1 -1
  145. package/script/src/types/info/requests.js +2 -12
  146. package/script/src/types/info/vaults.js +2 -12
  147. package/script/src/types/mod.js +2 -12
  148. package/script/src/types/subscriptions/requests.d.ts +72 -18
  149. package/script/src/types/subscriptions/requests.d.ts.map +1 -1
  150. package/script/src/types/subscriptions/requests.js +2 -12
  151. package/script/src/types/subscriptions/responses.d.ts +2 -0
  152. package/script/src/types/subscriptions/responses.d.ts.map +1 -1
  153. package/script/src/types/subscriptions/responses.js +2 -12
  154. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts +0 -2
  155. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts.map +0 -1
  156. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +0 -1
  157. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts +0 -95
  158. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts.map +0 -1
  159. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +0 -10
  160. package/esm/deps/jsr.io/@std/async/1.0.13/delay.d.ts +0 -43
  161. package/esm/deps/jsr.io/@std/async/1.0.13/delay.d.ts.map +0 -1
  162. package/esm/deps/jsr.io/@std/async/1.0.13/delay.js +0 -63
  163. package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +0 -9
  164. package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +0 -1
  165. package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.js +0 -2
  166. package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +0 -21
  167. package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +0 -1
  168. package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.js +0 -32
  169. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +0 -23
  170. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +0 -1
  171. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.js +0 -51
  172. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
  173. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
  174. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -13
  175. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
  176. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
  177. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -2
  178. package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +0 -39
  179. package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +0 -1
  180. package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.js +0 -87
  181. package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +0 -9
  182. package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +0 -1
  183. package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.js +0 -2
  184. package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts +0 -39
  185. package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +0 -1
  186. package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.js +0 -237
  187. package/esm/src/signing/_ethers.d.ts.map +0 -1
  188. package/esm/src/signing/_private_key.d.ts +0 -22
  189. package/esm/src/signing/_private_key.d.ts.map +0 -1
  190. package/esm/src/signing/_private_key.js +0 -124
  191. package/esm/src/signing/_viem.d.ts.map +0 -1
  192. package/esm/src/signing/_window.d.ts.map +0 -1
  193. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts +0 -2
  194. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts.map +0 -1
  195. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +0 -27
  196. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts +0 -95
  197. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts.map +0 -1
  198. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +0 -24
  199. package/script/deps/jsr.io/@std/async/1.0.13/delay.d.ts +0 -43
  200. package/script/deps/jsr.io/@std/async/1.0.13/delay.d.ts.map +0 -1
  201. package/script/deps/jsr.io/@std/async/1.0.13/delay.js +0 -76
  202. package/script/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +0 -9
  203. package/script/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +0 -1
  204. package/script/deps/jsr.io/@std/bytes/1.0.6/_types.js +0 -13
  205. package/script/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +0 -21
  206. package/script/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +0 -1
  207. package/script/deps/jsr.io/@std/bytes/1.0.6/concat.js +0 -45
  208. package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +0 -23
  209. package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +0 -1
  210. package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.js +0 -67
  211. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
  212. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
  213. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -26
  214. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
  215. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
  216. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -13
  217. package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +0 -39
  218. package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +0 -1
  219. package/script/deps/jsr.io/@std/encoding/1.0.10/hex.js +0 -101
  220. package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +0 -9
  221. package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +0 -1
  222. package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.js +0 -13
  223. package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts +0 -39
  224. package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +0 -1
  225. package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.js +0 -250
  226. package/script/src/signing/_ethers.d.ts.map +0 -1
  227. package/script/src/signing/_ethers.js +0 -26
  228. package/script/src/signing/_private_key.d.ts +0 -22
  229. package/script/src/signing/_private_key.d.ts.map +0 -1
  230. package/script/src/signing/_private_key.js +0 -138
  231. package/script/src/signing/_viem.d.ts.map +0 -1
  232. package/script/src/signing/_viem.js +0 -19
  233. package/script/src/signing/_window.d.ts.map +0 -1
  234. package/script/src/signing/_window.js +0 -43
  235. /package/esm/src/signing/{_ethers.js → _signTypedData/ethers.js} +0 -0
  236. /package/esm/src/signing/{_viem.js → _signTypedData/viem.js} +0 -0
@@ -30,4 +30,4 @@ export interface AbstractEthersV5Signer {
30
30
  export declare function isAbstractEthersSigner(client: unknown): client is AbstractEthersSigner;
31
31
  /** Checks if the given value is an abstract ethers v5 signer. */
32
32
  export declare function isAbstractEthersV5Signer(client: unknown): client is AbstractEthersV5Signer;
33
- //# sourceMappingURL=_ethers.d.ts.map
33
+ //# sourceMappingURL=ethers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ethers.d.ts","sourceRoot":"","sources":["../../../../src/src/signing/_signTypedData/ethers.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,MAAM,WAAW,oBAAoB;IACjC,aAAa,CACT,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,MAAM,CAAC;KAC7B,EACD,KAAK,EAAE;QACH,CAAC,GAAG,EAAE,MAAM,GAAG;YACX,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SAChB,EAAE,CAAC;KACP,EACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;CACtB;AAED,+FAA+F;AAC/F,MAAM,WAAW,sBAAsB;IACnC,cAAc,CACV,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,MAAM,CAAC;KAC7B,EACD,KAAK,EAAE;QACH,CAAC,GAAG,EAAE,MAAM,GAAG;YACX,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SAChB,EAAE,CAAC;KACP,EACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;CACtB;AAED,8DAA8D;AAC9D,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,oBAAoB,CAItF;AAED,iEAAiE;AACjE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,sBAAsB,CAI1F"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isAbstractEthersSigner = isAbstractEthersSigner;
4
+ exports.isAbstractEthersV5Signer = isAbstractEthersV5Signer;
5
+ /** Checks if the given value is an abstract ethers signer. */
6
+ function isAbstractEthersSigner(client) {
7
+ return typeof client === "object" && client !== null &&
8
+ "signTypedData" in client && typeof client.signTypedData === "function" &&
9
+ client.signTypedData.length === 3;
10
+ }
11
+ /** Checks if the given value is an abstract ethers v5 signer. */
12
+ function isAbstractEthersV5Signer(client) {
13
+ return typeof client === "object" && client !== null &&
14
+ "_signTypedData" in client && typeof client._signTypedData === "function" &&
15
+ client._signTypedData.length === 3;
16
+ }
@@ -0,0 +1,35 @@
1
+ import type { Hex } from "../../base.js";
2
+ import { type AbstractEthersSigner, type AbstractEthersV5Signer, isAbstractEthersSigner, isAbstractEthersV5Signer } from "./ethers.js";
3
+ import { isValidPrivateKey } from "./private_key.js";
4
+ import { type AbstractViemWalletClient, isAbstractViemWalletClient } from "./viem.js";
5
+ import { type AbstractWindowEthereum, isAbstractWindowEthereum } from "./window.js";
6
+ export { type AbstractEthersSigner, type AbstractEthersV5Signer, type AbstractViemWalletClient, type AbstractWindowEthereum, isAbstractEthersSigner, isAbstractEthersV5Signer, isAbstractViemWalletClient, isAbstractWindowEthereum, isValidPrivateKey, };
7
+ /** Abstract interface for a wallet that can sign typed data. */
8
+ export type AbstractWallet = Hex | AbstractViemWalletClient | AbstractEthersSigner | AbstractEthersV5Signer | AbstractWindowEthereum;
9
+ /** ECDSA signature components for Ethereum transactions and typed data. */
10
+ export interface Signature {
11
+ /** First 32-byte component of ECDSA signature */
12
+ r: Hex;
13
+ /** Second 32-byte component of ECDSA signature */
14
+ s: Hex;
15
+ /** Recovery identifier (27 or 28, or 0 or 1 for EIP-155) */
16
+ v: number;
17
+ }
18
+ export declare function signTypedData(args: {
19
+ wallet: AbstractWallet;
20
+ domain: {
21
+ name: string;
22
+ version: string;
23
+ chainId: number;
24
+ verifyingContract: Hex;
25
+ };
26
+ types: {
27
+ [key: string]: {
28
+ name: string;
29
+ type: string;
30
+ }[];
31
+ };
32
+ primaryType: string;
33
+ message: Record<string, unknown>;
34
+ }): Promise<Signature>;
35
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/src/signing/_signTypedData/mod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,sBAAsB,EACtB,wBAAwB,EAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAgD,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,KAAK,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACtF,OAAO,EAAE,KAAK,sBAAsB,EAAE,wBAAwB,EAAmC,MAAM,aAAa,CAAC;AAErH,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,GACpB,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,cAAc,GACpB,GAAG,GACH,wBAAwB,GACxB,oBAAoB,GACpB,sBAAsB,GACtB,sBAAsB,CAAC;AAE7B,2EAA2E;AAC3E,MAAM,WAAW,SAAS;IACtB,iDAAiD;IACjD,CAAC,EAAE,GAAG,CAAC;IACP,kDAAkD;IAClD,CAAC,EAAE,GAAG,CAAC;IACP,4DAA4D;IAC5D,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACtC,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,GAAG,CAAC;KAC1B,CAAC;IACF,KAAK,EAAE;QACH,CAAC,GAAG,EAAE,MAAM,GAAG;YACX,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SAChB,EAAE,CAAC;KACP,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,SAAS,CAAC,CA4CrB"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidPrivateKey = exports.isAbstractWindowEthereum = exports.isAbstractViemWalletClient = exports.isAbstractEthersV5Signer = exports.isAbstractEthersSigner = void 0;
4
+ exports.signTypedData = signTypedData;
5
+ const ethers_js_1 = require("./ethers.js");
6
+ Object.defineProperty(exports, "isAbstractEthersSigner", { enumerable: true, get: function () { return ethers_js_1.isAbstractEthersSigner; } });
7
+ Object.defineProperty(exports, "isAbstractEthersV5Signer", { enumerable: true, get: function () { return ethers_js_1.isAbstractEthersV5Signer; } });
8
+ const private_key_js_1 = require("./private_key.js");
9
+ Object.defineProperty(exports, "isValidPrivateKey", { enumerable: true, get: function () { return private_key_js_1.isValidPrivateKey; } });
10
+ const viem_js_1 = require("./viem.js");
11
+ Object.defineProperty(exports, "isAbstractViemWalletClient", { enumerable: true, get: function () { return viem_js_1.isAbstractViemWalletClient; } });
12
+ const window_js_1 = require("./window.js");
13
+ Object.defineProperty(exports, "isAbstractWindowEthereum", { enumerable: true, get: function () { return window_js_1.isAbstractWindowEthereum; } });
14
+ async function signTypedData(args) {
15
+ const { wallet, domain, types, primaryType, message } = args;
16
+ let signature;
17
+ if ((0, private_key_js_1.isValidPrivateKey)(wallet)) {
18
+ signature = await (0, private_key_js_1.signTypedData)({
19
+ privateKey: wallet,
20
+ domain,
21
+ types,
22
+ primaryType,
23
+ message,
24
+ });
25
+ }
26
+ else if ((0, viem_js_1.isAbstractViemWalletClient)(wallet)) {
27
+ signature = await wallet.signTypedData({
28
+ domain,
29
+ types: {
30
+ EIP712Domain: [
31
+ { name: "name", type: "string" },
32
+ { name: "version", type: "string" },
33
+ { name: "chainId", type: "uint256" },
34
+ { name: "verifyingContract", type: "address" },
35
+ ],
36
+ ...types,
37
+ },
38
+ primaryType,
39
+ message,
40
+ });
41
+ }
42
+ else if ((0, ethers_js_1.isAbstractEthersSigner)(wallet)) {
43
+ signature = await wallet.signTypedData(domain, types, message);
44
+ }
45
+ else if ((0, ethers_js_1.isAbstractEthersV5Signer)(wallet)) {
46
+ signature = await wallet._signTypedData(domain, types, message);
47
+ }
48
+ else if ((0, window_js_1.isAbstractWindowEthereum)(wallet)) {
49
+ signature = await (0, window_js_1.signTypedDataWithWindowEthereum)({
50
+ ethereum: wallet,
51
+ domain,
52
+ types,
53
+ primaryType,
54
+ message,
55
+ });
56
+ }
57
+ else {
58
+ throw new Error("Unsupported wallet for signing typed data");
59
+ }
60
+ return splitSignature(signature);
61
+ }
62
+ function splitSignature(signature) {
63
+ const r = `0x${signature.slice(2, 66)}`;
64
+ const s = `0x${signature.slice(66, 130)}`;
65
+ const v = parseInt(signature.slice(130, 132), 16);
66
+ return { r, s, v };
67
+ }
@@ -0,0 +1,26 @@
1
+ type Hex = `0x${string}`;
2
+ interface Types {
3
+ [type: string]: {
4
+ name: string;
5
+ type: string;
6
+ }[];
7
+ }
8
+ interface Domain extends Record<string, unknown> {
9
+ name?: string;
10
+ version?: string;
11
+ chainId?: number | string | bigint | Hex;
12
+ verifyingContract?: Hex;
13
+ salt?: Hex;
14
+ }
15
+ /** Signs typed data with a private key. */
16
+ export declare function signTypedData(args: {
17
+ privateKey: string;
18
+ domain?: Domain;
19
+ types: Types;
20
+ primaryType: string;
21
+ message: Record<string, unknown>;
22
+ }): Promise<Hex>;
23
+ /** Validates if a string is a valid secp256k1 private key. */
24
+ export declare function isValidPrivateKey(privateKey: unknown): privateKey is string;
25
+ export {};
26
+ //# sourceMappingURL=private_key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private_key.d.ts","sourceRoot":"","sources":["../../../../src/src/signing/_signTypedData/private_key.ts"],"names":[],"mappings":"AAGA,KAAK,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAEzB,UAAU,KAAK;IACX,CAAC,IAAI,EAAE,MAAM,GAAG;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KAChB,EAAE,CAAC;CACP;AAED,UAAU,MAAO,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IACzC,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,IAAI,CAAC,EAAE,GAAG,CAAC;CACd;AAED,2CAA2C;AAC3C,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,GAAG,CAAC,CAkBf;AAuJD,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,MAAM,CAG3E"}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.signTypedData = signTypedData;
4
+ exports.isValidPrivateKey = isValidPrivateKey;
5
+ const sha3_1 = require("@noble/hashes/sha3");
6
+ const secp256k1_1 = require("@noble/secp256k1");
7
+ /** Signs typed data with a private key. */
8
+ async function signTypedData(args) {
9
+ const { privateKey, domain = {}, types, primaryType, message, } = args;
10
+ const hash = hashTypedData({ domain, types, primaryType, message });
11
+ const signature = await (0, secp256k1_1.signAsync)(hash, cleanHex(privateKey));
12
+ const r = signature.r.toString(16).padStart(64, "0");
13
+ const s = signature.s.toString(16).padStart(64, "0");
14
+ const v = (signature.recovery + 27).toString(16).padStart(2, "0");
15
+ return `0x${r}${s}${v}`;
16
+ }
17
+ function hashTypedData(args) {
18
+ const { domain, types: types_, primaryType, message } = args;
19
+ const domainFields = [];
20
+ if (domain.name !== undefined) {
21
+ domainFields.push({ name: "name", type: "string" });
22
+ }
23
+ if (domain.version !== undefined) {
24
+ domainFields.push({ name: "version", type: "string" });
25
+ }
26
+ if (domain.chainId !== undefined) {
27
+ domainFields.push({ name: "chainId", type: "uint256" });
28
+ }
29
+ if (domain.verifyingContract !== undefined) {
30
+ domainFields.push({ name: "verifyingContract", type: "address" });
31
+ }
32
+ if (domain.salt !== undefined) {
33
+ domainFields.push({ name: "salt", type: "bytes32" });
34
+ }
35
+ const types = {
36
+ EIP712Domain: domainFields,
37
+ ...types_,
38
+ };
39
+ const bytes = [new Uint8Array([0x19, 0x01])];
40
+ bytes.push(hashStruct("EIP712Domain", domain, types));
41
+ if (primaryType !== "EIP712Domain")
42
+ bytes.push(hashStruct(primaryType, message, types));
43
+ return (0, sha3_1.keccak_256)(secp256k1_1.etc.concatBytes(...bytes));
44
+ }
45
+ function hashStruct(primaryType, data, types) {
46
+ const typeHash = (0, sha3_1.keccak_256)(new TextEncoder().encode(encodeType(primaryType, types)));
47
+ const encodedValues = types[primaryType].map((field) => encodeValue(field.type, data[field.name], types));
48
+ return (0, sha3_1.keccak_256)(secp256k1_1.etc.concatBytes(typeHash, ...encodedValues));
49
+ }
50
+ function encodeType(primaryType, types) {
51
+ const deps = findTypeDependencies(primaryType, types);
52
+ const sortedDeps = [primaryType, ...deps.filter((d) => d !== primaryType).sort()];
53
+ return sortedDeps
54
+ .map((type) => `${type}(${types[type].map((field) => `${field.type} ${field.name}`).join(",")})`)
55
+ .join("");
56
+ }
57
+ function findTypeDependencies(primaryType, types, found = new Set()) {
58
+ if (found.has(primaryType) || !types[primaryType])
59
+ return [];
60
+ found.add(primaryType);
61
+ for (const field of types[primaryType]) {
62
+ const baseType = field.type.replace(/\[\d*\]$/, "");
63
+ if (types[baseType]) {
64
+ findTypeDependencies(baseType, types, found);
65
+ }
66
+ }
67
+ return Array.from(found);
68
+ }
69
+ function encodeValue(type, value, types) {
70
+ const arrayMatch = type.match(/^(.*)\[(\d*)\]$/);
71
+ if (arrayMatch) {
72
+ // Extract type info: base type and optional length
73
+ const [, baseType, len] = arrayMatch;
74
+ if (!Array.isArray(value)) {
75
+ throw new Error(`Expected array for ${type}, got ${typeof value}`);
76
+ }
77
+ if (len && value.length !== +len) {
78
+ throw new Error(`Invalid length for ${type}: expected ${len}, got ${value.length}`);
79
+ }
80
+ // Encode each element in the array and hash them together
81
+ const encodedElements = value.map((v) => encodeValue(baseType, v, types));
82
+ return (0, sha3_1.keccak_256)(secp256k1_1.etc.concatBytes(...encodedElements));
83
+ }
84
+ if (types[type]) {
85
+ if (value === undefined)
86
+ return new Uint8Array(32);
87
+ return hashStruct(type, value, types);
88
+ }
89
+ if (type === "string") {
90
+ return (0, sha3_1.keccak_256)(new TextEncoder().encode(value));
91
+ }
92
+ if (type === "address") {
93
+ const bytes = secp256k1_1.etc.hexToBytes(cleanHex(value));
94
+ if (bytes.length !== 20)
95
+ throw new Error("address must be 20 bytes");
96
+ const padded = new Uint8Array(32);
97
+ padded.set(bytes, 12);
98
+ return padded;
99
+ }
100
+ if (type.startsWith("uint") || type.startsWith("int")) {
101
+ // Extract type info: uint/int and bit size
102
+ const isUint = type.startsWith("uint");
103
+ const bits = parseInt(type.slice(isUint ? 4 : 3) || "256");
104
+ if (bits > 256 || bits % 8 !== 0) {
105
+ throw new Error(`Unsupported bit size for ${type}: ${bits}`);
106
+ }
107
+ // Apply Two's complement for specified bit size
108
+ const bigIntValue = BigInt(value);
109
+ const resizedValue = isUint ? BigInt.asUintN(bits, bigIntValue) : BigInt.asIntN(bits, bigIntValue);
110
+ // Convert to 32-byte big-endian
111
+ const hex = BigInt.asUintN(256, resizedValue).toString(16).padStart(64, "0");
112
+ return secp256k1_1.etc.hexToBytes(hex);
113
+ }
114
+ if (type === "bool") {
115
+ const result = new Uint8Array(32);
116
+ result[31] = value ? 1 : 0;
117
+ return result;
118
+ }
119
+ if (type === "bytes") {
120
+ const bytes = typeof value === "string" ? secp256k1_1.etc.hexToBytes(cleanHex(value)) : value;
121
+ return (0, sha3_1.keccak_256)(bytes);
122
+ }
123
+ const bytesMatch = type.match(/^bytes(\d+)$/);
124
+ if (bytesMatch) {
125
+ // Extract type info: bytes size
126
+ const size = parseInt(bytesMatch[1]);
127
+ if (size === 0 || size > 32)
128
+ throw new Error(`Unsupported bytes size: ${size}`);
129
+ // Convert hex to bytes
130
+ const bytes = secp256k1_1.etc.hexToBytes(cleanHex(value));
131
+ if (bytes.length !== size)
132
+ throw new Error(`Invalid length for ${type}: expected ${size}, got ${bytes.length}`);
133
+ // Pad to 32 bytes
134
+ const padded = new Uint8Array(32);
135
+ padded.set(bytes, 0);
136
+ return padded;
137
+ }
138
+ throw new Error(`Unsupported type: ${type}`);
139
+ }
140
+ function cleanHex(hex) {
141
+ return hex.startsWith("0x") ? hex.slice(2) : hex;
142
+ }
143
+ /** Validates if a string is a valid secp256k1 private key. */
144
+ function isValidPrivateKey(privateKey) {
145
+ if (typeof privateKey !== "string")
146
+ return false;
147
+ return secp256k1_1.utils.isValidPrivateKey(cleanHex(privateKey));
148
+ }
@@ -1,4 +1,4 @@
1
- import type { Hex } from "../base.js";
1
+ import type { Hex } from "../../base.js";
2
2
  /** Abstract interface for a [viem wallet](https://viem.sh/docs/clients/wallet). */
3
3
  export interface AbstractViemWalletClient {
4
4
  signTypedData(params: {
@@ -20,4 +20,4 @@ export interface AbstractViemWalletClient {
20
20
  }
21
21
  /** Checks if the given value is an abstract viem wallet. */
22
22
  export declare function isAbstractViemWalletClient(client: unknown): client is AbstractViemWalletClient;
23
- //# sourceMappingURL=_viem.d.ts.map
23
+ //# sourceMappingURL=viem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viem.d.ts","sourceRoot":"","sources":["../../../../src/src/signing/_signTypedData/viem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC,mFAAmF;AACnF,MAAM,WAAW,wBAAwB;IACrC,aAAa,CACT,MAAM,EAAE;QACJ,MAAM,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,iBAAiB,EAAE,GAAG,CAAC;SAC1B,CAAC;QACF,KAAK,EAAE;YACH,CAAC,GAAG,EAAE,MAAM,GAAG;gBACX,IAAI,EAAE,MAAM,CAAC;gBACb,IAAI,EAAE,MAAM,CAAC;aAChB,EAAE,CAAC;SACP,CAAC;QACF,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,EACD,OAAO,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC,GAAG,CAAC,CAAC;CACnB;AAED,4DAA4D;AAC5D,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,wBAAwB,CAI9F"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isAbstractViemWalletClient = isAbstractViemWalletClient;
4
+ /** Checks if the given value is an abstract viem wallet. */
5
+ function isAbstractViemWalletClient(client) {
6
+ return typeof client === "object" && client !== null &&
7
+ "signTypedData" in client && typeof client.signTypedData === "function" &&
8
+ (client.signTypedData.length === 1 || client.signTypedData.length === 2);
9
+ }
@@ -1,4 +1,4 @@
1
- import type { Hex } from "../base.js";
1
+ import type { Hex } from "../../base.js";
2
2
  /** Abstract interface for a [window.ethereum](https://eips.ethereum.org/EIPS/eip-1193) object. */
3
3
  export interface AbstractWindowEthereum {
4
4
  request(args: {
@@ -7,17 +7,23 @@ export interface AbstractWindowEthereum {
7
7
  }): Promise<any>;
8
8
  }
9
9
  /** Signs typed data using `window.ethereum` (EIP-1193) with `eth_signTypedData_v4` (EIP-712). */
10
- export declare function signTypedDataWithWindowEthereum(ethereum: AbstractWindowEthereum, domain: {
11
- name: string;
12
- version: string;
13
- chainId: number;
14
- verifyingContract: Hex;
15
- }, types: {
16
- [key: string]: {
10
+ export declare function signTypedDataWithWindowEthereum(args: {
11
+ ethereum: AbstractWindowEthereum;
12
+ domain: {
17
13
  name: string;
18
- type: string;
19
- }[];
20
- }, message: Record<string, unknown>): Promise<Hex>;
14
+ version: string;
15
+ chainId: number;
16
+ verifyingContract: Hex;
17
+ };
18
+ types: {
19
+ [key: string]: {
20
+ name: string;
21
+ type: string;
22
+ }[];
23
+ };
24
+ primaryType: string;
25
+ message: Record<string, unknown>;
26
+ }): Promise<Hex>;
21
27
  /** Checks if the given value is an abstract `window.ethereum` object. */
22
28
  export declare function isAbstractWindowEthereum(client: unknown): client is AbstractWindowEthereum;
23
- //# sourceMappingURL=_window.d.ts.map
29
+ //# sourceMappingURL=window.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../../src/src/signing/_signTypedData/window.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC,kGAAkG;AAClG,MAAM,WAAW,sBAAsB;IAEnC,OAAO,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,MAAM,EAAE,GAAG,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAC7D;AAED,iGAAiG;AACjG,wBAAsB,+BAA+B,CAAC,IAAI,EAAE;IACxD,QAAQ,EAAE,sBAAsB,CAAC;IACjC,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,GAAG,CAAC;KAC1B,CAAC;IACF,KAAK,EAAE;QACH,CAAC,GAAG,EAAE,MAAM,GAAG;YACX,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SAChB,EAAE,CAAC;KACP,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,GAAG,CAAC,CAwBf;AAED,yEAAyE;AACzE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,sBAAsB,CAI1F"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.signTypedDataWithWindowEthereum = signTypedDataWithWindowEthereum;
4
+ exports.isAbstractWindowEthereum = isAbstractWindowEthereum;
5
+ /** Signs typed data using `window.ethereum` (EIP-1193) with `eth_signTypedData_v4` (EIP-712). */
6
+ async function signTypedDataWithWindowEthereum(args) {
7
+ const { ethereum, domain, types, primaryType, message } = args;
8
+ const accounts = await ethereum.request({ method: "eth_requestAccounts", params: [] });
9
+ if (!Array.isArray(accounts) || accounts.length === 0) {
10
+ throw new Error("No Ethereum accounts available");
11
+ }
12
+ const from = accounts[0];
13
+ const dataToSign = JSON.stringify({
14
+ domain,
15
+ types: {
16
+ EIP712Domain: [
17
+ { name: "name", type: "string" },
18
+ { name: "version", type: "string" },
19
+ { name: "chainId", type: "uint256" },
20
+ { name: "verifyingContract", type: "address" },
21
+ ],
22
+ ...types,
23
+ },
24
+ primaryType,
25
+ message,
26
+ });
27
+ return await ethereum.request({ method: "eth_signTypedData_v4", params: [from, dataToSign] });
28
+ }
29
+ /** Checks if the given value is an abstract `window.ethereum` object. */
30
+ function isAbstractWindowEthereum(client) {
31
+ return typeof client === "object" && client !== null &&
32
+ "request" in client && typeof client.request === "function" &&
33
+ client.request.length >= 1;
34
+ }
@@ -1,86 +1,48 @@
1
- import type { ApproveAgentRequest, ApproveBuilderFeeRequest, BatchModifyRequest, CancelByCloidRequest, CancelRequest, CDepositRequest, ClaimRewardsRequest, ConvertToMultiSigUserRequest, CreateSubAccountRequest, CreateVaultRequest, CSignerActionRequest_JailSelf, CSignerActionRequest_UnjailSelf, CValidatorActionRequest_ChangeProfile, CValidatorActionRequest_Register, CValidatorActionRequest_Unregister, CWithdrawRequest, EvmUserModifyRequest, ModifyRequest, MultiSigRequest, OrderRequest, PerpDeployRequest_RegisterAsset, PerpDeployRequest_SetOracle, PerpDexClassTransferRequest, RegisterReferrerRequest, ReserveRequestWeightRequest, ScheduleCancelRequest, SetDisplayNameRequest, SetReferrerRequest, SpotDeployRequest_Genesis, SpotDeployRequest_RegisterHyperliquidity, SpotDeployRequest_RegisterSpot, SpotDeployRequest_RegisterToken2, SpotDeployRequest_SetDeployerTradingFeeShare, SpotDeployRequest_UserGenesis, SpotSendRequest, SpotUserRequest, SubAccountSpotTransferRequest, SubAccountTransferRequest, TokenDelegateRequest, TwapCancelRequest, TwapOrderRequest, UpdateIsolatedMarginRequest, UpdateLeverageRequest, UsdClassTransferRequest, UsdSendRequest, VaultDistributeRequest, VaultModifyRequest, VaultTransferRequest, Withdraw3Request } from "../types/exchange/requests.js";
2
- /** Action sorter for correct signature generation. */
1
+ import type { DeepImmutable } from "../base.js";
2
+ import type { ApproveAgentRequest, ApproveBuilderFeeRequest, BatchModifyRequest, CancelByCloidRequest, CancelRequest, CDepositRequest, ClaimRewardsRequest, ConvertToMultiSigUserRequest, CreateSubAccountRequest, CreateVaultRequest, CSignerActionRequest_JailSelf, CSignerActionRequest_UnjailSelf, CValidatorActionRequest_ChangeProfile, CValidatorActionRequest_Register, CValidatorActionRequest_Unregister, CWithdrawRequest, EvmUserModifyRequest, ModifyRequest, MultiSigRequest, OrderRequest, PerpDeployRequest_RegisterAsset, PerpDeployRequest_SetOracle, PerpDexClassTransferRequest, PerpDexTransferRequest, RegisterReferrerRequest, ReserveRequestWeightRequest, ScheduleCancelRequest, SetDisplayNameRequest, SetReferrerRequest, SpotDeployRequest_Genesis, SpotDeployRequest_RegisterHyperliquidity, SpotDeployRequest_RegisterSpot, SpotDeployRequest_RegisterToken2, SpotDeployRequest_SetDeployerTradingFeeShare, SpotDeployRequest_UserGenesis, SpotSendRequest, SpotUserRequest, SubAccountSpotTransferRequest, SubAccountTransferRequest, TokenDelegateRequest, TwapCancelRequest, TwapOrderRequest, UpdateIsolatedMarginRequest, UpdateLeverageRequest, UsdClassTransferRequest, UsdSendRequest, VaultDistributeRequest, VaultModifyRequest, VaultTransferRequest, Withdraw3Request } from "../types/exchange/requests.js";
3
+ /** Action sorter and formatter for correct signature generation. */
3
4
  export declare const actionSorter: {
4
- /** Sorts and formats an `approveAgent` action. */
5
- approveAgent: (action: ApproveAgentRequest["action"]) => ApproveAgentRequest["action"];
6
- /** Sorts and formats an `approveBuilderFee` action. */
7
- approveBuilderFee: (action: ApproveBuilderFeeRequest["action"]) => ApproveBuilderFeeRequest["action"];
8
- /** Sorts and formats a `batchModify` action. */
9
- batchModify: (action: BatchModifyRequest["action"]) => BatchModifyRequest["action"];
10
- /** Sorts and formats a `cancel` action. */
11
- cancel: (action: CancelRequest["action"]) => CancelRequest["action"];
12
- /** Sorts and formats a `cancelByCloid` action. */
13
- cancelByCloid: (action: CancelByCloidRequest["action"]) => CancelByCloidRequest["action"];
14
- /** Sorts and formats a `cDeposit` action. */
15
- cDeposit: (action: CDepositRequest["action"]) => CDepositRequest["action"];
16
- /** Sorts and formats a `claimRewards` action. */
17
- claimRewards: (action: ClaimRewardsRequest["action"]) => ClaimRewardsRequest["action"];
18
- /** Sorts and formats a `convertToMultiSigUser` action. */
19
- convertToMultiSigUser: (action: ConvertToMultiSigUserRequest["action"]) => ConvertToMultiSigUserRequest["action"];
20
- /** Sorts and formats a `createSubAccount` action. */
21
- createSubAccount: (action: CreateSubAccountRequest["action"]) => CreateSubAccountRequest["action"];
22
- /** Sorts and formats a `createVault` action. */
23
- createVault: (action: CreateVaultRequest["action"]) => CreateVaultRequest["action"];
24
- /** Sorts and formats a `CSignerAction` action (jail/unjail). */
25
- CSignerAction: (action: CSignerActionRequest_JailSelf["action"] | CSignerActionRequest_UnjailSelf["action"]) => CSignerActionRequest_JailSelf["action"] | CSignerActionRequest_UnjailSelf["action"];
26
- /** Sorts and formats a `CValidatorAction` action (register/unregister/change profile). */
27
- CValidatorAction: (action: CValidatorActionRequest_ChangeProfile["action"] | CValidatorActionRequest_Register["action"] | CValidatorActionRequest_Unregister["action"]) => CValidatorActionRequest_ChangeProfile["action"] | CValidatorActionRequest_Register["action"] | CValidatorActionRequest_Unregister["action"];
28
- /** Sorts and formats a `cWithdraw` action. */
29
- cWithdraw: (action: CWithdrawRequest["action"]) => CWithdrawRequest["action"];
30
- /** Sorts and formats an `evmUserModify` action. */
31
- evmUserModify: (action: EvmUserModifyRequest["action"]) => EvmUserModifyRequest["action"];
32
- /** Sorts and formats a `modify` action. */
33
- modify: (action: ModifyRequest["action"]) => ModifyRequest["action"];
34
- /** Sorts and formats a `multiSig` action. */
35
- multiSig: (action: MultiSigRequest["action"]) => MultiSigRequest["action"];
36
- /** Sorts and formats an `order` action. */
37
- order: (action: OrderRequest["action"]) => OrderRequest["action"];
38
- /** Sorts and formats a `perpDeploy` action. */
39
- perpDeploy: (action: PerpDeployRequest_RegisterAsset["action"] | PerpDeployRequest_SetOracle["action"]) => PerpDeployRequest_RegisterAsset["action"] | PerpDeployRequest_SetOracle["action"];
40
- /** Sorts and formats a `PerpDexClassTransfer` action. */
41
- PerpDexClassTransfer: (action: PerpDexClassTransferRequest["action"]) => PerpDexClassTransferRequest["action"];
42
- /** Sorts and formats a `registerReferrer` action. */
43
- registerReferrer: (action: RegisterReferrerRequest["action"]) => RegisterReferrerRequest["action"];
44
- /** Sorts and formats a `reserveRequestWeight` action. */
45
- reserveRequestWeight: (action: ReserveRequestWeightRequest["action"]) => ReserveRequestWeightRequest["action"];
46
- /** Sorts and formats a `scheduleCancel` action. */
47
- scheduleCancel: (action: ScheduleCancelRequest["action"]) => ScheduleCancelRequest["action"];
48
- /** Sorts and formats a `setDisplayName` action. */
49
- setDisplayName: (action: SetDisplayNameRequest["action"]) => SetDisplayNameRequest["action"];
50
- /** Sorts and formats a `setReferrer` action. */
51
- setReferrer: (action: SetReferrerRequest["action"]) => SetReferrerRequest["action"];
52
- /** Sorts and formats a `spotDeploy` action. */
53
- spotDeploy: (action: SpotDeployRequest_Genesis["action"] | SpotDeployRequest_RegisterHyperliquidity["action"] | SpotDeployRequest_RegisterSpot["action"] | SpotDeployRequest_RegisterToken2["action"] | SpotDeployRequest_SetDeployerTradingFeeShare["action"] | SpotDeployRequest_UserGenesis["action"]) => SpotDeployRequest_Genesis["action"] | SpotDeployRequest_RegisterHyperliquidity["action"] | SpotDeployRequest_RegisterSpot["action"] | SpotDeployRequest_RegisterToken2["action"] | SpotDeployRequest_SetDeployerTradingFeeShare["action"] | SpotDeployRequest_UserGenesis["action"];
54
- /** Sorts and formats a `spotSend` action. */
55
- spotSend: (action: SpotSendRequest["action"]) => SpotSendRequest["action"];
56
- /** Sorts and formats a `spotUser` action. */
57
- spotUser: (action: SpotUserRequest["action"]) => SpotUserRequest["action"];
58
- /** Sorts and formats a `subAccountSpotTransfer` action. */
59
- subAccountSpotTransfer: (action: SubAccountSpotTransferRequest["action"]) => SubAccountSpotTransferRequest["action"];
60
- /** Sorts and formats a `subAccountTransfer` action. */
61
- subAccountTransfer: (action: SubAccountTransferRequest["action"]) => SubAccountTransferRequest["action"];
62
- /** Sorts and formats a `tokenDelegate` action. */
63
- tokenDelegate: (action: TokenDelegateRequest["action"]) => TokenDelegateRequest["action"];
64
- /** Sorts and formats a `twapCancel` action. */
65
- twapCancel: (action: TwapCancelRequest["action"]) => TwapCancelRequest["action"];
66
- /** Sorts and formats a `twapOrder` action. */
67
- twapOrder: (action: TwapOrderRequest["action"]) => TwapOrderRequest["action"];
68
- /** Sorts and formats an `updateIsolatedMargin` action. */
69
- updateIsolatedMargin: (action: UpdateIsolatedMarginRequest["action"]) => UpdateIsolatedMarginRequest["action"];
70
- /** Sorts and formats an `updateLeverage` action. */
71
- updateLeverage: (action: UpdateLeverageRequest["action"]) => UpdateLeverageRequest["action"];
72
- /** Sorts and formats an `usdClassTransfer` action. */
73
- usdClassTransfer: (action: UsdClassTransferRequest["action"]) => UsdClassTransferRequest["action"];
74
- /** Sorts and formats an `usdSend` action. */
75
- usdSend: (action: UsdSendRequest["action"]) => UsdSendRequest["action"];
76
- /** Sorts and formats a `vaultDistribute` action. */
77
- vaultDistribute: (action: VaultDistributeRequest["action"]) => VaultDistributeRequest["action"];
78
- /** Sorts and formats a `vaultModify` action. */
79
- vaultModify: (action: VaultModifyRequest["action"]) => VaultModifyRequest["action"];
80
- /** Sorts and formats a `vaultTransfer` action. */
81
- vaultTransfer: (action: VaultTransferRequest["action"]) => VaultTransferRequest["action"];
82
- /** Sorts and formats a `withdraw3` action. */
83
- withdraw3: (action: Withdraw3Request["action"]) => Withdraw3Request["action"];
5
+ approveAgent: (action: DeepImmutable<ApproveAgentRequest["action"]>) => ApproveAgentRequest["action"];
6
+ approveBuilderFee: (action: DeepImmutable<ApproveBuilderFeeRequest["action"]>) => ApproveBuilderFeeRequest["action"];
7
+ batchModify: (action: DeepImmutable<BatchModifyRequest["action"]>) => BatchModifyRequest["action"];
8
+ cancel: (action: DeepImmutable<CancelRequest["action"]>) => CancelRequest["action"];
9
+ cancelByCloid: (action: DeepImmutable<CancelByCloidRequest["action"]>) => CancelByCloidRequest["action"];
10
+ cDeposit: (action: DeepImmutable<CDepositRequest["action"]>) => CDepositRequest["action"];
11
+ claimRewards: (action: DeepImmutable<ClaimRewardsRequest["action"]>) => ClaimRewardsRequest["action"];
12
+ convertToMultiSigUser: (action: DeepImmutable<ConvertToMultiSigUserRequest["action"]>) => ConvertToMultiSigUserRequest["action"];
13
+ createSubAccount: (action: DeepImmutable<CreateSubAccountRequest["action"]>) => CreateSubAccountRequest["action"];
14
+ createVault: (action: DeepImmutable<CreateVaultRequest["action"]>) => CreateVaultRequest["action"];
15
+ CSignerAction: (action: DeepImmutable<CSignerActionRequest_JailSelf["action"]> | DeepImmutable<CSignerActionRequest_UnjailSelf["action"]>) => CSignerActionRequest_JailSelf["action"] | CSignerActionRequest_UnjailSelf["action"];
16
+ CValidatorAction: (action: DeepImmutable<CValidatorActionRequest_ChangeProfile["action"]> | DeepImmutable<CValidatorActionRequest_Register["action"]> | DeepImmutable<CValidatorActionRequest_Unregister["action"]>) => CValidatorActionRequest_ChangeProfile["action"] | CValidatorActionRequest_Register["action"] | CValidatorActionRequest_Unregister["action"];
17
+ cWithdraw: (action: DeepImmutable<CWithdrawRequest["action"]>) => CWithdrawRequest["action"];
18
+ evmUserModify: (action: DeepImmutable<EvmUserModifyRequest["action"]>) => EvmUserModifyRequest["action"];
19
+ modify: (action: DeepImmutable<ModifyRequest["action"]>) => ModifyRequest["action"];
20
+ multiSig: (action: DeepImmutable<MultiSigRequest["action"]>) => MultiSigRequest["action"];
21
+ order: (action: DeepImmutable<OrderRequest["action"]>) => OrderRequest["action"];
22
+ perpDeploy: (action: DeepImmutable<PerpDeployRequest_RegisterAsset["action"]> | DeepImmutable<PerpDeployRequest_SetOracle["action"]>) => PerpDeployRequest_RegisterAsset["action"] | PerpDeployRequest_SetOracle["action"];
23
+ PerpDexClassTransfer: (action: DeepImmutable<PerpDexClassTransferRequest["action"]>) => PerpDexClassTransferRequest["action"];
24
+ PerpDexTransfer: (action: DeepImmutable<PerpDexTransferRequest["action"]>) => PerpDexTransferRequest["action"];
25
+ registerReferrer: (action: DeepImmutable<RegisterReferrerRequest["action"]>) => RegisterReferrerRequest["action"];
26
+ reserveRequestWeight: (action: DeepImmutable<ReserveRequestWeightRequest["action"]>) => ReserveRequestWeightRequest["action"];
27
+ scheduleCancel: (action: DeepImmutable<ScheduleCancelRequest["action"]>) => ScheduleCancelRequest["action"];
28
+ setDisplayName: (action: DeepImmutable<SetDisplayNameRequest["action"]>) => SetDisplayNameRequest["action"];
29
+ setReferrer: (action: DeepImmutable<SetReferrerRequest["action"]>) => SetReferrerRequest["action"];
30
+ spotDeploy: (action: DeepImmutable<SpotDeployRequest_Genesis["action"]> | DeepImmutable<SpotDeployRequest_RegisterHyperliquidity["action"]> | DeepImmutable<SpotDeployRequest_RegisterSpot["action"]> | DeepImmutable<SpotDeployRequest_RegisterToken2["action"]> | DeepImmutable<SpotDeployRequest_SetDeployerTradingFeeShare["action"]> | DeepImmutable<SpotDeployRequest_UserGenesis["action"]>) => SpotDeployRequest_Genesis["action"] | SpotDeployRequest_RegisterHyperliquidity["action"] | SpotDeployRequest_RegisterSpot["action"] | SpotDeployRequest_RegisterToken2["action"] | SpotDeployRequest_SetDeployerTradingFeeShare["action"] | SpotDeployRequest_UserGenesis["action"];
31
+ spotSend: (action: DeepImmutable<SpotSendRequest["action"]>) => SpotSendRequest["action"];
32
+ spotUser: (action: DeepImmutable<SpotUserRequest["action"]>) => SpotUserRequest["action"];
33
+ subAccountSpotTransfer: (action: DeepImmutable<SubAccountSpotTransferRequest["action"]>) => SubAccountSpotTransferRequest["action"];
34
+ subAccountTransfer: (action: DeepImmutable<SubAccountTransferRequest["action"]>) => SubAccountTransferRequest["action"];
35
+ tokenDelegate: (action: DeepImmutable<TokenDelegateRequest["action"]>) => TokenDelegateRequest["action"];
36
+ twapCancel: (action: DeepImmutable<TwapCancelRequest["action"]>) => TwapCancelRequest["action"];
37
+ twapOrder: (action: DeepImmutable<TwapOrderRequest["action"]>) => TwapOrderRequest["action"];
38
+ updateIsolatedMargin: (action: DeepImmutable<UpdateIsolatedMarginRequest["action"]>) => UpdateIsolatedMarginRequest["action"];
39
+ updateLeverage: (action: DeepImmutable<UpdateLeverageRequest["action"]>) => UpdateLeverageRequest["action"];
40
+ usdClassTransfer: (action: DeepImmutable<UsdClassTransferRequest["action"]>) => UsdClassTransferRequest["action"];
41
+ usdSend: (action: DeepImmutable<UsdSendRequest["action"]>) => UsdSendRequest["action"];
42
+ vaultDistribute: (action: DeepImmutable<VaultDistributeRequest["action"]>) => VaultDistributeRequest["action"];
43
+ vaultModify: (action: DeepImmutable<VaultModifyRequest["action"]>) => VaultModifyRequest["action"];
44
+ vaultTransfer: (action: DeepImmutable<VaultTransferRequest["action"]>) => VaultTransferRequest["action"];
45
+ withdraw3: (action: DeepImmutable<Withdraw3Request["action"]>) => Withdraw3Request["action"];
84
46
  };
85
47
  /** EIP-712 type definitions for user-signed actions. */
86
48
  export declare const userSignedActionEip712Types: {
@@ -120,6 +82,18 @@ export declare const userSignedActionEip712Types: {
120
82
  type: string;
121
83
  }[];
122
84
  };
85
+ PerpDexTransfer: {
86
+ "HyperliquidTransaction:PerpDexTransfer": {
87
+ name: string;
88
+ type: string;
89
+ }[];
90
+ };
91
+ multiSig: {
92
+ "HyperliquidTransaction:SendMultiSig": {
93
+ name: string;
94
+ type: string;
95
+ }[];
96
+ };
123
97
  spotSend: {
124
98
  "HyperliquidTransaction:SpotSend": {
125
99
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"_sorter.d.ts","sourceRoot":"","sources":["../../../src/src/signing/_sorter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,4BAA4B,EAC5B,uBAAuB,EACvB,kBAAkB,EAClB,6BAA6B,EAC7B,+BAA+B,EAC/B,qCAAqC,EACrC,gCAAgC,EAChC,kCAAkC,EAClC,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,+BAA+B,EAC/B,2BAA2B,EAC3B,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,qBAAqB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