@orderly.network/markets 2.8.10 → 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.mjs
CHANGED
|
@@ -697,10 +697,8 @@ function searchBySymbol(list, searchValue = "", formatString) {
|
|
|
697
697
|
const compareSymbols = (a, b) => {
|
|
698
698
|
const symbolA = formatSymbol(a.symbol, formatString);
|
|
699
699
|
const symbolB = formatSymbol(b.symbol, formatString);
|
|
700
|
-
if (symbolA < symbolB)
|
|
701
|
-
|
|
702
|
-
if (symbolA > symbolB)
|
|
703
|
-
return 1;
|
|
700
|
+
if (symbolA < symbolB) return -1;
|
|
701
|
+
if (symbolA > symbolB) return 1;
|
|
704
702
|
return 0;
|
|
705
703
|
};
|
|
706
704
|
startsWithMatches.sort(compareSymbols);
|
|
@@ -731,12 +729,9 @@ var compareValues;
|
|
|
731
729
|
var init_utils = __esm({
|
|
732
730
|
"src/utils.ts"() {
|
|
733
731
|
compareValues = (aValue, bValue) => {
|
|
734
|
-
if (aValue == null && bValue == null)
|
|
735
|
-
|
|
736
|
-
if (
|
|
737
|
-
return 1;
|
|
738
|
-
if (bValue == null)
|
|
739
|
-
return -1;
|
|
732
|
+
if (aValue == null && bValue == null) return 0;
|
|
733
|
+
if (aValue == null) return 1;
|
|
734
|
+
if (bValue == null) return -1;
|
|
740
735
|
const aStr = String(aValue).trim();
|
|
741
736
|
const bStr = String(bValue).trim();
|
|
742
737
|
const aNum = Number(aStr);
|
|
@@ -795,8 +790,7 @@ function useDataSource() {
|
|
|
795
790
|
[markets]
|
|
796
791
|
);
|
|
797
792
|
const tvl = useMemo(() => {
|
|
798
|
-
if (!balance)
|
|
799
|
-
return 0;
|
|
793
|
+
if (!balance) return 0;
|
|
800
794
|
const { total_holding = 0 } = balance;
|
|
801
795
|
return new Decimal(total_holding).toNumber();
|
|
802
796
|
}, [balance]);
|
|
@@ -3534,8 +3528,7 @@ var init_fundingOverview_ui = __esm({
|
|
|
3534
3528
|
}
|
|
3535
3529
|
});
|
|
3536
3530
|
function getFundingInterval(next_funding_time, last_funding_rate_timestamp) {
|
|
3537
|
-
if (!next_funding_time || !last_funding_rate_timestamp)
|
|
3538
|
-
return 8;
|
|
3531
|
+
if (!next_funding_time || !last_funding_rate_timestamp) return 8;
|
|
3539
3532
|
const diff = next_funding_time - last_funding_rate_timestamp;
|
|
3540
3533
|
return Math.round(diff / 36e5);
|
|
3541
3534
|
}
|
|
@@ -5818,8 +5811,7 @@ var useFundingRateHintScript = (symbol) => {
|
|
|
5818
5811
|
return `${new Decimal(est_funding_rate).mul(notional).todp(4).toNumber()}`;
|
|
5819
5812
|
}, [est_funding_rate, notional, rows]);
|
|
5820
5813
|
const calculateAnnualizedRate = (rate, intervalHours) => {
|
|
5821
|
-
if (!rate || !intervalHours)
|
|
5822
|
-
return void 0;
|
|
5814
|
+
if (!rate || !intervalHours) return void 0;
|
|
5823
5815
|
const annualizedRate = new Decimal(rate).mul(24).div(intervalHours).mul(365);
|
|
5824
5816
|
return annualizedRate.todp(2, Decimal.ROUND_DOWN).toNumber();
|
|
5825
5817
|
};
|
|
@@ -6341,15 +6333,13 @@ var useHorizontalMarketsScript = (options) => {
|
|
|
6341
6333
|
(fav) => fav.tabs?.some((tab) => tab.id === selectedFavoriteTab.id)
|
|
6342
6334
|
)?.map((fav) => fav.name);
|
|
6343
6335
|
const map = /* @__PURE__ */ Object.create(null);
|
|
6344
|
-
for (const m of markets)
|
|
6345
|
-
map[m.symbol] = m;
|
|
6336
|
+
for (const m of markets) map[m.symbol] = m;
|
|
6346
6337
|
return (symbolsInTab || []).map((s) => map[s]).filter(Boolean);
|
|
6347
6338
|
}
|
|
6348
6339
|
if (selectedMarketType === "recent") {
|
|
6349
6340
|
const symbolsInRecent = favorite.recent?.map((r) => r.name) || [];
|
|
6350
6341
|
const map = /* @__PURE__ */ Object.create(null);
|
|
6351
|
-
for (const m of markets)
|
|
6352
|
-
map[m.symbol] = m;
|
|
6342
|
+
for (const m of markets) map[m.symbol] = m;
|
|
6353
6343
|
return symbolsInRecent.map((s) => map[s]).filter(Boolean);
|
|
6354
6344
|
}
|
|
6355
6345
|
return markets;
|
|
@@ -6371,10 +6361,8 @@ var useHorizontalMarketsScript = (options) => {
|
|
|
6371
6361
|
const list = optionSymbols ? optionSymbols : sortedMarkets.map((m) => m.symbol);
|
|
6372
6362
|
const max = optionMaxItems;
|
|
6373
6363
|
if (typeof max === "number") {
|
|
6374
|
-
if (max === -1)
|
|
6375
|
-
|
|
6376
|
-
if (max >= 0)
|
|
6377
|
-
return list.slice(0, max);
|
|
6364
|
+
if (max === -1) return list;
|
|
6365
|
+
if (max >= 0) return list.slice(0, max);
|
|
6378
6366
|
}
|
|
6379
6367
|
return list;
|
|
6380
6368
|
}, [sortedMarkets, optionSymbols, optionMaxItems]);
|
|
@@ -6829,5 +6817,5 @@ var MarketsMobileContent = (props) => {
|
|
|
6829
6817
|
init_marketsProvider();
|
|
6830
6818
|
|
|
6831
6819
|
export { CollapseMarkets, DropDownMarkets, DropDownMarketsConetnt, DropDownMarketsWidget, ExpandMarkets, ExpandMarketsWidget, FavoritesDropdownMenu, FavoritesDropdownMenuWidget, FavoritesList, FavoritesListFull, FavoritesListFullWidget, FavoritesListWidget, FavoritesTab, FavoritesTabWidget, FundingComparison, FundingComparisonWidget, FundingOverview, FundingOverviewWidget, FundingTabName, HorizontalMarkets, HorizontalMarketsWidget, MarketItem, MarketTypeFilter, MarketsDataList, MarketsDataListWidget, MarketsHeader, MarketsHeaderWidget, MarketsHomePage, MarketsList, MarketsListFull, MarketsListFullWidget, MarketsListWidget, MarketsPageTab, MarketsProvider, MarketsSheet, MarketsSheetWidget, MarketsTabName, NewListingList, NewListingListWidget, RecentList, RecentListWidget, SideMarkets, SideMarketsWidget, SubMenuMarkets, SubMenuMarketsWidget, SymbolInfoBar, SymbolInfoBarFull, SymbolInfoBarFullWidget, SymbolInfoBarWidget, useDropDownMarketsColumns, useDropDownMarketsScript, useExpandMarketsScript, useFavoritesDropdownMenuScript, useFavoritesListFullScript, useFavoritesListScript, useFavoritesTabScript, useFundingComparisonScript, useFundingOverviewScript, useHorizontalMarketsScript, useMarketsDataListScript, useMarketsHeaderScript, useMarketsListFullScript, useMarketsListScript, useMarketsSheetScript, useNewListingListScript, useRecentListScript, useSideMarketsScript, useSubMenuMarketsScript, useSymbolInfoBarFullScript, useSymbolInfoBarScript };
|
|
6832
|
-
//# sourceMappingURL=
|
|
6820
|
+
//# sourceMappingURL=index.mjs.map
|
|
6833
6821
|
//# sourceMappingURL=index.mjs.map
|