@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 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
+ }>;
@@ -0,0 +1,4 @@
1
+ import { HttpTransport, SubscriptionClient, WebSocketTransport } from "@nktkas/hyperliquid";
2
+ export const transport = new HttpTransport();
3
+ export const wsTransport = new WebSocketTransport();
4
+ export const wsClient = new SubscriptionClient({ transport: wsTransport });
package/dist/index.d.ts CHANGED
@@ -1,28 +1,4 @@
1
- import { UseSubscribeState } from '@outofgas/react-stream';
2
-
3
- declare function useDebouncedValue<T>(value: T, delayMs?: number): T;
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";