@orderly.network/trading 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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +43 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
package/dist/index.d.mts
CHANGED
|
@@ -369,7 +369,7 @@ declare const usePortfolioSheetScript: () => {
|
|
|
369
369
|
hasSubAccount: boolean;
|
|
370
370
|
aggregated: Omit<_orderly_network_types.API.PositionsTPSLExt, "rows">;
|
|
371
371
|
totalUnrealizedROI: number;
|
|
372
|
-
positionsInfo: 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<_orderly_network_types.API.PositionInfo, "rows">[Key] | undefined) => Omit<_orderly_network_types.API.PositionInfo, "rows">[Key]> & {
|
|
372
|
+
positionsInfo: 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<_orderly_network_types.API.PositionInfo, "rows">[Key] | undefined) => Omit<_orderly_network_types.API.PositionInfo, "rows">[Key]> & {
|
|
373
373
|
isNil: boolean;
|
|
374
374
|
};
|
|
375
375
|
marginRatio: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -369,7 +369,7 @@ declare const usePortfolioSheetScript: () => {
|
|
|
369
369
|
hasSubAccount: boolean;
|
|
370
370
|
aggregated: Omit<_orderly_network_types.API.PositionsTPSLExt, "rows">;
|
|
371
371
|
totalUnrealizedROI: number;
|
|
372
|
-
positionsInfo: 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<_orderly_network_types.API.PositionInfo, "rows">[Key] | undefined) => Omit<_orderly_network_types.API.PositionInfo, "rows">[Key]> & {
|
|
372
|
+
positionsInfo: 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<_orderly_network_types.API.PositionInfo, "rows">[Key] | undefined) => Omit<_orderly_network_types.API.PositionInfo, "rows">[Key]> & {
|
|
373
373
|
isNil: boolean;
|
|
374
374
|
};
|
|
375
375
|
marginRatio: number;
|
package/dist/index.js
CHANGED
|
@@ -2798,14 +2798,21 @@ var init_markPrice_desktop = __esm({
|
|
|
2798
2798
|
if (bids.length === 0 && asks.length === 0) {
|
|
2799
2799
|
return 0;
|
|
2800
2800
|
}
|
|
2801
|
-
const
|
|
2802
|
-
const
|
|
2803
|
-
|
|
2801
|
+
const bidRaw = bids[0]?.[0];
|
|
2802
|
+
const bid1 = bidRaw === void 0 || Number.isNaN(bidRaw) ? new utils.Decimal(0) : new utils.Decimal(bidRaw);
|
|
2803
|
+
const asksReversed = [...asks].reverse();
|
|
2804
|
+
const index = asksReversed.findIndex((item) => !Number.isNaN(item[0]));
|
|
2805
|
+
let ask1 = new utils.Decimal(0);
|
|
2804
2806
|
if (index !== -1) {
|
|
2805
|
-
|
|
2807
|
+
const askRaw = asksReversed[index][0];
|
|
2808
|
+
ask1 = Number.isNaN(askRaw) ? new utils.Decimal(0) : new utils.Decimal(askRaw);
|
|
2806
2809
|
}
|
|
2807
|
-
const
|
|
2808
|
-
|
|
2810
|
+
const mid = ask1.add(bid1).div(2);
|
|
2811
|
+
if (mid.isZero()) {
|
|
2812
|
+
return 0;
|
|
2813
|
+
}
|
|
2814
|
+
const dValue = ask1.sub(bid1).div(mid);
|
|
2815
|
+
return dValue.mul(1e6).add(0.1).toDecimalPlaces(0, utils.Decimal.ROUND_CEIL).div(1e4).toNumber();
|
|
2809
2816
|
}, [asks, bids]);
|
|
2810
2817
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2811
2818
|
ui.Tooltip,
|
|
@@ -8313,9 +8320,18 @@ var DesktopLayout4 = (props) => {
|
|
|
8313
8320
|
dataListMinHeight
|
|
8314
8321
|
} = props;
|
|
8315
8322
|
const { showCountdown, closeCountdown } = useShowRwaCountdown(props.symbol);
|
|
8323
|
+
const { brokerName } = hooks.useBadgeBySymbol(props.symbol);
|
|
8316
8324
|
const symbolInfoBarHeight2 = React12.useMemo(() => {
|
|
8317
|
-
|
|
8318
|
-
|
|
8325
|
+
let height = 56;
|
|
8326
|
+
if (brokerName) {
|
|
8327
|
+
height += 46;
|
|
8328
|
+
height += 8;
|
|
8329
|
+
}
|
|
8330
|
+
if (showCountdown) {
|
|
8331
|
+
height += 48;
|
|
8332
|
+
}
|
|
8333
|
+
return height;
|
|
8334
|
+
}, [showCountdown, brokerName]);
|
|
8319
8335
|
const { isRwa, open } = hooks.useGetRwaSymbolOpenStatus(props.symbol);
|
|
8320
8336
|
React12.useEffect(() => {
|
|
8321
8337
|
if (isRwa && !open) {
|
|
@@ -8452,9 +8468,6 @@ var DesktopLayout4 = (props) => {
|
|
|
8452
8468
|
ui.Box,
|
|
8453
8469
|
{
|
|
8454
8470
|
className: "oui-trading-symbolInfoBar-container",
|
|
8455
|
-
intensity: 900,
|
|
8456
|
-
r: "2xl",
|
|
8457
|
-
px: 3,
|
|
8458
8471
|
width: "100%",
|
|
8459
8472
|
style: {
|
|
8460
8473
|
minHeight: symbolInfoBarHeight2,
|
|
@@ -9115,6 +9128,12 @@ var MaybeEqual = () => {
|
|
|
9115
9128
|
var MobileLayout4 = (props) => {
|
|
9116
9129
|
const { t } = i18n.useTranslation();
|
|
9117
9130
|
const { isRwa, open, closeTimeInterval } = hooks.useGetRwaSymbolInfo(props.symbol);
|
|
9131
|
+
const { brokerId, brokerName, brokerNameRaw, displayName } = hooks.useBadgeBySymbol(
|
|
9132
|
+
props.symbol
|
|
9133
|
+
);
|
|
9134
|
+
const isCommunityListed = Boolean(brokerId ?? brokerName);
|
|
9135
|
+
const baseFromSymbol = props.symbol?.split("_")[1] ?? props.symbol ?? "";
|
|
9136
|
+
const symbolWithBroker = brokerName != null ? `${baseFromSymbol}-${brokerNameRaw}` : displayName ?? props.symbol ?? "";
|
|
9118
9137
|
React12.useEffect(() => {
|
|
9119
9138
|
if (isRwa && !open) {
|
|
9120
9139
|
showRwaOutsideMarketHoursNotify();
|
|
@@ -9208,7 +9227,17 @@ var MobileLayout4 = (props) => {
|
|
|
9208
9227
|
)
|
|
9209
9228
|
}
|
|
9210
9229
|
);
|
|
9211
|
-
const topBar = /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, {
|
|
9230
|
+
const topBar = /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { children: [
|
|
9231
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Flex, { mx: 1, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9232
|
+
markets.SymbolInfoBarRiskNotice,
|
|
9233
|
+
{
|
|
9234
|
+
visible: isCommunityListed,
|
|
9235
|
+
symbolWithBroker,
|
|
9236
|
+
brokerName: brokerNameRaw ?? brokerName ?? "",
|
|
9237
|
+
autoHeight: true,
|
|
9238
|
+
className: "oui-my-1"
|
|
9239
|
+
}
|
|
9240
|
+
) }),
|
|
9212
9241
|
symbolInfoBar,
|
|
9213
9242
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9214
9243
|
ui.SimpleSheet,
|
|
@@ -9216,7 +9245,7 @@ var MobileLayout4 = (props) => {
|
|
|
9216
9245
|
open: props.openMarketsSheet,
|
|
9217
9246
|
onOpenChange: props.onOpenMarketsSheetChange,
|
|
9218
9247
|
classNames: {
|
|
9219
|
-
body: "oui-h-full oui-pb-0",
|
|
9248
|
+
body: "oui-h-full oui-pb-0 ",
|
|
9220
9249
|
content: "!oui-w-[372px] !oui-max-w-[372px] !oui-p-0"
|
|
9221
9250
|
},
|
|
9222
9251
|
contentProps: { side: "left", closeable: false },
|
|
@@ -9250,6 +9279,7 @@ var MobileLayout4 = (props) => {
|
|
|
9250
9279
|
};
|
|
9251
9280
|
var Trading = (props) => {
|
|
9252
9281
|
const { isMobile } = ui.useScreen();
|
|
9282
|
+
const { t } = i18n.useTranslation();
|
|
9253
9283
|
if (isMobile) {
|
|
9254
9284
|
return /* @__PURE__ */ jsxRuntime.jsx(MobileLayout4, { ...props });
|
|
9255
9285
|
}
|