@nktkas/hyperliquid 0.22.1 → 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 (230) hide show
  1. package/README.md +125 -70
  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 +420 -368
  8. package/esm/src/clients/exchange.d.ts.map +1 -1
  9. package/esm/src/clients/exchange.js +721 -551
  10. package/esm/src/clients/info.d.ts +137 -41
  11. package/esm/src/clients/info.d.ts.map +1 -1
  12. package/esm/src/clients/info.js +124 -28
  13. package/esm/src/clients/multiSign.d.ts +406 -484
  14. package/esm/src/clients/multiSign.d.ts.map +1 -1
  15. package/esm/src/clients/multiSign.js +639 -734
  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/_signTypedData/ethers.d.ts +33 -0
  20. package/esm/src/signing/_signTypedData/ethers.d.ts.map +1 -0
  21. package/esm/src/signing/_signTypedData/ethers.js +12 -0
  22. package/esm/src/signing/_signTypedData/mod.d.ts +35 -0
  23. package/esm/src/signing/_signTypedData/mod.d.ts.map +1 -0
  24. package/esm/src/signing/_signTypedData/mod.js +59 -0
  25. package/esm/src/signing/_signTypedData/private_key.d.ts +26 -0
  26. package/esm/src/signing/_signTypedData/private_key.d.ts.map +1 -0
  27. package/esm/src/signing/_signTypedData/private_key.js +144 -0
  28. package/esm/src/signing/_signTypedData/viem.d.ts +23 -0
  29. package/esm/src/signing/_signTypedData/viem.d.ts.map +1 -0
  30. package/esm/src/signing/_signTypedData/viem.js +6 -0
  31. package/esm/src/signing/_signTypedData/window.d.ts +29 -0
  32. package/esm/src/signing/_signTypedData/window.d.ts.map +1 -0
  33. package/esm/src/signing/_signTypedData/window.js +30 -0
  34. package/esm/src/signing/_sorter.d.ts +128 -0
  35. package/esm/src/signing/_sorter.d.ts.map +1 -0
  36. package/esm/src/{signing.js → signing/_sorter.js} +36 -449
  37. package/esm/src/signing/mod.d.ts +272 -0
  38. package/esm/src/signing/mod.d.ts.map +1 -0
  39. package/esm/src/signing/mod.js +306 -0
  40. package/esm/src/transports/base.d.ts +1 -1
  41. package/esm/src/transports/base.d.ts.map +1 -1
  42. package/esm/src/transports/base.js +2 -2
  43. package/esm/src/transports/http/http_transport.d.ts +9 -15
  44. package/esm/src/transports/http/http_transport.d.ts.map +1 -1
  45. package/esm/src/transports/http/http_transport.js +64 -59
  46. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
  47. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  48. package/esm/src/transports/websocket/_hyperliquid_event_target.js +1 -1
  49. package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
  50. package/esm/src/transports/websocket/_reconnecting_websocket.js +17 -4
  51. package/esm/src/transports/websocket/_websocket_async_request.d.ts +0 -9
  52. package/esm/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
  53. package/esm/src/transports/websocket/_websocket_async_request.js +14 -20
  54. package/esm/src/transports/websocket/websocket_transport.d.ts +8 -4
  55. package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  56. package/esm/src/transports/websocket/websocket_transport.js +83 -54
  57. package/esm/src/types/exchange/requests.d.ts +27 -51
  58. package/esm/src/types/exchange/requests.d.ts.map +1 -1
  59. package/esm/src/types/explorer/requests.d.ts +5 -8
  60. package/esm/src/types/explorer/requests.d.ts.map +1 -1
  61. package/esm/src/types/info/accounts.d.ts +5 -5
  62. package/esm/src/types/info/accounts.d.ts.map +1 -1
  63. package/esm/src/types/info/delegations.d.ts +1 -1
  64. package/esm/src/types/info/delegations.d.ts.map +1 -1
  65. package/esm/src/types/info/orders.d.ts +1 -1
  66. package/esm/src/types/info/orders.d.ts.map +1 -1
  67. package/esm/src/types/info/requests.d.ts +49 -96
  68. package/esm/src/types/info/requests.d.ts.map +1 -1
  69. package/esm/src/types/subscriptions/requests.d.ts +72 -18
  70. package/esm/src/types/subscriptions/requests.d.ts.map +1 -1
  71. package/esm/src/types/subscriptions/responses.d.ts +2 -0
  72. package/esm/src/types/subscriptions/responses.d.ts.map +1 -1
  73. package/package.json +12 -8
  74. package/script/mod.d.ts +1 -1
  75. package/script/mod.d.ts.map +1 -1
  76. package/script/mod.js +13 -23
  77. package/script/src/base.d.ts +4 -1
  78. package/script/src/base.d.ts.map +1 -1
  79. package/script/src/base.js +10 -20
  80. package/script/src/clients/exchange.d.ts +420 -368
  81. package/script/src/clients/exchange.d.ts.map +1 -1
  82. package/script/src/clients/exchange.js +2000 -1840
  83. package/script/src/clients/info.d.ts +137 -41
  84. package/script/src/clients/info.d.ts.map +1 -1
  85. package/script/src/clients/info.js +1296 -1210
  86. package/script/src/clients/multiSign.d.ts +406 -484
  87. package/script/src/clients/multiSign.d.ts.map +1 -1
  88. package/script/src/clients/multiSign.js +2043 -2148
  89. package/script/src/clients/subscription.d.ts +38 -3
  90. package/script/src/clients/subscription.d.ts.map +1 -1
  91. package/script/src/clients/subscription.js +568 -545
  92. package/script/src/signing/_signTypedData/ethers.d.ts +33 -0
  93. package/script/src/signing/_signTypedData/ethers.d.ts.map +1 -0
  94. package/script/src/signing/_signTypedData/ethers.js +16 -0
  95. package/script/src/signing/_signTypedData/mod.d.ts +35 -0
  96. package/script/src/signing/_signTypedData/mod.d.ts.map +1 -0
  97. package/script/src/signing/_signTypedData/mod.js +67 -0
  98. package/script/src/signing/_signTypedData/private_key.d.ts +26 -0
  99. package/script/src/signing/_signTypedData/private_key.d.ts.map +1 -0
  100. package/script/src/signing/_signTypedData/private_key.js +148 -0
  101. package/script/src/signing/_signTypedData/viem.d.ts +23 -0
  102. package/script/src/signing/_signTypedData/viem.d.ts.map +1 -0
  103. package/script/src/signing/_signTypedData/viem.js +9 -0
  104. package/script/src/signing/_signTypedData/window.d.ts +29 -0
  105. package/script/src/signing/_signTypedData/window.d.ts.map +1 -0
  106. package/script/src/signing/_signTypedData/window.js +34 -0
  107. package/script/src/signing/_sorter.d.ts +128 -0
  108. package/script/src/signing/_sorter.d.ts.map +1 -0
  109. package/script/src/signing/_sorter.js +698 -0
  110. package/script/src/signing/mod.d.ts +272 -0
  111. package/script/src/signing/mod.d.ts.map +1 -0
  112. package/script/src/signing/mod.js +331 -0
  113. package/script/src/transports/base.d.ts +1 -1
  114. package/script/src/transports/base.d.ts.map +1 -1
  115. package/script/src/transports/base.js +11 -21
  116. package/script/src/transports/http/http_transport.d.ts +9 -15
  117. package/script/src/transports/http/http_transport.d.ts.map +1 -1
  118. package/script/src/transports/http/http_transport.js +97 -102
  119. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
  120. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  121. package/script/src/transports/websocket/_hyperliquid_event_target.js +51 -61
  122. package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
  123. package/script/src/transports/websocket/_reconnecting_websocket.js +271 -268
  124. package/script/src/transports/websocket/_websocket_async_request.d.ts +0 -9
  125. package/script/src/transports/websocket/_websocket_async_request.d.ts.map +1 -1
  126. package/script/src/transports/websocket/_websocket_async_request.js +157 -174
  127. package/script/src/transports/websocket/websocket_transport.d.ts +8 -4
  128. package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  129. package/script/src/transports/websocket/websocket_transport.js +209 -189
  130. package/script/src/types/exchange/requests.d.ts +27 -51
  131. package/script/src/types/exchange/requests.d.ts.map +1 -1
  132. package/script/src/types/exchange/requests.js +2 -12
  133. package/script/src/types/exchange/responses.js +2 -12
  134. package/script/src/types/explorer/requests.d.ts +5 -8
  135. package/script/src/types/explorer/requests.d.ts.map +1 -1
  136. package/script/src/types/explorer/requests.js +2 -12
  137. package/script/src/types/explorer/responses.js +2 -12
  138. package/script/src/types/info/accounts.d.ts +5 -5
  139. package/script/src/types/info/accounts.d.ts.map +1 -1
  140. package/script/src/types/info/accounts.js +2 -12
  141. package/script/src/types/info/assets.js +2 -12
  142. package/script/src/types/info/delegations.d.ts +1 -1
  143. package/script/src/types/info/delegations.d.ts.map +1 -1
  144. package/script/src/types/info/delegations.js +2 -12
  145. package/script/src/types/info/markets.js +2 -12
  146. package/script/src/types/info/orders.d.ts +1 -1
  147. package/script/src/types/info/orders.d.ts.map +1 -1
  148. package/script/src/types/info/orders.js +2 -12
  149. package/script/src/types/info/requests.d.ts +49 -96
  150. package/script/src/types/info/requests.d.ts.map +1 -1
  151. package/script/src/types/info/requests.js +2 -12
  152. package/script/src/types/info/vaults.js +2 -12
  153. package/script/src/types/mod.js +2 -12
  154. package/script/src/types/subscriptions/requests.d.ts +72 -18
  155. package/script/src/types/subscriptions/requests.d.ts.map +1 -1
  156. package/script/src/types/subscriptions/requests.js +2 -12
  157. package/script/src/types/subscriptions/responses.d.ts +2 -0
  158. package/script/src/types/subscriptions/responses.d.ts.map +1 -1
  159. package/script/src/types/subscriptions/responses.js +2 -12
  160. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts +0 -2
  161. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts.map +0 -1
  162. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +0 -1
  163. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts +0 -95
  164. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts.map +0 -1
  165. package/esm/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +0 -10
  166. package/esm/deps/jsr.io/@std/async/1.0.13/delay.d.ts +0 -43
  167. package/esm/deps/jsr.io/@std/async/1.0.13/delay.d.ts.map +0 -1
  168. package/esm/deps/jsr.io/@std/async/1.0.13/delay.js +0 -63
  169. package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +0 -9
  170. package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +0 -1
  171. package/esm/deps/jsr.io/@std/bytes/1.0.6/_types.js +0 -2
  172. package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +0 -21
  173. package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +0 -1
  174. package/esm/deps/jsr.io/@std/bytes/1.0.6/concat.js +0 -32
  175. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +0 -23
  176. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +0 -1
  177. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.js +0 -51
  178. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
  179. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
  180. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -13
  181. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
  182. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
  183. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -2
  184. package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +0 -39
  185. package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +0 -1
  186. package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.js +0 -87
  187. package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +0 -9
  188. package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +0 -1
  189. package/esm/deps/jsr.io/@std/msgpack/1.0.3/_types.js +0 -2
  190. package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts +0 -39
  191. package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +0 -1
  192. package/esm/deps/jsr.io/@std/msgpack/1.0.3/encode.js +0 -237
  193. package/esm/src/signing.d.ts +0 -463
  194. package/esm/src/signing.d.ts.map +0 -1
  195. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts +0 -2
  196. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.d.ts.map +0 -1
  197. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js +0 -27
  198. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts +0 -95
  199. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.d.ts.map +0 -1
  200. package/script/deps/jsr.io/@derzade/typescript-event-target/1.1.1/src/TypedEventTarget.js +0 -24
  201. package/script/deps/jsr.io/@std/async/1.0.13/delay.d.ts +0 -43
  202. package/script/deps/jsr.io/@std/async/1.0.13/delay.d.ts.map +0 -1
  203. package/script/deps/jsr.io/@std/async/1.0.13/delay.js +0 -76
  204. package/script/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts +0 -9
  205. package/script/deps/jsr.io/@std/bytes/1.0.6/_types.d.ts.map +0 -1
  206. package/script/deps/jsr.io/@std/bytes/1.0.6/_types.js +0 -13
  207. package/script/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts +0 -21
  208. package/script/deps/jsr.io/@std/bytes/1.0.6/concat.d.ts.map +0 -1
  209. package/script/deps/jsr.io/@std/bytes/1.0.6/concat.js +0 -45
  210. package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +0 -23
  211. package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +0 -1
  212. package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.js +0 -67
  213. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
  214. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
  215. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -26
  216. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
  217. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
  218. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -13
  219. package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +0 -39
  220. package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +0 -1
  221. package/script/deps/jsr.io/@std/encoding/1.0.10/hex.js +0 -101
  222. package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts +0 -9
  223. package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.d.ts.map +0 -1
  224. package/script/deps/jsr.io/@std/msgpack/1.0.3/_types.js +0 -13
  225. package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts +0 -39
  226. package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.d.ts.map +0 -1
  227. package/script/deps/jsr.io/@std/msgpack/1.0.3/encode.js +0 -250
  228. package/script/src/signing.d.ts +0 -463
  229. package/script/src/signing.d.ts.map +0 -1
  230. package/script/src/signing.js +0 -1129
