@orderly.network/trading 3.0.4-alpha.0 → 3.0.4-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.d.mts +157 -70
- package/dist/index.d.ts +157 -70
- package/dist/index.js +54 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -21
package/dist/index.js
CHANGED
|
@@ -1823,16 +1823,16 @@ var init_assetView = __esm({
|
|
|
1823
1823
|
init_assetView_widget();
|
|
1824
1824
|
}
|
|
1825
1825
|
});
|
|
1826
|
-
var OrderBookContext
|
|
1826
|
+
var OrderBookContext; exports.useOrderBookContext = void 0; var ORDERBOOK_COIN_TYPE_KEY, ORDERBOOK_MOBILE_COIN_TYPE_KEY; exports.OrderBookProvider = void 0;
|
|
1827
1827
|
var init_orderContext = __esm({
|
|
1828
1828
|
"src/components/base/orderBook/orderContext.tsx"() {
|
|
1829
1829
|
OrderBookContext = React12.createContext({
|
|
1830
1830
|
cellHeight: 22
|
|
1831
1831
|
});
|
|
1832
|
-
useOrderBookContext = () => React12.useContext(OrderBookContext);
|
|
1832
|
+
exports.useOrderBookContext = () => React12.useContext(OrderBookContext);
|
|
1833
1833
|
ORDERBOOK_COIN_TYPE_KEY = "orderbook_coin_type";
|
|
1834
1834
|
ORDERBOOK_MOBILE_COIN_TYPE_KEY = "orderbook_mobile_coin_unit";
|
|
1835
|
-
OrderBookProvider = (props) => {
|
|
1835
|
+
exports.OrderBookProvider = (props) => {
|
|
1836
1836
|
const [mode, setMode] = React12.useState("quantity");
|
|
1837
1837
|
const [totalMode, setTotalMode] = React12.useState("quantity");
|
|
1838
1838
|
const memoizedValue = React12__default.default.useMemo(() => {
|
|
@@ -1905,7 +1905,7 @@ var init_cell_desktop = __esm({
|
|
|
1905
1905
|
init_orderContext();
|
|
1906
1906
|
init_types();
|
|
1907
1907
|
DesktopOrderBookCell = (props) => {
|
|
1908
|
-
const { cellHeight, showTotal, onItemClick, depth, pendingOrders } = useOrderBookContext();
|
|
1908
|
+
const { cellHeight, showTotal, onItemClick, depth, pendingOrders } = exports.useOrderBookContext();
|
|
1909
1909
|
const {
|
|
1910
1910
|
symbolInfo,
|
|
1911
1911
|
currentHover,
|
|
@@ -2052,7 +2052,7 @@ var init_listBox_desktop = __esm({
|
|
|
2052
2052
|
};
|
|
2053
2053
|
DesktopListBox = (props) => {
|
|
2054
2054
|
const { data, type, countQty } = props;
|
|
2055
|
-
const { symbolInfo, depth } = useOrderBookContext();
|
|
2055
|
+
const { symbolInfo, depth } = exports.useOrderBookContext();
|
|
2056
2056
|
const findMaxItem = React12.useCallback(() => {
|
|
2057
2057
|
if (!data?.length) {
|
|
2058
2058
|
return null;
|
|
@@ -2211,7 +2211,7 @@ var init_listBox_desktop = __esm({
|
|
|
2211
2211
|
};
|
|
2212
2212
|
}
|
|
2213
2213
|
});
|
|
2214
|
-
var DesktopAsks;
|
|
2214
|
+
var DesktopAsks, InjectableDesktopAsks;
|
|
2215
2215
|
var init_asks_desktop = __esm({
|
|
2216
2216
|
"src/components/desktop/orderBook/asks.desktop.tsx"() {
|
|
2217
2217
|
init_types();
|
|
@@ -2237,9 +2237,13 @@ var init_asks_desktop = __esm({
|
|
|
2237
2237
|
}
|
|
2238
2238
|
);
|
|
2239
2239
|
};
|
|
2240
|
+
InjectableDesktopAsks = ui.injectable(
|
|
2241
|
+
DesktopAsks,
|
|
2242
|
+
"OrderBook.Desktop.Asks"
|
|
2243
|
+
);
|
|
2240
2244
|
}
|
|
2241
2245
|
});
|
|
2242
|
-
var DesktopBids;
|
|
2246
|
+
var DesktopBids, InjectableDesktopBids;
|
|
2243
2247
|
var init_bids_desktop = __esm({
|
|
2244
2248
|
"src/components/desktop/orderBook/bids.desktop.tsx"() {
|
|
2245
2249
|
init_types();
|
|
@@ -2264,6 +2268,10 @@ var init_bids_desktop = __esm({
|
|
|
2264
2268
|
}
|
|
2265
2269
|
);
|
|
2266
2270
|
};
|
|
2271
|
+
InjectableDesktopBids = ui.injectable(
|
|
2272
|
+
DesktopBids,
|
|
2273
|
+
"OrderBook.Desktop.Bids"
|
|
2274
|
+
);
|
|
2267
2275
|
}
|
|
2268
2276
|
});
|
|
2269
2277
|
var BuySellRatioSettings, MoreIcon;
|
|
@@ -2403,7 +2411,7 @@ var init_header_desktop = __esm({
|
|
|
2403
2411
|
};
|
|
2404
2412
|
DesktopHeader = (props) => {
|
|
2405
2413
|
const { base, quote = "USDC" } = props;
|
|
2406
|
-
const { showTotal } = useOrderBookContext();
|
|
2414
|
+
const { showTotal } = exports.useOrderBookContext();
|
|
2407
2415
|
const { t } = i18n.useTranslation();
|
|
2408
2416
|
const [popoverOpen, setOpen] = React12__default.default.useState(false);
|
|
2409
2417
|
const [coinType] = hooks.useLocalStorage(ORDERBOOK_COIN_TYPE_KEY, base);
|
|
@@ -2755,7 +2763,7 @@ var init_markPrice_desktop = __esm({
|
|
|
2755
2763
|
init_orderContext();
|
|
2756
2764
|
DesktopMarkPrice = (props) => {
|
|
2757
2765
|
const { markPrice = 0, lastPrice, asks, bids, symbolInfo } = props;
|
|
2758
|
-
const { showTotal } = useOrderBookContext();
|
|
2766
|
+
const { showTotal } = exports.useOrderBookContext();
|
|
2759
2767
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "oui-flex oui-flex-row oui-pl-3 oui-tabular-nums oui-justify-between oui-text-base-contrast-80 oui-text-xs oui-relative oui-cursor-pointer oui-py-[6px]", children: [
|
|
2760
2768
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2761
2769
|
"div",
|
|
@@ -2886,7 +2894,7 @@ var init_index_desktop = __esm({
|
|
|
2886
2894
|
};
|
|
2887
2895
|
}, []);
|
|
2888
2896
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2889
|
-
OrderBookProvider,
|
|
2897
|
+
exports.OrderBookProvider,
|
|
2890
2898
|
{
|
|
2891
2899
|
cellHeight: props.cellHeight ?? 20,
|
|
2892
2900
|
onItemClick: props.onItemClick,
|
|
@@ -2927,7 +2935,14 @@ var init_index_desktop = __esm({
|
|
|
2927
2935
|
)
|
|
2928
2936
|
] }),
|
|
2929
2937
|
/* @__PURE__ */ jsxRuntime.jsx(DesktopHeader, { quote, base }),
|
|
2930
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2938
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2939
|
+
InjectableDesktopAsks,
|
|
2940
|
+
{
|
|
2941
|
+
data: [...props.asks],
|
|
2942
|
+
symbolInfo: props.symbolInfo,
|
|
2943
|
+
depth: props.activeDepth
|
|
2944
|
+
}
|
|
2945
|
+
),
|
|
2931
2946
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2932
2947
|
DesktopMarkPrice,
|
|
2933
2948
|
{
|
|
@@ -2938,7 +2953,14 @@ var init_index_desktop = __esm({
|
|
|
2938
2953
|
symbolInfo: props.symbolInfo
|
|
2939
2954
|
}
|
|
2940
2955
|
),
|
|
2941
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2956
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2957
|
+
InjectableDesktopBids,
|
|
2958
|
+
{
|
|
2959
|
+
data: [...props.bids],
|
|
2960
|
+
symbolInfo: props.symbolInfo,
|
|
2961
|
+
depth: props.activeDepth
|
|
2962
|
+
}
|
|
2963
|
+
),
|
|
2942
2964
|
showBuySellRatio && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2943
2965
|
exports.BuySellRatioBar,
|
|
2944
2966
|
{
|
|
@@ -3273,7 +3295,7 @@ var init_listBox = __esm({
|
|
|
3273
3295
|
init_cell();
|
|
3274
3296
|
ListBox = (props) => {
|
|
3275
3297
|
const { data } = props;
|
|
3276
|
-
const { mode } = useOrderBookContext();
|
|
3298
|
+
const { mode } = exports.useOrderBookContext();
|
|
3277
3299
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { className: "oui-orderBook-list oui-order-book-list oui-flex oui-w-full oui-flex-col oui-gap-px", children: data.map((item, index) => {
|
|
3278
3300
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3279
3301
|
OrderBookCell,
|
|
@@ -3452,7 +3474,7 @@ var init_markPrice2 = __esm({
|
|
|
3452
3474
|
init_midPriceView();
|
|
3453
3475
|
init_orderContext();
|
|
3454
3476
|
MarkPrice = (props) => {
|
|
3455
|
-
const { symbolInfo } = useOrderBookContext();
|
|
3477
|
+
const { symbolInfo } = exports.useOrderBookContext();
|
|
3456
3478
|
const { quote_dp } = symbolInfo;
|
|
3457
3479
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3458
3480
|
ui.Flex,
|
|
@@ -3518,7 +3540,7 @@ var init_orderBook = __esm({
|
|
|
3518
3540
|
"qty"
|
|
3519
3541
|
);
|
|
3520
3542
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3521
|
-
OrderBookProvider,
|
|
3543
|
+
exports.OrderBookProvider,
|
|
3522
3544
|
{
|
|
3523
3545
|
cellHeight: props.cellHeight ?? 20,
|
|
3524
3546
|
onItemClick: props.onItemClick,
|
|
@@ -3876,7 +3898,9 @@ var orderBook_exports = {};
|
|
|
3876
3898
|
__export(orderBook_exports, {
|
|
3877
3899
|
BuySellRatioBar: () => exports.BuySellRatioBar,
|
|
3878
3900
|
OrderBook: () => exports.OrderBook,
|
|
3901
|
+
OrderBookProvider: () => exports.OrderBookProvider,
|
|
3879
3902
|
OrderBookWidget: () => exports.OrderBookWidget,
|
|
3903
|
+
useOrderBookContext: () => exports.useOrderBookContext,
|
|
3880
3904
|
useOrderBookScript: () => exports.useOrderBookScript
|
|
3881
3905
|
});
|
|
3882
3906
|
var init_orderBook2 = __esm({
|
|
@@ -3885,6 +3909,7 @@ var init_orderBook2 = __esm({
|
|
|
3885
3909
|
init_orderBook_widget();
|
|
3886
3910
|
init_orderBook_script();
|
|
3887
3911
|
init_buySellRatioBar();
|
|
3912
|
+
init_orderContext();
|
|
3888
3913
|
}
|
|
3889
3914
|
});
|
|
3890
3915
|
exports.RiskRate = void 0;
|
|
@@ -6915,17 +6940,10 @@ var Account = (props) => {
|
|
|
6915
6940
|
}
|
|
6916
6941
|
);
|
|
6917
6942
|
};
|
|
6918
|
-
ui.
|
|
6919
|
-
name: "mobile-account-menu",
|
|
6920
|
-
scope: ["*"],
|
|
6921
|
-
positions: [ui.ExtensionPositionEnum.MobileAccountMenu],
|
|
6922
|
-
builder: useAccountScript,
|
|
6923
|
-
__isInternal: true
|
|
6924
|
-
})((props) => {
|
|
6925
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Account, { ...props });
|
|
6926
|
-
});
|
|
6943
|
+
var InjectableAccount = ui.injectable(Account, "Account.MobileAccountMenu");
|
|
6927
6944
|
var MobileAccountMenuExtension = () => {
|
|
6928
|
-
|
|
6945
|
+
const state = useAccountScript();
|
|
6946
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InjectableAccount, { ...state });
|
|
6929
6947
|
};
|
|
6930
6948
|
|
|
6931
6949
|
// src/components/mobile/bottomNavBar/balance/balance.ui.tsx
|
|
@@ -8400,7 +8418,10 @@ var DesktopLayout4 = (props) => {
|
|
|
8400
8418
|
}
|
|
8401
8419
|
];
|
|
8402
8420
|
},
|
|
8403
|
-
sideEffects: ({
|
|
8421
|
+
sideEffects: ({
|
|
8422
|
+
active,
|
|
8423
|
+
dragOverlay
|
|
8424
|
+
}) => {
|
|
8404
8425
|
active.node.style.opacity = "0";
|
|
8405
8426
|
const innerElement = dragOverlay.node.querySelector(".inner-content");
|
|
8406
8427
|
if (innerElement) {
|
|
@@ -8473,9 +8494,6 @@ var DesktopLayout4 = (props) => {
|
|
|
8473
8494
|
const marketsWidget = /* @__PURE__ */ jsxRuntime.jsx(
|
|
8474
8495
|
markets.SideMarketsWidget,
|
|
8475
8496
|
{
|
|
8476
|
-
resizeable,
|
|
8477
|
-
panelSize,
|
|
8478
|
-
onPanelSizeChange,
|
|
8479
8497
|
symbol: props.symbol,
|
|
8480
8498
|
onSymbolChange: props.onSymbolChange
|
|
8481
8499
|
}
|
|
@@ -9106,6 +9124,12 @@ var DesktopLayout4 = (props) => {
|
|
|
9106
9124
|
}
|
|
9107
9125
|
);
|
|
9108
9126
|
};
|
|
9127
|
+
|
|
9128
|
+
// src/pages/trading/trading.injectable.tsx
|
|
9129
|
+
var InjectableDesktopLayout = ui.injectable(
|
|
9130
|
+
DesktopLayout4,
|
|
9131
|
+
"Trading.Layout.Desktop"
|
|
9132
|
+
);
|
|
9109
9133
|
var Countdown = ({
|
|
9110
9134
|
timeInterval
|
|
9111
9135
|
}) => {
|
|
@@ -9368,7 +9392,7 @@ var Trading = (props) => {
|
|
|
9368
9392
|
return /* @__PURE__ */ jsxRuntime.jsx(MobileLayout4, { ...props });
|
|
9369
9393
|
}
|
|
9370
9394
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9371
|
-
|
|
9395
|
+
InjectableDesktopLayout,
|
|
9372
9396
|
{
|
|
9373
9397
|
className: "oui-h-[calc(100vh_-_48px_-_29px)] oui-bg-base-10",
|
|
9374
9398
|
...props
|