@orderly.network/trading 2.8.12 → 2.8.13-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.js +15 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
package/dist/index.mjs
CHANGED
|
@@ -2,13 +2,13 @@ import { useAccount, useLocalStorage, useConfig, useWalletConnector, useMutation
|
|
|
2
2
|
import React12, { forwardRef, useMemo, createContext, useContext, useState, useCallback, useEffect, useRef, createElement } from 'react';
|
|
3
3
|
import { useDataTap, useAppContext } from '@orderly.network/react-app';
|
|
4
4
|
import { AccountStatusEnum, ChainNamespace, AlgoOrderRootType, OrderStatus, OrderSide, AssetHistoryStatusEnum, AssetHistorySideEnum, TradingviewFullscreenKey, OrderEntrySortKeys, EMPTY_LIST } from '@orderly.network/types';
|
|
5
|
-
import { TabType, DesktopOrderListWidget, MobileOrderListWidget } from '@orderly.network/ui-orders';
|
|
6
5
|
import { useTranslation, i18n, Trans } from '@orderly.network/i18n';
|
|
7
6
|
import { installExtension, ExtensionPositionEnum, cn, Button, formatAddress, registerSimpleDialog, registerSimpleSheet, modal, useModal, Flex, toast as toast$1, Text, ArrowRightShortIcon, Box, ListView, Grid, ArrowDownShortIcon, gradientTextVariants, EyeIcon, EyeCloseIcon, Divider, ChevronDownIcon, useScreen, Tooltip, Tabs, TabPanel, CloseIcon, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, Statistic, RefreshIcon, ArrowLeftRightIcon, ArrowUpShortIcon, InfoCircleIcon, ExtensionSlot, NewsFillIcon, SimpleSheet, SimpleDialog, ChainIcon, ExclamationFillIcon, Switch, Checkbox, Sheet, SheetTrigger, SheetContent, SettingFillIcon, Spinner, PopoverRoot, PopoverTrigger, PopoverContent, Select, Popover, CaretUpIcon, CaretDownIcon, Picker, TooltipRoot, TooltipTrigger, TooltipContent as TooltipContent$1, TooltipArrow, parseNumber } from '@orderly.network/ui';
|
|
8
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
8
|
import { PositionHistoryWidget, LiquidationWidget, PositionsWidget, CloseAllPositionsWidget, MobileLiquidationWidget, MobilePositionsWidget, MobilePositionHistoryWidget, useReversePositionEnabled } from '@orderly.network/ui-positions';
|
|
10
9
|
import { isTestnet, Decimal, commifyOptional, removeTrailingZeros, formatSymbol, optimizeSymbolDisplay, getPrecisionByNumber } from '@orderly.network/utils';
|
|
11
10
|
import { AssetsModule } from '@orderly.network/portfolio';
|
|
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
14
|
import { DepositAndWithdrawWithSheetId, TransferSheetId, DepositStatusWidget, DepositAndWithdrawWithDialogId, TransferDialogId } from '@orderly.network/ui-transfer';
|
|
@@ -84,9 +84,7 @@ var init_usePendingOrderCount = __esm({
|
|
|
84
84
|
init_useTradingLocalStorage();
|
|
85
85
|
usePendingOrderCount = (symbol) => {
|
|
86
86
|
const { showAllSymbol } = useTradingLocalStorage();
|
|
87
|
-
|
|
88
|
-
`orderly_${TabType.tp_sl}_pageSize`;
|
|
89
|
-
const [pendingOrders, { total: pendingCount }] = useOrderStream(
|
|
87
|
+
const [pendingOrders] = useOrderStream(
|
|
90
88
|
{
|
|
91
89
|
symbol: showAllSymbol ? void 0 : symbol,
|
|
92
90
|
status: OrderStatus.INCOMPLETE,
|
|
@@ -99,7 +97,7 @@ var init_usePendingOrderCount = __esm({
|
|
|
99
97
|
keeplive: true
|
|
100
98
|
}
|
|
101
99
|
);
|
|
102
|
-
const [tpslOrders
|
|
100
|
+
const [tpslOrders] = useOrderStream(
|
|
103
101
|
{
|
|
104
102
|
symbol: showAllSymbol ? void 0 : symbol,
|
|
105
103
|
status: OrderStatus.INCOMPLETE,
|
|
@@ -112,6 +110,18 @@ var init_usePendingOrderCount = __esm({
|
|
|
112
110
|
keeplive: true
|
|
113
111
|
}
|
|
114
112
|
);
|
|
113
|
+
const pendingCount = useMemo(() => {
|
|
114
|
+
if (showAllSymbol) {
|
|
115
|
+
return pendingOrders?.length ?? 0;
|
|
116
|
+
}
|
|
117
|
+
return pendingOrders?.filter((item) => item.symbol === symbol)?.length ?? 0;
|
|
118
|
+
}, [pendingOrders, showAllSymbol, symbol]);
|
|
119
|
+
const tpslCount = useMemo(() => {
|
|
120
|
+
if (showAllSymbol) {
|
|
121
|
+
return tpslOrders?.length ?? 0;
|
|
122
|
+
}
|
|
123
|
+
return tpslOrders?.filter((item) => item.symbol === symbol)?.length ?? 0;
|
|
124
|
+
}, [tpslOrders, showAllSymbol, symbol]);
|
|
115
125
|
const pendingOrderCount = useDataTap(pendingCount) ?? 0;
|
|
116
126
|
const tpSlOrderCount = useDataTap(tpslCount) ?? 0;
|
|
117
127
|
return {
|