@orderly.network/ui-orders 3.0.0-beta.1 → 3.0.0-beta.3

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.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import React2, { forwardRef, useMemo, useEffect, useRef, useImperativeHandle, useCallback, useState, createContext, memo, useContext } from 'react';
2
- import { useSymbolsInfo, useOrderStream, useLocalStorage, utils, useThrottledCallback, useMutation, useSWRConfig, useAccount, unstable_serialize, useMemoizedFn, getMinNotional, findTPSLFromOrder, findTPSLOrderPriceFromOrder, useMaxQty, useConfig, useTpslPriceChecker, useOrderEntity, useReferralInfo, useLeverageBySymbol } from '@orderly.network/hooks';
2
+ import { useSymbolsInfo, useOrderStream, useLocalStorage, utils, useThrottledCallback, useMutation, useSWRConfig, useAccount, unstable_serialize, useMemoizedFn, getMinNotional, findTPSLFromOrder, findTPSLOrderPriceFromOrder, useMaxQty, useBadgeBySymbol, useConfig, useTpslPriceChecker, useOrderEntity, useReferralInfo, useLeverageBySymbol } from '@orderly.network/hooks';
3
3
  import { useTranslation, Trans, i18n } from '@orderly.network/i18n';
4
- import { OrderStatus, AlgoOrderRootType, AlgoOrderType, OrderSide, OrderType, MarginMode, EMPTY_LIST } from '@orderly.network/types';
4
+ import { OrderStatus, AlgoOrderRootType, MarginMode, AlgoOrderType, OrderSide, OrderType, EMPTY_LIST } from '@orderly.network/types';
5
5
  import { formatSymbol, Decimal, commify, commifyOptional, getTrailingStopPrice, formatNum } from '@orderly.network/utils';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
- import { usePagination, modal, Text, Button, ThrottledButton, CloseIcon, cn, Flex, Input, inputFormatter, Slider, DataFilter, TableFeatures, Grid, Picker, ListView, Tabs, TabPanel, Badge, Tooltip, EditIcon, toast as toast$1, Popover, PopoverRoot, PopoverTrigger, PopoverContent, Divider, ShareIcon, CheckIcon, Statistic, SimpleDialog, useModal, Checkbox } from '@orderly.network/ui';
7
+ import { usePagination, modal, Text, Button, ThrottledButton, CloseIcon, cn, Flex, Input, inputFormatter, Slider, DataFilter, TableFeatures, Grid, Picker, ListView, Tabs, TabPanel, Badge, Tooltip, EditIcon, toast as toast$1, Popover, PopoverRoot, PopoverTrigger, PopoverContent, Divider, ShareIcon, CheckIcon, Statistic, SymbolBadge as SymbolBadge$1, SimpleDialog, useModal, Checkbox } from '@orderly.network/ui';
8
8
  import { useDataTap, useOrderEntryFormErrorMsg } from '@orderly.network/react-app';
9
9
  import { PositionTPSLPopover, CloseToLiqPriceIcon, PositionTPSLSheet } from '@orderly.network/ui-tpsl';
10
10
  import { format, subDays, differenceInDays } from 'date-fns';
@@ -41,67 +41,10 @@ var init_orders_script = __esm({
41
41
  }
42
42
  });
