@nktkas/hyperliquid 0.22.2 → 0.23.1

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 (256) hide show
  1. package/README.md +79 -67
  2. package/esm/mod.d.ts +1 -1
  3. package/esm/mod.d.ts.map +1 -1
  4. package/esm/src/base.d.ts +4 -1
  5. package/esm/src/base.d.ts.map +1 -1
  6. package/esm/src/base.js +2 -2
  7. package/esm/src/clients/exchange.d.ts +289 -207
  8. package/esm/src/clients/exchange.d.ts.map +1 -1
  9. package/esm/src/clients/exchange.js +605 -410
  10. package/esm/src/clients/info.d.ts +264 -48
  11. package/esm/src/clients/info.d.ts.map +1 -1
  12. package/esm/src/clients/info.js +273 -31
  13. package/esm/src/clients/multiSign.d.ts +285 -204
  14. package/esm/src/clients/multiSign.d.ts.map +1 -1
  15. package/esm/src/clients/multiSign.js +521 -493
  16. package/esm/src/clients/subscription.d.ts +38 -3
  17. package/esm/src/clients/subscription.d.ts.map +1 -1
  18. package/esm/src/clients/subscription.js +36 -3
  19. package/esm/src/signing/{_ethers.d.ts → _signTypedData/ethers.d.ts} +1 -1
  20. package/esm/src/signing/_signTypedData/ethers.d.ts.map +1 -0
  21. package/esm/src/signing/_signTypedData/mod.d.ts +35 -0
  22. package/esm/src/signing/_signTypedData/mod.d.ts.map +1 -0
  23. package/esm/src/signing/_signTypedData/mod.js +59 -0
  24. package/esm/src/signing/_signTypedData/private_key.d.ts +26 -0
  25. package/esm/src/signing/_signTypedData/private_key.d.ts.map +1 -0
  26. package/esm/src/signing/_signTypedData/private_key.js +144 -0
  27. package/esm/src/signing/{_viem.d.ts → _signTypedData/viem.d.ts} +2 -2
  28. package/esm/src/signing/_signTypedData/viem.d.ts.map +1 -0
  29. package/{script/src/signing/_window.d.ts → esm/src/signing/_signTypedData/window.d.ts} +18 -12
  30. package/esm/src/signing/_signTypedData/window.d.ts.map +1 -0
  31. package/esm/src/signing/{_window.js → _signTypedData/window.js} +3 -2
  32. package/esm/src/signing/_sorter.d.ts +56 -82
  33. package/esm/src/signing/_sorter.d.ts.map +1 -1
  34. package/esm/src/signing/_sorter.js +36 -49
  35. package/esm/src/signing/mod.d.ts +151 -130
  36. package/esm/src/signing/mod.d.ts.map +1 -1
  37. package/esm/src/signing/mod.js +182 -228
  38. package/esm/src/transports/base.d.ts +1 -1
  39. package/esm/src/transports/base.d.ts.map +1 -1
  40. package/esm/src/transports/base.js +2 -2
  41. package/esm/src/transports/http/http_transport.d.ts +9 -15
  42. package/esm/src/transports/http/http_transport.d.ts.map +1 -1
  43. package/esm/src/transports/http/http_transport.js +64 -59
  44. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
  45. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  46. package/esm/src/transports/websocket/_hyperliquid_event_target.js +1 -1
  47. package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
  48. package/esm/src/transports/websocket/_reconnecting_websocket.js +17 -4
  49. package/esm/src/transports/websocket/_websocket_async_request.d.ts +0 -9
  50. package/esm/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
  51. package/esm/src/transports/websocket/_websocket_async_request.js +14 -20
  52. package/esm/src/transports/websocket/websocket_transport.d.ts +8 -4
  53. package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  54. package/esm/src/transports/websocket/websocket_transport.js +83 -54
  55. package/esm/src/types/exchange/requests.d.ts +27 -51
  56. package/esm/src/types/exchange/requests.d.ts.map +1 -1
  57. package/esm/src/types/explorer/requests.d.ts +5 -8
  58. package/esm/src/types/explorer/requests.d.ts.map +1 -1
  59. package/esm/src/types/info/accounts.d.ts +5 -5
  60. package/esm/src/types/info/accounts.d.ts.map +1 -1
  61. package/esm/src/types/info/markets.d.ts +6 -0
  62. package/esm/src/types/info/markets.d.ts.map +1 -1
  63. package/esm/src/types/info/orders.d.ts +1 -1
  64. package/esm/src/types/info/orders.d.ts.map +1 -1
  65. package/esm/src/types/info/requests.d.ts +129 -124
  66. package/esm/src/types/info/requests.d.ts.map +1 -1
  67. package/{script/src/types/info/delegations.d.ts → esm/src/types/info/validators.d.ts} +2 -2
  68. package/esm/src/types/info/validators.d.ts.map +1 -0
  69. package/esm/src/types/info/vaults.d.ts +7 -0
  70. package/esm/src/types/info/vaults.d.ts.map +1 -1
  71. package/esm/src/types/mod.d.ts +1 -1
  72. package/esm/src/types/mod.d.ts.map +1 -1
  73. package/esm/src/types/subscriptions/requests.d.ts +72 -18
  74. package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
  75. package/esm/src/types/subscriptions/responses.d.ts +2 -0
  76. package/esm/src/types/subscriptions/responses.d.ts.map +1 -1
  77. package/package.json +8 -5
  78. package/script/mod.d.ts +1 -1
  79. package/script/mod.d.ts.map +1 -1
  80. package/script/mod.js +13 -23
  81. package/script/src/base.d.ts +4 -1
  82. package/script/src/base.d.ts.map +1 -1
  83. package/script/src/base.js +10 -20
  84. package/script/src/clients/exchange.d.ts +289 -207
  85. package/script/src/clients/exchange.d.ts.map +1 -1
  86. package/script/src/clients/exchange.js +2000 -1815
  87. package/script/src/clients/info.d.ts +264 -48
  88. package/script/src/clients/info.d.ts.map +1 -1
  89. package/script/src/clients/info.js +1442 -1210
  90. package/script/src/clients/multiSign.d.ts +285 -204
  91. package/script/src/clients/multiSign.d.ts.map +1 -1
  92. package/script/src/clients/multiSign.js +2043 -2025
  93. package/script/src/clients/subscription.d.ts +38 -3
  94. package/script/src/clients/subscription.d.ts.map +1 -1
  95. package/script/src/clients/subscription.js +568 -545
  96. package/script/src/signing/{_ethers.d.ts → _signTypedData/ethers.d.ts} +1 -1
  97. package/script/src/signing/_signTypedData/ethers.d.ts.map +1 -0
  98. package/script/src/signing/_signTypedData/ethers.js +16 -0
  99. package/script/src/signing/_signTypedData/mod.d.ts +35 -0
  100. package/script/src/signing/_signTypedData/mod.d.ts.map +1 -0
  101. package/script/src/signing/_signTypedData/mod.js +67 -0
  102. package/script/src/signing/_signTypedData/private_key.d.ts +26 -0
  103. package/script/src/signing/_signTypedData/private_key.d.ts.map +1 -0
  104. package/script/src/signing/_signTypedData/private_key.js +148 -0
  105. package/script/src/signing/{_viem.d.ts → _signTypedData/viem.d.ts} +2 -2
  106. package/script/src/signing/_signTypedData/viem.d.ts.map +1 -0
  107. package/script/src/signing/_signTypedData/viem.js +9 -0
  108. package/{esm/src/signing/_window.d.ts → script/src/signing/_signTypedData/window.d.ts} +18 -12
  109. package/script/src/signing/_signTypedData/window.d.ts.map +1 -0
  110. package/script/src/signing/_signTypedData/window.js +34 -0
  111. package/script/src/signing/_sorter.d.ts +56 -82
  112. package/script/src/signing/_sorter.d.ts.map +1 -1
  113. package/script/src/signing/_sorter.js +655 -678
  114. package/script/src/signing/mod.d.ts +151 -130
  115. package/script/src/signing/mod.d.ts.map +1 -1
  116. package/script/src/signing/mod.js +286 -342
  117. package/script/src/transports/base.d.ts +1 -1
  118. package/script/src/transports/base.d.ts.map +1 -1
  119. package/script/src/transports/base.js +11 -21
  120. package/script/src/transports/http/http_transport.d.ts +9 -15
  121. package/script/src/transports/http/http_transport.d.ts.map +1 -1
  122. package/script/src/transports/http/http_transport.js +97 -102
  123. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
  124. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  125. package/script/src/transports/websocket/_hyperliquid_event_target.js +51 -61
  126. package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
  127. package/script/src/transports/websocket/_reconnecting_websocket.js +271 -268
  128. package/script/src/transports/websocket/_websocket_async_request.d.ts +0 -9
  129. package/script/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
  130. package/script/src/transports/websocket/_websocket_async_request.js +157 -174
  131. package/script/src/transports/websocket/websocket_transport.d.ts +8 -4
  132. package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  133. package/script/src/transports/websocket/websocket_transport.js +209 -189
  134. package/script/src/types/exchange/requests.d.ts +27 -51
  135. package/script/src/types/exchange/requests.d.ts.map +1 -1
  136. package/script/src/types/exchange/requests.js +2 -12
  137. package/script/src/types/exchange/responses.js +2 -12
  138. package/script/src/types/explorer/requests.d.ts +5 -8
  139. package/script/src/types/explorer/requests.d.ts.map +1 -1
  140. package/script/src/types/explorer/requests.js +2 -12
  141. package/script/src/types/explorer/responses.js +2 -12
  142. package/script/src/types/info/accounts.d.ts +5 -5
  143. package/script/src/types/info/accounts.d.ts.map +1 -1
  144. package/script/src/types/info/accounts.js +2 -12
  145. package/script/src/types/info/assets.js +2 -12
  146. package/script/src/types/info/markets.d.ts +6 -0
  147. package/script/src/types/info/markets.d.ts.map +1 -1
  148. package/script/src/types/info/markets.js +2 -12
  149. package/script/src/types/info/orders.d.ts +1 -1
  150. package/script/src/types/info/orders.d.ts.map +1 -1
  151. package/script/src/types/info/orders.js +2 -12
  152. package/script/src/types/info/requests.d.ts +129 -124
  153. package/script/src/types/info/requests.d.ts.map +1 -1
  154. package/script/src/types/info/requests.js +2 -12
  155. package/{esm/src/types/info/delegations.d.ts → script/src/types/info/validators.d.ts} +2 -2
  156. package/script/src/types/info/validators.d.ts.map +1 -0
  157. package/script/src/types/info/validators.js +2 -0
  158. package/script/src/types/info/vaults.d.ts +7 -0
  159. package/script/src/types/info/vaults.d.ts.map +1 -1
  160. package/script/src/types/info/vaults.js +2 -12
  161. package/script/src/types/mod.d.ts +1 -1
  162. package/script/src/types/mod.d.ts.map +1 -1
  163. package/script/src/types/mod.js +2 -12
  164. package/script/src/types/subscriptions/requests.d.ts +72 -18
  165. package/script/src/types/subscriptions/requests.d.ts.map +1 -1
  166. package/script/src/types/subscriptions/requests.js +2 -12
  167. package/script/src/types/subscriptions/responses.d.ts +2 -0
  168. package/script/src/types/subscriptions/responses.d.ts.map +1 -1
  169. package/script/src/types/subscriptions/responses.js +2 -12
  170. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts +0 -2
  171. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts.map +0 -1
  172. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +0 -1
  173. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts +0 -95
  174. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts.map +0 -1
  175. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +0 -10
  176. package/esm/deps/jsr.io/@std/async/1.0.13/delay.d.ts +0 -43
  177. package/esm/deps/jsr.io/@std/async/1.0.13/delay.d.ts.map +0 -1
  178. package/esm/deps/jsr.io/@std/async/1.0.13/delay.js +0 -63
  179. package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +0 -9
  180. package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +0 -1
  181. package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.js +0 -2
  182. package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +0 -21
  183. package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +0 -1
  184. package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.js +0 -32
  185. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +0 -23
  186. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +0 -1
  187. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.js +0 -51
  188. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
  189. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
  190. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -13
  191. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
  192. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
  193. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -2
  194. package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +0 -39
  195. package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +0 -1
  196. package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.js +0 -87
  197. package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +0 -9
  198. package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +0 -1
  199. package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.js +0 -2
  200. package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts +0 -39
  201. package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +0 -1
  202. package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.js +0 -237
  203. package/esm/src/signing/_ethers.d.ts.map +0 -1
  204. package/esm/src/signing/_private_key.d.ts +0 -22
  205. package/esm/src/signing/_private_key.d.ts.map +0 -1
  206. package/esm/src/signing/_private_key.js +0 -124
  207. package/esm/src/signing/_viem.d.ts.map +0 -1
  208. package/esm/src/signing/_window.d.ts.map +0 -1
  209. package/esm/src/types/info/delegations.d.ts.map +0 -1
  210. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts +0 -2
  211. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts.map +0 -1
  212. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +0 -27
  213. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts +0 -95
  214. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts.map +0 -1
  215. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +0 -24
  216. package/script/deps/jsr.io/@std/async/1.0.13/delay.d.ts +0 -43
  217. package/script/deps/jsr.io/@std/async/1.0.13/delay.d.ts.map +0 -1
  218. package/script/deps/jsr.io/@std/async/1.0.13/delay.js +0 -76
  219. package/script/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +0 -9
  220. package/script/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +0 -1
  221. package/script/deps/jsr.io/@std/bytes/1.0.6/_types.js +0 -13
  222. package/script/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +0 -21
  223. package/script/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +0 -1
  224. package/script/deps/jsr.io/@std/bytes/1.0.6/concat.js +0 -45
  225. package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +0 -23
  226. package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +0 -1
  227. package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.js +0 -67
  228. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
  229. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
  230. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -26
  231. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
  232. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
  233. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -13
  234. package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +0 -39
  235. package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +0 -1
  236. package/script/deps/jsr.io/@std/encoding/1.0.10/hex.js +0 -101
  237. package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +0 -9
  238. package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +0 -1
  239. package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.js +0 -13
  240. package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts +0 -39
  241. package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +0 -1
  242. package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.js +0 -250
  243. package/script/src/signing/_ethers.d.ts.map +0 -1
  244. package/script/src/signing/_ethers.js +0 -26
  245. package/script/src/signing/_private_key.d.ts +0 -22
  246. package/script/src/signing/_private_key.d.ts.map +0 -1
  247. package/script/src/signing/_private_key.js +0 -138
  248. package/script/src/signing/_viem.d.ts.map +0 -1
  249. package/script/src/signing/_viem.js +0 -19
  250. package/script/src/signing/_window.d.ts.map +0 -1
  251. package/script/src/signing/_window.js +0 -43
  252. package/script/src/types/info/delegations.d.ts.map +0 -1
  253. package/script/src/types/info/delegations.js +0 -12
  254. /package/esm/src/signing/{_ethers.js → _signTypedData/ethers.js} +0 -0
  255. /package/esm/src/signing/{_viem.js → _signTypedData/viem.js} +0 -0
  256. /package/esm/src/types/info/{delegations.js → validators.js} +0 -0