@@ -1,43 +0,0 @@
1
- /** Options for {@linkcode delay}. */
2
- export interface DelayOptions {
3
- /** Signal used to abort the delay. */
4
- signal?: AbortSignal;
5
- /** Indicates whether the process should continue to run as long as the timer exists.
6
- *
7
- * @default {true}
8
- */
9
- persistent?: boolean;
10
- }
11
- /**
12
- * Resolve a {@linkcode Promise} after a given amount of milliseconds.
13
- *
14
- * @throws {DOMException} If the optional signal is aborted before the delay
15
- * duration, and `signal.reason` is undefined.
16
- * @param ms Duration in milliseconds for how long the delay should last.
17
- * @param options Additional options.
18
- *
19
- * @example Basic usage
20
- * ```ts no-assert
21
- * import { delay } from "@std/async/delay";
22
- *
23
- * // ...
24
- * const delayedPromise = delay(100);
25
- * const result = await delayedPromise;
26
- * // ...
27
- * ```
28
- *
29
- * @example Disable persistence
30
- *
31
- * Setting `persistent` to `false` will allow the process to continue to run as
32
- * long as the timer exists.
33
- *
34
- * ```ts no-assert ignore
35
- * import { delay } from "@std/async/delay";
36
- *
37
- * // ...
38
- * await delay(100, { persistent: false });
39
- * // ...
40
- * ```
41
- */
42
- export declare function delay(ms: number, options?: DelayOptions): Promise<void>;
43
- //# sourceMappingURL=delay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.13/delay.ts"],"names":[],"mappings":"AAGA,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC3B,sCAAsC;IACtC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B3E"}
@@ -1,76 +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"], factory);
10
- }
11
- })(function (require, exports) {
12
- "use strict";
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.delay = delay;
15
- /**
16
- * Resolve a {@linkcode Promise} after a given amount of milliseconds.
17
- *
18
- * @throws {DOMException} If the optional signal is aborted before the delay
19
- * duration, and `signal.reason` is undefined.
20
- * @param ms Duration in milliseconds for how long the delay should last.
21
- * @param options Additional options.
22
- *
23
- * @example Basic usage
24
- * ```ts no-assert
25
- * import { delay } from "@std/async/delay";
26
- *
27
- * // ...
28
- * const delayedPromise = delay(100);
29
- * const result = await delayedPromise;
30
- * // ...
31
- * ```
32
- *
33
- * @example Disable persistence
34
- *
35
- * Setting `persistent` to `false` will allow the process to continue to run as
36
- * long as the timer exists.
37
- *
38
- * ```ts no-assert ignore
39
- * import { delay } from "@std/async/delay";
40
- *
41
- * // ...
42
- * await delay(100, { persistent: false });
43
- * // ...
44
- * ```
45
- */
46
- function delay(ms, options = {}) {
47
- const { signal, persistent = true } = options;
48
- if (signal?.aborted)
49
- return Promise.reject(signal.reason);
50
- return new Promise((resolve, reject) => {
51
- const abort = () => {
52
- clearTimeout(i);
53
- reject(signal?.reason);
54
- };
55
- const done = () => {
56
- signal?.removeEventListener("abort", abort);
57
- resolve();
58
- };
59
- const i = setTimeout(done, ms);
60
- signal?.addEventListener("abort", abort, { once: true });
61
- if (persistent === false) {
62
- try {
63
- // @ts-ignore For browser compatibility
64
- Deno.unrefTimer(i);
65
- }
66
- catch (error) {
67
- if (!(error instanceof ReferenceError)) {
68
- throw error;
69
- }
70
- // deno-lint-ignore no-console
71
- console.error("`persistent` option is only available in Deno");
72
- }
73
- }
74
- });
75
- }
76
- });
@@ -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/bytes/1.0.6/_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,21 +0,0 @@
1
- import type { Uint8Array_ } from "./_types.js";
2
- export type { Uint8Array_ };
3
- /**
4
- * Concatenate an array of byte slices into a single slice.
5
- *
6
- * @param buffers Array of byte slices to concatenate.
7
- * @returns A new byte slice containing all the input slices concatenated.
8
- *
9
- * @example Basic usage
10
- * ```ts
11
- * import { concat } from "@std/bytes/concat";
12
- * import { assertEquals } from "@std/assert";
13
- *
14
- * const a = new Uint8Array([0, 1, 2]);
15
- * const b = new Uint8Array([3, 4, 5]);
16
- *
17
- * assertEquals(concat([a, b]), new Uint8Array([0, 1, 2, 3, 4, 5]));
18
- * ```
19
- */
20
- export declare function concat(buffers: readonly Uint8Array[]): Uint8Array_;
21
- //# sourceMappingURL=concat.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.6/concat.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,WAAW,CAalE"}
@@ -1,45 +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"], factory);
10
- }
11
- })(function (require, exports) {
12
- "use strict";
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.concat = concat;
15
- /**
16
- * Concatenate an array of byte slices into a single slice.
17
- *
18
- * @param buffers Array of byte slices to concatenate.
19
- * @returns A new byte slice containing all the input slices concatenated.
20
- *
21
- * @example Basic usage
22
- * ```ts
23
- * import { concat } from "@std/bytes/concat";
24
- * import { assertEquals } from "@std/assert";
25
- *
26
- * const a = new Uint8Array([0, 1, 2]);
27
- * const b = new Uint8Array([3, 4, 5]);
28
- *
29
- * assertEquals(concat([a, b]), new Uint8Array([0, 1, 2, 3, 4, 5]));
30
- * ```
31
- */
32
- function concat(buffers) {
33
- let length = 0;
34
- for (const buffer of buffers) {
35
- length += buffer.length;
36
- }
37
- const output = new Uint8Array(length);
38
- let index = 0;
39
- for (const buffer of buffers) {
40
- output.set(buffer, index);
41
- index += buffer.length;
42
- }
43
- return output;
44
- }
45
- });
@@ -1,23 +0,0 @@
1
- import type { Uint8Array_ } from "./_types.js";
2
- export type { Uint8Array_ };
3
- export declare const alphabet: Uint8Array;
4
- export declare const rAlphabet: Uint8Array;
5
- /**
6
- * Calculate the output size needed to encode a given input size for
7
- * {@linkcode encodeIntoHex}.
8
- *
9
- * @param originalSize The size of the input buffer.
10
- * @returns The size of the output buffer.
11
- *
12
- * @example Basic Usage
13
- * ```ts
14
- * import { assertEquals } from "@std/assert";
15
- * import { calcSizeHex } from "@std/encoding/unstable-hex";
16
- *
17
- * assertEquals(calcSizeHex(1), 2);
18
- * ```
19
- */
20
- export declare function calcSizeHex(originalSize: number): number;
21
- export declare function encode(buffer: Uint8Array_, i: number, o: number, alphabet: Uint8Array): number;
22
- export declare function decode(buffer: Uint8Array_, i: number, o: number, alphabet: Uint8Array): number;
23
- //# sourceMappingURL=_common16.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_common16.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/_common16.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,eAAO,MAAM,QAAQ,YAA+C,CAAC;AACrE,eAAO,MAAM,SAAS,YAA+B,CAAC;AAMtD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,MAAM,CACpB,MAAM,EAAE,WAAW,EACnB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,EAAE,UAAU,GACnB,MAAM,CAOR;AAED,wBAAgB,MAAM,CACpB,MAAM,EAAE,WAAW,EACnB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,EAAE,UAAU,GACnB,MAAM,CAeR"}
@@ -1,67 +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.rAlphabet = exports.alphabet = void 0;
14
- exports.calcSizeHex = calcSizeHex;
15
- exports.encode = encode;
16
- exports.decode = decode;
17
- exports.alphabet = new TextEncoder().encode("0123456789abcdef");
18
- exports.rAlphabet = new Uint8Array(128).fill(16); // alphabet.Hex.length
19
- exports.alphabet.forEach((byte, i) => exports.rAlphabet[byte] = i);
20
- new TextEncoder()
21
- .encode("ABCDEF")
22
- .forEach((byte, i) => exports.rAlphabet[byte] = i + 10);
23
- /**
24
- * Calculate the output size needed to encode a given input size for
25
- * {@linkcode encodeIntoHex}.
26
- *
27
- * @param originalSize The size of the input buffer.
28
- * @returns The size of the output buffer.
29
- *
30
- * @example Basic Usage
31
- * ```ts
32
- * import { assertEquals } from "@std/assert";
33
- * import { calcSizeHex } from "@std/encoding/unstable-hex";
34
- *
35
- * assertEquals(calcSizeHex(1), 2);
36
- * ```
37
- */
38
- function calcSizeHex(originalSize) {
39
- return originalSize * 2;
40
- }
41
- function encode(buffer, i, o, alphabet) {
42
- for (; i < buffer.length; ++i) {
43
- const x = buffer[i];
44
- buffer[o++] = alphabet[x >> 4];
45
- buffer[o++] = alphabet[x & 0xF];
46
- }
47
- return o;
48
- }
49
- function decode(buffer, i, o, alphabet) {
50
- if ((buffer.length - o) % 2 === 1) {
51
- throw new RangeError(`Cannot decode input as hex: Length (${buffer.length - o}) must be divisible by 2`);
52
- }
53
- i += 1;
54
- for (; i < buffer.length; i += 2) {
55
- buffer[o++] = (getByte(buffer[i - 1], alphabet) << 4) |
56
- getByte(buffer[i], alphabet);
57
- }
58
- return o;
59
- }
60
- function getByte(char, alphabet) {
61
- const byte = alphabet[char] ?? 16;
62
- if (byte === 16) { // alphabet.Hex.length
63
- throw new TypeError(`Cannot decode input as hex: Invalid character (${String.fromCharCode(char)})`);
64
- }
65
- return byte;
66
- }
67
- });
@@ -1,4 +0,0 @@
1
- import type { Uint8Array_ } from "./_types.js";
2
- export type { Uint8Array_ };
3
- export declare function detach(buffer: Uint8Array_, maxSize: number): [Uint8Array_, number];
4
- //# sourceMappingURL=_common_detach.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_common_detach.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/_common_detach.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,wBAAgB,MAAM,CACpB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,GACd,CAAC,WAAW,EAAE,MAAM,CAAC,CAWvB"}
@@ -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"}