43
43
  function parseBadgesFor(record) {
44
- const orderType = record.type;
45
- const algoType = record.algo_type;
46
- if (typeof orderType !== "undefined") {
47
- const list = [];
48
- if (!!record.parent_algo_type) {
49
- if (algoType === AlgoOrderType.STOP_LOSS) {
50
- const types = orderType === OrderType.CLOSE_POSITION ? [i18n.t("common.position"), i18n.t("tpsl.sl")] : [i18n.t("tpsl.sl")];
51
- list.push(...types);
52
- }
53
- if (algoType === AlgoOrderType.TAKE_PROFIT) {
54
- const types = orderType === OrderType.CLOSE_POSITION ? [i18n.t("common.position"), i18n.t("tpsl.tp")] : [i18n.t("tpsl.tp")];
55
- list.push(...types);
56
- }
57
- return list;
58
- }
59
- const type = typeof orderType === "string" ? orderType.replace("_ORDER", "") : "";
60
- if ([OrderType.ASK, OrderType.BID].includes(orderType)) {
61
- return [i18n.t("orderEntry.orderType.limit")];
62
- }
63
- if (record.algo_order_id === void 0 || record.algo_order_id && algoType === "BRACKET") {
64
- const typeMap = {
65
- [OrderType.LIMIT]: i18n.t("orderEntry.orderType.limit"),
66
- [OrderType.MARKET]: i18n.t("orderEntry.orderType.market"),
67
- [OrderType.POST_ONLY]: i18n.t("orderEntry.orderType.postOnly"),
68
- [OrderType.IOC]: i18n.t("orderEntry.orderType.ioc"),
69
- [OrderType.FOK]: i18n.t("orderEntry.orderType.fok")
70
- };
71
- return [
72
- typeMap[type] || upperCaseFirstLetter(type)
73
- ];
74
- }
75
- if (algoType === AlgoOrderRootType.TRAILING_STOP) {
76
- return [i18n.t("orderEntry.orderType.trailingStop")];
77
- }
78
- if (type) {
79
- const typeMap = {
80
- [OrderType.LIMIT]: i18n.t("orderEntry.orderType.stopLimit"),
81
- [OrderType.MARKET]: i18n.t("orderEntry.orderType.stopMarket")
82
- };
83
- return [typeMap[type] || type];
84
- }
85
- }
86
- if (typeof algoType !== "undefined") {
87
- const list = [];
88
- if (algoType === AlgoOrderRootType.POSITIONAL_TP_SL) {
89
- list.push(i18n.t("common.position"));
90
- }
91
- const tpOrder = record?.child_orders?.find(
92
- (order) => order.algo_type === AlgoOrderType.TAKE_PROFIT && !!order.trigger_price
93
- );
94
- const slOrder = record?.child_orders?.find(
95
- (order) => order.algo_type === AlgoOrderType.STOP_LOSS && !!order.trigger_price
96
- );
97
- if (tpOrder || slOrder) {
98
- list.push(
99
- tpOrder && slOrder ? i18n.t("common.tpsl") : tpOrder ? i18n.t("tpsl.tp") : i18n.t("tpsl.sl")
100
- );
101
- }
102
- return list;
103
- }
104
- return void 0;
44
+ const orderTypeBadges = getOrderTypeBadges(record);
45
+ const marginModeBadges = getMarginModeBadges(record);
46
+ const badges = [...orderTypeBadges, ...marginModeBadges];
47
+ return badges.length ? badges : void 0;
105
48
  }
106
49
  function grayCell(record) {
107
50
  return record.status === OrderStatus.CANCELLED || record.algo_status === OrderStatus.CANCELLED;
@@ -205,7 +148,7 @@ function convertApiOrderTypeToOrderEntryType(order) {
205
148
  }
206
149
  return order.type;
207
150
  }