@@ -1,26 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- (function (factory) {
3
- if (typeof module === "object" && typeof module.exports === "object") {
4
- var v = factory(require, exports);
5
- if (v !== undefined) module.exports = v;
6
- }
7
- else if (typeof define === "function" && define.amd) {
8
- define(["require", "exports"], factory);
9
- }
10
- })(function (require, exports) {
11
- "use strict";
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.detach = detach;
14
- function detach(buffer, maxSize) {
15
- const originalSize = buffer.length;
16
- if (buffer.byteOffset) {
17
- const b = new Uint8Array(buffer.buffer);
18
- b.set(buffer);
19
- buffer = b.subarray(0, originalSize);
20
- }
21
- // deno-lint-ignore no-explicit-any
22
- buffer = new Uint8Array(buffer.buffer.transfer(maxSize));
23
- buffer.set(buffer.subarray(0, originalSize), maxSize - originalSize);
24
- return [buffer, maxSize - originalSize];
25
- }
26
- });
@@ -1,9 +0,0 @@
1
- /**
2
- * Proxy type of {@code Uint8Array<ArrayBuffer} or {@code Uint8Array} in TypeScript 5.7 or below respectively.
3
- *
4
- * This type is internal utility type and should not be used directly.
5
- *
6
- * @internal @private
7
- */
8
- export type Uint8Array_ = ReturnType<Uint8Array["slice"]>;
9
- //# sourceMappingURL=_types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/_types.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- (function (factory) {
3
- if (typeof module === "object" && typeof module.exports === "object") {
4
- var v = factory(require, exports);
5
- if (v !== undefined) module.exports = v;
6
- }
7
- else if (typeof define === "function" && define.amd) {
8
- define(["require", "exports"], factory);
9
- }
10
- })(function (require, exports) {
11
- "use strict";
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- });
@@ -1,39 +0,0 @@
1
- import type { Uint8Array_ } from "./_types.js";
2
- export type { Uint8Array_ };
3
- /**
4
- * Converts data into a hex-encoded string.
5
- *
6
- * @param src The data to encode.
7
- *
8
- * @returns The hex-encoded string.
9
- *
10
- * @example Usage
11
- * ```ts
12
- * import { encodeHex } from "@std/encoding/hex";
13
- * import { assertEquals } from "@std/assert";
14
- *
15
- * assertEquals(encodeHex("abc"), "616263");
16
- * ```
17
- */
18
- export declare function encodeHex(src: string | Uint8Array | ArrayBuffer): string;
19
- /**
20
- * Decodes the given hex-encoded string. If the input is malformed, an error is
21
- * thrown.
22
- *
23
- * @param src The hex-encoded string to decode.
24
- *
25
- * @returns The decoded data.
26
- *
27
- * @example Usage
28
- * ```ts
29
- * import { decodeHex } from "@std/encoding/hex";
30
- * import { assertEquals } from "@std/assert";
31
- *
32
- * assertEquals(
33
- * decodeHex("616263"),
34
- * new TextEncoder().encode("abc"),
35
- * );
36
- * ```
37
- */
38
- export declare function decodeHex(src: string): Uint8Array_;
39
- //# sourceMappingURL=hex.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/hex.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAU5B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,CAWxE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAKlD"}
@@ -1,101 +0,0 @@
1
- // Copyright 2009 The Go Authors. All rights reserved.
2
- // https://github.com/golang/go/blob/master/LICENSE
3
- // Copyright 2018-2025 the Deno authors. MIT license.
4
- // This module is browser compatible.
5
- (function (factory) {
6
- if (typeof module === "object" && typeof module.exports === "object") {
7
- var v = factory(require, exports);
8
- if (v !== undefined) module.exports = v;
9
- }
10
- else if (typeof define === "function" && define.amd) {
11
- define(["require", "exports", "./_common16.js", "./_common_detach.js"], factory);
12
- }
13
- })(function (require, exports) {
14
- "use strict";
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.encodeHex = encodeHex;
17
- exports.decodeHex = decodeHex;
18
- /**
19
- * Port of the Go
20
- * {@link https://github.com/golang/go/blob/go1.12.5/src/encoding/hex/hex.go | encoding/hex}
21
- * library.
22
- *
23
- * ```ts
24
- * import {
25
- * decodeHex,
26
- * encodeHex,
27
- * } from "@std/encoding/hex";
28
- * import { assertEquals } from "@std/assert";
29
- *
30
- * assertEquals(encodeHex("abc"), "616263");
31
- *
32
- * assertEquals(
33
- * decodeHex("616263"),
34
- * new TextEncoder().encode("abc"),
35
- * );
36
- * ```
37
- *
38
- * @module
39
- */
40
- const _common16_js_1 = require("./_common16.js");
41
- const _common_detach_js_1 = require("./_common_detach.js");
42
- const alphabet = new TextEncoder()
43
- .encode("0123456789abcdef");
44
- const rAlphabet = new Uint8Array(128).fill(16); // alphabet.length
45
- alphabet.forEach((byte, i) => rAlphabet[byte] = i);
46
- new TextEncoder()
47
- .encode("ABCDEF")
48
- .forEach((byte, i) => rAlphabet[byte] = i + 10);
49
- /**
50
- * Converts data into a hex-encoded string.
51
- *
52
- * @param src The data to encode.
53
- *
54
- * @returns The hex-encoded string.
55
- *
56
- * @example Usage
57
- * ```ts
58
- * import { encodeHex } from "@std/encoding/hex";
59
- * import { assertEquals } from "@std/assert";
60
- *
61
- * assertEquals(encodeHex("abc"), "616263");
62
- * ```
63
- */
64
- function encodeHex(src) {
65
- if (typeof src === "string") {
66
- src = new TextEncoder().encode(src);
67
- }
68
- else if (src instanceof ArrayBuffer)
69
- src = new Uint8Array(src).slice();
70
- else
71
- src = src.slice();
72
- const [output, i] = (0, _common_detach_js_1.detach)(src, (0, _common16_js_1.calcSizeHex)(src.length));
73
- (0, _common16_js_1.encode)(output, i, 0, alphabet);
74
- return new TextDecoder().decode(output);
75
- }
76
- /**
77
- * Decodes the given hex-encoded string. If the input is malformed, an error is
78
- * thrown.
79
- *
80
- * @param src The hex-encoded string to decode.
81
- *
82
- * @returns The decoded data.
83
- *
84
- * @example Usage
85
- * ```ts
86
- * import { decodeHex } from "@std/encoding/hex";
87
- * import { assertEquals } from "@std/assert";
88
- *
89
- * assertEquals(
90
- * decodeHex("616263"),
91
- * new TextEncoder().encode("abc"),
92
- * );
93
- * ```
94
- */
95
- function decodeHex(src) {
96
- const output = new TextEncoder().encode(src);
97
- // deno-lint-ignore no-explicit-any
98
- return new Uint8Array(output.buffer
99
- .transfer((0, _common16_js_1.decode)(output, 0, 0, rAlphabet)));
100
- }
101
- });
@@ -1,9 +0,0 @@
1
- /**
2
- * Proxy type of {@code Uint8Array<ArrayBuffer} or {@code Uint8Array} in TypeScript 5.7 or below respectively.
3
- *
4
- * This type is internal utility type and should not be used directly.
5
- *
6
- * @internal @private
7
- */
8
- export type Uint8Array_ = ReturnType<Uint8Array["slice"]>;
9
- //# sourceMappingURL=_types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/msgpack/1.0.3/_types.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- (function (factory) {
3
- if (typeof module === "object" && typeof module.exports === "object") {
4
- var v = factory(require, exports);
5
- if (v !== undefined) module.exports = v;
6
- }
7
- else if (typeof define === "function" && define.amd) {
8
- define(["require", "exports"], factory);
9
- }
10
- })(function (require, exports) {
11
- "use strict";
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- });
@@ -1,39 +0,0 @@
1
- import type { Uint8Array_ } from "./_types.js";
2
- export type { Uint8Array_ };
3
- /**
4
- * Value types that can be encoded to MessagePack.
5
- */
6
- export type ValueType = number | bigint | string | boolean | null | Uint8Array | readonly ValueType[] | ValueMap;
7
- /**
8
- * Value map that can be encoded to MessagePack.
9
- */
10
- export interface ValueMap {
11
- /** Value map entry */
12
- [index: string | number]: ValueType;
13
- }
14
- /**
15
- * Encode a value to {@link https://msgpack.org/ | MessagePack} binary format.
16
- *
17
- * @example Usage
18
- * ```ts
19
- * import { encode } from "@std/msgpack/encode";
20
- * import { assertEquals } from "@std/assert";
21
- *
22
- * const obj = {
23
- * str: "deno",
24
- * arr: [1, 2, 3],
25
- * map: {
26
- * foo: "bar"
27
- * }
28
- * }
29
- *
30
- * const encoded = encode(obj);
31
- *
32
- * assertEquals(encoded.length, 31);
33
- * ```
34
- *
35
- * @param object Value to encode to MessagePack binary format.
36
- * @returns Encoded MessagePack binary data.
37
- */
38
- export declare function encode(object: ValueType): Uint8Array_;
39
- //# sourceMappingURL=encode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/msgpack/1.0.3/encode.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,UAAU,GACV,SAAS,SAAS,EAAE,GACpB,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,sBAAsB;IACtB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACrC;AAeD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,WAAW,CAIrD"}
@@ -1,250 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- // This module is browser compatible.
3
- (function (factory) {
4
- if (typeof module === "object" && typeof module.exports === "object") {
5
- var v = factory(require, exports);
6
- if (v !== undefined) module.exports = v;
7
- }
8
- else if (typeof define === "function" && define.amd) {
9
- define(["require", "exports", "../../bytes/1.0.6/concat.js"], factory);
10
- }
11
- })(function (require, exports) {
12
- "use strict";
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.encode = encode;
15
- const concat_js_1 = require("../../bytes/1.0.6/concat.js");
16
- const FOUR_BITS = 16;
17
- const FIVE_BITS = 32;
18
- const SEVEN_BITS = 128;
19
- const EIGHT_BITS = 256;
20
- const FIFTEEN_BITS = 32768;
21
- const SIXTEEN_BITS = 65536;
22
- const THIRTY_ONE_BITS = 2147483648;
23
- const THIRTY_TWO_BITS = 4294967296;
24
- const SIXTY_THREE_BITS = 9223372036854775808n;
25
- const SIXTY_FOUR_BITS = 18446744073709551616n;
26
- const encoder = new TextEncoder();
27
- /**
28
- * Encode a value to {@link https://msgpack.org/ | MessagePack} binary format.
29
- *
30
- * @example Usage
31
- * ```ts
32
- * import { encode } from "@std/msgpack/encode";
33
- * import { assertEquals } from "@std/assert";
34
- *
35
- * const obj = {
36
- * str: "deno",
37
- * arr: [1, 2, 3],
38
- * map: {
39
- * foo: "bar"
40
- * }
41
- * }
42
- *
43
- * const encoded = encode(obj);
44
- *
45
- * assertEquals(encoded.length, 31);
46
- * ```
47
- *
48
- * @param object Value to encode to MessagePack binary format.
49
- * @returns Encoded MessagePack binary data.
50
- */
51
- function encode(object) {
52
- const byteParts = [];
53
- encodeSlice(object, byteParts);
54
- return (0, concat_js_1.concat)(byteParts);
55
- }
56
- function encodeFloat64(num) {
57
- const dataView = new DataView(new ArrayBuffer(9));
58
- dataView.setFloat64(1, num);
59
- dataView.setUint8(0, 0xcb);
60
- return new Uint8Array(dataView.buffer);
61
- }
62
- function encodeNumber(num) {
63
- if (!Number.isInteger(num)) { // float 64
64
- return encodeFloat64(num);
65
- }
66
- if (num < 0) {
67
- if (num >= -FIVE_BITS) { // negative fixint
68
- return new Uint8Array([num]);
69
- }
70
- if (num >= -SEVEN_BITS) { // int 8
71
- return new Uint8Array([0xd0, num]);
72
- }
73
- if (num >= -FIFTEEN_BITS) { // int 16
74
- const dataView = new DataView(new ArrayBuffer(3));
75
- dataView.setInt16(1, num);
76
- dataView.setUint8(0, 0xd1);
77
- return new Uint8Array(dataView.buffer);
78
- }
79
- if (num >= -THIRTY_ONE_BITS) { // int 32
80
- const dataView = new DataView(new ArrayBuffer(5));
81
- dataView.setInt32(1, num);
82
- dataView.setUint8(0, 0xd2);
83
- return new Uint8Array(dataView.buffer);
84
- }
85
- // float 64
86
- return encodeFloat64(num);
87
- }
88
- // if the number fits within a positive fixint, use it
89
- if (num <= 0x7f) {
90
- return new Uint8Array([num]);
91
- }
92
- if (num < EIGHT_BITS) { // uint8
93
- return new Uint8Array([0xcc, num]);
94
- }
95
- if (num < SIXTEEN_BITS) { // uint16
96
- const dataView = new DataView(new ArrayBuffer(3));
97
- dataView.setUint16(1, num);
98
- dataView.setUint8(0, 0xcd);
99
- return new Uint8Array(dataView.buffer);
100
- }
101
- if (num < THIRTY_TWO_BITS) { // uint32
102
- const dataView = new DataView(new ArrayBuffer(5));
103
- dataView.setUint32(1, num);
104
- dataView.setUint8(0, 0xce);
105
- return new Uint8Array(dataView.buffer);
106
- }
107
- // float 64
108
- return encodeFloat64(num);
109
- }
110
- function encodeSlice(object, byteParts) {
111
- if (object === null) {
112
- byteParts.push(new Uint8Array([0xc0]));
113
- return;
114
- }
115
- if (object === false) {
116
- byteParts.push(new Uint8Array([0xc2]));
117
- return;
118
- }
119
- if (object === true) {
120
- byteParts.push(new Uint8Array([0xc3]));
121
- return;
122
- }
123
- if (typeof object === "number") {
124
- byteParts.push(encodeNumber(object));
125
- return;
126
- }
127
- if (typeof object === "bigint") {
128
- if (object < 0) {
129
- if (object < -SIXTY_THREE_BITS) {
130
- throw new Error("Cannot safely encode bigint larger than 64 bits");
131
- }
132
- const dataView = new DataView(new ArrayBuffer(9));
133
- dataView.setBigInt64(1, object);
134
- dataView.setUint8(0, 0xd3);
135
- byteParts.push(new Uint8Array(dataView.buffer));
136
- return;
137
- }
138
- if (object >= SIXTY_FOUR_BITS) {
139
- throw new Error("Cannot safely encode bigint larger than 64 bits");
140
- }
141
- const dataView = new DataView(new ArrayBuffer(9));
142
- dataView.setBigUint64(1, object);
143
- dataView.setUint8(0, 0xcf);
144
- byteParts.push(new Uint8Array(dataView.buffer));
145
- return;
146
- }
147
- if (typeof object === "string") {
148
- const encoded = encoder.encode(object);
149
- const len = encoded.length;
150
- if (len < FIVE_BITS) { // fixstr
151
- byteParts.push(new Uint8Array([0xa0 | len]));
152
- }
153
- else if (len < EIGHT_BITS) { // str 8
154
- byteParts.push(new Uint8Array([0xd9, len]));
155
- }
156
- else if (len < SIXTEEN_BITS) { // str 16
157
- const dataView = new DataView(new ArrayBuffer(3));
158
- dataView.setUint16(1, len);
159
- dataView.setUint8(0, 0xda);
160
- byteParts.push(new Uint8Array(dataView.buffer));
161
- }
162
- else if (len < THIRTY_TWO_BITS) { // str 32
163
- const dataView = new DataView(new ArrayBuffer(5));
164
- dataView.setUint32(1, len);
165
- dataView.setUint8(0, 0xdb);
166
- byteParts.push(new Uint8Array(dataView.buffer));
167
- }
168
- else {
169
- throw new Error("Cannot safely encode string with size larger than 32 bits");
170
- }
171
- byteParts.push(encoded);
172
- return;
173
- }
174
- if (object instanceof Uint8Array) {
175
- if (object.length < EIGHT_BITS) { // bin 8
176
- byteParts.push(new Uint8Array([0xc4, object.length]));
177
- }
178
- else if (object.length < SIXTEEN_BITS) { // bin 16
179
- const dataView = new DataView(new ArrayBuffer(3));
180
- dataView.setUint16(1, object.length);
181
- dataView.setUint8(0, 0xc5);
182
- byteParts.push(new Uint8Array(dataView.buffer));
183
- }
184
- else if (object.length < THIRTY_TWO_BITS) { // bin 32
185
- const dataView = new DataView(new ArrayBuffer(5));
186
- dataView.setUint32(1, object.length);
187
- dataView.setUint8(0, 0xc6);
188
- byteParts.push(new Uint8Array(dataView.buffer));
189
- }
190
- else {
191
- throw new Error("Cannot safely encode Uint8Array with size larger than 32 bits");
192
- }
193
- byteParts.push(object);
194
- return;
195
- }
196
- if (Array.isArray(object)) {
197
- if (object.length < FOUR_BITS) { // fixarray
198
- byteParts.push(new Uint8Array([0x90 | object.length]));
199
- }
200
- else if (object.length < SIXTEEN_BITS) { // array 16
201
- const dataView = new DataView(new ArrayBuffer(3));
202
- dataView.setUint16(1, object.length);
203
- dataView.setUint8(0, 0xdc);
204
- byteParts.push(new Uint8Array(dataView.buffer));
205
- }
206
- else if (object.length < THIRTY_TWO_BITS) { // array 32
207
- const dataView = new DataView(new ArrayBuffer(5));
208
- dataView.setUint32(1, object.length);
209
- dataView.setUint8(0, 0xdd);
210
- byteParts.push(new Uint8Array(dataView.buffer));
211
- }
212
- else {
213
- throw new Error("Cannot safely encode array with size larger than 32 bits");
214
- }
215
- for (const obj of object) {
216
- encodeSlice(obj, byteParts);
217
- }
218
- return;
219
- }
220
- // If object is a plain object
221
- const prototype = Object.getPrototypeOf(object);
222
- if (prototype === null || prototype === Object.prototype) {
223
- const numKeys = Object.keys(object).length;
224
- if (numKeys < FOUR_BITS) { // fixarray
225
- byteParts.push(new Uint8Array([0x80 | numKeys]));
226
- }
227
- else if (numKeys < SIXTEEN_BITS) { // map 16
228
- const dataView = new DataView(new ArrayBuffer(3));
229
- dataView.setUint16(1, numKeys);
230
- dataView.setUint8(0, 0xde);
231
- byteParts.push(new Uint8Array(dataView.buffer));
232
- }
233
- else if (numKeys < THIRTY_TWO_BITS) { // map 32
234
- const dataView = new DataView(new ArrayBuffer(5));
235
- dataView.setUint32(1, numKeys);
236
- dataView.setUint8(0, 0xdf);
237
- byteParts.push(new Uint8Array(dataView.buffer));
238
- }
239
- else {
240
- throw new Error("Cannot safely encode map with size larger than 32 bits");
241
- }
242
- for (const [key, value] of Object.entries(object)) {
243
- encodeSlice(key, byteParts);
244
- encodeSlice(value, byteParts);
245
- }
246
- return;
247
- }
248
- throw new Error("Cannot safely encode value into messagepack");
249
- }
250
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"_ethers.d.ts","sourceRoot":"","sources":["../../../src/src/signing/_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"}
@@ -1,26 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.isAbstractEthersSigner = isAbstractEthersSigner;
13
- exports.isAbstractEthersV5Signer = isAbstractEthersV5Signer;
14
- /** Checks if the given value is an abstract ethers signer. */
15
- function isAbstractEthersSigner(client) {
16
- return typeof client === "object" && client !== null &&
17
- "signTypedData" in client && typeof client.signTypedData === "function" &&
18
- client.signTypedData.length === 3;
19
- }
20
- /** Checks if the given value is an abstract ethers v5 signer. */
21
- function isAbstractEthersV5Signer(client) {
22
- return typeof client === "object" && client !== null &&
23
- "_signTypedData" in client && typeof client._signTypedData === "function" &&
24
- client._signTypedData.length === 3;
25
- }
26
- });
@@ -1,22 +0,0 @@
1
- import type { Hex } from "../base.js";
2
- /** Signs typed data (EIP-712) with a private key. */
3
- export declare function signTypedDataWithPrivateKey(args: {
4
- privateKey: string;
5
- domain: {
6
- name: string;
7
- version: string;
8
- chainId: number;
9
- verifyingContract: Hex;
10
- };
11
- types: {
12
- [key: string]: {
13
- name: string;
14
- type: string;
15
- }[];
16
- };
17
- primaryType: string;
18
- message: Record<string, unknown>;
19
- }): Promise<Hex>;
20
- /** Validates if a string is a valid secp256k1 private key. */
21
- export declare function isValidPrivateKey(privateKey: unknown): privateKey is string;
22
- //# sourceMappingURL=_private_key.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_private_key.d.ts","sourceRoot":"","sources":["../../../src/src/signing/_private_key.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,qDAAqD;AACrD,wBAAsB,2BAA2B,CAAC,IAAI,EAAE;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,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,CAiCf;AA8GD,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,MAAM,CAQ3E"}