@orderly.network/trading 2.0.0-alpha.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.css ADDED
@@ -0,0 +1,2 @@
1
+ :root{--orderly-color-primary: 71 116 246;--orderly-color-primary-light: 96 140 255;--orderly-color-primary-darken: 51 95 252;--orderly-color-primary-contrast: 255 255 255;--orderly-color-link: 96 140 255;--orderly-color-secondary: 51 57 72;--orderly-color-tertiary: 97 100 104;--orderly-color-quaternary: 218 218 218;--orderly-color-danger: 233 62 113;--orderly-color-danger-light: 255 68 124;--orderly-color-danger-darken: 172 45 88;--orderly-color-danger-contrast: 255 255 255;--orderly-color-success: 3 152 134;--orderly-color-success-light: 0 180 158;--orderly-color-success-darken: 0 119 105;--orderly-color-success-contrast: 255 255 255;--orderly-color-warning: 229 199 0;--orderly-color-warning-light: 229 199 0;--orderly-color-warning-darken: 90 72 12;--orderly-color-warning-contrast: 255 255 255;--orderly-color-fill: 40 46 58;--orderly-color-fill-active: 40 46 58;--orderly-color-base-100: 83 94 123;--orderly-color-base-200: 74 83 105;--orderly-color-base-300: 57 65 85;--orderly-color-base-400: 51 57 72;--orderly-color-base-500: 40 46 58;--orderly-color-base-600: 32 37 47;--orderly-color-base-700: 27 32 40;--orderly-color-base-800: 24 28 35;--orderly-color-base-900: 19 21 25;--orderly-color-base-foreground: 255 255 255;--orderly-color-trading-loss: 255 68 124;--orderly-color-trading-loss-contrast: 255 68 124;--orderly-color-trading-profit: 0 180 158;--orderly-color-trading-profit-contrast: 0 180 158;--orderly-rounded: 6px;--orderly-rounded-sm: 4px;--orderly-rounded-lg: 8px;--orderly-rounded-xl: 16px;--orderly-rounded-full: 9999px;--orderly-button-shadow: 0 1px 0 0 rgba(255, 255, 255, .1) inset, 0 -4px 0 0 rgba(0, 0, 0, .15) inset;--orderly-font-size-4xs: 11px;--orderly-font-size-3xs: 12px;--orderly-font-size-2xs: 13px;--orderly-font-size-xs: 14px;--orderly-font-size-sm: 15px;--orderly-font-size-base: 16px;--orderly-font-size-lg: 18px;--orderly-font-size-xl: 20px;--orderly-font-size-2xl: 24px;--orderly-font-size-3xl: 30px;--orderly-font-size-4xl: 36px;--orderly-color-divider: 42 46 52;--orderly-font-family: "DIN2014-Demi", "PingFangSC-Medium", "Noto Sans", sans-serif;--orderly-referral-bg-gradient-from: 39 43 147;--orderly-referral-bg-gradient-to: 41 137 226;--orderly-referral-text-gradient-from: 38 254 254;--orderly-referral-text-gradient-to: 89 176 254}
2
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/style/style.css"],"sourcesContent":[":root {\n /** Primary */\n --orderly-color-primary: 71 116 246;\n --orderly-color-primary-light: 96 140 255;\n --orderly-color-primary-darken: 51 95 252;\n --orderly-color-primary-contrast: 255 255 255;\n\n --orderly-color-link: 96 140 255;\n\n --orderly-color-secondary: 51 57 72;\n --orderly-color-tertiary: 97 100 104;\n --orderly-color-quaternary: 218 218 218;\n\n /** Danger / Sell / Short */\n --orderly-color-danger: 233 62 113;\n --orderly-color-danger-light: 255 68 124;\n --orderly-color-danger-darken: 172 45 88;\n --orderly-color-danger-contrast: 255 255 255;\n\n /** Success / Buy / Long */\n --orderly-color-success: 3 152 134;\n --orderly-color-success-light: 0 180 158;\n --orderly-color-success-darken: 0 119 105;\n --orderly-color-success-contrast: 255 255 255;\n\n /** Warning */\n --orderly-color-warning: 229 199 0;\n --orderly-color-warning-light: 229 199 0;\n --orderly-color-warning-darken: 90 72 12;\n --orderly-color-warning-contrast: 255 255 255;\n\n --orderly-color-fill: 40 46 58;\n --orderly-color-fill-active: 40 46 58;\n\n /** Background */\n --orderly-color-base-100: 83 94 123;\n --orderly-color-base-200: 74 83 105;\n --orderly-color-base-300: 57 65 85;\n --orderly-color-base-400: 51 57 72;\n --orderly-color-base-500: 40 46 58;\n --orderly-color-base-600: 32 37 47;\n --orderly-color-base-700: 27 32 40;\n --orderly-color-base-800: 24 28 35;\n --orderly-color-base-900: 19 21 25;\n\n --orderly-color-base-foreground: 255 255 255;\n\n --orderly-color-trading-loss: 255 68 124;\n --orderly-color-trading-loss-contrast: 255 68 124;\n --orderly-color-trading-profit: 0 180 158;\n --orderly-color-trading-profit-contrast: 0 180 158;\n\n /* rounded */\n --orderly-rounded: 6px;\n --orderly-rounded-sm: 4px;\n --orderly-rounded-lg: 8px;\n --orderly-rounded-xl: 16px;\n --orderly-rounded-full: 9999px;\n\n --orderly-button-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.1) inset,\n 0 -4px 0 0 rgba(0, 0, 0, 0.15) inset;\n\n --orderly-font-size-4xs: 11px;\n --orderly-font-size-3xs: 12px;\n --orderly-font-size-2xs: 13px;\n --orderly-font-size-xs: 14px;\n --orderly-font-size-sm: 15px;\n --orderly-font-size-base: 16px;\n --orderly-font-size-lg: 18px;\n --orderly-font-size-xl: 20px;\n --orderly-font-size-2xl: 24px;\n --orderly-font-size-3xl: 30px;\n --orderly-font-size-4xl: 36px;\n\n --orderly-color-divider: 42 46 52;\n\n --orderly-font-family: \"DIN2014-Demi\", \"PingFangSC-Medium\", \"Noto Sans\",\n sans-serif;\n\n --orderly-referral-bg-gradient-from: 39 43 147;\n --orderly-referral-bg-gradient-to: 41 137 226;\n --orderly-referral-text-gradient-from: 38 254 254;\n --orderly-referral-text-gradient-to: 89 176 254;\n}\n"],"mappings":"AAAA,MAEE,yBAAyB,GAAG,IAAI,IAChC,+BAA+B,GAAG,IAAI,IACtC,gCAAgC,GAAG,GAAG,IACtC,kCAAkC,IAAI,IAAI,IAE1C,sBAAsB,GAAG,IAAI,IAE7B,2BAA2B,GAAG,GAAG,GACjC,0BAA0B,GAAG,IAAI,IACjC,4BAA4B,IAAI,IAAI,IAGpC,wBAAwB,IAAI,GAAG,IAC/B,8BAA8B,IAAI,GAAG,IACrC,+BAA+B,IAAI,GAAG,GACtC,iCAAiC,IAAI,IAAI,IAGzC,yBAAyB,EAAE,IAAI,IAC/B,+BAA+B,EAAE,IAAI,IACrC,gCAAgC,EAAE,IAAI,IACtC,kCAAkC,IAAI,IAAI,IAG1C,yBAAyB,IAAI,IAAI,EACjC,+BAA+B,IAAI,IAAI,EACvC,gCAAgC,GAAG,GAAG,GACtC,kCAAkC,IAAI,IAAI,IAE1C,sBAAsB,GAAG,GAAG,GAC5B,6BAA6B,GAAG,GAAG,GAGnC,0BAA0B,GAAG,GAAG,IAChC,0BAA0B,GAAG,GAAG,IAChC,0BAA0B,GAAG,GAAG,GAChC,0BAA0B,GAAG,GAAG,GAChC,0BAA0B,GAAG,GAAG,GAChC,0BAA0B,GAAG,GAAG,GAChC,0BAA0B,GAAG,GAAG,GAChC,0BAA0B,GAAG,GAAG,GAChC,0BAA0B,GAAG,GAAG,GAEhC,iCAAiC,IAAI,IAAI,IAEzC,8BAA8B,IAAI,GAAG,IACrC,uCAAuC,IAAI,GAAG,IAC9C,gCAAgC,EAAE,IAAI,IACtC,yCAAyC,EAAE,IAAI,IAG/C,mBAAmB,IACnB,sBAAsB,IACtB,sBAAsB,IACtB,sBAAsB,KACtB,wBAAwB,OAExB,yBAAyB,EAAE,IAAI,EAAE,EAAE,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAK,KAAK,EAC/D,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAM,MAEjC,yBAAyB,KACzB,yBAAyB,KACzB,yBAAyB,KACzB,wBAAwB,KACxB,wBAAwB,KACxB,0BAA0B,KAC1B,wBAAwB,KACxB,wBAAwB,KACxB,yBAAyB,KACzB,yBAAyB,KACzB,yBAAyB,KAEzB,yBAAyB,GAAG,GAAG,GAE/B,uBAAuB,cAAc,EAAE,mBAAmB,EAAE,WAAW,EACrE,WAEF,qCAAqC,GAAG,GAAG,IAC3C,mCAAmC,GAAG,IAAI,IAC1C,uCAAuC,GAAG,IAAI,IAC9C,qCAAqC,GAAG,IAAI,GAC9C","names":[]}
@@ -0,0 +1,303 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as _orderly_network_types from '@orderly.network/types';
3
+ import { API, NetworkId, AccountStatusEnum } from '@orderly.network/types';
4
+ import { PositionsProps } from '@orderly.network/ui-positions';
5
+ import * as react from 'react';
6
+ import { ReactNode, FC, PropsWithChildren } from 'react';
7
+ import * as _orderly_network_hooks from '@orderly.network/hooks';
8
+
9
+ declare enum DataListTabType {
10
+ positions = "Positions",
11
+ pending = "Pending",
12
+ tp_sl = "TP/SL",
13
+ filled = "Filled",
14
+ orderHistory = "Order history"
15
+ }
16
+ declare const useDataListScript: (props: {
17
+ current?: DataListTabType;
18
+ config: PositionsProps & {
19
+ symbol?: string;
20
+ };
21
+ }) => {
22
+ current: DataListTabType | undefined;
23
+ config: PositionsProps & {
24
+ symbol?: string | undefined;
25
+ };
26
+ unPnlPriceBasis: any;
27
+ setUnPnlPriceBasic: (value: string) => void;
28
+ pnlNotionalDecimalPrecision: any;
29
+ setPnlNotionalDecimalPrecision: (value: number) => void;
30
+ showAllSymbol: any;
31
+ setShowAllSymbol: (value: boolean) => void;
32
+ };
33
+ type DataListState = ReturnType<typeof useDataListScript>;
34
+
35
+ type layoutInfo = {
36
+ width?: number;
37
+ height?: number;
38
+ fontSize?: number;
39
+ color?: string;
40
+ textAlign?: CanvasTextAlign;
41
+ textBaseline?: CanvasTextBaseline;
42
+ position: Partial<{
43
+ left: number;
44
+ right: number;
45
+ top: number;
46
+ bottom: number;
47
+ }>;
48
+ };
49
+ type PosterLayoutConfig = {
50
+ message?: layoutInfo;
51
+ domain?: layoutInfo;
52
+ position?: layoutInfo;
53
+ unrealizedPnl?: layoutInfo & {
54
+ secondaryColor: string;
55
+ secondaryFontSize: number;
56
+ };
57
+ informations?: layoutInfo & {
58
+ labelColor?: string;
59
+ };
60
+ updateTime?: layoutInfo;
61
+ };
62
+ type ShareOptions = {
63
+ pnl: {
64
+ /**
65
+ * defualt is Manrope
66
+ */
67
+ fontFamily?: string;
68
+ /**
69
+ * can not empty
70
+ */
71
+ backgroundImages: string[];
72
+ /**
73
+ * posterLayoutConfig
74
+ */
75
+ layout?: PosterLayoutConfig;
76
+ /**
77
+ * norma text color, default is "rgba(255, 255, 255, 0.98)"
78
+ */
79
+ color?: string;
80
+ /**
81
+ * profit text color, default is "rgb(0,181,159)"
82
+ */
83
+ profitColor?: string;
84
+ /**
85
+ * loss text color, default is "rgb(255,103,194)"
86
+ */
87
+ lossColor?: string;
88
+ /**
89
+ * brand color, default is "rgb(0,181,159)"
90
+ */
91
+ brandColor?: string;
92
+ };
93
+ };
94
+ declare enum TradingFeatures {
95
+ Sider = "sider",
96
+ TopNavBar = "topNavBar",
97
+ Footer = "footer",
98
+ Header = "header",
99
+ Kline = "kline",
100
+ OrderBook = "orderBook",
101
+ TradeHistory = "tradeHistory",
102
+ Positions = "positions",
103
+ Orders = "orders",
104
+ AssetAndMarginInfo = "asset_margin_info"
105
+ }
106
+ type BasicSymbolInfo = {
107
+ base_dp: number;
108
+ quote_dp: number;
109
+ base_tick: number;
110
+ base: string;
111
+ quote: string;
112
+ };
113
+ interface TradingPageState extends TradingPageV2Props {
114
+ symbolInfo: {
115
+ base_dp: number;
116
+ quote_dp: number;
117
+ base_tick: number;
118
+ base: string;
119
+ quote: string;
120
+ symbol: string;
121
+ };
122
+ }
123
+ interface TradingViewConfigInterface {
124
+ scriptSRC?: string;
125
+ library_path: string;
126
+ overrides?: Record<string, string>;
127
+ studiesOverrides?: Record<string, string>;
128
+ customCssUrl?: string;
129
+ colorConfig?: ColorConfigInterface;
130
+ }
131
+ interface ColorConfigInterface {
132
+ chartBG?: string;
133
+ upColor?: string;
134
+ downColor?: string;
135
+ pnlUpColor?: string;
136
+ pnlDownColor?: string;
137
+ pnlZoreColor?: string;
138
+ textColor?: string;
139
+ qtyTextColor?: string;
140
+ font?: string;
141
+ closeIcon?: string;
142
+ }
143
+ type ReferralProps = {
144
+ saveRefCode?: boolean;
145
+ onClickReferral?: () => void;
146
+ onBoundRefCode?: (success: boolean, error: any) => void;
147
+ refLink?: string;
148
+ slogan?: string;
149
+ };
150
+ type TradingRewardProps = {
151
+ onClickTradingReward?: () => void;
152
+ };
153
+ type BaseTradingPageProps = {
154
+ symbol: string;
155
+ tradingViewConfig: TradingViewConfigInterface;
156
+ onSymbolChange?: (symbol: API.Symbol) => void;
157
+ disableFeatures?: TradingFeatures[];
158
+ overrideFeatures?: Record<TradingFeatures, ReactNode>;
159
+ };
160
+ type TradingPageProps = BaseTradingPageProps & {
161
+ shareOptions: ShareOptions;
162
+ referral: ReferralProps;
163
+ tradingReward: TradingRewardProps;
164
+ };
165
+ type TradingPageV2Props = BaseTradingPageProps & {
166
+ dataList: {
167
+ current?: DataListTabType;
168
+ config: Partial<Omit<PositionsProps, "pnlNotionalDecimalPrecision">>;
169
+ };
170
+ };
171
+
172
+ declare const TradingPage: (props: TradingPageProps) => react_jsx_runtime.JSX.Element;
173
+
174
+ declare const DataList: FC<DataListState>;
175
+
176
+ declare const DataListWidget: (props: {
177
+ current?: DataListTabType;
178
+ config: Partial<Omit<PositionsProps, "pnlNotionalDecimalPrecision">>;
179
+ }) => react_jsx_runtime.JSX.Element;
180
+
181
+ declare const useLastTradesScript: (symbol: string) => {
182
+ base: any;
183
+ quote: any;
184
+ data: _orderly_network_types.API.Trade[];
185
+ isLoading: boolean;
186
+ baseDp: any;
187
+ quoteDp: any;
188
+ };
189
+ type LastTradesState = ReturnType<typeof useLastTradesScript>;
190
+
191
+ declare const LastTrades: FC<LastTradesState & {
192
+ className?: string;
193
+ style?: React.CSSProperties;
194
+ }>;
195
+
196
+ declare const LastTradesWidget: (props: {
197
+ symbol: string;
198
+ className?: string;
199
+ style?: React.CSSProperties;
200
+ }) => react_jsx_runtime.JSX.Element;
201
+
202
+ declare const useAssetViewScript: () => {
203
+ onDeposit: () => Promise<unknown>;
204
+ onWithdraw: () => Promise<unknown>;
205
+ onSettle: () => Promise<any>;
206
+ visible: any;
207
+ toggleVisible: () => void;
208
+ networkId: NetworkId;
209
+ isFirstTimeDeposit: boolean;
210
+ totalValue: number;
211
+ status: AccountStatusEnum;
212
+ freeCollateral: number;
213
+ marginRatioVal: number;
214
+ renderMMR: string;
215
+ isConnected: boolean;
216
+ };
217
+ type AssetViewState = ReturnType<typeof useAssetViewScript>;
218
+
219
+ declare const AssetView: FC<AssetViewState>;
220
+
221
+ declare const AssetViewWidget: () => react_jsx_runtime.JSX.Element;
222
+
223
+ declare const useOrderBookScript: (props: {
224
+ symbol: string;
225
+ height?: number;
226
+ }) => {
227
+ level: number;
228
+ asks: _orderly_network_hooks.OrderBookItem[] | undefined;
229
+ bids: _orderly_network_hooks.OrderBookItem[] | undefined;
230
+ markPrice: number | undefined;
231
+ lastPrice: number[] | undefined;
232
+ depths: string[];
233
+ selDepth: string | undefined;
234
+ base: string;
235
+ quote: string;
236
+ isLoading: boolean | undefined;
237
+ onItemClick: ((item: _orderly_network_hooks.OrderBookItem) => void) | undefined;
238
+ cellHeight: number;
239
+ onDepthChange: ((depth: number) => void) | undefined;
240
+ pendingOrders: number[];
241
+ symbolInfo: BasicSymbolInfo;
242
+ isMWeb: boolean;
243
+ };
244
+ type OrderBookState = ReturnType<typeof useOrderBookScript>;
245
+
246
+ declare const OrderBook: FC<OrderBookState & {
247
+ className?: string;
248
+ }>;
249
+
250
+ declare const OrderBookWidget: (props: {
251
+ className?: string;
252
+ symbol: string;
253
+ height?: number;
254
+ }) => react_jsx_runtime.JSX.Element;
255
+
256
+ declare const useRiskRateScript: () => {
257
+ riskRate: string;
258
+ riskRateColor: {
259
+ isHigh: boolean;
260
+ isMedium: boolean;
261
+ isLow: boolean;
262
+ isDefault: boolean;
263
+ };
264
+ isConnected: boolean;
265
+ currentLeverage: number;
266
+ maxLeverage: any;
267
+ };
268
+ type RiskRateState = ReturnType<typeof useRiskRateScript>;
269
+
270
+ declare const RiskRate: FC<RiskRateState>;
271
+
272
+ declare const RiskRateWidget: () => react_jsx_runtime.JSX.Element;
273
+
274
+ declare const useOrderBookAndTradesScript: (symbol: string) => {
275
+ symbol: string;
276
+ containerSize: {
277
+ width: number;
278
+ height: number;
279
+ } | undefined;
280
+ containerRef: any;
281
+ tab: "orderBook" | "lastTrades";
282
+ setTab: react.Dispatch<react.SetStateAction<"orderBook" | "lastTrades">>;
283
+ };
284
+ type OrderBookAndTradesState = ReturnType<typeof useOrderBookAndTradesScript>;
285
+
286
+ declare const OrderBookAndTrades: FC<OrderBookAndTradesState>;
287
+
288
+ declare const OrderBookAndTradesWidget: (props: {
289
+ symbol: string;
290
+ }) => react_jsx_runtime.JSX.Element;
291
+
292
+ declare const useTradingV2Script: () => TradingPageState;
293
+ type TradingV2State = ReturnType<typeof useTradingV2Script>;
294
+
295
+ declare const TradingV2: FC<TradingV2State>;
296
+
297
+ declare const TradingV2Widget: () => react_jsx_runtime.JSX.Element;
298
+
299
+ declare const TradingPageV2: (props: TradingPageV2Props) => react_jsx_runtime.JSX.Element;
300
+
301
+ declare const TradingPageProvider: (props: PropsWithChildren<TradingPageV2Props>) => react_jsx_runtime.JSX.Element;
302
+
303
+ export { AssetView, AssetViewWidget, DataList, DataListWidget, LastTrades, LastTradesWidget, OrderBook, OrderBookAndTrades, OrderBookAndTradesWidget, OrderBookWidget, RiskRate, RiskRateWidget, type ShareOptions, TradingPage, TradingPageProvider, TradingPageV2, TradingV2, TradingV2Widget, useOrderBookAndTradesScript, useOrderBookScript };
@@ -0,0 +1,303 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as _orderly_network_types from '@orderly.network/types';
3
+ import { API, NetworkId, AccountStatusEnum } from '@orderly.network/types';
4
+ import { PositionsProps } from '@orderly.network/ui-positions';
5
+ import * as react from 'react';
6
+ import { ReactNode, FC, PropsWithChildren } from 'react';
7
+ import * as _orderly_network_hooks from '@orderly.network/hooks';
8
+
9
+ declare enum DataListTabType {
10
+ positions = "Positions",
11
+ pending = "Pending",
12
+ tp_sl = "TP/SL",
13
+ filled = "Filled",
14
+ orderHistory = "Order history"
15
+ }
16
+ declare const useDataListScript: (props: {
17
+ current?: DataListTabType;
18
+ config: PositionsProps & {
19
+ symbol?: string;
20
+ };
21
+ }) => {
22
+ current: DataListTabType | undefined;
23
+ config: PositionsProps & {
24
+ symbol?: string | undefined;
25
+ };
26
+ unPnlPriceBasis: any;
27
+ setUnPnlPriceBasic: (value: string) => void;
28
+ pnlNotionalDecimalPrecision: any;
29
+ setPnlNotionalDecimalPrecision: (value: number) => void;
30
+ showAllSymbol: any;
31
+ setShowAllSymbol: (value: boolean) => void;
32
+ };
33
+ type DataListState = ReturnType<typeof useDataListScript>;
34
+
35
+ type layoutInfo = {
36
+ width?: number;
37
+ height?: number;
38
+ fontSize?: number;
39
+ color?: string;
40
+ textAlign?: CanvasTextAlign;
41
+ textBaseline?: CanvasTextBaseline;
42
+ position: Partial<{
43
+ left: number;
44
+ right: number;
45
+ top: number;
46
+ bottom: number;
47
+ }>;
48
+ };
49
+ type PosterLayoutConfig = {
50
+ message?: layoutInfo;
51
+ domain?: layoutInfo;
52
+ position?: layoutInfo;
53
+ unrealizedPnl?: layoutInfo & {
54
+ secondaryColor: string;
55
+ secondaryFontSize: number;
56
+ };
57
+ informations?: layoutInfo & {
58
+ labelColor?: string;
59
+ };
60
+ updateTime?: layoutInfo;
61
+ };
62
+ type ShareOptions = {
63
+ pnl: {
64
+ /**
65
+ * defualt is Manrope
66
+ */
67
+ fontFamily?: string;
68
+ /**
69
+ * can not empty
70
+ */
71
+ backgroundImages: string[];
72
+ /**
73
+ * posterLayoutConfig
74
+ */
75
+ layout?: PosterLayoutConfig;
76
+ /**
77
+ * norma text color, default is "rgba(255, 255, 255, 0.98)"
78
+ */
79
+ color?: string;
80
+ /**
81
+ * profit text color, default is "rgb(0,181,159)"
82
+ */
83
+ profitColor?: string;
84
+ /**
85
+ * loss text color, default is "rgb(255,103,194)"
86
+ */
87
+ lossColor?: string;
88
+ /**
89
+ * brand color, default is "rgb(0,181,159)"
90
+ */
91
+ brandColor?: string;
92
+ };
93
+ };
94
+ declare enum TradingFeatures {
95
+ Sider = "sider",
96
+ TopNavBar = "topNavBar",
97
+ Footer = "footer",
98
+ Header = "header",
99
+ Kline = "kline",
100
+ OrderBook = "orderBook",
101
+ TradeHistory = "tradeHistory",
102
+ Positions = "positions",
103
+ Orders = "orders",
104
+ AssetAndMarginInfo = "asset_margin_info"
105
+ }
106
+ type BasicSymbolInfo = {
107
+ base_dp: number;
108
+ quote_dp: number;
109
+ base_tick: number;
110
+ base: string;
111
+ quote: string;
112
+ };
113
+ interface TradingPageState extends TradingPageV2Props {
114
+ symbolInfo: {
115
+ base_dp: number;
116
+ quote_dp: number;
117
+ base_tick: number;
118
+ base: string;
119
+ quote: string;
120
+ symbol: string;
121
+ };
122
+ }
123
+ interface TradingViewConfigInterface {
124
+ scriptSRC?: string;
125
+ library_path: string;
126
+ overrides?: Record<string, string>;
127
+ studiesOverrides?: Record<string, string>;
128
+ customCssUrl?: string;
129
+ colorConfig?: ColorConfigInterface;
130
+ }
131
+ interface ColorConfigInterface {
132
+ chartBG?: string;
133
+ upColor?: string;
134
+ downColor?: string;
135
+ pnlUpColor?: string;
136
+ pnlDownColor?: string;
137
+ pnlZoreColor?: string;
138
+ textColor?: string;
139
+ qtyTextColor?: string;
140
+ font?: string;
141
+ closeIcon?: string;
142
+ }
143
+ type ReferralProps = {
144
+ saveRefCode?: boolean;
145
+ onClickReferral?: () => void;
146
+ onBoundRefCode?: (success: boolean, error: any) => void;
147
+ refLink?: string;
148
+ slogan?: string;
149
+ };
150
+ type TradingRewardProps = {
151
+ onClickTradingReward?: () => void;
152
+ };
153
+ type BaseTradingPageProps = {
154
+ symbol: string;
155
+ tradingViewConfig: TradingViewConfigInterface;
156
+ onSymbolChange?: (symbol: API.Symbol) => void;
157
+ disableFeatures?: TradingFeatures[];
158
+ overrideFeatures?: Record<TradingFeatures, ReactNode>;
159
+ };
160
+ type TradingPageProps = BaseTradingPageProps & {
161
+ shareOptions: ShareOptions;
162
+ referral: ReferralProps;
163
+ tradingReward: TradingRewardProps;
164
+ };
165
+ type TradingPageV2Props = BaseTradingPageProps & {
166
+ dataList: {
167
+ current?: DataListTabType;
168
+ config: Partial<Omit<PositionsProps, "pnlNotionalDecimalPrecision">>;
169
+ };
170
+ };
171
+
172
+ declare const TradingPage: (props: TradingPageProps) => react_jsx_runtime.JSX.Element;
173
+
174
+ declare const DataList: FC<DataListState>;
175
+
176
+ declare const DataListWidget: (props: {
177
+ current?: DataListTabType;
178
+ config: Partial<Omit<PositionsProps, "pnlNotionalDecimalPrecision">>;
179
+ }) => react_jsx_runtime.JSX.Element;
180
+
181
+ declare const useLastTradesScript: (symbol: string) => {
182
+ base: any;
183
+ quote: any;
184
+ data: _orderly_network_types.API.Trade[];
185
+ isLoading: boolean;
186
+ baseDp: any;
187
+ quoteDp: any;
188
+ };
189
+ type LastTradesState = ReturnType<typeof useLastTradesScript>;
190
+
191
+ declare const LastTrades: FC<LastTradesState & {
192
+ className?: string;
193
+ style?: React.CSSProperties;
194
+ }>;
195
+
196
+ declare const LastTradesWidget: (props: {
197
+ symbol: string;
198
+ className?: string;
199
+ style?: React.CSSProperties;
200
+ }) => react_jsx_runtime.JSX.Element;
201
+
202
+ declare const useAssetViewScript: () => {
203
+ onDeposit: () => Promise<unknown>;
204
+ onWithdraw: () => Promise<unknown>;
205
+ onSettle: () => Promise<any>;
206
+ visible: any;
207
+ toggleVisible: () => void;
208
+ networkId: NetworkId;
209
+ isFirstTimeDeposit: boolean;
210
+ totalValue: number;
211
+ status: AccountStatusEnum;
212
+ freeCollateral: number;
213
+ marginRatioVal: number;
214
+ renderMMR: string;
215
+ isConnected: boolean;
216
+ };
217
+ type AssetViewState = ReturnType<typeof useAssetViewScript>;
218
+
219
+ declare const AssetView: FC<AssetViewState>;
220
+
221
+ declare const AssetViewWidget: () => react_jsx_runtime.JSX.Element;
222
+
223
+ declare const useOrderBookScript: (props: {
224
+ symbol: string;
225
+ height?: number;
226
+ }) => {
227
+ level: number;
228
+ asks: _orderly_network_hooks.OrderBookItem[] | undefined;
229
+ bids: _orderly_network_hooks.OrderBookItem[] | undefined;
230
+ markPrice: number | undefined;
231
+ lastPrice: number[] | undefined;
232
+ depths: string[];
233
+ selDepth: string | undefined;
234
+ base: string;
235
+ quote: string;
236
+ isLoading: boolean | undefined;
237
+ onItemClick: ((item: _orderly_network_hooks.OrderBookItem) => void) | undefined;
238
+ cellHeight: number;
239
+ onDepthChange: ((depth: number) => void) | undefined;
240
+ pendingOrders: number[];
241
+ symbolInfo: BasicSymbolInfo;
242
+ isMWeb: boolean;
243
+ };
244
+ type OrderBookState = ReturnType<typeof useOrderBookScript>;
245
+
246
+ declare const OrderBook: FC<OrderBookState & {
247
+ className?: string;
248
+ }>;
249
+
250
+ declare const OrderBookWidget: (props: {
251
+ className?: string;
252
+ symbol: string;
253
+ height?: number;
254
+ }) => react_jsx_runtime.JSX.Element;
255
+
256
+ declare const useRiskRateScript: () => {
257
+ riskRate: string;
258
+ riskRateColor: {
259
+ isHigh: boolean;
260
+ isMedium: boolean;
261
+ isLow: boolean;
262
+ isDefault: boolean;
263
+ };
264
+ isConnected: boolean;
265
+ currentLeverage: number;
266
+ maxLeverage: any;
267
+ };
268
+ type RiskRateState = ReturnType<typeof useRiskRateScript>;
269
+
270
+ declare const RiskRate: FC<RiskRateState>;
271
+
272
+ declare const RiskRateWidget: () => react_jsx_runtime.JSX.Element;
273
+
274
+ declare const useOrderBookAndTradesScript: (symbol: string) => {
275
+ symbol: string;
276
+ containerSize: {
277
+ width: number;
278
+ height: number;
279
+ } | undefined;
280
+ containerRef: any;
281
+ tab: "orderBook" | "lastTrades";
282
+ setTab: react.Dispatch<react.SetStateAction<"orderBook" | "lastTrades">>;
283
+ };
284
+ type OrderBookAndTradesState = ReturnType<typeof useOrderBookAndTradesScript>;
285
+
286
+ declare const OrderBookAndTrades: FC<OrderBookAndTradesState>;
287
+
288
+ declare const OrderBookAndTradesWidget: (props: {
289
+ symbol: string;
290
+ }) => react_jsx_runtime.JSX.Element;
291
+
292
+ declare const useTradingV2Script: () => TradingPageState;
293
+ type TradingV2State = ReturnType<typeof useTradingV2Script>;
294
+
295
+ declare const TradingV2: FC<TradingV2State>;
296
+
297
+ declare const TradingV2Widget: () => react_jsx_runtime.JSX.Element;
298
+
299
+ declare const TradingPageV2: (props: TradingPageV2Props) => react_jsx_runtime.JSX.Element;
300
+
301
+ declare const TradingPageProvider: (props: PropsWithChildren<TradingPageV2Props>) => react_jsx_runtime.JSX.Element;
302
+
303
+ export { AssetView, AssetViewWidget, DataList, DataListWidget, LastTrades, LastTradesWidget, OrderBook, OrderBookAndTrades, OrderBookAndTradesWidget, OrderBookWidget, RiskRate, RiskRateWidget, type ShareOptions, TradingPage, TradingPageProvider, TradingPageV2, TradingV2, TradingV2Widget, useOrderBookAndTradesScript, useOrderBookScript };