208
- var upperCaseFirstLetter;
151
+ var upperCaseFirstLetter, normalizeMarginMode, getMarginModeBadges, getOrderTypeBadges;
209
152
  var init_util = __esm({
210
153
  "src/utils/util.ts"() {
211
154
  upperCaseFirstLetter = (str) => {
@@ -214,6 +157,88 @@ var init_util = __esm({
214
157
  if (str.length === 1) return str.charAt(0).toUpperCase();
215
158
  return str.charAt(0).toUpperCase() + str.toLowerCase().slice(1);
216
159
  };
160
+ normalizeMarginMode = (value) => {
161
+ if (value === 1 || value === MarginMode.ISOLATED) {
162
+ return MarginMode.ISOLATED;
163
+ }
164
+ if (value === 0 || value === MarginMode.CROSS) {
165
+ return MarginMode.CROSS;
166
+ }
167
+ return void 0;
168
+ };
169
+ getMarginModeBadges = (record) => {
170
+ const marginMode = normalizeMarginMode(record?.margin_mode);
171
+ if (marginMode === MarginMode.ISOLATED) {
172
+ return [i18n.t("marginMode.isolated")];
173
+ }
174
+ if (marginMode === MarginMode.CROSS) {
175
+ return [i18n.t("marginMode.cross")];
176
+ }
177
+ return [];
178
+ };
179
+ getOrderTypeBadges = (record) => {
180
+ const orderType = record.type;
181
+ const algoType = record.algo_type;
182
+ if (typeof orderType !== "undefined") {
183
+ const list = [];
184
+ if (!!record.parent_algo_type) {
185
+ if (algoType === AlgoOrderType.STOP_LOSS) {
186
+ const types = orderType === OrderType.CLOSE_POSITION ? [i18n.t("common.position"), i18n.t("tpsl.sl")] : [i18n.t("tpsl.sl")];
187
+ list.push(...types);
188
+ }
189
+ if (algoType === AlgoOrderType.TAKE_PROFIT) {
190
+ const types = orderType === OrderType.CLOSE_POSITION ? [i18n.t("common.position"), i18n.t("tpsl.tp")] : [i18n.t("tpsl.tp")];
191
+ list.push(...types);
192
+ }
193
+ return list;
194
+ }
195
+ const type = typeof orderType === "string" ? orderType.replace("_ORDER", "") : "";
196
+ if ([OrderType.ASK, OrderType.BID].includes(orderType)) {
197
+ return [i18n.t("orderEntry.orderType.limit")];
198
+ }
199
+ if (record.algo_order_id === void 0 || record.algo_order_id && algoType === "BRACKET") {
200
+ const typeMap = {
201
+ [OrderType.LIMIT]: i18n.t("orderEntry.orderType.limit"),
202
+ [OrderType.MARKET]: i18n.t("orderEntry.orderType.market"),
203
+ [OrderType.POST_ONLY]: i18n.t("orderEntry.orderType.postOnly"),
204
+ [OrderType.IOC]: i18n.t("orderEntry.orderType.ioc"),
205
+ [OrderType.FOK]: i18n.t("orderEntry.orderType.fok")
206
+ };
207
+ return [
208
+ typeMap[type] || upperCaseFirstLetter(type)
209
+ ];
210
+ }
211
+ if (algoType === AlgoOrderRootType.TRAILING_STOP) {
212
+ return [i18n.t("orderEntry.orderType.trailingStop")];
213
+ }
214
+ if (type) {
215
+ const typeMap = {
216
+ [OrderType.LIMIT]: i18n.t("orderEntry.orderType.stopLimit"),
217
+ [OrderType.MARKET]: i18n.t("orderEntry.orderType.stopMarket")
218
+ };
219
+ return [typeMap[type] || type];
220
+ }
221
+ }
222
+ if (typeof algoType !== "undefined") {
223
+ const list = [];
224
+ if (algoType === AlgoOrderRootType.POSITIONAL_TP_SL) {
225
+ list.push(i18n.t("common.position"));
226
+ }
227
+ const tpOrder = record?.child_orders?.find(
228
+ (order) => order.algo_type === AlgoOrderType.TAKE_PROFIT && !!order.trigger_price
229
+ );
230
+ const slOrder = record?.child_orders?.find(
231
+ (order) => order.algo_type === AlgoOrderType.STOP_LOSS && !!order.trigger_price
232
+ );
233
+ if (tpOrder || slOrder) {
234
+ list.push(
235
+ tpOrder && slOrder ? i18n.t("common.tpsl") : tpOrder ? i18n.t("tpsl.tp") : i18n.t("tpsl.sl")
236
+ );
237
+ }
238
+ return list;
239
+ }
240
+ return [];
241
+ };
217
242
  }
218
243
  });
219
244
  var SymbolContext, useSymbolContext;
@@ -280,6 +305,7 @@ var init_shareButton_script = __esm({
280
305
  const { sharePnLConfig, order, iconSize } = props;
281
306
  const { t } = useTranslation();
282
307
  const { getFirstRefCode } = useReferralInfo();
308
+ const { brokerNameRaw } = useBadgeBySymbol(order.symbol);
283
309
  const refCode = useMemo(() => {
284
310
  return getFirstRefCode()?.code;
285
311
  }, [getFirstRefCode]);
@@ -297,7 +323,8 @@ var init_shareButton_script = __esm({
297
323
  },
298
324
  refCode,
299
325
  leverage,
300
- ...sharePnLConfig
326
+ ...sharePnLConfig,
327
+ brokerName: sharePnLConfig?.brokerName ?? brokerNameRaw
301
328
  }
302
329
  });
303
330
  };
@@ -1143,10 +1170,10 @@ var init_tpslOrderRowContext = __esm({
1143
1170
  }
1144
1171
  );
1145
1172
  const getRelatedPosition = useMemoizedFn(
1146
- (symbol) => {
1173
+ (symbol, marginMode) => {
1147
1174
  const positions = config.cache.get(positionKey);
1148
1175
  return positions?.data?.rows?.find(
1149
- (p) => p.symbol === symbol
1176
+ (p) => p.symbol === symbol && (p.margin_mode ?? MarginMode.CROSS) === (marginMode ?? MarginMode.CROSS)
1150
1177
  );
1151
1178
  }
1152
1179
  );
@@ -1164,12 +1191,12 @@ var init_tpslOrderRowContext = __esm({
1164
1191
  });
1165
1192
  useEffect(() => {
1166
1193
  if ("algo_type" in order || (order?.reduce_only ?? false)) {
1167
- const position2 = getRelatedPosition(order.symbol);
1194
+ const position2 = getRelatedPosition(order.symbol, order.margin_mode);
1168
1195
  if (position2) {
1169
1196
  setPosition(position2);
1170
1197
  }
1171
1198
  }
1172
- }, [order.symbol]);
1199
+ }, [getRelatedPosition, order.margin_mode, order.symbol]);
1173
1200
  const memoizedValue = useMemo(() => {
1174
1201
  return {
1175
1202
  order,
@@ -1984,6 +2011,29 @@ var init_triggerPriceCell = __esm({
1984
2011
  };
1985
2012
  }
1986
2013
  });
2014
+ var OrderSymbolCell;
2015
+ var init_orderSymbolCell = __esm({
2016
+ "src/components/orderList/desktop/orderSymbolCell.tsx"() {
2017
+ OrderSymbolCell = (props) => {
2018
+ const { symbol, onSymbolChange } = props;
2019
+ const { brokerId, brokerName, brokerNameRaw } = useBadgeBySymbol(symbol);
2020
+ return /* @__PURE__ */ jsx(
2021
+ Text.symbolBadge,
2022
+ {
2023
+ className: "oui-cursor-pointer",
2024
+ badge: brokerName ?? brokerId ?? void 0,
2025
+ fullName: brokerNameRaw,
2026
+ onClick: (e) => {
2027
+ onSymbolChange?.({ symbol });
2028
+ e.stopPropagation();
2029
+ e.preventDefault();
2030
+ },
2031
+ children: symbol
2032
+ }
2033
+ );
2034
+ };
2035
+ }
2036
+ });
1987
2037
  var Renew;
1988
2038
  var init_renew = __esm({
1989
2039
  "src/components/orderList/desktop/renew.tsx"() {
@@ -2355,31 +2405,25 @@ function instrument(option) {
2355
2405
  },
2356
2406
  render: (value, record) => {
2357
2407
  const showGray = grayCell(record);
2358
- return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
2408
+ return /* @__PURE__ */ jsxs(Flex, { gap: 2, className: "oui-py-1", children: [
2359
2409
  /* @__PURE__ */ jsx(
2360
2410
  "div",
2361
2411
  {
2362
2412
  className: cn(
2363
- "oui-h-7 oui-w-1 oui-shrink-0 oui-rounded-[1px]",
2413
+ "oui-h-[34px] oui-w-1 oui-shrink-0 oui-rounded-[1px]",
2364
2414
  record.side === OrderSide.BUY ? "oui-bg-trade-profit" : "oui-bg-trade-loss"
2365
2415
  )
2366
2416
  }
2367
2417
  ),
2368
- /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", children: [
2418
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", gap: 1, children: [
2369
2419
  /* @__PURE__ */ jsx(
2370
- Text.formatted,
2420
+ OrderSymbolCell,
2371
2421
  {
2372
- size: "xs",
2373
- className: "oui-cursor-pointer oui-text-xs",
2374
- onClick: (e) => {
2375
- option?.onSymbolChange?.({ symbol: value });
2376
- e.stopPropagation();
2377
- e.preventDefault();
2378
- },
2379
- children: `${value.split("_")[1]}-PERP`
2422
+ symbol: value,
2423
+ onSymbolChange: option?.onSymbolChange
2380
2424
  }
2381
2425
  ),
2382
- option?.showType && /* @__PURE__ */ jsx(Flex, { direction: "row", gap: 1, children: parseBadgesFor(record)?.map((e, index) => /* @__PURE__ */ jsx(
2426
+ option?.showType && /* @__PURE__ */ jsx(Flex, { direction: "row", gap: 1, wrap: "wrap", children: parseBadgesFor(record)?.map((e, index) => /* @__PURE__ */ jsx(
2383
2427
  Badge,
2384
2428
  {
2385
2429
  color: e.toLocaleLowerCase() === "position" ? showGray ? "neutral" : "primary" : "neutral",
@@ -2907,6 +2951,7 @@ var init_useColumn = __esm({
2907
2951
  init_quantityCell();
2908
2952
  init_trailingCallbackCell();
2909
2953
  init_triggerPriceCell();
2954
+ init_orderSymbolCell();
2910
2955
  init_renew();
2911
2956
  init_tpslEdit();
2912
2957
  init_tpslPrice();
@@ -2925,7 +2970,7 @@ var init_useColumn = __esm({
2925
2970
  case "all" /* all */:
2926
2971
  return [
2927
2972
  instrument({
2928
- width: 130,
2973
+ width: 200,
2929
2974
  showType: true,
2930
2975
  onSymbolChange,
2931
2976
  enableSort: false
@@ -2963,7 +3008,7 @@ var init_useColumn = __esm({
2963
3008
  case "pending" /* pending */:
2964
3009
  return [
2965
3010
  instrument({
2966
- width: 172,
3011
+ width: 200,
2967
3012
  showType: true,
2968
3013
  onSymbolChange,
2969
3014
  enableSort: false
@@ -2987,7 +3032,7 @@ var init_useColumn = __esm({
2987
3032
  case "tp_sl" /* tp_sl */:
2988
3033
  return [
2989
3034
  instrument({
2990
- width: 176,
3035
+ width: 200,
2991
3036
  showType: true,
2992
3037
  onSymbolChange,
2993
3038
  enableSort: false
@@ -3005,7 +3050,7 @@ var init_useColumn = __esm({
3005
3050
  return [
3006
3051
  instrument({
3007
3052
  showType: true,
3008
- width: 154,
3053
+ width: 200,
3009
3054
  onSymbolChange
3010
3055
  }),
3011
3056
  // type({ width: 124 }),
@@ -3040,7 +3085,7 @@ var init_useColumn = __esm({
3040
3085
  return [
3041
3086
  instrument({
3042
3087
  showType: true,
3043
- width: 154,
3088
+ width: 200,
3044
3089
  onSymbolChange,
3045
3090
  enableSort: false
3046
3091
  }),
@@ -3064,7 +3109,7 @@ var init_useColumn = __esm({
3064
3109
  return [
3065
3110
  instrument({
3066
3111
  showType: true,
3067
- width: 154,
3112
+ width: 200,
3068
3113
  onSymbolChange
3069
3114
  }),
3070
3115
  // side({ width: 124 }),
@@ -3087,7 +3132,7 @@ var init_useColumn = __esm({
3087
3132
  return [
3088
3133
  instrument({
3089
3134
  showType: true,
3090
- width: 154,
3135
+ width: 200,
3091
3136
  onSymbolChange
3092
3137
  }),
3093
3138
  // side({ width: 124 }),
@@ -3125,10 +3170,23 @@ var init_useColumn = __esm({
3125
3170
  };
3126
3171
  }
3127
3172
  });
3173
+ var SymbolBadge;
3174
+ var init_symbolBadge = __esm({
3175
+ "src/components/symbolBadge.tsx"() {
3176
+ SymbolBadge = (props) => {
3177
+ const { brokerId, brokerName, brokerNameRaw } = useBadgeBySymbol(
3178
+ props.symbol
3179
+ );
3180
+ const badge = brokerName ?? brokerId ?? void 0;
3181
+ return /* @__PURE__ */ jsx(SymbolBadge$1, { badge, fullName: brokerNameRaw });
3182
+ };
3183
+ }
3184
+ });
3128
3185
  var SymbolToken, OrderTypeView, OrderTime, OrderState, Qty, Filled, EstTotal, TriggerPrice, MarkPrice, LimitPrice, TPTrigger, SLTrigger, TPPrice, SLPrice, TPSLQuantity, AvgPrice2, OrderPrice, RealizedPnL, MobileTooltip, Fee, TrailingCallback, TrailingPrice;
3129
3186
  var init_items = __esm({
3130
3187
  "src/components/orderList/mobile/items.tsx"() {
3131
3188
  init_util();
3189
+ init_symbolBadge();
3132
3190
  init_tpslOrderRowContext();
3133
3191
  SymbolToken = (props) => {
3134
3192
  const { item } = props;
@@ -3139,9 +3197,10 @@ var init_items = __esm({
3139
3197
  {
3140
3198
  intensity: 80,
3141
3199
  rule: "symbol",
3142
- formatString: "base-type",
3200
+ formatString: "base",
3143
3201
  size: "sm",
3144
3202
  prefix: /* @__PURE__ */ jsx(Badge, { color: isBuy ? "success" : "danger", size: "xs", children: isBuy ? t("common.buy") : t("common.sell") }),
3203
+ suffix: /* @__PURE__ */ jsx(SymbolBadge, { symbol: item.symbol }),
3145
3204
  onClick: () => {
3146
3205
  props.onSymbolChange?.({ symbol: item.symbol });
3147
3206
  },
@@ -4076,6 +4135,7 @@ var ConfirmDialogContent;
4076
4135
  var init_editDialogContent = __esm({
4077
4136
  "src/components/orderList/mobile/editSheet/components/editDialogContent.tsx"() {
4078
4137
  init_util();
4138
+ init_symbolBadge();
4079
4139
  ConfirmDialogContent = (props) => {
4080
4140
  const { item } = props;
4081
4141
  const {
@@ -4098,16 +4158,19 @@ var init_editDialogContent = __esm({
4098
4158
  }
4099
4159
  ),
4100
4160
  /* @__PURE__ */ jsxs(Flex, { gap: 2, mb: 3, mt: 2, justify: "between", children: [
4101
- /* @__PURE__ */ jsx(
4102
- Text.formatted,
4103
- {
4104
- rule: "symbol",
4105
- formatString: "base-type",
4106
- size: "base",
4107
- showIcon: true,
4108
- children: item.symbol
4109
- }
4110
- ),
4161
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", gap: 1, grow: true, children: [
4162
+ /* @__PURE__ */ jsx(
4163
+ Text.formatted,
4164
+ {
4165
+ rule: "symbol",
4166
+ formatString: "base",
4167
+ size: "base",
4168
+ showIcon: true,
4169
+ children: item.symbol
4170
+ }
4171
+ ),
4172
+ /* @__PURE__ */ jsx(SymbolBadge, { symbol: item.symbol })
4173
+ ] }),
4111
4174
  /* @__PURE__ */ jsxs(Flex, { direction: "row", gap: 1, children: [
4112
4175
  parseBadgesFor(item)?.map((e, index) => /* @__PURE__ */ jsx(
4113
4176
  Badge,
@@ -4249,11 +4312,22 @@ var EditSheetHeader;
4249
4312
  var init_editSheetHeader = __esm({
4250
4313
  "src/components/orderList/mobile/editSheet/components/editSheetHeader.tsx"() {
4251
4314
  init_util();
4315
+ init_symbolBadge();
4252
4316
  EditSheetHeader = (props) => {
4253
4317
  const { item } = props;
4254
4318
  const { t } = useTranslation();
4255
4319
  return /* @__PURE__ */ jsxs(Flex, { width: "100%", justify: "between", children: [
4256
- /* @__PURE__ */ jsx(Text.formatted, { rule: "symbol", showIcon: true, intensity: 80, children: item.symbol }),
4320
+ /* @__PURE__ */ jsx(
4321
+ Text.formatted,
4322
+ {
4323
+ rule: "symbol",
4324
+ formatString: "base",
4325
+ showIcon: true,
4326
+ intensity: 80,
4327
+ suffix: /* @__PURE__ */ jsx(SymbolBadge, { symbol: item.symbol }),
4328
+ children: item.symbol
4329
+ }
4330
+ ),
4257
4331
  /* @__PURE__ */ jsxs(Flex, { direction: "row", gap: 1, children: [
4258
4332
  parseBadgesFor(props.item)?.map((e, index) => /* @__PURE__ */ jsx(
4259
4333
  Badge,
@@ -5391,15 +5465,21 @@ var init_useFormatOrderHistory = __esm({
5391
5465
  if (!e.is_activated || !e.trigger_price) {
5392
5466
  continue;
5393
5467
  }
5394
- e.parent_algo_type = element.algo_type;
5395
- _data.push(e);
5468
+ _data.push({
5469
+ ...e,
5470
+ parent_algo_type: element.algo_type,
5471
+ margin_mode: e.margin_mode ?? element.margin_mode
5472
+ });
5396
5473
  }
5397
5474
  } else {
5398
5475
  for (let j = 0; j < element.child_orders.length; j++) {
5399
5476
  const e = element.child_orders[j];
5400
5477
  if (!!e && (e.algo_status === OrderStatus.FILLED || e.algo_status === OrderStatus.PARTIAL_FILLED)) {
5401
- e.parent_algo_type = element.algo_type;
5402
- _data.push(e);
5478
+ _data.push({
5479
+ ...e,
5480
+ parent_algo_type: element.algo_type,
5481
+ margin_mode: e.margin_mode ?? element.margin_mode
5482
+ });
5403
5483
  }
5404
5484
  }
5405
5485
  }
@@ -5506,7 +5586,7 @@ var init_orderList_script = __esm({
5506
5586
  page: enableLoadMore || !manualPagination ? void 0 : page,
5507
5587
  // pending and ts_sl list get all data
5508
5588
  size: manualPagination ? pageSize : 500,
5509
- sourceTypeAll: type === "orderHistory" /* orderHistory */,
5589
+ sourceTypeAll: type === "orderHistory" /* orderHistory */ || type === "filled" /* filled */,
5510
5590
  dateRange,
5511
5591
  includes,
5512
5592
  excludes