@hyperix/hooks 0.1.5 → 0.1.7
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.
- package/README.md +0 -14
- package/dist/config/hl.d.ts +6 -0
- package/dist/config/hl.js +4 -0
- package/dist/index.d.ts +4 -28
- package/dist/index.js +4 -2285
- package/dist/lib/symbol-converter.d.ts +96 -0
- package/dist/lib/symbol-converter.js +190 -0
- package/dist/use-l2-book.d.ts +23 -0
- package/dist/use-l2-book.js +69 -0
- package/dist/use-symbol-converter.d.ts +3 -0
- package/dist/use-symbol-converter.js +19 -0
- package/dist/use-trade-history.d.ts +20 -0
- package/dist/use-trade-history.js +54 -0
- package/dist/use-trades.d.ts +9 -0
- package/dist/use-trades.js +26 -0
- package/dist/use-user-fills.d.ts +13 -0
- package/dist/use-user-fills.js +40 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -6,20 +6,6 @@ React hooks for the local workspace.
|
|
|
6
6
|
|
|
7
7
|
This package is intended for source-first usage inside the monorepo. Consumers should reference it with `"workspace:*"` and let the app bundler resolve the TypeScript source.
|
|
8
8
|
|
|
9
|
-
## Example
|
|
10
|
-
|
|
11
|
-
```tsx
|
|
12
|
-
import { useState } from "react";
|
|
13
|
-
import { useDebouncedValue } from "@bunstack/hooks";
|
|
14
|
-
|
|
15
|
-
function Search() {
|
|
16
|
-
const [query, setQuery] = useState("");
|
|
17
|
-
const debouncedQuery = useDebouncedValue(query, 300);
|
|
18
|
-
|
|
19
|
-
return <input value={query} onChange={(e) => setQuery(e.target.value)} />;
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
9
|
## Tests
|
|
24
10
|
|
|
25
11
|
```bash
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HttpTransport, SubscriptionClient, WebSocketTransport } from "@nktkas/hyperliquid";
|
|
2
|
+
export declare const transport: HttpTransport;
|
|
3
|
+
export declare const wsTransport: WebSocketTransport;
|
|
4
|
+
export declare const wsClient: SubscriptionClient<{
|
|
5
|
+
transport: WebSocketTransport;
|
|
6
|
+
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type L2BookLevel = [price: number, size: number, cumulativeSize: number];
|
|
6
|
-
type L2Book = {
|
|
7
|
-
bids: L2BookLevel[];
|
|
8
|
-
asks: L2BookLevel[];
|
|
9
|
-
maxCumulativeSize: number;
|
|
10
|
-
levels: {
|
|
11
|
-
nSigFigs: number;
|
|
12
|
-
tick: string;
|
|
13
|
-
}[];
|
|
14
|
-
spread: number;
|
|
15
|
-
spreadPercent: number;
|
|
16
|
-
};
|
|
17
|
-
type UseL2BookOptions = {
|
|
18
|
-
depth?: number;
|
|
19
|
-
nSigFigs?: number;
|
|
20
|
-
};
|
|
21
|
-
declare const EMPTY_L2_BOOK: L2Book;
|
|
22
|
-
declare function calcOrderbookLevels(price: number): {
|
|
23
|
-
nSigFigs: number;
|
|
24
|
-
tick: string;
|
|
25
|
-
}[];
|
|
26
|
-
declare const useL2Book: (coin: string, options?: UseL2BookOptions) => UseSubscribeState<L2Book>;
|
|
27
|
-
|
|
28
|
-
export { EMPTY_L2_BOOK, type L2Book, type L2BookLevel, type UseL2BookOptions, calcOrderbookLevels, useDebouncedValue, useL2Book };
|
|
1
|
+
export * from "./use-l2-book.js";
|
|
2
|
+
export * from "./use-trade-history.js";
|
|
3
|
+
export * from "./use-trades.js";
|
|
4
|
+
export * from "./use-user-fills.js";
|