@nktkas/hyperliquid 0.19.2 → 0.20.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 (123) hide show
  1. package/README.md +21 -29
  2. package/esm/_dnt.polyfills.d.ts +20 -0
  3. package/esm/_dnt.polyfills.d.ts.map +1 -0
  4. package/esm/_dnt.polyfills.js +12 -0
  5. package/esm/mod.d.ts +3 -0
  6. package/esm/mod.d.ts.map +1 -1
  7. package/esm/mod.js +2 -0
  8. package/esm/src/base.d.ts +1 -47
  9. package/esm/src/base.d.ts.map +1 -1
  10. package/esm/src/base.js +1 -8
  11. package/esm/src/clients/event.d.ts +2 -3
  12. package/esm/src/clients/event.d.ts.map +1 -1
  13. package/esm/src/clients/event.js +49 -57
  14. package/esm/src/clients/public.d.ts +24 -5
  15. package/esm/src/clients/public.d.ts.map +1 -1
  16. package/esm/src/clients/public.js +23 -7
  17. package/esm/src/clients/wallet.d.ts +12 -13
  18. package/esm/src/clients/wallet.d.ts.map +1 -1
  19. package/esm/src/clients/wallet.js +55 -265
  20. package/esm/src/signing.d.ts +5 -0
  21. package/esm/src/signing.d.ts.map +1 -1
  22. package/esm/src/signing.js +24 -5
  23. package/esm/src/transports/base.d.ts +49 -0
  24. package/esm/src/transports/base.d.ts.map +1 -0
  25. package/esm/src/transports/base.js +8 -0
  26. package/esm/src/transports/http/http_transport.d.ts +8 -5
  27. package/esm/src/transports/http/http_transport.d.ts.map +1 -1
  28. package/esm/src/transports/http/http_transport.js +15 -62
  29. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +36 -39
  30. package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  31. package/esm/src/transports/websocket/_reconnecting_websocket.d.ts +18 -25
  32. package/esm/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
  33. package/esm/src/transports/websocket/_reconnecting_websocket.js +80 -179
  34. package/{script/src/transports/websocket/_websocket_request_dispatcher.d.ts → esm/src/transports/websocket/_websocket_async_request.d.ts} +14 -18
  35. package/esm/src/transports/websocket/_websocket_async_request.d.ts.map +1 -0
  36. package/esm/src/transports/websocket/{_websocket_request_dispatcher.js → _websocket_async_request.js} +41 -74
  37. package/esm/src/transports/websocket/websocket_transport.d.ts +38 -28
  38. package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  39. package/esm/src/transports/websocket/websocket_transport.js +61 -76
  40. package/esm/src/types/info/assets.d.ts +0 -48
  41. package/esm/src/types/info/assets.d.ts.map +1 -1
  42. package/esm/src/types/info/markets.d.ts +52 -0
  43. package/esm/src/types/info/markets.d.ts.map +1 -0
  44. package/esm/src/types/info/markets.js +1 -0
  45. package/esm/src/types/info/requests.d.ts +9 -0
  46. package/esm/src/types/info/requests.d.ts.map +1 -1
  47. package/esm/src/types/mod.d.ts +4 -0
  48. package/esm/src/types/mod.d.ts.map +1 -1
  49. package/esm/src/types/mod.js +3 -1
  50. package/package.json +12 -9
  51. package/script/_dnt.polyfills.d.ts +20 -0
  52. package/script/_dnt.polyfills.d.ts.map +1 -0
  53. package/script/_dnt.polyfills.js +23 -0
  54. package/script/mod.d.ts +3 -0
  55. package/script/mod.d.ts.map +1 -1
  56. package/script/mod.js +3 -1
  57. package/script/src/base.d.ts +1 -47
  58. package/script/src/base.d.ts.map +1 -1
  59. package/script/src/base.js +2 -10
  60. package/script/src/clients/event.d.ts +2 -3
  61. package/script/src/clients/event.d.ts.map +1 -1
  62. package/script/src/clients/event.js +49 -57
  63. package/script/src/clients/public.d.ts +24 -5
  64. package/script/src/clients/public.d.ts.map +1 -1
  65. package/script/src/clients/public.js +23 -7
  66. package/script/src/clients/wallet.d.ts +12 -13
  67. package/script/src/clients/wallet.d.ts.map +1 -1
  68. package/script/src/clients/wallet.js +55 -265
  69. package/script/src/signing.d.ts +5 -0
  70. package/script/src/signing.d.ts.map +1 -1
  71. package/script/src/signing.js +75 -56
  72. package/script/src/transports/base.d.ts +49 -0
  73. package/script/src/transports/base.d.ts.map +1 -0
  74. package/script/src/transports/base.js +22 -0
  75. package/script/src/transports/http/http_transport.d.ts +8 -5
  76. package/script/src/transports/http/http_transport.d.ts.map +1 -1
  77. package/script/src/transports/http/http_transport.js +16 -63
  78. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +36 -39
  79. package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
  80. package/script/src/transports/websocket/_reconnecting_websocket.d.ts +18 -25
  81. package/script/src/transports/websocket/_reconnecting_websocket.d.ts.map +1 -1
  82. package/script/src/transports/websocket/_reconnecting_websocket.js +81 -180
  83. package/{esm/src/transports/websocket/_websocket_request_dispatcher.d.ts → script/src/transports/websocket/_websocket_async_request.d.ts} +14 -18
  84. package/script/src/transports/websocket/_websocket_async_request.d.ts.map +1 -0
  85. package/script/src/transports/websocket/{_websocket_request_dispatcher.js → _websocket_async_request.js} +44 -77
  86. package/script/src/transports/websocket/websocket_transport.d.ts +38 -28
  87. package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
  88. package/script/src/transports/websocket/websocket_transport.js +63 -78
  89. package/script/src/types/info/assets.d.ts +0 -48
  90. package/script/src/types/info/assets.d.ts.map +1 -1
  91. package/script/src/types/info/markets.d.ts +52 -0
  92. package/script/src/types/info/markets.d.ts.map +1 -0
  93. package/script/{deps/jsr.io/@noble/hashes/1.8.0/src/crypto.js → src/types/info/markets.js} +0 -2
  94. package/script/src/types/info/requests.d.ts +9 -0
  95. package/script/src/types/info/requests.d.ts.map +1 -1
  96. package/script/src/types/mod.d.ts +4 -0
  97. package/script/src/types/mod.d.ts.map +1 -1
  98. package/script/src/types/mod.js +25 -22
  99. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.d.ts +0 -55
  100. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.d.ts.map +0 -1
  101. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.js +0 -66
  102. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/crypto.d.ts +0 -2
  103. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/crypto.d.ts.map +0 -1
  104. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/crypto.js +0 -1
  105. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/sha3.d.ts +0 -53
  106. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/sha3.d.ts.map +0 -1
  107. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/sha3.js +0 -294
  108. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/utils.d.ts +0 -161
  109. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/utils.d.ts.map +0 -1
  110. package/esm/deps/jsr.io/@noble/hashes/1.8.0/src/utils.js +0 -280
  111. package/esm/src/transports/websocket/_websocket_request_dispatcher.d.ts.map +0 -1
  112. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.d.ts +0 -55
  113. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.d.ts.map +0 -1
  114. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.js +0 -99
  115. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/crypto.d.ts +0 -2
  116. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/crypto.d.ts.map +0 -1
  117. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/sha3.d.ts +0 -53
  118. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/sha3.d.ts.map +0 -1
  119. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/sha3.js +0 -309
  120. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/utils.d.ts +0 -161
  121. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/utils.d.ts.map +0 -1
  122. package/script/deps/jsr.io/@noble/hashes/1.8.0/src/utils.js +0 -322
  123. package/script/src/transports/websocket/_websocket_request_dispatcher.d.ts.map +0 -1
