From e2f127947ed36f0412539e8ac938271666fa113d Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 19 Dec 2024 20:30:22 -0500 Subject: [PATCH 01/10] megalodon-ontology --- src/abacus-ts/selectors/assets.ts | 7 ++++++- src/abacus-ts/selectors/base.ts | 5 +++++ src/abacus-ts/selectors/markets.ts | 7 ++++++- src/hooks/useSeen.ts | 4 ++-- src/state/accountSelectors.ts | 6 +++--- src/views/MarketDetails/CurrentMarketDetails.tsx | 8 +++----- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/abacus-ts/selectors/assets.ts b/src/abacus-ts/selectors/assets.ts index 98170180f..477dbfba0 100644 --- a/src/abacus-ts/selectors/assets.ts +++ b/src/abacus-ts/selectors/assets.ts @@ -1,13 +1,18 @@ import { createSelector } from 'reselect'; import { transformAssetsInfo } from '../calculators/assets'; -import { selectRawAssetsData } from './base'; +import { selectRawAssets, selectRawAssetsData } from './base'; import { selectCurrentMarketInfo } from './markets'; export const selectAllAssetsInfo = createSelector([selectRawAssetsData], (assets) => transformAssetsInfo(assets) ); +export const selectAllAssetsInfoLoading = createSelector( + [selectRawAssets], + (assets) => assets.status +); + export const selectCurrentMarketAssetInfo = createSelector( [selectCurrentMarketInfo, selectAllAssetsInfo], (currentMarketInfo, assets) => { diff --git a/src/abacus-ts/selectors/base.ts b/src/abacus-ts/selectors/base.ts index 3087b2476..e88b48947 100644 --- a/src/abacus-ts/selectors/base.ts +++ b/src/abacus-ts/selectors/base.ts @@ -7,6 +7,7 @@ export const selectRawAccountState = (state: RootState) => state.raw.account; export const selectRawMarkets = (state: RootState) => state.raw.markets.allMarkets; export const selectRawMarketsData = (state: RootState) => state.raw.markets.allMarkets.data; export const selectRawAssetsData = (state: RootState) => state.raw.markets.assets.data; +export const selectRawAssets = (state: RootState) => state.raw.markets.assets; export const selectRawParentSubaccount = (state: RootState) => state.raw.account.parentSubaccount; export const selectRawParentSubaccountData = (state: RootState) => @@ -31,6 +32,10 @@ export const selectRawIndexerHeightData = (state: RootState) => state.raw.heights.indexerHeight.data; export const selectRawValidatorHeightData = (state: RootState) => state.raw.heights.validatorHeight.data; +export const selectRawIndexerHeightDataLoading = (state: RootState) => + state.raw.heights.indexerHeight.status; +export const selectRawValidatorHeightDataLoading = (state: RootState) => + state.raw.heights.validatorHeight.status; export const selectRawFillsRest = (state: RootState) => state.raw.account.fills; export const selectRawOrdersRest = (state: RootState) => state.raw.account.orders; diff --git a/src/abacus-ts/selectors/markets.ts b/src/abacus-ts/selectors/markets.ts index 1b31eaa79..dd336c787 100644 --- a/src/abacus-ts/selectors/markets.ts +++ b/src/abacus-ts/selectors/markets.ts @@ -2,12 +2,17 @@ import { createAppSelector } from '@/state/appTypes'; import { getCurrentMarketId } from '@/state/perpetualsSelectors'; import { calculateAllMarkets } from '../calculators/markets'; -import { selectRawMarketsData } from './base'; +import { selectRawMarkets, selectRawMarketsData } from './base'; export const selectAllMarketsInfo = createAppSelector([selectRawMarketsData], (markets) => calculateAllMarkets(markets) ); +export const selectAllMarketsInfoLoading = createAppSelector( + [selectRawMarkets], + (markets) => markets.status +); + export const selectCurrentMarketInfo = createAppSelector( [selectAllMarketsInfo, getCurrentMarketId], (markets, currentMarketId) => (currentMarketId ? markets?.[currentMarketId] : undefined) diff --git a/src/hooks/useSeen.ts b/src/hooks/useSeen.ts index 6ae7934af..1b5ecaa03 100644 --- a/src/hooks/useSeen.ts +++ b/src/hooks/useSeen.ts @@ -1,6 +1,6 @@ import { useEffect, useRef } from 'react'; -import { selectRawIndexerHeightData } from '@/abacus-ts/selectors/base'; +import { MegalodonCore } from '@/abacus-ts/ontology'; import { shallowEqual } from 'react-redux'; import { getUserWalletAddress } from '@/state/accountSelectors'; @@ -14,7 +14,7 @@ export function useViewPanel( ) { const networkId = useAppSelector(getSelectedNetwork); const walletId = useAppSelector(getUserWalletAddress); - const height = useAppSelector(selectRawIndexerHeightData); + const height = useAppSelector(MegalodonCore.network.indexerHeight.data); const lastSetCore = useRef([]); const dispatch = useAppDispatch(); diff --git a/src/state/accountSelectors.ts b/src/state/accountSelectors.ts index 49337c144..9e7e00248 100644 --- a/src/state/accountSelectors.ts +++ b/src/state/accountSelectors.ts @@ -1,4 +1,4 @@ -import { selectRawIndexerHeightData } from '@/abacus-ts/selectors/base'; +import { MegalodonCore } from '@/abacus-ts/ontology'; import { OrderSide } from '@dydxprotocol/v4-client-js'; import BigNumber from 'bignumber.js'; import { groupBy, sum } from 'lodash'; @@ -702,7 +702,7 @@ export const createGetUnseenOrdersCount = () => createAppSelector( [ getCurrentAccountMemory, - selectRawIndexerHeightData, + MegalodonCore.network.indexerHeight.data, getSubaccountOrders, (state, market: string | undefined) => market, ], @@ -734,7 +734,7 @@ export const createGetUnseenFillsCount = () => createAppSelector( [ getCurrentAccountMemory, - selectRawIndexerHeightData, + MegalodonCore.network.indexerHeight.data, getSubaccountFills, (state, market: string | undefined) => market, ], diff --git a/src/views/MarketDetails/CurrentMarketDetails.tsx b/src/views/MarketDetails/CurrentMarketDetails.tsx index 0e47e0987..286b81501 100644 --- a/src/views/MarketDetails/CurrentMarketDetails.tsx +++ b/src/views/MarketDetails/CurrentMarketDetails.tsx @@ -1,8 +1,6 @@ -import { selectCurrentMarketAssetInfo } from '@/abacus-ts/selectors/assets'; -import { selectCurrentMarketInfo } from '@/abacus-ts/selectors/markets'; +import { MegalodonHelpers } from '@/abacus-ts/ontology'; import { IndexerPerpetualMarketType } from '@/types/indexer/indexerApiGen'; import BigNumber from 'bignumber.js'; -import { shallowEqual } from 'react-redux'; import { STRING_KEYS } from '@/constants/localization'; @@ -22,8 +20,8 @@ import { MarketDetails } from './MarketDetails'; export const CurrentMarketDetails = () => { const stringGetter = useStringGetter(); - const currentMarketData = useAppSelector(selectCurrentMarketInfo, shallowEqual); - const asset = useAppSelector(selectCurrentMarketAssetInfo); + const currentMarketData = useAppSelector(MegalodonHelpers.currentMarket.marketInfo); + const asset = useAppSelector(MegalodonHelpers.currentMarket.assetInfo); const { displayableAsset, From cc93cb7d10968ba93959888d829e6b2d77eb90de Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 19 Dec 2024 20:30:34 -0500 Subject: [PATCH 02/10] fix --- src/abacus-ts/ontology.ts | 98 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 src/abacus-ts/ontology.ts diff --git a/src/abacus-ts/ontology.ts b/src/abacus-ts/ontology.ts new file mode 100644 index 000000000..77da781d2 --- /dev/null +++ b/src/abacus-ts/ontology.ts @@ -0,0 +1,98 @@ +import { type RootState } from '@/state/_store'; +import { getCurrentMarketId } from '@/state/perpetualsSelectors'; + +import { + getCurrentMarketAccountFills, + selectAccountFills, + selectAccountFillsLoading, + selectAccountOrdersLoading, + selectCurrentMarketOpenOrders, + selectCurrentMarketOrderHistory, + selectOpenOrders, + selectOrderHistory, + selectParentSubaccountOpenPositions, + selectParentSubaccountOpenPositionsLoading, + selectParentSubaccountSummary, + selectParentSubaccountSummaryLoading, +} from './selectors/account'; +import { + selectAllAssetsInfo, + selectAllAssetsInfoLoading, + selectCurrentMarketAssetInfo, +} from './selectors/assets'; +import { + selectRawIndexerHeightData, + selectRawIndexerHeightDataLoading, + selectRawValidatorHeightData, + selectRawValidatorHeightDataLoading, +} from './selectors/base'; +import { + selectAllMarketsInfo, + selectAllMarketsInfoLoading, + selectCurrentMarketInfo, +} from './selectors/markets'; + +// every leaf is a selector or a paramaterized selector +type NestedSelectors = { + [K: string]: + | NestedSelectors + | ((state: RootState) => any) + | (() => (state: RootState, ...other: any[]) => any); +}; + +// all data should be accessed via selectrs in this file +// no files outside abacus-ts should access anything within abacus-ts except this file +export const MegalodonCore = { + account: { + parentSubaccountSummary: { + data: selectParentSubaccountSummary, + loading: selectParentSubaccountSummaryLoading, + }, + parentSubaccountPositions: { + data: selectParentSubaccountOpenPositions, + loading: selectParentSubaccountOpenPositionsLoading, + }, + openOrders: { + data: selectOpenOrders, + loading: selectAccountOrdersLoading, + }, + orderHistory: { + data: selectOrderHistory, + loading: selectAccountOrdersLoading, + }, + fills: { + data: selectAccountFills, + loading: selectAccountFillsLoading, + }, + }, + markets: { + currentMarketId: getCurrentMarketId, + markets: { + data: selectAllMarketsInfo, + loading: selectAllMarketsInfoLoading, + }, + assets: { data: selectAllAssetsInfo, loading: selectAllAssetsInfoLoading }, + }, + network: { + indexerHeight: { + data: selectRawIndexerHeightData, + loading: selectRawIndexerHeightDataLoading, + }, + validatorHeight: { + data: selectRawValidatorHeightData, + loading: selectRawValidatorHeightDataLoading, + }, + }, +} as const satisfies NestedSelectors; + +export const MegalodonHelpers = { + currentMarket: { + marketInfo: selectCurrentMarketInfo, + assetInfo: selectCurrentMarketAssetInfo, + account: { + openOrders: selectCurrentMarketOpenOrders, + orderHistory: selectCurrentMarketOrderHistory, + fills: getCurrentMarketAccountFills, + }, + }, +} as const satisfies NestedSelectors; From de0b0d01beddd748d8d4c92135aff1b2d68b5425 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 19 Dec 2024 20:46:58 -0500 Subject: [PATCH 03/10] fix --- .eslintrc.json | 11 +++++++++++ src/abacus-ts/ontology.ts | 1 + src/state/_store.ts | 14 ++++++-------- src/state/raw.ts | 1 + 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index f4c8b114f..482964e0d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -42,6 +42,17 @@ "no-multi-assign": "off", "no-nested-ternary": "off", "no-param-reassign": ["error", { "props": false }], + "no-restricted-imports": [ + "error", + { + "patterns": [ + "@/abacus-ts/*", + "!@/abacus-ts/ontology", + "!@/abacus-ts/lib", + "!@/abacus-ts/summaryTypes" + ] + } + ], "no-return-assign": "off", "no-return-await": "off", "no-underscore-dangle": "off", diff --git a/src/abacus-ts/ontology.ts b/src/abacus-ts/ontology.ts index 77da781d2..102584fb9 100644 --- a/src/abacus-ts/ontology.ts +++ b/src/abacus-ts/ontology.ts @@ -42,6 +42,7 @@ type NestedSelectors = { // all data should be accessed via selectrs in this file // no files outside abacus-ts should access anything within abacus-ts except this file +// TODO - enforce this via eslint export const MegalodonCore = { account: { parentSubaccountSummary: { diff --git a/src/state/_store.ts b/src/state/_store.ts index dc0ae05ef..aff5413df 100644 --- a/src/state/_store.ts +++ b/src/state/_store.ts @@ -1,3 +1,5 @@ +// eslint-disable-next-line no-restricted-imports +import { storeLifecycles } from '@/abacus-ts/storeLifecycles'; import { Middleware, combineReducers, configureStore } from '@reduxjs/toolkit'; import { persistReducer, persistStore } from 'redux-persist'; import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2'; @@ -5,7 +7,6 @@ import storage from 'redux-persist/lib/storage'; import abacusStateManager from '@/lib/abacus'; import { runFn } from '@/lib/do'; -import { testFlags } from '@/lib/testFlags'; import { accountSlice } from './account'; import { accountUiMemorySlice } from './accountUiMemory'; @@ -98,13 +99,10 @@ export const persistor = persistStore(store); // Set store so (Abacus & v4-Client) classes can getState and dispatch abacusStateManager.setStore(store); -if (testFlags.useAbacusTs) { - runFn(async () => { - const { storeLifecycles } = await import('@/abacus-ts/storeLifecycles'); - // we ignore the cleanups for now since we want these running forever - storeLifecycles.forEach((fn) => fn(store)); - }); -} +runFn(async () => { + // we ignore the cleanups for now since we want these running forever + storeLifecycles.forEach((fn) => fn(store)); +}); export type RootStore = typeof store; export type RootState = ReturnType; diff --git a/src/state/raw.ts b/src/state/raw.ts index 2132af23a..1492ab57d 100644 --- a/src/state/raw.ts +++ b/src/state/raw.ts @@ -1,4 +1,5 @@ import { Loadable, loadableIdle } from '@/abacus-ts/lib/loadable'; +// eslint-disable-next-line no-restricted-imports import { AssetInfos, MarketsData, From a6925f254185af7cf960b96821e92805e0077978 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 19 Dec 2024 20:48:41 -0500 Subject: [PATCH 04/10] fix --- src/abacus-ts/ontology.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/abacus-ts/ontology.ts b/src/abacus-ts/ontology.ts index 102584fb9..77da781d2 100644 --- a/src/abacus-ts/ontology.ts +++ b/src/abacus-ts/ontology.ts @@ -42,7 +42,6 @@ type NestedSelectors = { // all data should be accessed via selectrs in this file // no files outside abacus-ts should access anything within abacus-ts except this file -// TODO - enforce this via eslint export const MegalodonCore = { account: { parentSubaccountSummary: { From 2e74fe6137d690a818df285afdcd454435486ec9 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 19 Dec 2024 20:55:11 -0500 Subject: [PATCH 05/10] fix --- .eslintrc.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index 482964e0d..7fe49ae6f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,7 +11,14 @@ "plugin:react-hooks/recommended", "prettier" ], - "overrides": [], + "overrides": [ + { + "files": ["@/abacus-ts/**"], + "rules": { + "no-restricted-imports": "off" + } + } + ], "parserOptions": { "project": "./tsconfig.json", "ecmaVersion": "latest", From 4426bcc4a45f4bc208639e27401e94cbf0022668 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 19 Dec 2024 20:58:22 -0500 Subject: [PATCH 06/10] fix --- .eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index 7fe49ae6f..3609ee35d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -13,7 +13,7 @@ ], "overrides": [ { - "files": ["@/abacus-ts/**"], + "files": ["**/abacus-ts/**"], "rules": { "no-restricted-imports": "off" } From 3bd504fa5104b44b8d2cd9fece5edc44788877a8 Mon Sep 17 00:00:00 2001 From: Tyler Date: Fri, 20 Dec 2024 12:11:07 -0500 Subject: [PATCH 07/10] fix --- src/abacus-ts/ontology.ts | 4 ++-- src/hooks/useSeen.ts | 4 ++-- src/state/accountSelectors.ts | 6 +++--- src/views/MarketDetails/CurrentMarketDetails.tsx | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/abacus-ts/ontology.ts b/src/abacus-ts/ontology.ts index 77da781d2..3af6be90c 100644 --- a/src/abacus-ts/ontology.ts +++ b/src/abacus-ts/ontology.ts @@ -42,7 +42,7 @@ type NestedSelectors = { // all data should be accessed via selectrs in this file // no files outside abacus-ts should access anything within abacus-ts except this file -export const MegalodonCore = { +export const BonsaiCore = { account: { parentSubaccountSummary: { data: selectParentSubaccountSummary, @@ -85,7 +85,7 @@ export const MegalodonCore = { }, } as const satisfies NestedSelectors; -export const MegalodonHelpers = { +export const BonsaiHelpers = { currentMarket: { marketInfo: selectCurrentMarketInfo, assetInfo: selectCurrentMarketAssetInfo, diff --git a/src/hooks/useSeen.ts b/src/hooks/useSeen.ts index 1b5ecaa03..b3ad82550 100644 --- a/src/hooks/useSeen.ts +++ b/src/hooks/useSeen.ts @@ -1,6 +1,6 @@ import { useEffect, useRef } from 'react'; -import { MegalodonCore } from '@/abacus-ts/ontology'; +import { BonsaiCore } from '@/abacus-ts/ontology'; import { shallowEqual } from 'react-redux'; import { getUserWalletAddress } from '@/state/accountSelectors'; @@ -14,7 +14,7 @@ export function useViewPanel( ) { const networkId = useAppSelector(getSelectedNetwork); const walletId = useAppSelector(getUserWalletAddress); - const height = useAppSelector(MegalodonCore.network.indexerHeight.data); + const height = useAppSelector(BonsaiCore.network.indexerHeight.data); const lastSetCore = useRef([]); const dispatch = useAppDispatch(); diff --git a/src/state/accountSelectors.ts b/src/state/accountSelectors.ts index 9e7e00248..d2ea111ae 100644 --- a/src/state/accountSelectors.ts +++ b/src/state/accountSelectors.ts @@ -1,4 +1,4 @@ -import { MegalodonCore } from '@/abacus-ts/ontology'; +import { BonsaiCore } from '@/abacus-ts/ontology'; import { OrderSide } from '@dydxprotocol/v4-client-js'; import BigNumber from 'bignumber.js'; import { groupBy, sum } from 'lodash'; @@ -702,7 +702,7 @@ export const createGetUnseenOrdersCount = () => createAppSelector( [ getCurrentAccountMemory, - MegalodonCore.network.indexerHeight.data, + BonsaiCore.network.indexerHeight.data, getSubaccountOrders, (state, market: string | undefined) => market, ], @@ -734,7 +734,7 @@ export const createGetUnseenFillsCount = () => createAppSelector( [ getCurrentAccountMemory, - MegalodonCore.network.indexerHeight.data, + BonsaiCore.network.indexerHeight.data, getSubaccountFills, (state, market: string | undefined) => market, ], diff --git a/src/views/MarketDetails/CurrentMarketDetails.tsx b/src/views/MarketDetails/CurrentMarketDetails.tsx index 286b81501..2345c5aa6 100644 --- a/src/views/MarketDetails/CurrentMarketDetails.tsx +++ b/src/views/MarketDetails/CurrentMarketDetails.tsx @@ -1,4 +1,4 @@ -import { MegalodonHelpers } from '@/abacus-ts/ontology'; +import { BonsaiHelpers } from '@/abacus-ts/ontology'; import { IndexerPerpetualMarketType } from '@/types/indexer/indexerApiGen'; import BigNumber from 'bignumber.js'; @@ -20,8 +20,8 @@ import { MarketDetails } from './MarketDetails'; export const CurrentMarketDetails = () => { const stringGetter = useStringGetter(); - const currentMarketData = useAppSelector(MegalodonHelpers.currentMarket.marketInfo); - const asset = useAppSelector(MegalodonHelpers.currentMarket.assetInfo); + const currentMarketData = useAppSelector(BonsaiHelpers.currentMarket.marketInfo); + const asset = useAppSelector(BonsaiHelpers.currentMarket.assetInfo); const { displayableAsset, From bdacda1a2d64f82ac47c8a01cd9169b82d3e7363 Mon Sep 17 00:00:00 2001 From: Tyler Date: Mon, 6 Jan 2025 16:27:58 -0500 Subject: [PATCH 08/10] fixes --- src/abacus-ts/ontology.ts | 2 +- src/abacus-ts/selectors/assets.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/abacus-ts/ontology.ts b/src/abacus-ts/ontology.ts index 3af6be90c..34c5d7749 100644 --- a/src/abacus-ts/ontology.ts +++ b/src/abacus-ts/ontology.ts @@ -40,7 +40,7 @@ type NestedSelectors = { | (() => (state: RootState, ...other: any[]) => any); }; -// all data should be accessed via selectrs in this file +// all data should be accessed via selectors in this file // no files outside abacus-ts should access anything within abacus-ts except this file export const BonsaiCore = { account: { diff --git a/src/abacus-ts/selectors/assets.ts b/src/abacus-ts/selectors/assets.ts index 477dbfba0..cdca46fd3 100644 --- a/src/abacus-ts/selectors/assets.ts +++ b/src/abacus-ts/selectors/assets.ts @@ -1,19 +1,19 @@ -import { createSelector } from 'reselect'; +import { createAppSelector } from '@/state/appTypes'; import { transformAssetsInfo } from '../calculators/assets'; import { selectRawAssets, selectRawAssetsData } from './base'; import { selectCurrentMarketInfo } from './markets'; -export const selectAllAssetsInfo = createSelector([selectRawAssetsData], (assets) => +export const selectAllAssetsInfo = createAppSelector([selectRawAssetsData], (assets) => transformAssetsInfo(assets) ); -export const selectAllAssetsInfoLoading = createSelector( +export const selectAllAssetsInfoLoading = createAppSelector( [selectRawAssets], (assets) => assets.status ); -export const selectCurrentMarketAssetInfo = createSelector( +export const selectCurrentMarketAssetInfo = createAppSelector( [selectCurrentMarketInfo, selectAllAssetsInfo], (currentMarketInfo, assets) => { if (currentMarketInfo == null || assets == null) { From 1de805c90c3b892c45190712a4099c93ef6e28c3 Mon Sep 17 00:00:00 2001 From: Tyler Date: Mon, 6 Jan 2025 16:31:57 -0500 Subject: [PATCH 09/10] fix --- src/hooks/useInitializePage.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hooks/useInitializePage.ts b/src/hooks/useInitializePage.ts index 1accf9aae..6c9a740ff 100644 --- a/src/hooks/useInitializePage.ts +++ b/src/hooks/useInitializePage.ts @@ -1,5 +1,6 @@ import { useEffect, useRef } from 'react'; +// eslint-disable-next-line no-restricted-imports import { IndexerWebsocketManager } from '@/abacus-ts/websocket/lib/indexerWebsocketManager'; import { LocalStorageKey } from '@/constants/localStorage'; From 71f0d8455c764efddaba8ba9636f6a6370b90af6 Mon Sep 17 00:00:00 2001 From: Tyler Date: Mon, 6 Jan 2025 16:41:48 -0500 Subject: [PATCH 10/10] fix --- src/abacus-ts/selectors/markets.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/abacus-ts/selectors/markets.ts b/src/abacus-ts/selectors/markets.ts index a6a45f47b..4fc93bfa3 100644 --- a/src/abacus-ts/selectors/markets.ts +++ b/src/abacus-ts/selectors/markets.ts @@ -9,14 +9,12 @@ export const selectAllMarketsInfo = createAppSelector([selectRawMarketsData], (m calculateAllMarkets(markets) ); -export const selectAllMarketsInfoLoading = createAppSelector( - [selectRawMarkets], - (markets) => markets.status -); - export const selectCurrentMarketInfo = createAppSelector( [selectAllMarketsInfo, getCurrentMarketId], (markets, currentMarketId) => (currentMarketId ? markets?.[currentMarketId] : undefined) ); -export const selectMarketsInfoLoading = createAppSelector([selectRawMarkets], mergeLoadableStatus); +export const selectAllMarketsInfoLoading = createAppSelector( + [selectRawMarkets], + mergeLoadableStatus +);