@orderly.network/trading 3.0.4-alpha.1 → 3.0.4-alpha.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.d.mts +127 -70
- package/dist/index.d.ts +127 -70
- package/dist/index.js +66 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +74 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -21
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React12, { forwardRef, useMemo, createContext,
|
|
1
|
+
import { useBadgeBySymbol, useGetRwaSymbolOpenStatus, useLocalStorage, useGetRwaSymbolCloseTimeInterval, usePositionStream, useOrderStream, useAccount, useFundingDetails, useFundingRateBySymbol, useFundingRate, useSymbolsInfo, useOrderbookStream, useEventEmitter, useCollateral, useMarginRatio, useLeverage, useDebouncedCallback, useMediaQuery, useAssetsHistory, useGetRwaSymbolInfo, useWalletConnector, useConfig, useMutation, useChains, useReferralInfo, useCurEpochEstimate, TWType, useEpochInfo, useMarketTradeStream, useAccountInstance, useComputedLTV, useTickerStream } from '@orderly.network/hooks';
|
|
2
|
+
import React12, { forwardRef, useMemo, createContext, useEffect, useState, useRef, useCallback, useContext, createElement } from 'react';
|
|
3
3
|
import { useDataTap, useAppContext } from '@orderly.network/react-app';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { TradingviewFullscreenKey, OrderEntrySortKeys, AlgoOrderRootType, OrderStatus, OrderSide, AccountStatusEnum, AssetHistoryStatusEnum, AssetHistorySideEnum, ChainNamespace, EMPTY_LIST } from '@orderly.network/types';
|
|
5
|
+
import { i18n, useTranslation, Trans } from '@orderly.network/i18n';
|
|
6
|
+
import { injectable, cn, Button, formatAddress, registerSimpleDialog, registerSimpleSheet, Box, Flex, Text, toast as toast$1, useScreen, ExclamationFillIcon, CloseIcon, TooltipRoot, TooltipTrigger, TooltipContent as TooltipContent$1, TooltipArrow, parseNumber, Divider, ListView, Grid, ArrowDownShortIcon, gradientTextVariants, EyeIcon, EyeCloseIcon, ChevronDownIcon, modal, Tooltip, Tabs, TabPanel, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, Statistic, RefreshIcon, ArrowLeftRightIcon, ArrowUpShortIcon, InfoCircleIcon, NewsFillIcon, SimpleSheet, SimpleDialog, ChainIcon, useModal, ArrowRightShortIcon, Switch, Checkbox, Sheet, SheetTrigger, SheetContent, SettingFillIcon, Spinner, PopoverRoot, PopoverTrigger, PopoverContent, Select, Popover, CaretUpIcon, CaretDownIcon, Picker } from '@orderly.network/ui';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { PositionHistoryWidget, LiquidationWidget, PositionsWidget, CloseAllPositionsWidget, MobileLiquidationWidget, MobilePositionsWidget, MobilePositionHistoryWidget, useReversePositionEnabled } from '@orderly.network/ui-positions';
|
|
9
|
-
import {
|
|
9
|
+
import { Decimal, getPrecisionByNumber, commifyOptional, removeTrailingZeros, isTestnet, formatSymbol, optimizeSymbolDisplay } from '@orderly.network/utils';
|
|
10
10
|
import { AssetsModule } from '@orderly.network/portfolio';
|
|
11
11
|
import { DesktopOrderListWidget, TabType, MobileOrderListWidget } from '@orderly.network/ui-orders';
|
|
12
12
|
import { AuthGuard } from '@orderly.network/ui-connector';
|
|
13
13
|
import { OrderEntryWidget, LTVRiskTooltipWidget } from '@orderly.network/ui-order-entry';
|
|
14
|
-
import { DepositAndWithdrawWithSheetId, TransferSheetId,
|
|
14
|
+
import { DepositStatusWidget, DepositAndWithdrawWithSheetId, TransferSheetId, DepositAndWithdrawWithDialogId, TransferDialogId } from '@orderly.network/ui-transfer';
|
|
15
15
|
import { TradingviewWidget } from '@orderly.network/ui-tradingview';
|
|
16
16
|
import Split from '@uiw/react-split';
|
|
17
17
|
import { ScanQRCodeWidget } from '@orderly.network/ui-scaffold';
|
|
@@ -20,7 +20,7 @@ import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, close
|
|
|
20
20
|
import { restrictToVerticalAxis } from '@dnd-kit/modifiers';
|
|
21
21
|
import { sortableKeyboardCoordinates, SortableContext, verticalListSortingStrategy, useSortable, arrayMove } from '@dnd-kit/sortable';
|
|
22
22
|
import { CSS } from '@dnd-kit/utilities';
|
|
23
|
-
import {
|
|
23
|
+
import { HorizontalMarketsWidget, SideMarketsWidget, SymbolInfoBarFullWidget, SymbolInfoBarWidget, SymbolInfoBarRiskNotice, MarketsSheetWidget } from '@orderly.network/markets';
|
|
24
24
|
|
|
25
25
|
var __defProp = Object.defineProperty;
|
|
26
26
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -2204,7 +2204,7 @@ var init_listBox_desktop = __esm({
|
|
|
2204
2204
|
};
|
|
2205
2205
|
}
|
|
2206
2206
|
});
|
|
2207
|
-
var DesktopAsks;
|
|
2207
|
+
var DesktopAsks, InjectableDesktopAsks;
|
|
2208
2208
|
var init_asks_desktop = __esm({
|
|
2209
2209
|
"src/components/desktop/orderBook/asks.desktop.tsx"() {
|
|
2210
2210
|
init_types();
|
|
@@ -2230,9 +2230,13 @@ var init_asks_desktop = __esm({
|
|
|
2230
2230
|
}
|
|
2231
2231
|
);
|
|
2232
2232
|
};
|
|
2233
|
+
InjectableDesktopAsks = injectable(
|
|
2234
|
+
DesktopAsks,
|
|
2235
|
+
"OrderBook.Desktop.Asks"
|
|
2236
|
+
);
|
|
2233
2237
|
}
|
|
2234
2238
|
});
|
|
2235
|
-
var DesktopBids;
|
|
2239
|
+
var DesktopBids, InjectableDesktopBids;
|
|
2236
2240
|
var init_bids_desktop = __esm({
|
|
2237
2241
|
"src/components/desktop/orderBook/bids.desktop.tsx"() {
|
|
2238
2242
|
init_types();
|
|
@@ -2257,6 +2261,10 @@ var init_bids_desktop = __esm({
|
|
|
2257
2261
|
}
|
|
2258
2262
|
);
|
|
2259
2263
|
};
|
|
2264
|
+
InjectableDesktopBids = injectable(
|
|
2265
|
+
DesktopBids,
|
|
2266
|
+
"OrderBook.Desktop.Bids"
|
|
2267
|
+
);
|
|
2260
2268
|
}
|
|
2261
2269
|
});
|
|
2262
2270
|
var BuySellRatioSettings, MoreIcon;
|
|
@@ -2920,7 +2928,14 @@ var init_index_desktop = __esm({
|
|
|
2920
2928
|
)
|
|
2921
2929
|
] }),
|
|
2922
2930
|
/* @__PURE__ */ jsx(DesktopHeader, { quote, base }),
|
|
2923
|
-
/* @__PURE__ */ jsx(
|
|
2931
|
+
/* @__PURE__ */ jsx(
|
|
2932
|
+
InjectableDesktopAsks,
|
|
2933
|
+
{
|
|
2934
|
+
data: [...props.asks],
|
|
2935
|
+
symbolInfo: props.symbolInfo,
|
|
2936
|
+
depth: props.activeDepth
|
|
2937
|
+
}
|
|
2938
|
+
),
|
|
2924
2939
|
/* @__PURE__ */ jsx(
|
|
2925
2940
|
DesktopMarkPrice,
|
|
2926
2941
|
{
|
|
@@ -2931,7 +2946,14 @@ var init_index_desktop = __esm({
|
|
|
2931
2946
|
symbolInfo: props.symbolInfo
|
|
2932
2947
|
}
|
|
2933
2948
|
),
|
|
2934
|
-
/* @__PURE__ */ jsx(
|
|
2949
|
+
/* @__PURE__ */ jsx(
|
|
2950
|
+
InjectableDesktopBids,
|
|
2951
|
+
{
|
|
2952
|
+
data: [...props.bids],
|
|
2953
|
+
symbolInfo: props.symbolInfo,
|
|
2954
|
+
depth: props.activeDepth
|
|
2955
|
+
}
|
|
2956
|
+
),
|
|
2935
2957
|
showBuySellRatio && /* @__PURE__ */ jsx(
|
|
2936
2958
|
BuySellRatioBar,
|
|
2937
2959
|
{
|
|
@@ -6911,17 +6933,10 @@ var Account = (props) => {
|
|
|
6911
6933
|
}
|
|
6912
6934
|
);
|
|
6913
6935
|
};
|
|
6914
|
-
|
|
6915
|
-
name: "mobile-account-menu",
|
|
6916
|
-
scope: ["*"],
|
|
6917
|
-
positions: [ExtensionPositionEnum.MobileAccountMenu],
|
|
6918
|
-
builder: useAccountScript,
|
|
6919
|
-
__isInternal: true
|
|
6920
|
-
})((props) => {
|
|
6921
|
-
return /* @__PURE__ */ jsx(Account, { ...props });
|
|
6922
|
-
});
|
|
6936
|
+
var InjectableAccount = injectable(Account, "Account.MobileAccountMenu");
|
|
6923
6937
|
var MobileAccountMenuExtension = () => {
|
|
6924
|
-
|
|
6938
|
+
const state = useAccountScript();
|
|
6939
|
+
return /* @__PURE__ */ jsx(InjectableAccount, { ...state });
|
|
6925
6940
|
};
|
|
6926
6941
|
|
|
6927
6942
|
// src/components/mobile/bottomNavBar/balance/balance.ui.tsx
|
|
@@ -8396,7 +8411,10 @@ var DesktopLayout4 = (props) => {
|
|
|
8396
8411
|
}
|
|
8397
8412
|
];
|
|
8398
8413
|
},
|
|
8399
|
-
sideEffects: ({
|
|
8414
|
+
sideEffects: ({
|
|
8415
|
+
active,
|
|
8416
|
+
dragOverlay
|
|
8417
|
+
}) => {
|
|
8400
8418
|
active.node.style.opacity = "0";
|
|
8401
8419
|
const innerElement = dragOverlay.node.querySelector(".inner-content");
|
|
8402
8420
|
if (innerElement) {
|
|
@@ -8469,11 +8487,9 @@ var DesktopLayout4 = (props) => {
|
|
|
8469
8487
|
const marketsWidget = /* @__PURE__ */ jsx(
|
|
8470
8488
|
SideMarketsWidget,
|
|
8471
8489
|
{
|
|
8472
|
-
resizeable,
|
|
8473
|
-
panelSize,
|
|
8474
|
-
onPanelSizeChange,
|
|
8475
8490
|
symbol: props.symbol,
|
|
8476
|
-
onSymbolChange: props.onSymbolChange
|
|
8491
|
+
onSymbolChange: props.onSymbolChange,
|
|
8492
|
+
panelSize
|
|
8477
8493
|
}
|
|
8478
8494
|
);
|
|
8479
8495
|
const toggleButtoncls = cn(
|
|
@@ -8515,13 +8531,13 @@ var DesktopLayout4 = (props) => {
|
|
|
8515
8531
|
height: "100%",
|
|
8516
8532
|
width: marketsWidth,
|
|
8517
8533
|
style: { minWidth: marketsWidth },
|
|
8518
|
-
className: "oui-trading-markets-container oui-transition-all oui-duration-150",
|
|
8534
|
+
className: "oui-trading-markets-container oui-min-h-0 oui-min-w-0 oui-max-w-full oui-transition-all oui-duration-150",
|
|
8519
8535
|
onTransitionEnd: () => setAnimating(false),
|
|
8520
8536
|
children: /* @__PURE__ */ jsxs(
|
|
8521
8537
|
Flex,
|
|
8522
8538
|
{
|
|
8523
8539
|
id: "oui-side-markets",
|
|
8524
|
-
className: "oui-relative oui-font-semibold",
|
|
8540
|
+
className: "oui-relative oui-min-h-0 oui-min-w-0 oui-font-semibold",
|
|
8525
8541
|
direction: "column",
|
|
8526
8542
|
gapY: 5,
|
|
8527
8543
|
height: "100%",
|
|
@@ -8532,10 +8548,7 @@ var DesktopLayout4 = (props) => {
|
|
|
8532
8548
|
Box,
|
|
8533
8549
|
{
|
|
8534
8550
|
width: "100%",
|
|
8535
|
-
className:
|
|
8536
|
-
panelSize === "large" && "oui-h-[calc(100%_-_56px)]",
|
|
8537
|
-
panelSize === "middle" && "oui-h-full"
|
|
8538
|
-
),
|
|
8551
|
+
className: "oui-min-h-0 oui-min-w-0 oui-max-w-full oui-flex-1 oui-overflow-hidden oui-rounded-b-2xl",
|
|
8539
8552
|
children: marketsWidget
|
|
8540
8553
|
}
|
|
8541
8554
|
)
|
|
@@ -8579,10 +8592,10 @@ var DesktopLayout4 = (props) => {
|
|
|
8579
8592
|
{
|
|
8580
8593
|
classNames: {
|
|
8581
8594
|
root: cn(
|
|
8582
|
-
tradingViewFullScreen ? "!oui-absolute oui-
|
|
8595
|
+
tradingViewFullScreen ? "!oui-absolute oui-inset-0 oui-z-40 oui-bg-base-10" : "oui-z-1"
|
|
8583
8596
|
),
|
|
8584
8597
|
content: cn(
|
|
8585
|
-
tradingViewFullScreen ? "oui-
|
|
8598
|
+
tradingViewFullScreen ? "oui-inset-3 oui-overflow-hidden oui-rounded-[16px] oui-bg-base-9" : ""
|
|
8586
8599
|
)
|
|
8587
8600
|
},
|
|
8588
8601
|
symbol: props.symbol,
|
|
@@ -8714,7 +8727,8 @@ var DesktopLayout4 = (props) => {
|
|
|
8714
8727
|
Flex,
|
|
8715
8728
|
{
|
|
8716
8729
|
gap: 2,
|
|
8717
|
-
|
|
8730
|
+
itemAlign: "stretch",
|
|
8731
|
+
className: "oui-min-h-0 oui-flex-1 oui-overflow-hidden",
|
|
8718
8732
|
style: { minWidth: marketsWidth + tradingViewMinWidth + space },
|
|
8719
8733
|
children: [
|
|
8720
8734
|
marketLayout === "left" && marketsView,
|
|
@@ -8744,10 +8758,20 @@ var DesktopLayout4 = (props) => {
|
|
|
8744
8758
|
);
|
|
8745
8759
|
const renderTradingViewAndOrderbookView = () => {
|
|
8746
8760
|
if (max4XL && layout === "left") {
|
|
8747
|
-
return /* @__PURE__ */ jsxs(
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8761
|
+
return /* @__PURE__ */ jsxs(
|
|
8762
|
+
Flex,
|
|
8763
|
+
{
|
|
8764
|
+
gapX: 2,
|
|
8765
|
+
itemAlign: "stretch",
|
|
8766
|
+
className: "oui-min-h-0",
|
|
8767
|
+
style: { minHeight: orderbookMinHeight },
|
|
8768
|
+
height: "100%",
|
|
8769
|
+
children: [
|
|
8770
|
+
tradingViewAndOrderbookView,
|
|
8771
|
+
marketLayout === "left" && marketsView
|
|
8772
|
+
]
|
|
8773
|
+
}
|
|
8774
|
+
);
|
|
8751
8775
|
}
|
|
8752
8776
|
return tradingViewAndOrderbookView;
|
|
8753
8777
|
};
|
|
@@ -8876,6 +8900,7 @@ var DesktopLayout4 = (props) => {
|
|
|
8876
8900
|
pt: 3,
|
|
8877
8901
|
r: "2xl",
|
|
8878
8902
|
width: marketsWidth,
|
|
8903
|
+
className: "oui-overflow-hidden",
|
|
8879
8904
|
style: {
|
|
8880
8905
|
minHeight: tradindviewMinHeight + orderbookMinHeight + space,
|
|
8881
8906
|
maxHeight: tradindviewMaxHeight + orderbookMaxHeight + space
|
|
@@ -9053,8 +9078,9 @@ var DesktopLayout4 = (props) => {
|
|
|
9053
9078
|
/* @__PURE__ */ jsxs(
|
|
9054
9079
|
Flex,
|
|
9055
9080
|
{
|
|
9081
|
+
itemAlign: "stretch",
|
|
9056
9082
|
className: cn(
|
|
9057
|
-
"oui-flex-1 oui-overflow-hidden",
|
|
9083
|
+
"oui-min-h-0 oui-flex-1 oui-overflow-hidden",
|
|
9058
9084
|
layout === "left" && "oui-flex-row-reverse"
|
|
9059
9085
|
),
|
|
9060
9086
|
gap: 2,
|
|
@@ -9102,6 +9128,12 @@ var DesktopLayout4 = (props) => {
|
|
|
9102
9128
|
}
|
|
9103
9129
|
);
|
|
9104
9130
|
};
|
|
9131
|
+
|
|
9132
|
+
// src/pages/trading/trading.injectable.tsx
|
|
9133
|
+
var InjectableDesktopLayout = injectable(
|
|
9134
|
+
DesktopLayout4,
|
|
9135
|
+
"Trading.Layout.Desktop"
|
|
9136
|
+
);
|
|
9105
9137
|
var Countdown = ({
|
|
9106
9138
|
timeInterval
|
|
9107
9139
|
}) => {
|
|
@@ -9364,7 +9396,7 @@ var Trading = (props) => {
|
|
|
9364
9396
|
return /* @__PURE__ */ jsx(MobileLayout4, { ...props });
|
|
9365
9397
|
}
|
|
9366
9398
|
return /* @__PURE__ */ jsx(
|
|
9367
|
-
|
|
9399
|
+
InjectableDesktopLayout,
|
|
9368
9400
|
{
|
|
9369
9401
|
className: "oui-h-[calc(100vh_-_48px_-_29px)] oui-bg-base-10",
|
|
9370
9402
|
...props
|