@@ -1,161 +0,0 @@
1
- /**
2
- * Utilities for hex, bytes, CSPRNG.
3
- * @module
4
- */
5
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
6
- /** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */
7
- export declare function isBytes(a: unknown): a is Uint8Array;
8
- /** Asserts something is positive integer. */
9
- export declare function anumber(n: number): void;
10
- /** Asserts something is Uint8Array. */
11
- export declare function abytes(b: Uint8Array | undefined, ...lengths: number[]): void;
12
- /** Asserts something is hash */
13
- export declare function ahash(h: IHash): void;
14
- /** Asserts a hash instance has not been destroyed / finished */
15
- export declare function aexists(instance: any, checkFinished?: boolean): void;
16
- /** Asserts output is properly-sized byte array */
17
- export declare function aoutput(out: any, instance: any): void;
18
- /** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */
19
- export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | Uint16Array | Int16Array | Uint32Array | Int32Array;
20
- /** Cast u8 / u16 / u32 to u8. */
21
- export declare function u8(arr: TypedArray): Uint8Array;
22
- /** Cast u8 / u16 / u32 to u32. */
23
- export declare function u32(arr: TypedArray): Uint32Array;
24
- /** Zeroize a byte array. Warning: JS provides no guarantees. */
25
- export declare function clean(...arrays: TypedArray[]): void;
26
- /** Create DataView of an array for easy byte-level manipulation. */
27
- export declare function createView(arr: TypedArray): DataView;
28
- /** The rotate right (circular right shift) operation for uint32 */
29
- export declare function rotr(word: number, shift: number): number;
30
- /** The rotate left (circular left shift) operation for uint32 */
31
- export declare function rotl(word: number, shift: number): number;
32
- /** Is current platform little-endian? Most are. Big-Endian platform: IBM */
33
- export declare const isLE: boolean;
34
- /** The byte swap operation for uint32 */
35
- export declare function byteSwap(word: number): number;
36
- /** Conditionally byte swap if on a big-endian platform */
37
- export declare const swap8IfBE: (n: number) => number;
38
- /** @deprecated */
39
- export declare const byteSwapIfBE: typeof swap8IfBE;
40
- /** In place byte swap for Uint32Array */
41
- export declare function byteSwap32(arr: Uint32Array): Uint32Array;
42
- export declare const swap32IfBE: (u: Uint32Array) => Uint32Array;
43
- /**
44
- * Convert byte array to hex string. Uses built-in function, when available.
45
- * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'
46
- */
47
- export declare function bytesToHex(bytes: Uint8Array): string;
48
- /**
49
- * Convert hex string to byte array. Uses built-in function, when available.
50
- * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])
51
- */
52
- export declare function hexToBytes(hex: string): Uint8Array;
53
- /**
54
- * There is no setImmediate in browser and setTimeout is slow.
55
- * Call of async fn will return Promise, which will be fullfiled only on
56
- * next scheduler queue processing step and this is exactly what we need.
57
- */
58
- export declare const nextTick: () => Promise<void>;
59
- /** Returns control to thread each 'tick' ms to avoid blocking. */
60
- export declare function asyncLoop(iters: number, tick: number, cb: (i: number) => void): Promise<void>;
61
- /**
62
- * Converts string to bytes using UTF8 encoding.
63
- * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])
64
- */
65
- export declare function utf8ToBytes(str: string): Uint8Array;
66
- /**
67
- * Converts bytes to string using UTF8 encoding.
68
- * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'
69
- */
70
- export declare function bytesToUtf8(bytes: Uint8Array): string;
71
- /** Accepted input of hash functions. Strings are converted to byte arrays. */
72
- export type Input = string | Uint8Array;
73
- /**
74
- * Normalizes (non-hex) string or Uint8Array to Uint8Array.
75
- * Warning: when Uint8Array is passed, it would NOT get copied.
76
- * Keep in mind for future mutable operations.
77
- */
78
- export declare function toBytes(data: Input): Uint8Array;
79
- /** KDFs can accept string or Uint8Array for user convenience. */
80
- export type KDFInput = string | Uint8Array;
81
- /**
82
- * Helper for KDFs: consumes uint8array or string.
83
- * When string is passed, does utf8 decoding, using TextDecoder.
84
- */
85
- export declare function kdfInputToBytes(data: KDFInput): Uint8Array;
86
- /** Copies several Uint8Arrays into one. */
87
- export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array;
88
- type EmptyObj = {};
89
- export declare function checkOpts<T1 extends EmptyObj, T2 extends EmptyObj>(defaults: T1, opts?: T2): T1 & T2;
90
- /** Hash interface. */
91
- export type IHash = {
92
- (data: Uint8Array): Uint8Array;
93
- blockLen: number;
94
- outputLen: number;
95
- create: any;
96
- };
97
- /** For runtime check if class implements interface */
98
- export declare abstract class Hash<T extends Hash<T>> {
99
- abstract blockLen: number;
100
- abstract outputLen: number;
101
- abstract update(buf: Input): this;
102
- abstract digestInto(buf: Uint8Array): void;
103
- abstract digest(): Uint8Array;
104
- /**
105
- * Resets internal state. Makes Hash instance unusable.
106
- * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed
107
- * by user, they will need to manually call `destroy()` when zeroing is necessary.
108
- */
109
- abstract destroy(): void;
110
- /**
111
- * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()`
112
- * when no options are passed.
113
- * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal
114
- * buffers are overwritten => causes buffer overwrite which is used for digest in some cases.
115
- * There are no guarantees for clean-up because it's impossible in JS.
116
- */
117
- abstract _cloneInto(to?: T): T;
118
- abstract clone(): T;
119
- }
120
- /**
121
- * XOF: streaming API to read digest in chunks.
122
- * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name.
123
- * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot
124
- * destroy state, next call can require more bytes.
125
- */
126
- export type HashXOF<T extends Hash<T>> = Hash<T> & {
127
- xof(bytes: number): Uint8Array;
128
- xofInto(buf: Uint8Array): Uint8Array;
129
- };
130
- /** Hash function */
131
- export type CHash = ReturnType<typeof createHasher>;
132
- /** Hash function with output */
133
- export type CHashO = ReturnType<typeof createOptHasher>;
134
- /** XOF with output */
135
- export type CHashXO = ReturnType<typeof createXOFer>;
136
- /** Wraps hash function, creating an interface on top of it */
137
- export declare function createHasher<T extends Hash<T>>(hashCons: () => Hash<T>): {
138
- (msg: Input): Uint8Array;
139
- outputLen: number;
140
- blockLen: number;
141
- create(): Hash<T>;
142
- };
143
- export declare function createOptHasher<H extends Hash<H>, T extends Object>(hashCons: (opts?: T) => Hash<H>): {
144
- (msg: Input, opts?: T): Uint8Array;
145
- outputLen: number;
146
- blockLen: number;
147
- create(opts?: T): Hash<H>;
148
- };
149
- export declare function createXOFer<H extends HashXOF<H>, T extends Object>(hashCons: (opts?: T) => HashXOF<H>): {
150
- (msg: Input, opts?: T): Uint8Array;
151
- outputLen: number;
152
- blockLen: number;
153
- create(opts?: T): HashXOF<H>;
154
- };
155
- export declare const wrapConstructor: typeof createHasher;
156
- export declare const wrapConstructorWithOpts: typeof createOptHasher;
157
- export declare const wrapXOFConstructorWithOpts: typeof createXOFer;
158
- /** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */
159
- export declare function randomBytes(bytesLength?: number): Uint8Array;
160
- export {};
161
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@noble/hashes/1.8.0/src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AAUtE,qFAAqF;AACrF,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAEnD;AAED,6CAA6C;AAC7C,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED,uCAAuC;AACvC,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAI5E;AAED,gCAAgC;AAChC,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAKpC;AAED,gEAAgE;AAChE,wBAAgB,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,aAAa,UAAO,GAAG,IAAI,CAGjE;AAED,kDAAkD;AAClD,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI,CAMrD;AAED,uEAAu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,CAOA;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EACjE,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,GAC9B;IACD,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;CAC3B,CAOA;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAChE,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GACjC;IACD,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC9B,CAOA;AACD,eAAO,MAAM,eAAe,EAAE,OAAO,YAA2B,CAAC;AACjE,eAAO,MAAM,uBAAuB,EAAE,OAAO,eAAiC,CAAC;AAC/E,eAAO,MAAM,0BAA0B,EAAE,OAAO,WAAyB,CAAC;AAE1E,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,WAAW,SAAK,GAAG,UAAU,CASxD"}
@@ -1,280 +0,0 @@
1
- /**
2
- * Utilities for hex, bytes, CSPRNG.
3
- * @module
4
- */
5
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
6
- // We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.
7
- // node.js versions earlier than v19 don't declare it in global scope.
8
- // For node.js, package.json#exports field mapping rewrites import
9
- // from `crypto` to `cryptoNode`, which imports native module.
10
- // Makes the utils un-importable in browsers without a bundler.
11
- // Once node.js 18 is deprecated (2025-04-30), we can just drop the import.
12
- import { crypto } from './crypto.js';
13
- /** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */
14
- export function isBytes(a) {
15
- return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');
16
- }
17
- /** Asserts something is positive integer. */
18
- export function anumber(n) {
19
- if (!Number.isSafeInteger(n) || n < 0)
20
- throw new Error('positive integer expected, got ' + n);
21
- }
22
- /** Asserts something is Uint8Array. */
23
- export function abytes(b, ...lengths) {
24
- if (!isBytes(b))
25
- throw new Error('Uint8Array expected');
26
- if (lengths.length > 0 && !lengths.includes(b.length))
27
- throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);
28
- }
29
- /** Asserts something is hash */
30
- export function ahash(h) {
31
- if (typeof h !== 'function' || typeof h.create !== 'function')
32
- throw new Error('Hash should be wrapped by utils.createHasher');
33
- anumber(h.outputLen);
34
- anumber(h.blockLen);
35
- }
36
- /** Asserts a hash instance has not been destroyed / finished */
37
- export function aexists(instance, checkFinished = true) {
38
- if (instance.destroyed)
39
- throw new Error('Hash instance has been destroyed');
40
- if (checkFinished && instance.finished)
41
- throw new Error('Hash#digest() has already been called');
42
- }
43
- /** Asserts output is properly-sized byte array */
44
- export function aoutput(out, instance) {
45
- abytes(out);
46
- const min = instance.outputLen;
47
- if (out.length < min) {
48
- throw new Error('digestInto() expects output buffer of length at least ' + min);
49
- }
50
- }
51
- /** Cast u8 / u16 / u32 to u8. */
52
- export function u8(arr) {
53
- return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
54
- }
55
- /** Cast u8 / u16 / u32 to u32. */
56
- export function u32(arr) {
57
- return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
58
- }
59
- /** Zeroize a byte array. Warning: JS provides no guarantees. */
60
- export function clean(...arrays) {
61
- for (let i = 0; i < arrays.length; i++) {
62
- arrays[i].fill(0);
63
- }
64
- }
65
- /** Create DataView of an array for easy byte-level manipulation. */
66
- export function createView(arr) {
67
- return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
68
- }
69
- /** The rotate right (circular right shift) operation for uint32 */
70
- export function rotr(word, shift) {
71
- return (word << (32 - shift)) | (word >>> shift);
72
- }
73
- /** The rotate left (circular left shift) operation for uint32 */
74
- export function rotl(word, shift) {
75
- return (word << shift) | ((word >>> (32 - shift)) >>> 0);
76
- }
77
- /** Is current platform little-endian? Most are. Big-Endian platform: IBM */
78
- export const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();
79
- /** The byte swap operation for uint32 */
80
- export function byteSwap(word) {
81
- return (((word << 24) & 0xff000000) |
82
- ((word << 8) & 0xff0000) |
83
- ((word >>> 8) & 0xff00) |
84
- ((word >>> 24) & 0xff));
85
- }
86
- /** Conditionally byte swap if on a big-endian platform */
87
- export const swap8IfBE = isLE
88
- ? (n) => n
89
- : (n) => byteSwap(n);
90
- /** @deprecated */
91
- export const byteSwapIfBE = swap8IfBE;
92
- /** In place byte swap for Uint32Array */
93
- export function byteSwap32(arr) {
94
- for (let i = 0; i < arr.length; i++) {
95
- arr[i] = byteSwap(arr[i]);
96
- }
97
- return arr;
98
- }
99
- export const swap32IfBE = isLE
100
- ? (u) => u
101
- : byteSwap32;
102
- // Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex
103
- const hasHexBuiltin = /* @__PURE__ */ (() =>
104
- // @ts-ignore
105
- typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();
106
- // Array where index 0xf0 (240) is mapped to string 'f0'
107
- const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));
108
- /**
109
- * Convert byte array to hex string. Uses built-in function, when available.
110
- * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'
111
- */
112
- export function bytesToHex(bytes) {
113
- abytes(bytes);
114
- // @ts-ignore
115
- if (hasHexBuiltin)
116
- return bytes.toHex();
117
- // pre-caching improves the speed 6x
118
- let hex = '';
119
- for (let i = 0; i < bytes.length; i++) {
120
- hex += hexes[bytes[i]];
121
- }
122
- return hex;
123
- }
124
- // We use optimized technique to convert hex string to byte array
125
- const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
126
- function asciiToBase16(ch) {
127
- if (ch >= asciis._0 && ch <= asciis._9)
128
- return ch - asciis._0; // '2' => 50-48
129
- if (ch >= asciis.A && ch <= asciis.F)
130
- return ch - (asciis.A - 10); // 'B' => 66-(65-10)
131
- if (ch >= asciis.a && ch <= asciis.f)
132
- return ch - (asciis.a - 10); // 'b' => 98-(97-10)
133
- return;
134
- }
135
- /**
136
- * Convert hex string to byte array. Uses built-in function, when available.
137
- * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])
138
- */
139
- export function hexToBytes(hex) {
140
- if (typeof hex !== 'string')
141
- throw new Error('hex string expected, got ' + typeof hex);
142
- // @ts-ignore
143
- if (hasHexBuiltin)
144
- return Uint8Array.fromHex(hex);
145
- const hl = hex.length;
146
- const al = hl / 2;
147
- if (hl % 2)
148
- throw new Error('hex string expected, got unpadded hex of length ' + hl);
149
- const array = new Uint8Array(al);
150
- for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
151
- const n1 = asciiToBase16(hex.charCodeAt(hi));
152
- const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
153
- if (n1 === undefined || n2 === undefined) {
154
- const char = hex[hi] + hex[hi + 1];
155
- throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi);
156
- }
157
- array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163
158
- }
159
- return array;
160
- }
161
- /**
162
- * There is no setImmediate in browser and setTimeout is slow.
163
- * Call of async fn will return Promise, which will be fullfiled only on
164
- * next scheduler queue processing step and this is exactly what we need.
165
- */
166
- export const nextTick = async () => { };
167
- /** Returns control to thread each 'tick' ms to avoid blocking. */
168
- export async function asyncLoop(iters, tick, cb) {
169
- let ts = Date.now();
170
- for (let i = 0; i < iters; i++) {
171
- cb(i);
172
- // Date.now() is not monotonic, so in case if clock goes backwards we return return control too
173
- const diff = Date.now() - ts;
174
- if (diff >= 0 && diff < tick)
175
- continue;
176
- await nextTick();
177
- ts += diff;
178
- }
179
- }
180
- /**
181
- * Converts string to bytes using UTF8 encoding.
182
- * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])
183
- */
184
- export function utf8ToBytes(str) {
185
- if (typeof str !== 'string')
186
- throw new Error('string expected');
187
- return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809
188
- }
189
- /**
190
- * Converts bytes to string using UTF8 encoding.
191
- * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'
192
- */
193
- export function bytesToUtf8(bytes) {
194
- return new TextDecoder().decode(bytes);
195
- }
196
- /**
197
- * Normalizes (non-hex) string or Uint8Array to Uint8Array.
198
- * Warning: when Uint8Array is passed, it would NOT get copied.
199
- * Keep in mind for future mutable operations.
200
- */
201
- export function toBytes(data) {
202
- if (typeof data === 'string')
203
- data = utf8ToBytes(data);
204
- abytes(data);
205
- return data;
206
- }
207
- /**
208
- * Helper for KDFs: consumes uint8array or string.
209
- * When string is passed, does utf8 decoding, using TextDecoder.
210
- */
211
- export function kdfInputToBytes(data) {
212
- if (typeof data === 'string')
213
- data = utf8ToBytes(data);
214
- abytes(data);
215
- return data;
216
- }
217
- /** Copies several Uint8Arrays into one. */
218
- export function concatBytes(...arrays) {
219
- let sum = 0;
220
- for (let i = 0; i < arrays.length; i++) {
221
- const a = arrays[i];
222
- abytes(a);
223
- sum += a.length;
224
- }
225
- const res = new Uint8Array(sum);
226
- for (let i = 0, pad = 0; i < arrays.length; i++) {
227
- const a = arrays[i];
228
- res.set(a, pad);
229
- pad += a.length;
230
- }
231
- return res;
232
- }
233
- export function checkOpts(defaults, opts) {
234
- if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')
235
- throw new Error('options should be object or undefined');
236
- const merged = Object.assign(defaults, opts);
237
- return merged;
238
- }
239
- /** For runtime check if class implements interface */
240
- export class Hash {
241
- }
242
- /** Wraps hash function, creating an interface on top of it */
243
- export function createHasher(hashCons) {
244
- const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
245
- const tmp = hashCons();
246
- hashC.outputLen = tmp.outputLen;
247
- hashC.blockLen = tmp.blockLen;
248
- hashC.create = () => hashCons();
249
- return hashC;
250
- }
251
- export function createOptHasher(hashCons) {
252
- const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
253
- const tmp = hashCons({});
254
- hashC.outputLen = tmp.outputLen;
255
- hashC.blockLen = tmp.blockLen;
256
- hashC.create = (opts) => hashCons(opts);
257
- return hashC;
258
- }
259
- export function createXOFer(hashCons) {
260
- const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
261
- const tmp = hashCons({});
262
- hashC.outputLen = tmp.outputLen;
263
- hashC.blockLen = tmp.blockLen;
264
- hashC.create = (opts) => hashCons(opts);
265
- return hashC;
266
- }
267
- export const wrapConstructor = createHasher;
268
- export const wrapConstructorWithOpts = createOptHasher;
269
- export const wrapXOFConstructorWithOpts = createXOFer;
270
- /** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */
271
- export function randomBytes(bytesLength = 32) {
272
- if (crypto && typeof crypto.getRandomValues === 'function') {
273
- return crypto.getRandomValues(new Uint8Array(bytesLength));
274
- }
275
- // Legacy Node.js compatibility
276
- if (crypto && typeof crypto.randomBytes === 'function') {
277
- return Uint8Array.from(crypto.randomBytes(bytesLength));
278
- }
279
- throw new Error('crypto.getRandomValues must be defined');
280
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"_websocket_request_dispatcher.d.ts","sourceRoot":"","sources":["../../../../src/src/transports/websocket/_websocket_request_dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAY7E;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,cAAc;gBACzC,OAAO,EAAE,MAAM;CAI9B;AAED;;;GAGG;AACH,qBAAa,0BAA0B;IAkBvB,OAAO,CAAC,MAAM;IAjB1B,gCAAgC;IAChC,OAAO,CAAC,MAAM,CAAa;IAE3B,oDAAoD;IACpD,OAAO,CAAC,OAAO,CAMD;IAEd;;;;OAIG;gBACiB,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,sBAAsB;IAwDvE;;;;;;OAMG;IACG,OAAO,CACT,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,EAC5C,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,GACrB,OAAO,CAAC,OAAO,CAAC;IAoCnB;;;;OAIG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;CAK7C"}
@@ -1,55 +0,0 @@
1
- declare function fromBig(n: bigint, le?: boolean): {
2
- h: number;
3
- l: number;
4
- };
5
- declare function split(lst: bigint[], le?: boolean): Uint32Array[];
6
- declare const toBig: (h: number, l: number) => bigint;
7
- declare const shrSH: (h: number, _l: number, s: number) => number;
8
- declare const shrSL: (h: number, l: number, s: number) => number;
9
- declare const rotrSH: (h: number, l: number, s: number) => number;
10
- declare const rotrSL: (h: number, l: number, s: number) => number;
11
- declare const rotrBH: (h: number, l: number, s: number) => number;
12
- declare const rotrBL: (h: number, l: number, s: number) => number;
13
- declare const rotr32H: (_h: number, l: number) => number;
14
- declare const rotr32L: (h: number, _l: number) => number;
15
- declare const rotlSH: (h: number, l: number, s: number) => number;
16
- declare const rotlSL: (h: number, l: number, s: number) => number;
17
- declare const rotlBH: (h: number, l: number, s: number) => number;
18
- declare const rotlBL: (h: number, l: number, s: number) => number;
19
- declare function add(Ah: number, Al: number, Bh: number, Bl: number): {
20
- h: number;
21
- l: number;
22
- };
23
- declare const add3L: (Al: number, Bl: number, Cl: number) => number;
24
- declare const add3H: (low: number, Ah: number, Bh: number, Ch: number) => number;
25
- declare const add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number;
26
- declare const add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number;
27
- declare const add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number;
28
- declare const add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number;
29
- export { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig };
30
- declare const u64: {
31
- fromBig: typeof fromBig;
32
- split: typeof split;
33
- toBig: (h: number, l: number) => bigint;
34
- shrSH: (h: number, _l: number, s: number) => number;
35
- shrSL: (h: number, l: number, s: number) => number;
36
- rotrSH: (h: number, l: number, s: number) => number;
37
- rotrSL: (h: number, l: number, s: number) => number;
38
- rotrBH: (h: number, l: number, s: number) => number;
39
- rotrBL: (h: number, l: number, s: number) => number;
40
- rotr32H: (_h: number, l: number) => number;
41
- rotr32L: (h: number, _l: number) => number;
42
- rotlSH: (h: number, l: number, s: number) => number;
43
- rotlSL: (h: number, l: number, s: number) => number;
44
- rotlBH: (h: number, l: number, s: number) => number;
45
- rotlBL: (h: number, l: number, s: number) => number;
46
- add: typeof add;
47
- add3L: (Al: number, Bl: number, Cl: number) => number;
48
- add3H: (low: number, Ah: number, Bh: number, Ch: number) => number;
49
- add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number;
50
- add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number;
51
- add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number;
52
- add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number;
53
- };
54
- export default u64;
55
- //# sourceMappingURL=_u64.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_u64.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@noble/hashes/1.8.0/src/_u64.ts"],"names":[],"mappings":"AAQA,iBAAS,OAAO,CACd,CAAC,EAAE,MAAM,EACT,EAAE,UAAQ,GACT;IACD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAGA;AAED,iBAAS,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,UAAQ,GAAG,WAAW,EAAE,CASvD;AAED,QAAA,MAAM,KAAK,MAAO,MAAM,KAAK,MAAM,KAAG,MAAqD,CAAC;AAE5F,QAAA,MAAM,KAAK,MAAO,MAAM,MAAM,MAAM,KAAK,MAAM,KAAG,MAAiB,CAAC;AACpE,QAAA,MAAM,KAAK,MAAO,MAAM,KAAK,MAAM,KAAK,MAAM,KAAG,MAAqC,CAAC;AAEvF,QAAA,MAAM,MAAM,MAAO,MAAM,KAAK,MAAM,KAAK,MAAM,KAAG,MAAqC,CAAC;AACxF,QAAA,MAAM,MAAM,MAAO,MAAM,KAAK,MAAM,KAAK,MAAM,KAAG,MAAqC,CAAC;AAExF,QAAA,MAAM,MAAM,MAAO,MAAM,KAAK,MAAM,KAAK,MAAM,KAAG,MAA4C,CAAC;AAC/F,QAAA,MAAM,MAAM,MAAO,MAAM,KAAK,MAAM,KAAK,MAAM,KAAG,MAA4C,CAAC;AAE/F,QAAA,MAAM,OAAO,OAAQ,MAAM,KAAK,MAAM,KAAG,MAAW,CAAC;AACrD,QAAA,MAAM,OAAO,MAAO,MAAM,MAAM,MAAM,KAAG,MAAW,CAAC;AAErD,QAAA,MAAM,MAAM,MAAO,MAAM,KAAK,MAAM,KAAK,MAAM,KAAG,MAAqC,CAAC;AACxF,QAAA,MAAM,MAAM,MAAO,MAAM,KAA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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.toBig = exports.shrSL = exports.shrSH = exports.rotrSL = exports.rotrSH = exports.rotrBL = exports.rotrBH = exports.rotr32L = exports.rotr32H = exports.rotlSL = exports.rotlSH = exports.rotlBL = exports.rotlBH = exports.add5L = exports.add5H = exports.add4L = exports.add4H = exports.add3L = exports.add3H = void 0;
13
- exports.add = add;
14
- exports.fromBig = fromBig;
15
- exports.split = split;
16
- /**
17
- * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.
18
- * @todo re-check https://issues.chromium.org/issues/42212588
19
- * @module
20
- */
21
- const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
22
- const _32n = /* @__PURE__ */ BigInt(32);
23
- function fromBig(n, le = false) {
24
- if (le)
25
- return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };
26
- return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
27
- }
28
- function split(lst, le = false) {
29
- const len = lst.length;
30
- let Ah = new Uint32Array(len);
31
- let Al = new Uint32Array(len);
32
- for (let i = 0; i < len; i++) {
33
- const { h, l } = fromBig(lst[i], le);
34
- [Ah[i], Al[i]] = [h, l];
35
- }
36
- return [Ah, Al];
37
- }
38
- const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);
39
- exports.toBig = toBig;
40
- // for Shift in [0, 32)
41
- const shrSH = (h, _l, s) => h >>> s;
42
- exports.shrSH = shrSH;
43
- const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);
44
- exports.shrSL = shrSL;
45
- // Right rotate for Shift in [1, 32)
46
- const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));
47
- exports.rotrSH = rotrSH;
48
- const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);
49
- exports.rotrSL = rotrSL;
50
- // Right rotate for Shift in (32, 64), NOTE: 32 is special case.
51
- const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));
52
- exports.rotrBH = rotrBH;
53
- const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));
54
- exports.rotrBL = rotrBL;
55
- // Right rotate for shift===32 (just swaps l&h)
56
- const rotr32H = (_h, l) => l;
57
- exports.rotr32H = rotr32H;
58
- const rotr32L = (h, _l) => h;
59
- exports.rotr32L = rotr32L;
60
- // Left rotate for Shift in [1, 32)
61
- const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));
62
- exports.rotlSH = rotlSH;
63
- const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));
64
- exports.rotlSL = rotlSL;
65
- // Left rotate for Shift in (32, 64), NOTE: 32 is special case.
66
- const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));
67
- exports.rotlBH = rotlBH;
68
- const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));
69
- exports.rotlBL = rotlBL;
70
- // JS uses 32-bit signed integers for bitwise operations which means we cannot
71
- // simple take carry out of low bit sum by shift, we need to use division.
72
- function add(Ah, Al, Bh, Bl) {
73
- const l = (Al >>> 0) + (Bl >>> 0);
74
- return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };
75
- }
76
- // Addition with more than 2 elements
77
- const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
78
- exports.add3L = add3L;
79
- const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;
80
- exports.add3H = add3H;
81
- const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
82
- exports.add4L = add4L;
83
- const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;
84
- exports.add4H = add4H;
85
- const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
86
- exports.add5L = add5L;
87
- const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;
88
- exports.add5H = add5H;
89
- // prettier-ignore
90
- const u64 = {
91
- fromBig, split, toBig,
92
- shrSH, shrSL,
93
- rotrSH, rotrSL, rotrBH, rotrBL,
94
- rotr32H, rotr32L,
95
- rotlSH, rotlSL, rotlBH, rotlBL,
96
- add, add3L, add3H, add4L, add4H, add5H, add5L,
97
- };
98
- exports.default = u64;
99
- });
@@ -1,2 +0,0 @@
1
- export declare const crypto: any;
2
- //# sourceMappingURL=crypto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@noble/hashes/1.8.0/src/crypto.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM,EAAE,GACqE,CAAC"}