@orderly.network/hooks 0.0.38 → 0.0.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orderly.network/hooks",
3
- "version": "0.0.38",
3
+ "version": "0.0.39",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -21,7 +21,7 @@
21
21
  "rxjs": "^7.8.1",
22
22
  "tsup": "^7.1.0",
23
23
  "typescript": "^5.1.6",
24
- "tsconfig": "0.0.35"
24
+ "tsconfig": "0.0.36"
25
25
  },
26
26
  "dependencies": {
27
27
  "ramda": "^0.29.0",
@@ -29,11 +29,11 @@
29
29
  "swr": "^2.2.0",
30
30
  "use-constant": "^1.1.1",
31
31
  "use-debounce": "^9.0.4",
32
- "@orderly.network/core": "0.0.37",
33
- "@orderly.network/futures": "0.0.38",
34
- "@orderly.network/net": "1.0.35",
35
- "@orderly.network/utils": "0.0.31",
36
- "@orderly.network/types": "0.0.37"
32
+ "@orderly.network/core": "0.0.38",
33
+ "@orderly.network/futures": "0.0.39",
34
+ "@orderly.network/net": "1.0.36",
35
+ "@orderly.network/utils": "0.0.32",
36
+ "@orderly.network/types": "0.0.38"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "rxjs": "^7.8.1"
package/dist/index.d.mts DELETED
@@ -1,332 +0,0 @@
1
- import useSWR, { SWRConfiguration, SWRResponse } from 'swr';
2
- export { SWRConfig, SWRConfiguration, default as useSWR } from 'swr';
3
- import { SWRMutationConfiguration } from 'swr/mutation';
4
- import { Account, AccountState, ConfigStore, OrderlyKeyStore, WalletAdapter, IContract, EventEmitter } from '@orderly.network/core';
5
- import * as react from 'react';
6
- import react__default, { FC, PropsWithChildren } from 'react';
7
- export { default as useConstant } from 'use-constant';
8
- import { WS } from '@orderly.network/net';
9
- import { OrderSide, OrderEntity, API, WSMessage } from '@orderly.network/types';
10
- import * as swr__internal from 'swr/_internal';
11
- import * as swr_subscription from 'swr/subscription';
12
-
13
- type useQueryOptions<T> = SWRConfiguration & {
14
- formatter?: (data: any) => T;
15
- };
16
-
17
- /**
18
- * useQuery
19
- * @description for public api
20
- * @param query
21
- * @param options
22
- */
23
- declare const useQuery: <T>(query: Parameters<typeof useSWR>["0"], options?: useQueryOptions<T> | undefined) => SWRResponse<T, any, any>;
24
-
25
- type HTTP_METHOD = "POST" | "PUT" | "DELETE";
26
- declare const useMutation: <T, E>(url: string, method?: HTTP_METHOD, options?: SWRMutationConfiguration<T, E> | undefined) => [any, any];
27
-
28
- /**
29
- * usePrivateQuery
30
- * @description for private api
31
- * @param query
32
- * @param options
33
- */
34
- declare const usePrivateQuery: <T>(query: string, options?: useQueryOptions<T> | undefined) => SWRResponse<T, any, any>;
35
-
36
- declare const useTradingView: () => {};
37
-
38
- declare const usePrivateObserve: <T>() => {
39
- data: T | undefined;
40
- };
41
-
42
- declare const useTopicObserve: <T>(topic: string) => {
43
- data: T | undefined;
44
- };
45
-
46
- declare const useAccount: () => {
47
- account: Account;
48
- state: AccountState;
49
- login: (address: string) => void;
50
- createOrderlyKey: (remember: boolean) => Promise<string>;
51
- createAccount: () => Promise<string>;
52
- disconnect: () => Promise<void>;
53
- connect: () => Promise<any>;
54
- setChain: (chainId: number) => Promise<any>;
55
- };
56
-
57
- declare const useAccountInstance: () => Account;
58
-
59
- interface OrderlyAppConfig {
60
- logoUrl: string;
61
- theme: any;
62
- }
63
- type AppStateErrors = {
64
- ChainNetworkNotSupport: boolean;
65
- IpNotSupport: boolean;
66
- NetworkError: boolean;
67
- };
68
- interface OrderlyContextState extends OrderlyAppConfig {
69
- fetcher?: (url: string, init: RequestInit) => Promise<any>;
70
- apiBaseUrl: string;
71
- klineDataUrl: string;
72
- configStore: ConfigStore;
73
- keyStore: OrderlyKeyStore;
74
- walletAdapter: {
75
- new (options: any): WalletAdapter;
76
- };
77
- contractManager: IContract;
78
- networkId: string;
79
- onWalletConnect?: () => Promise<any>;
80
- onWalletDisconnect?: () => Promise<any>;
81
- onSetChain?: (chainId: number) => Promise<any>;
82
- ready: boolean;
83
- onAppTestChange?: (name: string) => void;
84
- errors: AppStateErrors;
85
- }
86
- declare const OrderlyContext: react.Context<OrderlyContextState>;
87
- declare const OrderlyProvider: react.Provider<OrderlyContextState>;
88
-
89
- declare const useAppState: () => {
90
- errors: AppStateErrors;
91
- ready: boolean;
92
- };
93
-
94
- declare const usePreLoadData: (onSuccess: (name: string) => void) => void;
95
-
96
- declare const useEventEmitter: (channel?: string) => EventEmitter<string | symbol, any>;
97
-
98
- declare function useSessionStorage<T>(key: string, initialValue: T): [T, (data: any) => void];
99
-
100
- declare function useLocalStorage<T>(key: string, initialValue: T): [T, any];
101
-
102
- type useRunOnceProps = {
103
- fn: () => any;
104
- sessionKey?: string;
105
- };
106
- declare const useRunOnce: react__default.FC<useRunOnceProps>;
107
-
108
- declare const DataSourceProvider: FC<PropsWithChildren>;
109
-
110
- declare const useWS: () => WS;
111
-
112
- type OrderBookItem = number[];
113
- type OrderbookData = {
114
- asks: OrderBookItem[];
115
- bids: OrderBookItem[];
116
- };
117
- type OrderbookOptions = {
118
- level?: number;
119
- };
120
- /**
121
- * @name useOrderbookStream
122
- * @description React hook that returns the current orderbook for a given market
123
- */
124
- declare const useOrderbookStream: (symbol: string, initial?: OrderbookData, options?: OrderbookOptions) => ({
125
- markPrice: any;
126
- middlePrice: any;
127
- asks: OrderBookItem[];
128
- bids: OrderBookItem[];
129
- onDepthChange?: undefined;
130
- depth?: undefined;
131
- allDepths?: undefined;
132
- isLoading?: undefined;
133
- onItemClick?: undefined;
134
- } | {
135
- onDepthChange: (depth: number) => void;
136
- depth: number | undefined;
137
- allDepths: any[];
138
- isLoading: boolean;
139
- onItemClick: (item: OrderBookItem) => void;
140
- })[];
141
-
142
- interface OrderEntryReturn {
143
- onSubmit: (values: OrderEntity) => Promise<any>;
144
- maxQty: number;
145
- freeCollateral: number;
146
- markPrice: number;
147
- symbolConfig: API.SymbolExt;
148
- helper: {
149
- calculate: (values: any, field: string, value: any) => any;
150
- validator: (values: any) => any;
151
- };
152
- }
153
- type UseOrderEntryOptions = {
154
- commify?: boolean;
155
- validate?: (data: OrderEntity) => {
156
- [P in keyof OrderEntity]?: string;
157
- } | null | undefined;
158
- };
159
- /**
160
- * 创建订单
161
- * @param symbol
162
- * @returns
163
- */
164
- declare const useOrderEntry: (symbol: string, side: OrderSide, reduceOnly?: boolean, options?: UseOrderEntryOptions) => OrderEntryReturn;
165
-
166
- interface MarketInfo {
167
- }
168
- declare const useFetures: () => {
169
- data: MarketInfo[] | undefined;
170
- sortBy: (key: string) => void;
171
- filterBy: (key: string) => void;
172
- isLoading: boolean;
173
- error: any;
174
- };
175
-
176
- declare const useSymbolsInfo: () => any;
177
-
178
- declare const useAccountInfo: () => swr__internal.SWRResponse<API.AccountInfo, any, any>;
179
-
180
- declare const useTokenInfo: () => any;
181
-
182
- declare const useMarketsStream: () => {
183
- data: WSMessage.Ticker[] | null;
184
- };
185
-
186
- declare const useMarkPricesStream: () => swr_subscription.SWRSubscriptionResponse<any, any>;
187
-
188
- declare const useMarkPrice: (symbol: string) => swr_subscription.SWRSubscriptionResponse<any, any>;
189
-
190
- declare const useLeverage: () => ({
191
- update: (data: any) => any;
192
- } | undefined)[];
193
-
194
- declare const useTickerStream: (symbol: string) => any;
195
-
196
- declare const useFundingRate: (symbol: string) => {
197
- est_funding_rate: string;
198
- countDown: string;
199
- symbol?: string | undefined;
200
- est_funding_rate_timestamp?: number | undefined;
201
- last_funding_rate?: number | undefined;
202
- last_funding_rate_timestamp?: number | undefined;
203
- next_funding_time?: number | undefined;
204
- sum_unitary_funding?: number | undefined;
205
- };
206
-
207
- declare const usePositionStream: (symbol?: string, options?: SWRConfiguration) => any[];
208
-
209
- declare enum OrderStatus {
210
- FILLED = "FILLED",
211
- PARTIAL_FILLED = "PARTIAL_FILLED",
212
- CANCELED = "CANCELED",
213
- NEW = "NEW",
214
- COMPLETED = "COMPLETED"
215
- }
216
- declare const useOrderStream: ({ status, symbol, side, size, }?: {
217
- symbol?: string | undefined;
218
- status?: OrderStatus | undefined;
219
- size?: number | undefined;
220
- side?: OrderSide | undefined;
221
- }) => (any[] | {
222
- cancelAllOrders: () => void;
223
- updateOrder: (orderId: string, order: OrderEntity) => any;
224
- cancelOrder: (orderId: string, symbol?: string) => any;
225
- } | null)[];
226
-
227
- interface MarketTradeStreamOptions {
228
- limit?: number;
229
- }
230
- declare const useMarketTradeStream: (symbol: string, options?: MarketTradeStreamOptions) => {
231
- data: API.Trade[];
232
- isLoading: boolean;
233
- };
234
-
235
- type CollateralOutputs = {
236
- totalCollateral: number;
237
- freeCollateral: number;
238
- totalValue: number;
239
- availableBalance: number;
240
- };
241
- /**
242
- * 用户保证金
243
- * @returns
244
- */
245
- type Options = {
246
- dp: number;
247
- };
248
- declare const useCollateral: (options?: Options) => CollateralOutputs;
249
-
250
- declare const useMaxQty: (symbol: string, side: OrderSide, reduceOnly?: boolean) => number;
251
-
252
- declare const useMarginRatio: () => {
253
- marginRatio: number;
254
- currentLeverage: number;
255
- };
256
-
257
- type inputOptions = {
258
- filter?: (item: API.Chain) => boolean;
259
- pick?: "dexs" | "network_infos" | "token_infos";
260
- };
261
- declare const useChains: (networkId?: "testnet" | "mainnet", options?: inputOptions & SWRConfiguration) => any[];
262
-
263
- declare const useHolding: () => {
264
- data: API.Holding[] | undefined;
265
- usdc: API.Holding | undefined;
266
- isLoading: boolean;
267
- };
268
-
269
- declare const useBalance: () => any;
270
-
271
- declare const usePrivateDataObserver: () => void;
272
-
273
- declare const useExecutionReport: () => any;
274
-
275
- interface Info {
276
- symbol: string;
277
- quote_min: number;
278
- quote_max: number;
279
- quote_tick: number;
280
- base_min: number;
281
- base_max: number;
282
- base_tick: number;
283
- min_notional: number;
284
- price_range: number;
285
- created_time: number;
286
- updated_time: number;
287
- }
288
- /**
289
- * useInfo
290
- * @returns
291
- */
292
- declare const useInfo: () => swr__internal.SWRResponse<Info[], any, any>;
293
-
294
- interface Token {
295
- token: string;
296
- token_account_id: string;
297
- decimals: number;
298
- minimum_increment: number;
299
- }
300
- /**
301
- * useToken
302
- * @description get token info
303
- */
304
- declare const useToken: () => swr__internal.SWRResponse<Token[], any, any>;
305
-
306
- interface FundingRate {
307
- symbol: string;
308
- est_funding_rate: number;
309
- est_funding_rate_timestamp: number;
310
- last_funding_rate: number;
311
- last_funding_rate_timestamp: number;
312
- next_funding_time: number;
313
- sum_unitary_funding: number;
314
- }
315
- /**
316
- * FundingRate
317
- * @param symbol
318
- */
319
- declare const useFundingRateBySymbol: (symbol: string) => swr__internal.SWRResponse<FundingRate, any, any>;
320
-
321
- declare const index_useFundingRateBySymbol: typeof useFundingRateBySymbol;
322
- declare const index_useInfo: typeof useInfo;
323
- declare const index_useToken: typeof useToken;
324
- declare namespace index {
325
- export {
326
- index_useFundingRateBySymbol as useFundingRateBySymbol,
327
- index_useInfo as useInfo,
328
- index_useToken as useToken,
329
- };
330
- }
331
-
332
- export { AppStateErrors, DataSourceProvider, OrderStatus, OrderlyAppConfig, OrderlyContext, OrderlyContextState, OrderlyProvider, index as apis, useAccount, useAccountInfo, useAccountInstance, useAppState, useBalance, useChains, useCollateral, useEventEmitter, useExecutionReport, useFetures, useFundingRate, useHolding, useLeverage, useLocalStorage, useMarginRatio, useMarkPrice, useMarkPricesStream, useMarketTradeStream, useMarketsStream, useMaxQty, useMutation, useOrderEntry, useOrderStream, useOrderbookStream, usePositionStream, usePreLoadData, usePrivateDataObserver, usePrivateObserve, usePrivateQuery, useQuery, useRunOnce, useSessionStorage, useSymbolsInfo, useTickerStream, useTokenInfo, useTopicObserve, useTradingView, useWS };
package/dist/index.d.ts DELETED
@@ -1,332 +0,0 @@
1
- import useSWR, { SWRConfiguration, SWRResponse } from 'swr';
2
- export { SWRConfig, SWRConfiguration, default as useSWR } from 'swr';
3
- import { SWRMutationConfiguration } from 'swr/mutation';
4
- import { Account, AccountState, ConfigStore, OrderlyKeyStore, WalletAdapter, IContract, EventEmitter } from '@orderly.network/core';
5
- import * as react from 'react';
6
- import react__default, { FC, PropsWithChildren } from 'react';
7
- export { default as useConstant } from 'use-constant';
8
- import { WS } from '@orderly.network/net';
9
- import { OrderSide, OrderEntity, API, WSMessage } from '@orderly.network/types';
10
- import * as swr__internal from 'swr/_internal';
11
- import * as swr_subscription from 'swr/subscription';
12
-
13
- type useQueryOptions<T> = SWRConfiguration & {
14
- formatter?: (data: any) => T;
15
- };
16
-
17
- /**
18
- * useQuery
19
- * @description for public api
20
- * @param query
21
- * @param options
22
- */
23
- declare const useQuery: <T>(query: Parameters<typeof useSWR>["0"], options?: useQueryOptions<T> | undefined) => SWRResponse<T, any, any>;
24
-
25
- type HTTP_METHOD = "POST" | "PUT" | "DELETE";
26
- declare const useMutation: <T, E>(url: string, method?: HTTP_METHOD, options?: SWRMutationConfiguration<T, E> | undefined) => [any, any];
27
-
28
- /**
29
- * usePrivateQuery
30
- * @description for private api
31
- * @param query
32
- * @param options
33
- */
34
- declare const usePrivateQuery: <T>(query: string, options?: useQueryOptions<T> | undefined) => SWRResponse<T, any, any>;
35
-
36
- declare const useTradingView: () => {};
37
-
38
- declare const usePrivateObserve: <T>() => {
39
- data: T | undefined;
40
- };
41
-
42
- declare const useTopicObserve: <T>(topic: string) => {
43
- data: T | undefined;
44
- };
45
-
46
- declare const useAccount: () => {
47
- account: Account;
48
- state: AccountState;
49
- login: (address: string) => void;
50
- createOrderlyKey: (remember: boolean) => Promise<string>;
51
- createAccount: () => Promise<string>;
52
- disconnect: () => Promise<void>;
53
- connect: () => Promise<any>;
54
- setChain: (chainId: number) => Promise<any>;
55
- };
56
-
57
- declare const useAccountInstance: () => Account;
58
-
59
- interface OrderlyAppConfig {
60
- logoUrl: string;
61
- theme: any;
62
- }
63
- type AppStateErrors = {
64
- ChainNetworkNotSupport: boolean;
65
- IpNotSupport: boolean;
66
- NetworkError: boolean;
67
- };
68
- interface OrderlyContextState extends OrderlyAppConfig {
69
- fetcher?: (url: string, init: RequestInit) => Promise<any>;
70
- apiBaseUrl: string;
71
- klineDataUrl: string;
72
- configStore: ConfigStore;
73
- keyStore: OrderlyKeyStore;
74
- walletAdapter: {
75
- new (options: any): WalletAdapter;
76
- };
77
- contractManager: IContract;
78
- networkId: string;
79
- onWalletConnect?: () => Promise<any>;
80
- onWalletDisconnect?: () => Promise<any>;
81
- onSetChain?: (chainId: number) => Promise<any>;
82
- ready: boolean;
83
- onAppTestChange?: (name: string) => void;
84
- errors: AppStateErrors;
85
- }
86
- declare const OrderlyContext: react.Context<OrderlyContextState>;
87
- declare const OrderlyProvider: react.Provider<OrderlyContextState>;
88
-
89
- declare const useAppState: () => {
90
- errors: AppStateErrors;
91
- ready: boolean;
92
- };
93
-
94
- declare const usePreLoadData: (onSuccess: (name: string) => void) => void;
95
-
96
- declare const useEventEmitter: (channel?: string) => EventEmitter<string | symbol, any>;
97
-
98
- declare function useSessionStorage<T>(key: string, initialValue: T): [T, (data: any) => void];
99
-
100
- declare function useLocalStorage<T>(key: string, initialValue: T): [T, any];
101
-
102
- type useRunOnceProps = {
103
- fn: () => any;
104
- sessionKey?: string;
105
- };
106
- declare const useRunOnce: react__default.FC<useRunOnceProps>;
107
-
108
- declare const DataSourceProvider: FC<PropsWithChildren>;
109
-
110
- declare const useWS: () => WS;
111
-
112
- type OrderBookItem = number[];
113
- type OrderbookData = {
114
- asks: OrderBookItem[];
115
- bids: OrderBookItem[];
116
- };
117
- type OrderbookOptions = {
118
- level?: number;
119
- };
120
- /**
121
- * @name useOrderbookStream
122
- * @description React hook that returns the current orderbook for a given market
123
- */
124
- declare const useOrderbookStream: (symbol: string, initial?: OrderbookData, options?: OrderbookOptions) => ({
125
- markPrice: any;
126
- middlePrice: any;
127
- asks: OrderBookItem[];
128
- bids: OrderBookItem[];
129
- onDepthChange?: undefined;
130
- depth?: undefined;
131
- allDepths?: undefined;
132
- isLoading?: undefined;
133
- onItemClick?: undefined;
134
- } | {
135
- onDepthChange: (depth: number) => void;
136
- depth: number | undefined;
137
- allDepths: any[];
138
- isLoading: boolean;
139
- onItemClick: (item: OrderBookItem) => void;
140
- })[];
141
-
142
- interface OrderEntryReturn {
143
- onSubmit: (values: OrderEntity) => Promise<any>;
144
- maxQty: number;
145
- freeCollateral: number;
146
- markPrice: number;
147
- symbolConfig: API.SymbolExt;
148
- helper: {
149
- calculate: (values: any, field: string, value: any) => any;
150
- validator: (values: any) => any;
151
- };
152
- }
153
- type UseOrderEntryOptions = {
154
- commify?: boolean;
155
- validate?: (data: OrderEntity) => {
156
- [P in keyof OrderEntity]?: string;
157
- } | null | undefined;
158
- };
159
- /**
160
- * 创建订单
161
- * @param symbol
162
- * @returns
163
- */
164
- declare const useOrderEntry: (symbol: string, side: OrderSide, reduceOnly?: boolean, options?: UseOrderEntryOptions) => OrderEntryReturn;
165
-
166
- interface MarketInfo {
167
- }
168
- declare const useFetures: () => {
169
- data: MarketInfo[] | undefined;
170
- sortBy: (key: string) => void;
171
- filterBy: (key: string) => void;
172
- isLoading: boolean;
173
- error: any;
174
- };
175
-
176
- declare const useSymbolsInfo: () => any;
177
-
178
- declare const useAccountInfo: () => swr__internal.SWRResponse<API.AccountInfo, any, any>;
179
-
180
- declare const useTokenInfo: () => any;
181
-
182
- declare const useMarketsStream: () => {
183
- data: WSMessage.Ticker[] | null;
184
- };
185
-
186
- declare const useMarkPricesStream: () => swr_subscription.SWRSubscriptionResponse<any, any>;
187
-
188
- declare const useMarkPrice: (symbol: string) => swr_subscription.SWRSubscriptionResponse<any, any>;
189
-
190
- declare const useLeverage: () => ({
191
- update: (data: any) => any;
192
- } | undefined)[];
193
-
194
- declare const useTickerStream: (symbol: string) => any;
195
-
196
- declare const useFundingRate: (symbol: string) => {
197
- est_funding_rate: string;
198
- countDown: string;
199
- symbol?: string | undefined;
200
- est_funding_rate_timestamp?: number | undefined;
201
- last_funding_rate?: number | undefined;
202
- last_funding_rate_timestamp?: number | undefined;
203
- next_funding_time?: number | undefined;
204
- sum_unitary_funding?: number | undefined;
205
- };
206
-
207
- declare const usePositionStream: (symbol?: string, options?: SWRConfiguration) => any[];
208
-
209
- declare enum OrderStatus {
210
- FILLED = "FILLED",
211
- PARTIAL_FILLED = "PARTIAL_FILLED",
212
- CANCELED = "CANCELED",
213
- NEW = "NEW",
214
- COMPLETED = "COMPLETED"
215
- }
216
- declare const useOrderStream: ({ status, symbol, side, size, }?: {
217
- symbol?: string | undefined;
218
- status?: OrderStatus | undefined;
219
- size?: number | undefined;
220
- side?: OrderSide | undefined;
221
- }) => (any[] | {
222
- cancelAllOrders: () => void;
223
- updateOrder: (orderId: string, order: OrderEntity) => any;
224
- cancelOrder: (orderId: string, symbol?: string) => any;
225
- } | null)[];
226
-
227
- interface MarketTradeStreamOptions {
228
- limit?: number;
229
- }
230
- declare const useMarketTradeStream: (symbol: string, options?: MarketTradeStreamOptions) => {
231
- data: API.Trade[];
232
- isLoading: boolean;
233
- };
234
-
235
- type CollateralOutputs = {
236
- totalCollateral: number;
237
- freeCollateral: number;
238
- totalValue: number;
239
- availableBalance: number;
240
- };
241
- /**
242
- * 用户保证金
243
- * @returns
244
- */
245
- type Options = {
246
- dp: number;
247
- };
248
- declare const useCollateral: (options?: Options) => CollateralOutputs;
249
-
250
- declare const useMaxQty: (symbol: string, side: OrderSide, reduceOnly?: boolean) => number;
251
-
252
- declare const useMarginRatio: () => {
253
- marginRatio: number;
254
- currentLeverage: number;
255
- };
256
-
257
- type inputOptions = {
258
- filter?: (item: API.Chain) => boolean;
259
- pick?: "dexs" | "network_infos" | "token_infos";
260
- };
261
- declare const useChains: (networkId?: "testnet" | "mainnet", options?: inputOptions & SWRConfiguration) => any[];
262
-
263
- declare const useHolding: () => {
264
- data: API.Holding[] | undefined;
265
- usdc: API.Holding | undefined;
266
- isLoading: boolean;
267
- };
268
-
269
- declare const useBalance: () => any;
270
-
271
- declare const usePrivateDataObserver: () => void;
272
-
273
- declare const useExecutionReport: () => any;
274
-
275
- interface Info {
276
- symbol: string;
277
- quote_min: number;
278
- quote_max: number;
279
- quote_tick: number;
280
- base_min: number;
281
- base_max: number;
282
- base_tick: number;
283
- min_notional: number;
284
- price_range: number;
285
- created_time: number;
286
- updated_time: number;
287
- }
288
- /**
289
- * useInfo
290
- * @returns
291
- */
292
- declare const useInfo: () => swr__internal.SWRResponse<Info[], any, any>;
293
-
294
- interface Token {
295
- token: string;
296
- token_account_id: string;
297
- decimals: number;
298
- minimum_increment: number;
299
- }
300
- /**
301
- * useToken
302
- * @description get token info
303
- */
304
- declare const useToken: () => swr__internal.SWRResponse<Token[], any, any>;
305
-
306
- interface FundingRate {
307
- symbol: string;
308
- est_funding_rate: number;
309
- est_funding_rate_timestamp: number;
310
- last_funding_rate: number;
311
- last_funding_rate_timestamp: number;
312
- next_funding_time: number;
313
- sum_unitary_funding: number;
314
- }
315
- /**
316
- * FundingRate
317
- * @param symbol
318
- */
319
- declare const useFundingRateBySymbol: (symbol: string) => swr__internal.SWRResponse<FundingRate, any, any>;
320
-
321
- declare const index_useFundingRateBySymbol: typeof useFundingRateBySymbol;
322
- declare const index_useInfo: typeof useInfo;
323
- declare const index_useToken: typeof useToken;
324
- declare namespace index {
325
- export {
326
- index_useFundingRateBySymbol as useFundingRateBySymbol,
327
- index_useInfo as useInfo,
328
- index_useToken as useToken,
329
- };
330
- }
331
-
332
- export { AppStateErrors, DataSourceProvider, OrderStatus, OrderlyAppConfig, OrderlyContext, OrderlyContextState, OrderlyProvider, index as apis, useAccount, useAccountInfo, useAccountInstance, useAppState, useBalance, useChains, useCollateral, useEventEmitter, useExecutionReport, useFetures, useFundingRate, useHolding, useLeverage, useLocalStorage, useMarginRatio, useMarkPrice, useMarkPricesStream, useMarketTradeStream, useMarketsStream, useMaxQty, useMutation, useOrderEntry, useOrderStream, useOrderbookStream, usePositionStream, usePreLoadData, usePrivateDataObserver, usePrivateObserve, usePrivateQuery, useQuery, useRunOnce, useSessionStorage, useSymbolsInfo, useTickerStream, useTokenInfo, useTopicObserve, useTradingView, useWS };