@orderly.network/markets 2.8.10-alpha.0 → 2.8.11-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 +13 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -703,10 +703,8 @@ function searchBySymbol(list, searchValue = "", formatString) {
|
|
|
703
703
|
const compareSymbols = (a, b) => {
|
|
704
704
|
const symbolA = utils.formatSymbol(a.symbol, formatString);
|
|
705
705
|
const symbolB = utils.formatSymbol(b.symbol, formatString);
|
|
706
|
-
if (symbolA < symbolB)
|
|
707
|
-
|
|
708
|
-
if (symbolA > symbolB)
|
|
709
|
-
return 1;
|
|
706
|
+
if (symbolA < symbolB) return -1;
|
|
707
|
+
if (symbolA > symbolB) return 1;
|
|
710
708
|
return 0;
|
|
711
709
|
};
|
|
712
710
|
startsWithMatches.sort(compareSymbols);
|
|
@@ -737,12 +735,9 @@ var compareValues;
|
|
|
737
735
|
var init_utils = __esm({
|
|
738
736
|
"src/utils.ts"() {
|
|
739
737
|
compareValues = (aValue, bValue) => {
|
|
740
|
-
if (aValue == null && bValue == null)
|
|
741
|
-
|
|
742
|
-
if (
|
|
743
|
-
return 1;
|
|
744
|
-
if (bValue == null)
|
|
745
|
-
return -1;
|
|
738
|
+
if (aValue == null && bValue == null) return 0;
|
|
739
|
+
if (aValue == null) return 1;
|
|
740
|
+
if (bValue == null) return -1;
|
|
746
741
|
const aStr = String(aValue).trim();
|
|
747
742
|
const bStr = String(bValue).trim();
|
|
748
743
|
const aNum = Number(aStr);
|
|
@@ -801,8 +796,7 @@ function useDataSource() {
|
|
|
801
796
|
[markets]
|
|
802
797
|
);
|
|
803
798
|
const tvl = React6.useMemo(() => {
|
|
804
|
-
if (!balance)
|
|
805
|
-
return 0;
|
|
799
|
+
if (!balance) return 0;
|
|
806
800
|
const { total_holding = 0 } = balance;
|
|
807
801
|
return new utils.Decimal(total_holding).toNumber();
|
|
808
802
|
}, [balance]);
|
|
@@ -3540,8 +3534,7 @@ var init_fundingOverview_ui = __esm({
|
|
|
3540
3534
|
}
|
|
3541
3535
|
});
|
|
3542
3536
|
function getFundingInterval(next_funding_time, last_funding_rate_timestamp) {
|
|
3543
|
-
if (!next_funding_time || !last_funding_rate_timestamp)
|
|
3544
|
-
return 8;
|
|
3537
|
+
if (!next_funding_time || !last_funding_rate_timestamp) return 8;
|
|
3545
3538
|
const diff = next_funding_time - last_funding_rate_timestamp;
|
|
3546
3539
|
return Math.round(diff / 36e5);
|
|
3547
3540
|
}
|
|
@@ -5824,8 +5817,7 @@ var useFundingRateHintScript = (symbol) => {
|
|
|
5824
5817
|
return `${new utils.Decimal(est_funding_rate).mul(notional).todp(4).toNumber()}`;
|
|
5825
5818
|
}, [est_funding_rate, notional, rows]);
|
|
5826
5819
|
const calculateAnnualizedRate = (rate, intervalHours) => {
|
|
5827
|
-
if (!rate || !intervalHours)
|
|
5828
|
-
return void 0;
|
|
5820
|
+
if (!rate || !intervalHours) return void 0;
|
|
5829
5821
|
const annualizedRate = new utils.Decimal(rate).mul(24).div(intervalHours).mul(365);
|
|
5830
5822
|
return annualizedRate.todp(2, utils.Decimal.ROUND_DOWN).toNumber();
|
|
5831
5823
|
};
|
|
@@ -6347,15 +6339,13 @@ var useHorizontalMarketsScript = (options) => {
|
|
|
6347
6339
|
(fav) => fav.tabs?.some((tab) => tab.id === selectedFavoriteTab.id)
|
|
6348
6340
|
)?.map((fav) => fav.name);
|
|
6349
6341
|
const map = /* @__PURE__ */ Object.create(null);
|
|
6350
|
-
for (const m of markets)
|
|
6351
|
-
map[m.symbol] = m;
|
|
6342
|
+
for (const m of markets) map[m.symbol] = m;
|
|
6352
6343
|
return (symbolsInTab || []).map((s) => map[s]).filter(Boolean);
|
|
6353
6344
|
}
|
|
6354
6345
|
if (selectedMarketType === "recent") {
|
|
6355
6346
|
const symbolsInRecent = favorite.recent?.map((r) => r.name) || [];
|
|
6356
6347
|
const map = /* @__PURE__ */ Object.create(null);
|
|
6357
|
-
for (const m of markets)
|
|
6358
|
-
map[m.symbol] = m;
|
|
6348
|
+
for (const m of markets) map[m.symbol] = m;
|
|
6359
6349
|
return symbolsInRecent.map((s) => map[s]).filter(Boolean);
|
|
6360
6350
|
}
|
|
6361
6351
|
return markets;
|
|
@@ -6377,10 +6367,8 @@ var useHorizontalMarketsScript = (options) => {
|
|
|
6377
6367
|
const list = optionSymbols ? optionSymbols : sortedMarkets.map((m) => m.symbol);
|
|
6378
6368
|
const max = optionMaxItems;
|
|
6379
6369
|
if (typeof max === "number") {
|
|
6380
|
-
if (max === -1)
|
|
6381
|
-
|
|
6382
|
-
if (max >= 0)
|
|
6383
|
-
return list.slice(0, max);
|
|
6370
|
+
if (max === -1) return list;
|
|
6371
|
+
if (max >= 0) return list.slice(0, max);
|
|
6384
6372
|
}
|
|
6385
6373
|
return list;
|
|
6386
6374
|
}, [sortedMarkets, optionSymbols, optionMaxItems]);
|
|
@@ -6865,5 +6853,5 @@ exports.useSideMarketsScript = useSideMarketsScript;
|
|
|
6865
6853
|
exports.useSubMenuMarketsScript = useSubMenuMarketsScript;
|
|
6866
6854
|
exports.useSymbolInfoBarFullScript = useSymbolInfoBarFullScript;
|
|
6867
6855
|
exports.useSymbolInfoBarScript = useSymbolInfoBarScript;
|
|
6868
|
-
//# sourceMappingURL=
|
|
6856
|
+
//# sourceMappingURL=index.js.map
|
|
6869
6857
|
//# sourceMappingURL=index.js.map
|