@hyperix/hooks 0.1.6 → 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.
@@ -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,35 +1,4 @@
1
- import { UseSubscribeState } from '@outofgas/react-stream';
2
- import { TradesEvent } from '@nktkas/hyperliquid/api/subscription';
3
-
4
- type L2BookLevel = [price: number, size: number, cumulativeSize: number];
5
- type L2Book = {
6
- bids: L2BookLevel[];
7
- asks: L2BookLevel[];
8
- maxCumulativeSize: number;
9
- levels: {
10
- nSigFigs: number;
11
- tick: string;
12
- }[];
13
- spread: number;
14
- spreadPercent: number;
15
- };
16
- type UseL2BookOptions = {
17
- depth?: number;
18
- nSigFigs?: number;
19
- };
20
- declare const EMPTY_L2_BOOK: L2Book;
21
- declare function calcOrderbookLevels(price: number): {
22
- nSigFigs: number;
23
- tick: string;
24
- }[];
25
- declare const useL2Book: (coin: string, options?: UseL2BookOptions) => UseSubscribeState<L2Book>;
26
-
27
- type Trade = TradesEvent[number];
28
- type UseTradesOptions = {
29
- limit?: number;
30
- enabled?: boolean;
31
- };
32
- declare const EMPTY_TRADES: Trade[];
33
- declare function useTrades(coin: string, options?: UseTradesOptions): UseSubscribeState<Trade[]>;
34
-
35
- export { EMPTY_L2_BOOK, EMPTY_TRADES, type L2Book, type L2BookLevel, type Trade, type UseL2BookOptions, type UseTradesOptions, calcOrderbookLevels, useL2Book, useTrades };
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";