@orderly.network/hooks 2.11.2 → 2.12.0-alpha.0
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 +192 -105
- package/dist/index.d.ts +192 -105
- package/dist/index.js +241 -54
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +236 -54
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
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: "2.
|
|
173
|
+
declare const _default: "2.12.0-alpha.0";
|
|
41
174
|
|
|
42
175
|
declare const fetcher: (url: string, init: RequestInit | undefined, queryOptions: useQueryOptions<any>) => Promise<any>;
|
|
43
176
|
type useQueryOptions<T> = SWRConfiguration & {
|
|
@@ -471,102 +604,6 @@ declare function useChains<T extends NetworkId | undefined, K extends UseChainsO
|
|
|
471
604
|
UseChainsReturnObject
|
|
472
605
|
];
|
|
473
606
|
|
|
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
607
|
type FilteredChains = {
|
|
571
608
|
mainnet?: {
|
|
572
609
|
id: number;
|
|
@@ -831,7 +868,8 @@ declare enum MarketsType$1 {
|
|
|
831
868
|
FAVORITES = 0,
|
|
832
869
|
RECENT = 1,
|
|
833
870
|
ALL = 2,
|
|
834
|
-
NEW_LISTING = 3
|
|
871
|
+
NEW_LISTING = 3,
|
|
872
|
+
COMMUNITY = 4
|
|
835
873
|
}
|
|
836
874
|
interface FavoriteTab$1 {
|
|
837
875
|
name: string;
|
|
@@ -876,7 +914,8 @@ declare enum MarketsType {
|
|
|
876
914
|
RECENT = 1,
|
|
877
915
|
ALL = 2,
|
|
878
916
|
RWA = 3,
|
|
879
|
-
NEW_LISTING = 4
|
|
917
|
+
NEW_LISTING = 4,
|
|
918
|
+
COMMUNITY = 5
|
|
880
919
|
}
|
|
881
920
|
interface FavoriteTab {
|
|
882
921
|
name: string;
|
|
@@ -899,6 +938,10 @@ type TabSort = Record<string, {
|
|
|
899
938
|
type MarketsItem = {
|
|
900
939
|
symbol: string;
|
|
901
940
|
displayName?: string;
|
|
941
|
+
/** Permissionless listing: display name without broker_id suffix */
|
|
942
|
+
display_symbol_name?: string;
|
|
943
|
+
/** Permissionless listing: broker id; null for non-community-listed symbols */
|
|
944
|
+
broker_id?: string | null;
|
|
902
945
|
index_price: number;
|
|
903
946
|
mark_price: number;
|
|
904
947
|
sum_unitary_funding: number;
|
|
@@ -1058,6 +1101,7 @@ declare const useMarginModeBySymbol: (symbol: string, fallback?: MarginMode | nu
|
|
|
1058
1101
|
error: any;
|
|
1059
1102
|
refresh: swr.KeyedMutator<MarginModesResponseItem[]>;
|
|
1060
1103
|
update: (mode: MarginMode) => Promise<SetMarginModeResult>;
|
|
1104
|
+
isPermissionlessListing: boolean;
|
|
1061
1105
|
};
|
|
1062
1106
|
|
|
1063
1107
|
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 +1238,7 @@ declare const usePositionStream: (symbol?: string, options?: SWRConfiguration &
|
|
|
1194
1238
|
readonly totalCollateral: _orderly_network_utils.Decimal;
|
|
1195
1239
|
readonly totalValue: _orderly_network_utils.Decimal | null;
|
|
1196
1240
|
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]> & {
|
|
1241
|
+
}, 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
1242
|
isNil: boolean;
|
|
1199
1243
|
}, {
|
|
1200
1244
|
/**
|
|
@@ -2244,6 +2288,41 @@ declare function useOrderEntry$1(symbol: string, side: OrderSide, reduceOnly: bo
|
|
|
2244
2288
|
|
|
2245
2289
|
declare function useMediaQuery(query: string): boolean;
|
|
2246
2290
|
|
|
2291
|
+
interface UseBadgeBySymbolReturn {
|
|
2292
|
+
/** Display name of the symbol. API.display_symbol_name */
|
|
2293
|
+
displayName: string;
|
|
2294
|
+
/** Broker ID of the symbol. */
|
|
2295
|
+
brokerId: string | undefined;
|
|
2296
|
+
/** Badge label: first segment of raw name, truncated to 7 chars with "...". */
|
|
2297
|
+
brokerName: string | undefined;
|
|
2298
|
+
/** Raw broker name as provided by the API. */
|
|
2299
|
+
brokerNameRaw: string | undefined;
|
|
2300
|
+
}
|
|
2301
|
+
/**
|
|
2302
|
+
* Match the given `symbol` in `symbolsInfo` and return `displayName`, `brokerId`,
|
|
2303
|
+
* and the mapped `brokerName`.
|
|
2304
|
+
*
|
|
2305
|
+
* `brokerName` comes from the `/v1/public/broker/name` broker list
|
|
2306
|
+
* (SWR shared cache).
|
|
2307
|
+
*/
|
|
2308
|
+
declare const useBadgeBySymbol: (symbol: string) => UseBadgeBySymbolReturn;
|
|
2309
|
+
/**
|
|
2310
|
+
* Same rules as {@link useSymbolWithBroker}, for use in callbacks / non-React code paths.
|
|
2311
|
+
*/
|
|
2312
|
+
declare function formatSymbolWithBroker(symbol: string, symbolsInfo: {
|
|
2313
|
+
isNil?: boolean;
|
|
2314
|
+
[key: string]: unknown;
|
|
2315
|
+
}, brokers: Record<string, string> | undefined): string;
|
|
2316
|
+
/**
|
|
2317
|
+
* Short market label: `base`, or `base-{brokerNameBase}` when the symbol is broker-scoped and a broker
|
|
2318
|
+
* name is available from symbols info + broker list.
|
|
2319
|
+
*
|
|
2320
|
+
* Symbol shape: `type_base_quote` with optional trailing `_broker_id` segments (broker_id may
|
|
2321
|
+
* contain underscores, e.g. `orderly`). Otherwise falls back to a leading letter run for legacy
|
|
2322
|
+
* compact symbols.
|
|
2323
|
+
*/
|
|
2324
|
+
declare const useSymbolWithBroker: (symbol: string) => string;
|
|
2325
|
+
|
|
2247
2326
|
type posterDataSource = {
|
|
2248
2327
|
/**
|
|
2249
2328
|
* slogan of the poster
|
|
@@ -2251,6 +2330,7 @@ type posterDataSource = {
|
|
|
2251
2330
|
message?: string;
|
|
2252
2331
|
position: {
|
|
2253
2332
|
symbol: string;
|
|
2333
|
+
brokerName?: string;
|
|
2254
2334
|
side: "LONG" | "SHORT";
|
|
2255
2335
|
marginMode?: MarginMode;
|
|
2256
2336
|
/**
|
|
@@ -2773,6 +2853,7 @@ declare const useOrderEntryNextInternal: (symbol: string, options?: {
|
|
|
2773
2853
|
readonly setValues: (values: Partial<FullOrderState>, additional?: {
|
|
2774
2854
|
markPrice: number;
|
|
2775
2855
|
}) => Partial<OrderlyOrder> | undefined;
|
|
2856
|
+
readonly setValuesRaw: (values: Partial<FullOrderState>) => Partial<OrderlyOrder> | undefined;
|
|
2776
2857
|
readonly submit: () => void;
|
|
2777
2858
|
readonly reset: (order?: Partial<OrderlyOrder>) => void;
|
|
2778
2859
|
readonly generateOrder: (creator: OrderCreator<any>, options: {
|
|
@@ -2846,6 +2927,12 @@ type OrderEntryReturn = {
|
|
|
2846
2927
|
shouldUpdateLastChangedField?: boolean;
|
|
2847
2928
|
}) => void;
|
|
2848
2929
|
setValues: (values: Partial<FullOrderState>) => void;
|
|
2930
|
+
/**
|
|
2931
|
+
* Raw merge setter for externally computed bundles (e.g. Advanced TPSL).
|
|
2932
|
+
*
|
|
2933
|
+
* Unlike `setValues`, this intentionally skips `calculate()` to avoid overwriting computed TPSL fields.
|
|
2934
|
+
*/
|
|
2935
|
+
setValuesRaw: (values: Partial<FullOrderState>) => void;
|
|
2849
2936
|
symbolInfo: API.SymbolExt;
|
|
2850
2937
|
/**
|
|
2851
2938
|
* Meta state including validation and submission status.
|
|
@@ -3104,4 +3191,4 @@ interface UseFeatureFlagReturn {
|
|
|
3104
3191
|
*/
|
|
3105
3192
|
declare const useFeatureFlag: (key: FlagKeys) => UseFeatureFlagReturn;
|
|
3106
3193
|
|
|
3107
|
-
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, type Brokers, type Chain, type ChainFilter, type Chains, type CheckReferralCodeReturns, type CollateralOutputs, type ComputedAlgoOrder, type ConfigProviderProps, type ConnectedChain, type CurrentEpochEstimate, 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 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 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, getMinNotional, getPriceKey, indexedDBManager, initializeAppDatabase, isCurrentlyClosed, isCurrentlyTrading, noCacheConfig, parseJSON, persistIndexedDB, resetTimestampOffsetState, timestampWaitingMiddleware, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAppStore, useAssetsHistory, useAudioPlayer, 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, 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, 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 };
|
|
3194
|
+
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, type Brokers, type BuiltInMarketTab, type Chain, type ChainFilter, type Chains, type CheckReferralCodeReturns, 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 };
|