@orderly.network/hooks 3.0.0-beta.1 → 3.0.0-beta.2
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/dist/index.d.mts +198 -111
- package/dist/index.d.ts +198 -111
- package/dist/index.js +462 -184
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +459 -186
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
3
|
+
import * as _orderly_network_types from '@orderly.network/types';
|
|
4
|
+
import { API, NetworkId, TrackerEventName, OrderlyOrder, ChainNamespace, WSMessage, MarginMode, OrderType, OrderStatus, OrderSide, AlgoOrderRootType, OrderEntity, PositionType, AlgoOrderEntity, AssetHistoryStatusEnum, RequireKeys, AlgoOrderType } from '@orderly.network/types';
|
|
1
5
|
import * as swr from 'swr';
|
|
2
6
|
import { SWRConfiguration, SWRHook, SWRResponse, Middleware } from 'swr';
|
|
3
7
|
export { swr };
|
|
@@ -6,10 +10,6 @@ import * as swr_mutation from 'swr/mutation';
|
|
|
6
10
|
import { SWRMutationConfiguration, SWRMutationResponse } from 'swr/mutation';
|
|
7
11
|
import * as swr_infinite from 'swr/infinite';
|
|
8
12
|
import { SWRInfiniteKeyLoader, SWRInfiniteConfiguration } from 'swr/infinite';
|
|
9
|
-
import * as react from 'react';
|
|
10
|
-
import { PropsWithChildren, FC, ReactNode } from 'react';
|
|
11
|
-
import * as _orderly_network_types from '@orderly.network/types';
|
|
12
|
-
import { NetworkId, TrackerEventName, API, OrderlyOrder, ChainNamespace, WSMessage, MarginMode, OrderType, OrderStatus, OrderSide, AlgoOrderRootType, OrderEntity, PositionType, AlgoOrderEntity, AssetHistoryStatusEnum, RequireKeys, AlgoOrderType } from '@orderly.network/types';
|
|
13
13
|
import * as _orderly_network_core from '@orderly.network/core';
|
|
14
14
|
import { AccountState, Account, EventEmitter, ConfigStore, ConfigKey, SimpleDI, OrderlyKeyStore, WalletAdapter, IContract, DefaultConfigStore } from '@orderly.network/core';
|
|
15
15
|
export { SubAccount, WalletAdapter } from '@orderly.network/core';
|
|
@@ -30,6 +30,139 @@ import { StoreMutatorIdentifier, StateCreator } from 'zustand';
|
|
|
30
30
|
import * as zustand_middleware from 'zustand/middleware';
|
|
31
31
|
import { PersistOptions } from 'zustand/middleware';
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Check if currently trading based on next_open/next_close timestamps
|
|
35
|
+
* @param nextOpen - Next open time timestamp
|
|
36
|
+
* @param nextClose - Next close time timestamp
|
|
37
|
+
* @param currentTime - Current time timestamp
|
|
38
|
+
* @returns boolean - true if currently trading
|
|
39
|
+
*/
|
|
40
|
+
declare const isCurrentlyTrading: (nextClose: number, status: "open" | "close", currentTime?: number) => boolean;
|
|
41
|
+
declare const isCurrentlyClosed: (nextOpen: number, status: "open" | "close", currentTime?: number) => boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Type alias for the return type of useSymbolsInfo hook
|
|
44
|
+
*/
|
|
45
|
+
type RwaSymbolsInfo = ReturnType<typeof useRwaSymbolsInfo>;
|
|
46
|
+
/**
|
|
47
|
+
* A hook that provides access to symbol information.
|
|
48
|
+
*
|
|
49
|
+
* @returns A getter object that provides access to symbol information.
|
|
50
|
+
* The getter allows accessing symbol data either by symbol name directly,
|
|
51
|
+
* or through a two-level access pattern (symbol and property).
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const rwaSymbolsInfo = useRwaSymbolsInfo();
|
|
56
|
+
*
|
|
57
|
+
* // Get all info for a symbol
|
|
58
|
+
* const ethInfo = rwaSymbolsInfo["PERP_ETH_USDC"]();
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare const useRwaSymbolsInfo: () => Record<string, <Key extends keyof API.RwaSymbol>(key: Key, defaultValue?: API.RwaSymbol[Key] | undefined) => API.RwaSymbol[Key]> & Record<string, () => API.RwaSymbol> & {
|
|
62
|
+
isNil: boolean;
|
|
63
|
+
};
|
|
64
|
+
declare const useRwaSymbolsInfoStore: () => Record<string, API.RwaSymbol> | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Return type definition for the hook
|
|
67
|
+
*
|
|
68
|
+
* - isRwa: true if the symbol is an RWA symbol
|
|
69
|
+
* - open: true if the symbol is open for trading
|
|
70
|
+
* - nextOpen: the next open time in milliseconds
|
|
71
|
+
* - nextClose: the next close time in milliseconds
|
|
72
|
+
* - closeTimeInterval: the time interval in seconds until the symbol closes (countdown format)
|
|
73
|
+
* - openTimeInterval: the time interval in seconds until the symbol opens (countdown format)
|
|
74
|
+
*/
|
|
75
|
+
interface RwaSymbolResult {
|
|
76
|
+
isRwa: boolean;
|
|
77
|
+
open?: boolean;
|
|
78
|
+
nextOpen?: number;
|
|
79
|
+
nextClose?: number;
|
|
80
|
+
closeTimeInterval?: number;
|
|
81
|
+
openTimeInterval?: number;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Hook to initialize and manage the global timer
|
|
85
|
+
* This hook should be called once at the top level of the application to start and manage the global timer
|
|
86
|
+
*/
|
|
87
|
+
declare const useInitRwaSymbolsRuntime: () => void;
|
|
88
|
+
/**
|
|
89
|
+
* Hook to get current RWA symbol information with real-time updates
|
|
90
|
+
* Retrieves the state of a specific symbol from the centralized store
|
|
91
|
+
* @param symbol - The symbol to query
|
|
92
|
+
* @returns RwaSymbolResult containing RWA status and countdown information
|
|
93
|
+
*/
|
|
94
|
+
declare const useGetRwaSymbolInfo: (symbol: string) => RwaSymbolResult;
|
|
95
|
+
/**
|
|
96
|
+
* Simplified hook to get RWA symbol open status with real-time updates
|
|
97
|
+
* @param symbol - The symbol to query
|
|
98
|
+
* @returns Object containing isRwa and open status
|
|
99
|
+
*/
|
|
100
|
+
declare const useGetRwaSymbolOpenStatus: (symbol: string) => {
|
|
101
|
+
isRwa: boolean;
|
|
102
|
+
open?: boolean;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Hook to get RWA symbol close time interval with filtering
|
|
106
|
+
* @param symbol - The symbol to query
|
|
107
|
+
* @param thresholdMinutes - Time threshold in minutes, defaults to 30
|
|
108
|
+
* @returns Close time interval in seconds, or undefined if not within threshold
|
|
109
|
+
*/
|
|
110
|
+
declare const useGetRwaSymbolCloseTimeInterval: (symbol: string, thresholdMinutes?: number) => {
|
|
111
|
+
isRwa: boolean;
|
|
112
|
+
open?: boolean;
|
|
113
|
+
closeTimeInterval?: number;
|
|
114
|
+
nextClose?: number;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Hook to get RWA symbol open time interval with filtering
|
|
118
|
+
* @param symbol - The symbol to query
|
|
119
|
+
* @param thresholdMinutes - Time threshold in minutes, defaults to 30
|
|
120
|
+
* @returns Open time interval in seconds, or undefined if not within threshold
|
|
121
|
+
*/
|
|
122
|
+
declare const useGetRwaSymbolOpenTimeInterval: (symbol: string, thresholdMinutes?: number) => {
|
|
123
|
+
isRwa: boolean;
|
|
124
|
+
open?: boolean;
|
|
125
|
+
openTimeInterval?: number;
|
|
126
|
+
nextOpen?: number;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
type MarketCategoryComponentKey = "marketsSheet" | "expandMarkets" | "dropDownMarkets" | "subMenuMarkets" | "marketsDataList" | "horizontalMarkets";
|
|
130
|
+
type MarketBuiltInTabType = "favorites" | "community" | "all" | "rwa" | "newListing" | "recent";
|
|
131
|
+
type MarketTabBase = {
|
|
132
|
+
name?: string;
|
|
133
|
+
icon?: ReactNode | string;
|
|
134
|
+
suffix?: ReactNode | string;
|
|
135
|
+
isVisible?: (symbolList: API.MarketInfoExt[], ctx: {
|
|
136
|
+
rwaSymbolsInfo?: RwaSymbolsInfo;
|
|
137
|
+
}) => boolean;
|
|
138
|
+
};
|
|
139
|
+
type BuiltInMarketTab = MarketTabBase & {
|
|
140
|
+
type: MarketBuiltInTabType;
|
|
141
|
+
};
|
|
142
|
+
type CustomMarketTab = MarketTabBase & {
|
|
143
|
+
id: string;
|
|
144
|
+
name: string;
|
|
145
|
+
match: (market: API.MarketInfoExt) => boolean;
|
|
146
|
+
};
|
|
147
|
+
type MarketTabConfig = BuiltInMarketTab | CustomMarketTab;
|
|
148
|
+
interface MarketCategoryContext {
|
|
149
|
+
componentKey: MarketCategoryComponentKey;
|
|
150
|
+
builtIn: Record<MarketBuiltInTabType, BuiltInMarketTab>;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Function-only config for market tabs.
|
|
154
|
+
*
|
|
155
|
+
* @param original - Default built-in tabs for the current component (as MarketTabConfig[])
|
|
156
|
+
* @param context - { componentKey, builtIn } for referencing built-in tab definitions
|
|
157
|
+
* @returns Final tab sequence to render
|
|
158
|
+
*/
|
|
159
|
+
type MarketCategoryConfig = (original: MarketTabConfig[], context: MarketCategoryContext) => MarketTabConfig[];
|
|
160
|
+
type MarketCategoriesConfigProviderProps = {
|
|
161
|
+
value?: MarketCategoryConfig;
|
|
162
|
+
};
|
|
163
|
+
declare const MarketCategoriesConfigProvider: FC<PropsWithChildren<MarketCategoriesConfigProviderProps>>;
|
|
164
|
+
declare function useMarketCategoriesConfig(): MarketCategoryConfig | undefined;
|
|
165
|
+
|
|
33
166
|
declare global {
|
|
34
167
|
interface Window {
|
|
35
168
|
__ORDERLY_VERSION__?: {
|
|
@@ -37,7 +170,7 @@ declare global {
|
|
|
37
170
|
};
|
|
38
171
|
}
|
|
39
172
|
}
|
|
40
|
-
declare const _default: "3.0.0-beta.
|
|
173
|
+
declare const _default: "3.0.0-beta.2";
|
|
41
174
|
|
|
42
175
|
declare const fetcher: (url: string, init: RequestInit | undefined, queryOptions: useQueryOptions<any>) => Promise<any>;
|
|
43
176
|
type useQueryOptions<T> = SWRConfiguration & {
|
|
@@ -330,12 +463,11 @@ declare const useRefereeRebateSummary: (params: Params) => {
|
|
|
330
463
|
isLoading: boolean;
|
|
331
464
|
};
|
|
332
465
|
|
|
333
|
-
|
|
334
|
-
isExist
|
|
466
|
+
declare const useCheckReferralCode: (code?: string) => {
|
|
467
|
+
isExist: boolean | undefined;
|
|
335
468
|
error: any;
|
|
336
469
|
isLoading: boolean;
|
|
337
470
|
};
|
|
338
|
-
declare const useCheckReferralCode: (code?: string) => CheckReferralCodeReturns;
|
|
339
471
|
|
|
340
472
|
declare const useGetReferralCode: (accountId?: string) => {
|
|
341
473
|
referral_code?: string;
|
|
@@ -471,102 +603,6 @@ declare function useChains<T extends NetworkId | undefined, K extends UseChainsO
|
|
|
471
603
|
UseChainsReturnObject
|
|
472
604
|
];
|
|
473
605
|
|
|
474
|
-
/**
|
|
475
|
-
* Check if currently trading based on next_open/next_close timestamps
|
|
476
|
-
* @param nextOpen - Next open time timestamp
|
|
477
|
-
* @param nextClose - Next close time timestamp
|
|
478
|
-
* @param currentTime - Current time timestamp
|
|
479
|
-
* @returns boolean - true if currently trading
|
|
480
|
-
*/
|
|
481
|
-
declare const isCurrentlyTrading: (nextClose: number, status: "open" | "close", currentTime?: number) => boolean;
|
|
482
|
-
declare const isCurrentlyClosed: (nextOpen: number, status: "open" | "close", currentTime?: number) => boolean;
|
|
483
|
-
/**
|
|
484
|
-
* Type alias for the return type of useSymbolsInfo hook
|
|
485
|
-
*/
|
|
486
|
-
type RwaSymbolsInfo = ReturnType<typeof useRwaSymbolsInfo>;
|
|
487
|
-
/**
|
|
488
|
-
* A hook that provides access to symbol information.
|
|
489
|
-
*
|
|
490
|
-
* @returns A getter object that provides access to symbol information.
|
|
491
|
-
* The getter allows accessing symbol data either by symbol name directly,
|
|
492
|
-
* or through a two-level access pattern (symbol and property).
|
|
493
|
-
*
|
|
494
|
-
* @example
|
|
495
|
-
* ```typescript
|
|
496
|
-
* const rwaSymbolsInfo = useRwaSymbolsInfo();
|
|
497
|
-
*
|
|
498
|
-
* // Get all info for a symbol
|
|
499
|
-
* const ethInfo = rwaSymbolsInfo["PERP_ETH_USDC"]();
|
|
500
|
-
* ```
|
|
501
|
-
*/
|
|
502
|
-
declare const useRwaSymbolsInfo: () => Record<string, <Key extends keyof API.RwaSymbol>(key: Key, defaultValue?: API.RwaSymbol[Key] | undefined) => API.RwaSymbol[Key]> & Record<string, () => API.RwaSymbol> & {
|
|
503
|
-
isNil: boolean;
|
|
504
|
-
};
|
|
505
|
-
declare const useRwaSymbolsInfoStore: () => Record<string, API.RwaSymbol> | undefined;
|
|
506
|
-
/**
|
|
507
|
-
* Return type definition for the hook
|
|
508
|
-
*
|
|
509
|
-
* - isRwa: true if the symbol is an RWA symbol
|
|
510
|
-
* - open: true if the symbol is open for trading
|
|
511
|
-
* - nextOpen: the next open time in milliseconds
|
|
512
|
-
* - nextClose: the next close time in milliseconds
|
|
513
|
-
* - closeTimeInterval: the time interval in seconds until the symbol closes (countdown format)
|
|
514
|
-
* - openTimeInterval: the time interval in seconds until the symbol opens (countdown format)
|
|
515
|
-
*/
|
|
516
|
-
interface RwaSymbolResult {
|
|
517
|
-
isRwa: boolean;
|
|
518
|
-
open?: boolean;
|
|
519
|
-
nextOpen?: number;
|
|
520
|
-
nextClose?: number;
|
|
521
|
-
closeTimeInterval?: number;
|
|
522
|
-
openTimeInterval?: number;
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* Hook to initialize and manage the global timer
|
|
526
|
-
* This hook should be called once at the top level of the application to start and manage the global timer
|
|
527
|
-
*/
|
|
528
|
-
declare const useInitRwaSymbolsRuntime: () => void;
|
|
529
|
-
/**
|
|
530
|
-
* Hook to get current RWA symbol information with real-time updates
|
|
531
|
-
* Retrieves the state of a specific symbol from the centralized store
|
|
532
|
-
* @param symbol - The symbol to query
|
|
533
|
-
* @returns RwaSymbolResult containing RWA status and countdown information
|
|
534
|
-
*/
|
|
535
|
-
declare const useGetRwaSymbolInfo: (symbol: string) => RwaSymbolResult;
|
|
536
|
-
/**
|
|
537
|
-
* Simplified hook to get RWA symbol open status with real-time updates
|
|
538
|
-
* @param symbol - The symbol to query
|
|
539
|
-
* @returns Object containing isRwa and open status
|
|
540
|
-
*/
|
|
541
|
-
declare const useGetRwaSymbolOpenStatus: (symbol: string) => {
|
|
542
|
-
isRwa: boolean;
|
|
543
|
-
open?: boolean;
|
|
544
|
-
};
|
|
545
|
-
/**
|
|
546
|
-
* Hook to get RWA symbol close time interval with filtering
|
|
547
|
-
* @param symbol - The symbol to query
|
|
548
|
-
* @param thresholdMinutes - Time threshold in minutes, defaults to 30
|
|
549
|
-
* @returns Close time interval in seconds, or undefined if not within threshold
|
|
550
|
-
*/
|
|
551
|
-
declare const useGetRwaSymbolCloseTimeInterval: (symbol: string, thresholdMinutes?: number) => {
|
|
552
|
-
isRwa: boolean;
|
|
553
|
-
open?: boolean;
|
|
554
|
-
closeTimeInterval?: number;
|
|
555
|
-
nextClose?: number;
|
|
556
|
-
};
|
|
557
|
-
/**
|
|
558
|
-
* Hook to get RWA symbol open time interval with filtering
|
|
559
|
-
* @param symbol - The symbol to query
|
|
560
|
-
* @param thresholdMinutes - Time threshold in minutes, defaults to 30
|
|
561
|
-
* @returns Open time interval in seconds, or undefined if not within threshold
|
|
562
|
-
*/
|
|
563
|
-
declare const useGetRwaSymbolOpenTimeInterval: (symbol: string, thresholdMinutes?: number) => {
|
|
564
|
-
isRwa: boolean;
|
|
565
|
-
open?: boolean;
|
|
566
|
-
openTimeInterval?: number;
|
|
567
|
-
nextOpen?: number;
|
|
568
|
-
};
|
|
569
|
-
|
|
570
606
|
type FilteredChains = {
|
|
571
607
|
mainnet?: {
|
|
572
608
|
id: number;
|
|
@@ -831,7 +867,8 @@ declare enum MarketsType$1 {
|
|
|
831
867
|
FAVORITES = 0,
|
|
832
868
|
RECENT = 1,
|
|
833
869
|
ALL = 2,
|
|
834
|
-
NEW_LISTING = 3
|
|
870
|
+
NEW_LISTING = 3,
|
|
871
|
+
COMMUNITY = 4
|
|
835
872
|
}
|
|
836
873
|
interface FavoriteTab$1 {
|
|
837
874
|
name: string;
|
|
@@ -876,7 +913,8 @@ declare enum MarketsType {
|
|
|
876
913
|
RECENT = 1,
|
|
877
914
|
ALL = 2,
|
|
878
915
|
RWA = 3,
|
|
879
|
-
NEW_LISTING = 4
|
|
916
|
+
NEW_LISTING = 4,
|
|
917
|
+
COMMUNITY = 5
|
|
880
918
|
}
|
|
881
919
|
interface FavoriteTab {
|
|
882
920
|
name: string;
|
|
@@ -899,6 +937,10 @@ type TabSort = Record<string, {
|
|
|
899
937
|
type MarketsItem = {
|
|
900
938
|
symbol: string;
|
|
901
939
|
displayName?: string;
|
|
940
|
+
/** Permissionless listing: display name without broker_id suffix */
|
|
941
|
+
display_symbol_name?: string;
|
|
942
|
+
/** Permissionless listing: broker id; null for non-community-listed symbols */
|
|
943
|
+
broker_id?: string | null;
|
|
902
944
|
index_price: number;
|
|
903
945
|
mark_price: number;
|
|
904
946
|
sum_unitary_funding: number;
|
|
@@ -1058,6 +1100,7 @@ declare const useMarginModeBySymbol: (symbol: string, fallback?: MarginMode | nu
|
|
|
1058
1100
|
error: any;
|
|
1059
1101
|
refresh: swr.KeyedMutator<MarginModesResponseItem[]>;
|
|
1060
1102
|
update: (mode: MarginMode) => Promise<SetMarginModeResult>;
|
|
1103
|
+
isPermissionlessListing: boolean;
|
|
1061
1104
|
};
|
|
1062
1105
|
|
|
1063
1106
|
declare const useOdosQuote: () => readonly [(this: unknown, data: Record<string, any> | null, params?: Record<string, any> | undefined, options?: swr_mutation.SWRMutationConfiguration<unknown, unknown> | undefined) => Promise<any>, {
|
|
@@ -1194,7 +1237,7 @@ declare const usePositionStream: (symbol?: string, options?: SWRConfiguration &
|
|
|
1194
1237
|
readonly totalCollateral: _orderly_network_utils.Decimal;
|
|
1195
1238
|
readonly totalValue: _orderly_network_utils.Decimal | null;
|
|
1196
1239
|
readonly totalUnrealizedROI: number;
|
|
1197
|
-
}, Record<"unsettledPnL" | "margin_ratio" | "initial_margin_ratio" | "maintenance_margin_ratio" | "open_margin_ratio" | "current_margin_ratio_with_orders" | "initial_margin_ratio_with_orders" | "maintenance_margin_ratio_with_orders" | "total_collateral_value" | "free_collateral" | "total_pnl_24_h" | "unrealPnL" | "total_unreal_pnl" | "total_unreal_pnl_index" | "total_unsettled_pnl" | "notional" | "unrealPnlROI" | "unrealPnlROI_index", <Key extends "unsettledPnL" | "margin_ratio" | "initial_margin_ratio" | "maintenance_margin_ratio" | "open_margin_ratio" | "current_margin_ratio_with_orders" | "initial_margin_ratio_with_orders" | "maintenance_margin_ratio_with_orders" | "total_collateral_value" | "free_collateral" | "total_pnl_24_h" | "unrealPnL" | "total_unreal_pnl" | "total_unreal_pnl_index" | "total_unsettled_pnl" | "notional" | "unrealPnlROI" | "unrealPnlROI_index">(defaultValue?: Omit<API.PositionInfo, "rows">[Key] | undefined) => Omit<API.PositionInfo, "rows">[Key]> & {
|
|
1240
|
+
}, Record<"unsettledPnL" | "margin_ratio" | "initial_margin_ratio" | "maintenance_margin_ratio" | "open_margin_ratio" | "current_margin_ratio_with_orders" | "initial_margin_ratio_with_orders" | "maintenance_margin_ratio_with_orders" | "total_collateral_value" | "free_collateral" | "total_pnl_24_h" | "unrealPnL" | "total_unreal_pnl" | "total_unreal_pnl_index" | "total_unsettled_pnl" | "notional" | "unrealPnlROI" | "unrealPnlROI_index" | "total_unsettled_cross_pnl" | "total_unsettled_isolated_pnl", <Key extends "unsettledPnL" | "margin_ratio" | "initial_margin_ratio" | "maintenance_margin_ratio" | "open_margin_ratio" | "current_margin_ratio_with_orders" | "initial_margin_ratio_with_orders" | "maintenance_margin_ratio_with_orders" | "total_collateral_value" | "free_collateral" | "total_pnl_24_h" | "unrealPnL" | "total_unreal_pnl" | "total_unreal_pnl_index" | "total_unsettled_pnl" | "notional" | "unrealPnlROI" | "unrealPnlROI_index" | "total_unsettled_cross_pnl" | "total_unsettled_isolated_pnl">(defaultValue?: Omit<API.PositionInfo, "rows">[Key] | undefined) => Omit<API.PositionInfo, "rows">[Key]> & {
|
|
1198
1241
|
isNil: boolean;
|
|
1199
1242
|
}, {
|
|
1200
1243
|
/**
|
|
@@ -1570,7 +1613,7 @@ type DST = {
|
|
|
1570
1613
|
};
|
|
1571
1614
|
type UseDepositReturn = ReturnType<typeof useDeposit>;
|
|
1572
1615
|
declare const useDeposit: (options: DepositOptions) => {
|
|
1573
|
-
balance: string;
|
|
1616
|
+
balance: string | null;
|
|
1574
1617
|
allowance: string;
|
|
1575
1618
|
/** deposit fee, unit: wei */
|
|
1576
1619
|
depositFee: bigint;
|
|
@@ -1909,6 +1952,7 @@ declare const useStatisticsDaily: (params: QueryParams, options?: {
|
|
|
1909
1952
|
|
|
1910
1953
|
type UserStatistics = {
|
|
1911
1954
|
perp_trading_volume_last_24_hours?: number;
|
|
1955
|
+
perp_trading_volume_today?: number;
|
|
1912
1956
|
};
|
|
1913
1957
|
declare const useUserStatistics: () => readonly [UserStatistics | null, {
|
|
1914
1958
|
readonly isValidating: boolean;
|
|
@@ -2243,6 +2287,41 @@ declare function useOrderEntry$1(symbol: string, side: OrderSide, reduceOnly: bo
|
|
|
2243
2287
|
|
|
2244
2288
|
declare function useMediaQuery(query: string): boolean;
|
|
2245
2289
|
|
|
2290
|
+
interface UseBadgeBySymbolReturn {
|
|
2291
|
+
/** Display name of the symbol. API.display_symbol_name */
|
|
2292
|
+
displayName: string;
|
|
2293
|
+
/** Broker ID of the symbol. */
|
|
2294
|
+
brokerId: string | undefined;
|
|
2295
|
+
/** Badge label: first segment of raw name, truncated to 7 chars with "...". */
|
|
2296
|
+
brokerName: string | undefined;
|
|
2297
|
+
/** Raw broker name as provided by the API. */
|
|
2298
|
+
brokerNameRaw: string | undefined;
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* Match the given `symbol` in `symbolsInfo` and return `displayName`, `brokerId`,
|
|
2302
|
+
* and the mapped `brokerName`.
|
|
2303
|
+
*
|
|
2304
|
+
* `brokerName` comes from the `/v1/public/broker/name` broker list
|
|
2305
|
+
* (SWR shared cache).
|
|
2306
|
+
*/
|
|
2307
|
+
declare const useBadgeBySymbol: (symbol: string) => UseBadgeBySymbolReturn;
|
|
2308
|
+
/**
|
|
2309
|
+
* Same rules as {@link useSymbolWithBroker}, for use in callbacks / non-React code paths.
|
|
2310
|
+
*/
|
|
2311
|
+
declare function formatSymbolWithBroker(symbol: string, symbolsInfo: {
|
|
2312
|
+
isNil?: boolean;
|
|
2313
|
+
[key: string]: unknown;
|
|
2314
|
+
}, brokers: Record<string, string> | undefined): string;
|
|
2315
|
+
/**
|
|
2316
|
+
* Short market label: `base`, or `base-{brokerNameBase}` when the symbol is broker-scoped and a broker
|
|
2317
|
+
* name is available from symbols info + broker list.
|
|
2318
|
+
*
|
|
2319
|
+
* Symbol shape: `type_base_quote` with optional trailing `_broker_id` segments (broker_id may
|
|
2320
|
+
* contain underscores, e.g. `orderly`). Otherwise falls back to a leading letter run for legacy
|
|
2321
|
+
* compact symbols.
|
|
2322
|
+
*/
|
|
2323
|
+
declare const useSymbolWithBroker: (symbol: string) => string;
|
|
2324
|
+
|
|
2246
2325
|
type posterDataSource = {
|
|
2247
2326
|
/**
|
|
2248
2327
|
* slogan of the poster
|
|
@@ -2250,8 +2329,9 @@ type posterDataSource = {
|
|
|
2250
2329
|
message?: string;
|
|
2251
2330
|
position: {
|
|
2252
2331
|
symbol: string;
|
|
2332
|
+
brokerName?: string;
|
|
2253
2333
|
side: "LONG" | "SHORT";
|
|
2254
|
-
marginMode?:
|
|
2334
|
+
marginMode?: MarginMode;
|
|
2255
2335
|
/**
|
|
2256
2336
|
* The leverage of the position
|
|
2257
2337
|
*/
|
|
@@ -2765,13 +2845,14 @@ declare const useOrderEntryNextInternal: (symbol: string, options?: {
|
|
|
2765
2845
|
symbolInfo?: API.SymbolExt;
|
|
2766
2846
|
symbolLeverage?: number;
|
|
2767
2847
|
}) => {
|
|
2768
|
-
readonly formattedOrder:
|
|
2848
|
+
readonly formattedOrder: OrderlyOrder;
|
|
2769
2849
|
readonly setValue: (key: keyof FullOrderState, value: any, additional?: {
|
|
2770
2850
|
markPrice: number;
|
|
2771
2851
|
}) => Partial<OrderlyOrder> | undefined;
|
|
2772
2852
|
readonly setValues: (values: Partial<FullOrderState>, additional?: {
|
|
2773
2853
|
markPrice: number;
|
|
2774
2854
|
}) => Partial<OrderlyOrder> | undefined;
|
|
2855
|
+
readonly setValuesRaw: (values: Partial<FullOrderState>) => Partial<OrderlyOrder> | undefined;
|
|
2775
2856
|
readonly submit: () => void;
|
|
2776
2857
|
readonly reset: (order?: Partial<OrderlyOrder>) => void;
|
|
2777
2858
|
readonly generateOrder: (creator: OrderCreator<any>, options: {
|
|
@@ -2849,6 +2930,12 @@ type OrderEntryReturn = {
|
|
|
2849
2930
|
shouldUpdateLastChangedField?: boolean;
|
|
2850
2931
|
}) => void;
|
|
2851
2932
|
setValues: (values: Partial<FullOrderState>) => void;
|
|
2933
|
+
/**
|
|
2934
|
+
* Raw merge setter for externally computed bundles (e.g. Advanced TPSL).
|
|
2935
|
+
*
|
|
2936
|
+
* Unlike `setValues`, this intentionally skips `calculate()` to avoid overwriting computed TPSL fields.
|
|
2937
|
+
*/
|
|
2938
|
+
setValuesRaw: (values: Partial<FullOrderState>) => void;
|
|
2852
2939
|
symbolInfo: API.SymbolExt;
|
|
2853
2940
|
/**
|
|
2854
2941
|
* Meta state including validation and submission status.
|
|
@@ -3107,4 +3194,4 @@ interface UseFeatureFlagReturn {
|
|
|
3107
3194
|
*/
|
|
3108
3195
|
declare const useFeatureFlag: (key: FlagKeys) => UseFeatureFlagReturn;
|
|
3109
3196
|
|
|
3110
|
-
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, type Brokers, type
|
|
3197
|
+
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, type Brokers, type BuiltInMarketTab, type Chain, type ChainFilter, type Chains, type CollateralOutputs, type ComputedAlgoOrder, type ConfigProviderProps, type ConnectedChain, type CurrentEpochEstimate, type CustomMarketTab, DefaultLayoutConfig, DistributionId, type DrawOptions, ENVType, ERROR_MSG_CODES, type EpochInfoItem, type EpochInfoType, EpochStatus, type ExclusiveConfigProviderProps, ExtendedConfigStore, type Favorite, type FavoriteTab, type FeatureFlagItem, type FilteredChains, FlagKeys, type FundingRates, MaintenanceStatus, type MarginRatioReturn, type MarketBuiltInTabType, MarketCategoriesConfigProvider, type MarketCategoriesConfigProviderProps, type MarketCategoryComponentKey, type MarketCategoryConfig, type MarketCategoryContext, type MarketTabConfig, type MarketsItem, MarketsStorageKey, type MarketsStore, MarketsType, type NewListing, ORDERLY_ORDERBOOK_DEPTH_KEY, type OrderBookItem, type OrderEntryReturn, type OrderMetadata, type OrderMetadataConfig, type OrderParams, type OrderValidationItem, type OrderValidationResult, type OrderbookData, type OrderbookOptions, type OrderlyConfigContextState, OrderlyConfigProvider, OrderlyContext, OrderlyProvider, type PosterLayoutConfig, type PriceMode, type Recent, RefferalAPI, type RestrictedInfoOptions, type RestrictedInfoReturns, type RwaSymbolResult, type RwaSymbolsInfo, ScopeType, type StatusInfo, StatusProvider, type SymbolsInfo, TWType, type UseBadgeBySymbolReturn, type UseChainsOptions, type UseChainsReturnObject, type UseDepositReturn, type UseFeatureFlagReturn, type UseOrderEntryMetaState, WalletConnectorContext, type WalletConnectorContextState, type WalletRewards, type WalletRewardsHistoryReturns, type WalletRewardsItem, type WalletState, WsNetworkStatus, checkNotional, cleanStringStyle, fetcher, findPositionTPSLFromOrders, findTPSLFromOrder, findTPSLOrderPriceFromOrder, formatSymbolWithBroker, getMinNotional, getPriceKey, indexedDBManager, initializeAppDatabase, isCurrentlyClosed, isCurrentlyTrading, noCacheConfig, parseJSON, persistIndexedDB, resetTimestampOffsetState, timestampWaitingMiddleware, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAppStore, useAssetsHistory, useAudioPlayer, useBadgeBySymbol, useBalanceSubscription, useBalanceTopic, useBoolean, useChain, useChainInfo, useChains, useCheckReferralCode, useCollateral, useCommission, useComputedLTV, useConfig, useConvert, useCurEpochEstimate, useDaily, useDeposit, useDistribution, useDistributionHistory, useEpochInfo, useEstLiqPriceBySymbol, useEventEmitter, useFeatureFlag, useFeeState, useFundingDetails, useFundingFeeHistory, useFundingRate, useFundingRateBySymbol, useFundingRateHistory, useFundingRates, useFundingRatesStore, useGetClaimed, useGetEnv, useGetEstLiqPrice, useGetReferralCode, useGetRwaSymbolCloseTimeInterval, useGetRwaSymbolInfo, useGetRwaSymbolOpenStatus, useGetRwaSymbolOpenTimeInterval, useHoldingStream, useIndexPrice, useIndexPricesStream, useInfiniteQuery, useInitRwaSymbolsRuntime, useInternalTransfer, useKeyStore, useLazyQuery, useLeverage, useLeverageBySymbol, useLocalStorage, useMainTokenStore, useMainnetChainsStore, useMaintenanceStatus, useMarginModeBySymbol, useMarginModes, useMarginRatio, useMarkPrice, useMarkPriceBySymbol, useMarkPricesStream, useMarket, useMarketCategoriesConfig, useMarketList, useMarketMap, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxLeverage, useMaxQty, useMaxWithdrawal, useMediaQuery, useMemoizedFn, useMutation, useNetworkInfo, useOdosQuote, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, useOrderlyContext, usePortfolio, usePositionActions, usePositionClose, usePositionStream, usePositions, usePoster, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, type useQueryOptions, useRefereeHistory, useRefereeInfo, useRefereeRebateSummary, useReferralInfo, useReferralRebateSummary, useRestrictedInfo, useRwaSymbolsInfo, useRwaSymbolsInfoStore, useSessionStorage, useSettleSubscription, useSimpleDI, useStatisticsDaily, useStorageChain, useStorageLedgerAddress, useSubAccountAlgoOrderStream, useSubAccountDataObserver, useSubAccountMaxWithdrawal, useSubAccountMutation, useSubAccountQuery, useSubAccountWS, useSwapSupportStore, useSymbolInfo, useSymbolLeverage, useSymbolLeverageMap, useSymbolPriceRange, useSymbolWithBroker, useSymbolsInfo, useSymbolsInfoStore, useTPSLOrder, useTestTokenStore, useTestnetChainsStore, useTickerStream, useTokenInfo, useTokensInfo, useTpslPriceChecker, useTrack, useTrackingInstance, useTradingRewardsStatus, useTransfer, useTransferHistory, useUpdatedRef, useUserStatistics, useVaultsHistory, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWalletTopic, useWithdraw, useWsStatus, index as utils, _default as version };
|