From 3d8588d43428dbb41c19b406c24f588c1ee02194 Mon Sep 17 00:00:00 2001 From: tjs Date: Fri, 21 Jul 2023 14:47:53 -0400 Subject: [PATCH] use latest prettier --- apis/birdeye/helpers.ts | 4 +- apis/birdeye/streaming.ts | 2 +- apis/coingecko.ts | 10 +- apis/datafeed.ts | 34 +- apis/mngo/datafeed.ts | 18 +- apis/mngo/streaming.ts | 2 +- apis/notifications/notificationSettings.ts | 4 +- components/BorrowForm.tsx | 8 +- components/DepositForm.tsx | 12 +- components/HealthImpactTokenChange.tsx | 2 +- components/Layout.tsx | 13 +- components/MangoProvider.tsx | 39 ++- components/RepayForm.tsx | 14 +- components/SolanaTps.tsx | 2 +- components/TokenList.tsx | 16 +- components/WithdrawForm.tsx | 12 +- components/account/AccountActions.tsx | 4 +- components/account/AccountHeroStats.tsx | 16 +- components/account/AccountPage.tsx | 4 +- components/account/AccountValue.tsx | 2 +- components/account/ActivityFeedTable.tsx | 20 +- components/account/ActivityFilters.tsx | 4 +- components/account/AssetsLiabilities.tsx | 2 +- components/account/CreateAccountForm.tsx | 6 +- components/account/FundingChart.tsx | 8 +- components/account/HealthContributions.tsx | 16 +- components/account/HistoryTabs.tsx | 4 +- components/account/LiquidationDetails.tsx | 4 +- components/account/MangoAccountSummary.tsx | 8 +- components/account/MarketsHealthTable.tsx | 4 +- components/account/PerpTradeDetails.tsx | 2 +- components/borrow/BorrowPage.tsx | 6 +- components/borrow/YourBorrowsTable.tsx | 6 +- components/chat/ChatForm.tsx | 4 +- components/governance/GovernanceDelegate.tsx | 2 +- .../governance/ListMarket/ListMarket.tsx | 14 +- components/governance/ListToken/ListToken.tsx | 46 +-- components/governance/OnBoarding.tsx | 4 +- components/governance/Vote/ProposalCard.tsx | 12 +- components/governance/Vote/Vote.tsx | 2 +- components/governance/Vote/VoteProgress.tsx | 4 +- components/governance/Vote/VoteResult.tsx | 4 +- components/leaderboard/LeaderboardPage.tsx | 8 +- components/modals/CloseAccountModal.tsx | 12 +- .../modals/CreateOpenbookMarketModal.tsx | 4 +- .../modals/CreateSwitchboardOracleModal.tsx | 4 +- components/modals/DelegateModal.tsx | 6 +- components/modals/MangoAccountsListModal.tsx | 6 +- components/modals/ModifyTvOrderModal.tsx | 12 +- components/modals/SharePositionModal.tsx | 4 +- components/modals/TradeVolumeAlertModal.tsx | 4 +- components/modals/UserSetupModal.tsx | 14 +- .../notifications/NotificationsDrawer.tsx | 10 +- .../notifications/TransactionNotification.tsx | 14 +- components/profile/EditNftProfilePic.tsx | 4 +- components/profile/EditProfileForm.tsx | 6 +- components/rewards/Leaderboards.tsx | 4 +- components/rewards/RewardsPage.tsx | 8 +- components/search/SearchPage.tsx | 4 +- components/settings/AnimationSettings.tsx | 2 +- components/settings/DisplaySettings.tsx | 10 +- components/settings/HotKeysSettings.tsx | 2 +- components/settings/NotificationSettings.tsx | 2 +- .../settings/PreferredExplorerSettings.tsx | 2 +- components/settings/RpcSettings.tsx | 8 +- components/settings/SoundSettings.tsx | 2 +- components/shared/BalancesTable.tsx | 10 +- components/shared/DetailedAreaOrBarChart.tsx | 20 +- components/shared/FavoriteMarketButton.tsx | 4 +- components/shared/SuccessParticles.tsx | 6 +- components/shared/TableElements.tsx | 2 +- components/shared/TokenLogo.tsx | 2 +- components/shared/TokenVaultWarnings.tsx | 2 +- components/shared/useDebounce.tsx | 4 +- components/shared/useInterval.tsx | 2 +- components/stats/AverageFundingChart.tsx | 2 +- components/stats/MangoPerpStatsCharts.tsx | 16 +- components/stats/PerpMarketsOverviewTable.tsx | 20 +- components/stats/PerpPositionsStatsTable.tsx | 8 +- components/stats/SpotMarketsTable.tsx | 24 +- components/stats/StatsPage.tsx | 2 +- components/stats/TokenDetailsTable.tsx | 6 +- components/stats/TokenOverviewTable.tsx | 8 +- components/stats/TokenStatsCharts.tsx | 2 +- components/swap/RoutesModal.tsx | 2 +- components/swap/SwapForm.tsx | 24 +- components/swap/SwapFormTokenList.tsx | 4 +- components/swap/SwapHistoryTable.tsx | 6 +- components/swap/SwapPage.tsx | 2 +- components/swap/SwapReviewRouteInfo.tsx | 42 +-- components/swap/SwapTokenChart.tsx | 28 +- components/swap/useJupiterSwapData.ts | 4 +- components/swap/useQuoteRoutes.ts | 18 +- components/swap/useTokenMax.tsx | 20 +- components/token/ActionPanel.tsx | 2 +- components/token/ChartTabs.tsx | 2 +- components/token/CoingeckoStats.tsx | 4 +- components/token/TokenPage.tsx | 6 +- components/token/TokenParams.tsx | 14 +- components/token/TopTokenAccounts.tsx | 8 +- components/tours/CustomTooltip.tsx | 2 +- components/trade/AdvancedMarketHeader.tsx | 10 +- components/trade/AdvancedTradeForm.tsx | 32 +- components/trade/DepthChart.tsx | 28 +- components/trade/GroupSize.tsx | 4 +- components/trade/MarketCloseModal.tsx | 12 +- components/trade/MarketLogos.tsx | 4 +- components/trade/MarketSelectDropdown.tsx | 18 +- components/trade/MaxSizeButton.tsx | 10 +- components/trade/OpenOrders.tsx | 34 +- components/trade/OraclePrice.tsx | 12 +- components/trade/Orderbook.tsx | 40 +-- components/trade/PerpButtonGroup.tsx | 12 +- components/trade/PerpFundingRate.tsx | 14 +- components/trade/PerpPositions.tsx | 28 +- components/trade/PerpSlider.tsx | 10 +- components/trade/RecentTrades.tsx | 18 +- components/trade/Slippage.tsx | 2 +- components/trade/SpotButtonGroup.tsx | 6 +- components/trade/SpotMarketOrderSwapForm.tsx | 18 +- components/trade/SpotSlider.tsx | 16 +- components/trade/TradeAdvancedPage.tsx | 6 +- components/trade/TradeHistory.tsx | 4 +- components/trade/TradeHotKeys.tsx | 46 +-- components/trade/TradeSummary.tsx | 18 +- components/trade/TradingChartContainer.tsx | 2 +- components/trade/TradingViewChart.tsx | 48 +-- components/trade/TradingViewChartKline.tsx | 16 +- .../trade/TradingViewChartKlineContainer.tsx | 2 +- components/trade/UnsettledTrades.tsx | 12 +- components/wallet/ConnectWalletButton.tsx | 4 +- .../notifications/useNotificationSettings.ts | 2 +- hooks/notifications/useNotificationSocket.ts | 4 +- hooks/notifications/useNotifications.ts | 2 +- hooks/use24HourChange.tsx | 6 +- hooks/useAccountHourlyVolumeStats.ts | 2 +- hooks/useAccountPerformanceData.ts | 2 +- hooks/useBanksWithBalances.ts | 6 +- hooks/useBirdeyeMarketPrices.ts | 6 +- hooks/useCoingecko.ts | 10 +- hooks/useHealthContributions.ts | 4 +- hooks/useIpAddress.ts | 4 +- hooks/useIsWhiteListed.ts | 2 +- hooks/useJupiterMints.ts | 4 +- hooks/useLocalStorageState.ts | 14 +- hooks/useOracleProvider.ts | 2 +- hooks/useScreenshot.tsx | 4 +- hooks/useSelectedMarket.ts | 16 +- hooks/useSolBalance.ts | 2 +- hooks/useStablePrice.ts | 8 +- hooks/useTradeHistory.ts | 24 +- hooks/useUnsettledSpotBalances.ts | 8 +- next.config.js | 4 +- package.json | 6 +- pages/_app.tsx | 8 +- pages/api/hello.ts | 2 +- pages/dashboard/index.tsx | 108 ++++--- pages/dashboard/mangoaccount.tsx | 44 +-- pages/dashboard/risks.tsx | 14 +- pages/governance/list.tsx | 2 +- pages/trade.tsx | 6 +- store/governanceStore.ts | 26 +- store/mangoStore.ts | 100 +++--- store/spotBalancesUpdater.ts | 12 +- types/index.ts | 14 +- utils/account.ts | 16 +- utils/governance/accounts/vsrAccounts.ts | 16 +- utils/governance/constants.ts | 14 +- utils/governance/fetch/deposits.ts | 14 +- utils/governance/instructions/castVote.ts | 12 +- .../governance/instructions/createProposal.ts | 18 +- .../governance/instructions/relinquishVote.ts | 6 +- .../instructions/updateVoteWeightRecord.ts | 6 +- utils/governance/listingTools.ts | 54 ++-- .../governance/market/createOpenBookMarket.ts | 20 +- utils/governance/openSerumApiProxy.ts | 2 +- utils/governance/proposals.ts | 4 +- utils/governance/tools.ts | 10 +- utils/governance/voteStakeRegistryClient.ts | 11 +- utils/index.ts | 2 +- utils/kLineChart.ts | 4 +- utils/numbers.ts | 8 +- utils/orderbook.ts | 18 +- utils/tokens.ts | 14 +- utils/tradeForm.ts | 10 +- utils/wallet.ts | 4 +- yarn.lock | 300 ++++++++++++------ 187 files changed, 1258 insertions(+), 1149 deletions(-) diff --git a/apis/birdeye/helpers.ts b/apis/birdeye/helpers.ts index 9a62c0c3..8eb24ccb 100644 --- a/apis/birdeye/helpers.ts +++ b/apis/birdeye/helpers.ts @@ -110,7 +110,7 @@ export const calcPricePrecision = (num: number | string) => { export const formatPrice = ( num: number, precision?: number, - gr0 = true + gr0 = true, ): string => { if (!num) { return num.toString() @@ -132,7 +132,7 @@ export const formatPrice = ( const matchString: string = match[0].slice(1) formated = formated.replace( /\.0{4,15}/g, - `.0${SUBSCRIPT_NUMBER_MAP[matchString.length]}` + `.0${SUBSCRIPT_NUMBER_MAP[matchString.length]}`, ) } diff --git a/apis/birdeye/streaming.ts b/apis/birdeye/streaming.ts index bbc7f483..f2f92cdc 100644 --- a/apis/birdeye/streaming.ts +++ b/apis/birdeye/streaming.ts @@ -51,7 +51,7 @@ export function subscribeOnStream( onRealtimeCallback: any, subscriberUID: any, onResetCacheNeededCallback: any, - lastBar: any + lastBar: any, ) { subscriptionItem = { resolution, diff --git a/apis/coingecko.ts b/apis/coingecko.ts index 68496332..d6e3b96c 100644 --- a/apis/coingecko.ts +++ b/apis/coingecko.ts @@ -3,7 +3,7 @@ type CoingeckoOhlcv = [ open: number, high: number, low: number, - close: number + close: number, ][] export type ChartDataItem = { @@ -16,16 +16,16 @@ export type ChartDataItem = { export const fetchChartData = async ( baseTokenId: string | undefined, quoteTokenId: string | undefined, - daysToShow: string + daysToShow: string, ): Promise => { if (!baseTokenId || !quoteTokenId) return [] try { const [inputResponse, outputResponse] = await Promise.all([ fetch( - `https://api.coingecko.com/api/v3/coins/${baseTokenId}/ohlc?vs_currency=usd&days=${daysToShow}` + `https://api.coingecko.com/api/v3/coins/${baseTokenId}/ohlc?vs_currency=usd&days=${daysToShow}`, ), fetch( - `https://api.coingecko.com/api/v3/coins/${quoteTokenId}/ohlc?vs_currency=usd&days=${daysToShow}` + `https://api.coingecko.com/api/v3/coins/${quoteTokenId}/ohlc?vs_currency=usd&days=${daysToShow}`, ), ]) @@ -36,7 +36,7 @@ export const fetchChartData = async ( const parsedData: ChartDataItem[] = [] for (const inputTokenCandle of inputTokenData) { const outputTokenCandle = outputTokenData.find( - (outputTokenCandle) => outputTokenCandle[0] === inputTokenCandle[0] + (outputTokenCandle) => outputTokenCandle[0] === inputTokenCandle[0], ) if (outputTokenCandle) { if (['usd-coin', 'tether'].includes(quoteTokenId)) { diff --git a/apis/datafeed.ts b/apis/datafeed.ts index 656070d4..47cafd5c 100644 --- a/apis/datafeed.ts +++ b/apis/datafeed.ts @@ -72,11 +72,11 @@ const configurationData = { const getTickerFromMktAddress = ( group: Group, - symbolAddress: string + symbolAddress: string, ): string | null => { try { const serumMkt = group.getSerum3MarketByExternalMarket( - new PublicKey(symbolAddress) + new PublicKey(symbolAddress), ) if (serumMkt) { @@ -88,7 +88,7 @@ const getTickerFromMktAddress = ( const perpMarkets = Array.from(group.perpMarketsMapByMarketIndex.values()) const perpMkt = perpMarkets.find( - (perpMarket) => perpMarket.publicKey.toString() === symbolAddress + (perpMarket) => perpMarket.publicKey.toString() === symbolAddress, ) if (perpMkt) { @@ -102,12 +102,12 @@ let marketType: 'spot' | 'perp' export const queryPerpBars = async ( tokenAddress: string, - resolution: typeof SUPPORTED_RESOLUTIONS[number], + resolution: (typeof SUPPORTED_RESOLUTIONS)[number], periodParams: { firstDataRequest: boolean from: number to: number - } + }, ): Promise => { const { from, to } = periodParams @@ -150,12 +150,12 @@ export const queryPerpBars = async ( export const queryBirdeyeBars = async ( tokenAddress: string, - resolution: typeof SUPPORTED_RESOLUTIONS[number], + resolution: (typeof SUPPORTED_RESOLUTIONS)[number], periodParams: { firstDataRequest: boolean from: number to: number - } + }, ): Promise => { const { from, to } = periodParams const urlParameters = { @@ -167,7 +167,7 @@ export const queryBirdeyeBars = async ( const query = Object.keys(urlParameters) .map( (name: string) => - `${name}=${encodeURIComponent((urlParameters as any)[name])}` + `${name}=${encodeURIComponent((urlParameters as any)[name])}`, ) .join('&') @@ -207,14 +207,14 @@ export default { _userInput: string, _exchange: string, _symbolType: string, - _onResultReadyCallback: (items: SearchSymbolResultItem[]) => void + _onResultReadyCallback: (items: SearchSymbolResultItem[]) => void, ) => { return }, resolveSymbol: async ( symbolAddress: string, - onSymbolResolvedCallback: (symbolInfo: SymbolInfo) => void + onSymbolResolvedCallback: (symbolInfo: SymbolInfo) => void, // _onResolveErrorCallback: any, // _extension: any ) => { @@ -283,9 +283,9 @@ export default { bars: Bar[], t: { noData: boolean - } + }, ) => void, - onErrorCallback: (e: any) => void + onErrorCallback: (e: any) => void, ) => { try { const { firstDataRequest } = periodParams @@ -298,14 +298,14 @@ export default { bars = await queryPerpBars( symbolInfo.address, resolution as any, - periodParams + periodParams, ) } else { marketType = 'spot' bars = await queryBirdeyeBars( symbolInfo.address, resolution as any, - periodParams + periodParams, ) } if (!bars || bars.length === 0) { @@ -335,7 +335,7 @@ export default { resolution: string, onRealtimeCallback: (data: any) => void, subscriberUID: string, - onResetCacheNeededCallback: () => void + onResetCacheNeededCallback: () => void, ) => { subscriptionIds.set(subscriberUID, symbolInfo.address) if (symbolInfo.description?.includes('PERP')) { @@ -345,7 +345,7 @@ export default { onRealtimeCallback, subscriberUID, onResetCacheNeededCallback, - lastBarsCache.get(symbolInfo.address) + lastBarsCache.get(symbolInfo.address), ) } else { subscribeOnSpotStream( @@ -354,7 +354,7 @@ export default { onRealtimeCallback, subscriberUID, onResetCacheNeededCallback, - lastBarsCache.get(symbolInfo.address) + lastBarsCache.get(symbolInfo.address), ) } }, diff --git a/apis/mngo/datafeed.ts b/apis/mngo/datafeed.ts index 502280c6..dda38d3a 100644 --- a/apis/mngo/datafeed.ts +++ b/apis/mngo/datafeed.ts @@ -66,12 +66,12 @@ const configurationData = { export const queryBars = async ( tokenAddress: string, - resolution: typeof SUPPORTED_RESOLUTIONS[number], + resolution: (typeof SUPPORTED_RESOLUTIONS)[number], periodParams: { firstDataRequest: boolean from: number to: number - } + }, ): Promise => { const { from, to } = periodParams const urlParameters = { @@ -121,14 +121,14 @@ export default { _userInput: string, _exchange: string, _symbolType: string, - _onResultReadyCallback: (items: SearchSymbolResultItem[]) => void + _onResultReadyCallback: (items: SearchSymbolResultItem[]) => void, ) => { return }, resolveSymbol: async ( symbolAddress: string, - onSymbolResolvedCallback: (symbolInfo: SymbolInfo) => void + onSymbolResolvedCallback: (symbolInfo: SymbolInfo) => void, // _onResolveErrorCallback: any, // _extension: any ) => { @@ -187,16 +187,16 @@ export default { bars: Bar[], t: { noData: boolean - } + }, ) => void, - onErrorCallback: (e: any) => void + onErrorCallback: (e: any) => void, ) => { try { const { firstDataRequest } = periodParams const bars = await queryBars( symbolInfo.address, resolution as any, - periodParams + periodParams, ) if (!bars || bars.length === 0) { // "noData" should be set if there is no data in the requested period. @@ -226,7 +226,7 @@ export default { resolution: string, onRealtimeCallback: (data: any) => void, subscriberUID: string, - onResetCacheNeededCallback: () => void + onResetCacheNeededCallback: () => void, ) => { subscribeOnStream( symbolInfo, @@ -234,7 +234,7 @@ export default { onRealtimeCallback, subscriberUID, onResetCacheNeededCallback, - lastBarsCache.get(symbolInfo.address) + lastBarsCache.get(symbolInfo.address), ) }, diff --git a/apis/mngo/streaming.ts b/apis/mngo/streaming.ts index 0a832c7e..e518cd86 100644 --- a/apis/mngo/streaming.ts +++ b/apis/mngo/streaming.ts @@ -59,7 +59,7 @@ export function subscribeOnStream( onRealtimeCallback: any, subscriberUID: any, onResetCacheNeededCallback: any, - lastBar: any + lastBar: any, ) { subscriptionItem = { resolution, diff --git a/apis/notifications/notificationSettings.ts b/apis/notifications/notificationSettings.ts index cf3c4684..7f261902 100644 --- a/apis/notifications/notificationSettings.ts +++ b/apis/notifications/notificationSettings.ts @@ -6,7 +6,7 @@ export type NotificationSettings = { export const fetchNotificationSettings = async ( wallet: string, - token: string + token: string, ) => { const data = await fetch( `${NOTIFICATION_API}notifications/user/getSettings`, @@ -15,7 +15,7 @@ export const fetchNotificationSettings = async ( authorization: token, publickey: wallet, }, - } + }, ) const body = await data.json() diff --git a/components/BorrowForm.tsx b/components/BorrowForm.tsx index f8bf2372..3e28d47f 100644 --- a/components/BorrowForm.tsx +++ b/components/BorrowForm.tsx @@ -57,7 +57,7 @@ function BorrowForm({ onSuccess, token }: BorrowFormProps) { const [inputAmount, setInputAmount] = useState('') const [submitting, setSubmitting] = useState(false) const [selectedToken, setSelectedToken] = useState( - token || INPUT_TOKEN_DEFAULT + token || INPUT_TOKEN_DEFAULT, ) const [showTokenList, setShowTokenList] = useState(false) const [sizePercentage, setSizePercentage] = useState('') @@ -91,11 +91,11 @@ function BorrowForm({ onSuccess, token }: BorrowFormProps) { setSizePercentage(percentage) const amount = floorToDecimal( new Decimal(percentage).div(100).mul(tokenMax), - bank.mintDecimals + bank.mintDecimals, ) setInputAmount(amount.toFixed()) }, - [tokenMax, bank] + [tokenMax, bank], ) const setMax = useCallback(() => { @@ -123,7 +123,7 @@ function BorrowForm({ onSuccess, token }: BorrowFormProps) { mangoAccount, bank!.mint, Number(inputAmount), - true + true, ) notify({ title: 'Transaction confirmed', diff --git a/components/DepositForm.tsx b/components/DepositForm.tsx index bc60a2ec..7b775346 100644 --- a/components/DepositForm.tsx +++ b/components/DepositForm.tsx @@ -43,7 +43,7 @@ interface DepositFormProps { export const walletBalanceForToken = ( walletTokens: TokenAccount[], - token: string + token: string, ): { maxAmount: number; maxDecimals: number } => { const group = mangoStore.getState().group const bank = group?.banksMapByName.get(token)?.[0] @@ -67,7 +67,7 @@ function DepositForm({ onSuccess, token }: DepositFormProps) { const [inputAmount, setInputAmount] = useState('') const [submitting, setSubmitting] = useState(false) const [selectedToken, setSelectedToken] = useState( - token || INPUT_TOKEN_DEFAULT + token || INPUT_TOKEN_DEFAULT, ) const [showTokenList, setShowTokenList] = useState(false) const [sizePercentage, setSizePercentage] = useState('') @@ -98,11 +98,11 @@ function DepositForm({ onSuccess, token }: DepositFormProps) { setSizePercentage(percentage) const amount = floorToDecimal( new Decimal(tokenMax.maxAmount).mul(percentage).div(100), - tokenMax.maxDecimals + tokenMax.maxDecimals, ) setInputAmount(amount.toFixed()) }, - [tokenMax] + [tokenMax], ) const handleSelectToken = (token: string) => { @@ -124,7 +124,7 @@ function DepositForm({ onSuccess, token }: DepositFormProps) { group, mangoAccount, bank.mint, - parseFloat(inputAmount) + parseFloat(inputAmount), ) notify({ title: 'Transaction confirmed', @@ -225,7 +225,7 @@ function DepositForm({ onSuccess, token }: DepositFormProps) { value={inputAmount} onValueChange={(e: NumberFormatValues) => { setInputAmount( - !Number.isNaN(Number(e.value)) ? e.value : '' + !Number.isNaN(Number(e.value)) ? e.value : '', ) }} isAllowed={withValueLimit} diff --git a/components/HealthImpactTokenChange.tsx b/components/HealthImpactTokenChange.tsx index c6c1d6f3..7756b5b4 100644 --- a/components/HealthImpactTokenChange.tsx +++ b/components/HealthImpactTokenChange.tsx @@ -22,7 +22,7 @@ const HealthImpactTokenChange = ({ mangoAccount.simHealthRatioWithTokenPositionUiChanges( group, [{ mintPk, uiTokenAmount }], - HealthType.maint + HealthType.maint, ) return projectedHealth! > 100 diff --git a/components/Layout.tsx b/components/Layout.tsx index 5ad38d40..712c6c79 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -36,7 +36,7 @@ const termsLastUpdated = 1679441610978 const Layout = ({ children }: { children: ReactNode }) => { const [isCollapsed, setIsCollapsed] = useLocalStorageState( SIDEBAR_COLLAPSE_KEY, - false + false, ) const { width } = useViewport() @@ -52,9 +52,12 @@ const Layout = ({ children }: { children: ReactNode }) => { const animationFrames = 15 for (let x = 1; x <= animationFrames; x++) { - setTimeout(() => { - window.dispatchEvent(new Event('resize')) - }, (sideBarAnimationDuration / animationFrames) * x) + setTimeout( + () => { + window.dispatchEvent(new Event('resize')) + }, + (sideBarAnimationDuration / animationFrames) * x, + ) } }, [isCollapsed]) @@ -124,7 +127,7 @@ const TermsOfUse = () => { const { connected } = useWallet() const [acceptTerms, setAcceptTerms] = useLocalStorageState( ACCEPT_TERMS_KEY, - '' + '', ) const showTermsOfUse = useMemo(() => { diff --git a/components/MangoProvider.tsx b/components/MangoProvider.tsx index ad04bfe0..36c7f57d 100644 --- a/components/MangoProvider.tsx +++ b/components/MangoProvider.tsx @@ -38,17 +38,23 @@ const HydrateStore = () => { actions.fetchGroup() }, [marketName]) - useInterval(() => { - actions.fetchGroup() - }, (slowNetwork ? 40 : 20) * SECONDS) + useInterval( + () => { + actions.fetchGroup() + }, + (slowNetwork ? 40 : 20) * SECONDS, + ) // refetches open orders every 30 seconds // only the selected market's open orders are updated via websocket - useInterval(() => { - if (mangoAccountAddress) { - actions.fetchOpenOrders() - } - }, (slowNetwork ? 60 : 30) * SECONDS) + useInterval( + () => { + if (mangoAccountAddress) { + actions.fetchOpenOrders() + } + }, + (slowNetwork ? 60 : 30) * SECONDS, + ) // refetch trade history and activity feed when switching accounts useEffect(() => { @@ -59,10 +65,13 @@ const HydrateStore = () => { }, [mangoAccountAddress]) // reload and parse market fills from the event queue - useInterval(async () => { - const actions = mangoStore.getState().actions - actions.loadMarketFills() - }, (slowNetwork ? 60 : 20) * SECONDS) + useInterval( + async () => { + const actions = mangoStore.getState().actions + actions.loadMarketFills() + }, + (slowNetwork ? 60 : 20) * SECONDS, + ) // The websocket library solana/web3.js uses closes its websocket connection when the subscription list // is empty after opening its first time, preventing subsequent subscriptions from receiving responses. @@ -92,11 +101,11 @@ const HydrateStore = () => { if (context.slot > lastSeenSlot) { const decodedMangoAccount = client.program.coder.accounts.decode( 'mangoAccount', - info?.data + info?.data, ) const newMangoAccount = MangoAccount.from( mangoAccount.publicKey, - decodedMangoAccount + decodedMangoAccount, ) if (newMangoAccount.serum3Active().length > 0) { await newMangoAccount.reloadSerum3OpenOrders(client) @@ -107,7 +116,7 @@ const HydrateStore = () => { }) actions.fetchOpenOrders() } - } + }, ) return () => { diff --git a/components/RepayForm.tsx b/components/RepayForm.tsx index 307e1156..29ef4688 100644 --- a/components/RepayForm.tsx +++ b/components/RepayForm.tsx @@ -45,7 +45,7 @@ function RepayForm({ onSuccess, token }: RepayFormProps) { const [inputAmount, setInputAmount] = useState('') const [submitting, setSubmitting] = useState(false) const [selectedToken, setSelectedToken] = useState( - token || INPUT_TOKEN_DEFAULT + token || INPUT_TOKEN_DEFAULT, ) const [showTokenList, setShowTokenList] = useState(false) const [sizePercentage, setSizePercentage] = useState('') @@ -69,7 +69,7 @@ function RepayForm({ onSuccess, token }: RepayFormProps) { const borrowAmount = useMemo(() => { if (!mangoAccount || !bank) return new Decimal(0) const amount = new Decimal( - mangoAccount.getTokenBorrowsUi(bank) + mangoAccount.getTokenBorrowsUi(bank), ).toDecimalPlaces(bank.mintDecimals, Decimal.ROUND_UP) return amount }, [bank, mangoAccount]) @@ -78,7 +78,7 @@ function RepayForm({ onSuccess, token }: RepayFormProps) { if (!bank) return const amount = new Decimal(borrowAmount).toDecimalPlaces( bank.mintDecimals, - Decimal.ROUND_UP + Decimal.ROUND_UP, ) setInputAmount(amount.toFixed()) setSizePercentage('100') @@ -95,7 +95,7 @@ function RepayForm({ onSuccess, token }: RepayFormProps) { setInputAmount(amount.toFixed()) }, - [bank, borrowAmount] + [bank, borrowAmount], ) const handleSelectToken = (token: string) => { @@ -130,7 +130,7 @@ function RepayForm({ onSuccess, token }: RepayFormProps) { mangoAccount, bank.mint, actualAmount, - true + true, ) notify({ title: 'Transaction confirmed', @@ -154,7 +154,7 @@ function RepayForm({ onSuccess, token }: RepayFormProps) { }) } }, - [bank, publicKey?.toBase58(), sizePercentage] + [bank, publicKey?.toBase58(), sizePercentage], ) useEffect(() => { @@ -236,7 +236,7 @@ function RepayForm({ onSuccess, token }: RepayFormProps) { value={inputAmount} onValueChange={(e: NumberFormatValues) => { setInputAmount( - !Number.isNaN(Number(e.value)) ? e.value : '' + !Number.isNaN(Number(e.value)) ? e.value : '', ) }} isAllowed={withValueLimit} diff --git a/components/SolanaTps.tsx b/components/SolanaTps.tsx index b3f1fa9f..c59605c2 100644 --- a/components/SolanaTps.tsx +++ b/components/SolanaTps.tsx @@ -10,7 +10,7 @@ const tpsWarningThreshold = 1300 const getRecentPerformance = async ( connection: Connection, - setTps: (x: number) => void + setTps: (x: number) => void, ) => { try { const samples = 2 diff --git a/components/TokenList.tsx b/components/TokenList.tsx index 9f24bf40..e7139c6f 100644 --- a/components/TokenList.tsx +++ b/components/TokenList.tsx @@ -38,13 +38,13 @@ const TokenList = () => { const { t } = useTranslation(['common', 'token', 'trade']) const [showZeroBalances, setShowZeroBalances] = useLocalStorageState( SHOW_ZERO_BALANCES_KEY, - true + true, ) const { mangoAccount, mangoAccountAddress } = useMangoAccount() const { initContributions } = useHealthContributions() const spotBalances = mangoStore((s) => s.mangoAccount.spotBalances) const totalInterestData = mangoStore( - (s) => s.mangoAccount.interestTotals.data + (s) => s.mangoAccount.interestTotals.data, ) const { width } = useViewport() const showTableView = width ? width > breakpoints.md : false @@ -136,7 +136,7 @@ const TokenList = () => { const hasInterestEarned = totalInterestData.find( (d) => d.symbol.toLowerCase() === symbol.toLowerCase() || - (symbol === 'ETH (Portal)' && d.symbol === 'ETH') + (symbol === 'ETH (Portal)' && d.symbol === 'ETH'), ) const interestAmount = hasInterestEarned @@ -273,7 +273,7 @@ const MobileTokenListItem = ({ bank }: { bank: BankWithBalance }) => { const { mangoAccount } = useMangoAccount() const { initContributions } = useHealthContributions() const totalInterestData = mangoStore( - (s) => s.mangoAccount.interestTotals.data + (s) => s.mangoAccount.interestTotals.data, ) const tokenBank = bank.bank const mint = tokenBank.mint @@ -282,7 +282,7 @@ const MobileTokenListItem = ({ bank }: { bank: BankWithBalance }) => { const hasInterestEarned = totalInterestData.find( (d) => d.symbol.toLowerCase() === symbol.toLowerCase() || - (symbol === 'ETH (Portal)' && d.symbol === 'ETH') + (symbol === 'ETH (Portal)' && d.symbol === 'ETH'), ) const interestAmount = hasInterestEarned @@ -464,7 +464,7 @@ const ActionsMenu = ({ ? setShowWithdrawModal(true) : setShowRepayModal(true) }, - [] + [], ) const balance = useMemo(() => { @@ -474,7 +474,7 @@ const ActionsMenu = ({ const handleSwap = useCallback(() => { const tokenInfo = mangoTokens.find( - (t) => t.address === bank.mint.toString() + (t) => t.address === bank.mint.toString(), ) const group = mangoStore.getState().group if (balance && balance > 0) { @@ -493,7 +493,7 @@ const ActionsMenu = ({ } else { if (tokenInfo?.symbol === 'USDC') { const solTokenInfo = mangoTokens.find( - (t) => t.address === WRAPPED_SOL_MINT.toString() + (t) => t.address === WRAPPED_SOL_MINT.toString(), ) const solBank = group?.getFirstBankByMint(WRAPPED_SOL_MINT) set((s) => { diff --git a/components/WithdrawForm.tsx b/components/WithdrawForm.tsx index 9a226485..a8163e39 100644 --- a/components/WithdrawForm.tsx +++ b/components/WithdrawForm.tsx @@ -49,7 +49,7 @@ function WithdrawForm({ onSuccess, token }: WithdrawFormProps) { const [inputAmount, setInputAmount] = useState('') const [submitting, setSubmitting] = useState(false) const [selectedToken, setSelectedToken] = useState( - token || INPUT_TOKEN_DEFAULT + token || INPUT_TOKEN_DEFAULT, ) const [showTokenList, setShowTokenList] = useState(false) const [sizePercentage, setSizePercentage] = useState('') @@ -82,17 +82,17 @@ function WithdrawForm({ onSuccess, token }: WithdrawFormProps) { if (percentage !== '100') { amount = floorToDecimal( new Decimal(adjustedTokenMax).mul(percentage).div(100), - bank.mintDecimals + bank.mintDecimals, ) } else { amount = floorToDecimal( new Decimal(adjustedTokenMax), - bank.mintDecimals + bank.mintDecimals, ) } setInputAmount(amount.toString()) }, - [bank, adjustedTokenMax] + [bank, adjustedTokenMax], ) const setMax = useCallback(() => { @@ -116,7 +116,7 @@ function WithdrawForm({ onSuccess, token }: WithdrawFormProps) { mangoAccount, bank.mint, withdrawAmount, - false + false, ) notify({ title: 'Transaction confirmed', @@ -227,7 +227,7 @@ function WithdrawForm({ onSuccess, token }: WithdrawFormProps) { value={inputAmount} onValueChange={(e: NumberFormatValues) => setInputAmount( - !Number.isNaN(Number(e.value)) ? e.value : '' + !Number.isNaN(Number(e.value)) ? e.value : '', ) } isAllowed={withValueLimit} diff --git a/components/account/AccountActions.tsx b/components/account/AccountActions.tsx index 4d523c9c..ebbb6a08 100644 --- a/components/account/AccountActions.tsx +++ b/components/account/AccountActions.tsx @@ -29,7 +29,7 @@ import { breakpoints } from 'utils/theme' export const handleCopyAddress = ( mangoAccount: MangoAccount, - successMessage: string + successMessage: string, ) => { copyToClipboard(mangoAccount.publicKey.toString()) notify({ @@ -121,7 +121,7 @@ const AccountActions = () => { mangoAccount!, t('copy-address-success', { pk: abbreviateAddress(mangoAccount!.publicKey), - }) + }), ) } > diff --git a/components/account/AccountHeroStats.tsx b/components/account/AccountHeroStats.tsx index 381516bc..f4497322 100644 --- a/components/account/AccountHeroStats.tsx +++ b/components/account/AccountHeroStats.tsx @@ -40,7 +40,7 @@ const AccountHeroStats = ({ useAccountHourlyVolumeStats() const totalInterestData = mangoStore( - (s) => s.mangoAccount.interestTotals.data + (s) => s.mangoAccount.interestTotals.data, ) useEffect(() => { @@ -63,7 +63,7 @@ const AccountHeroStats = ({ retry: 3, refetchOnWindowFocus: false, enabled: !!mangoAccountAddress, - } + }, ) const { @@ -79,7 +79,7 @@ const AccountHeroStats = ({ retry: 3, refetchOnWindowFocus: false, enabled: !!mangoAccountAddress, - } + }, ) const maintHealth = useMemo(() => { @@ -91,7 +91,7 @@ const AccountHeroStats = ({ const leverage = useMemo(() => { if (!group || !mangoAccount) return 0 const assetsValue = toUiDecimalsForQuote( - mangoAccount.getAssetsValue(group).toNumber() + mangoAccount.getAssetsValue(group).toNumber(), ) if (isNaN(assetsValue / accountValue)) { @@ -110,7 +110,7 @@ const AccountHeroStats = ({ if (totalInterestData.length) { return totalInterestData.reduce( (a, c) => a + (c.borrow_interest_usd * -1 + c.deposit_interest_usd), - 0 + 0, ) } return 0.0 @@ -120,7 +120,7 @@ const AccountHeroStats = ({ if (fundingData?.length && mangoAccountAddress) { return fundingData.reduce( (a, c) => a + c.long_funding + c.short_funding, - 0 + 0, ) } return 0.0 @@ -268,7 +268,7 @@ const AccountHeroStats = ({ value={ group && mangoAccount ? toUiDecimalsForQuote( - mangoAccount.getCollateralValue(group) + mangoAccount.getCollateralValue(group), ) : 0 } @@ -289,7 +289,7 @@ const AccountHeroStats = ({ value={ group && mangoAccount ? toUiDecimalsForQuote( - mangoAccount.getAssetsValue(group, HealthType.init) + mangoAccount.getAssetsValue(group, HealthType.init), ) : 0 } diff --git a/components/account/AccountPage.tsx b/components/account/AccountPage.tsx index 2ccee3d1..c2d73060 100644 --- a/components/account/AccountPage.tsx +++ b/components/account/AccountPage.tsx @@ -42,7 +42,7 @@ const AccountPage = () => { const isMobile = width ? width < breakpoints.md : false const [activeTab, setActiveTab] = useLocalStorageState( 'accountHeroKey-0.1', - 'account-value' + 'account-value', ) const { performanceData, rollingDailyData } = useAccountPerformanceData() const router = useRouter() @@ -53,7 +53,7 @@ const AccountPage = () => { const query = { ...router.query, ['view']: view } router.push({ pathname: router.pathname, query }) }, - [router] + [router], ) const handleCloseDailyPnlModal = () => { diff --git a/components/account/AccountValue.tsx b/components/account/AccountValue.tsx index 1345590b..e3406e24 100644 --- a/components/account/AccountValue.tsx +++ b/components/account/AccountValue.tsx @@ -40,7 +40,7 @@ const AccountValue = ({ const [showExpandChart, setShowExpandChart] = useState(false) const [animationSettings] = useLocalStorageState( ANIMATION_SETTINGS_KEY, - INITIAL_ANIMATION_SETTINGS + INITIAL_ANIMATION_SETTINGS, ) const { width } = useViewport() const { performanceLoading: loading } = useAccountPerformanceData() diff --git a/components/account/ActivityFeedTable.tsx b/components/account/ActivityFeedTable.tsx index 43791428..1b669bf4 100644 --- a/components/account/ActivityFeedTable.tsx +++ b/components/account/ActivityFeedTable.tsx @@ -48,7 +48,7 @@ export const getFee = (activity: any, mangoAccountAddress: string) => { const value = price * quantity fee = { value: formatFee( - mangoAccountAddress === maker ? maker_fee * value : taker_fee * value + mangoAccountAddress === maker ? maker_fee * value : taker_fee * value, ), symbol: 'USDC', } @@ -63,14 +63,14 @@ export const getFee = (activity: any, mangoAccountAddress: string) => { if (side === 'liqee') { fee = { value: formatNumericValue( - Math.abs(liab_amount) - Math.abs(asset_amount * asset_price) + Math.abs(liab_amount) - Math.abs(asset_amount * asset_price), ), symbol: liab_symbol, } } else { fee = { value: formatNumericValue( - Math.abs(asset_amount * asset_price) - Math.abs(liab_amount) + Math.abs(asset_amount * asset_price) - Math.abs(liab_amount), ), symbol: liab_symbol, } @@ -81,14 +81,14 @@ export const getFee = (activity: any, mangoAccountAddress: string) => { if (base_transfer > 0) { fee = { value: formatNumericValue( - Math.abs(base_transfer * price) - Math.abs(quote_transfer) + Math.abs(base_transfer * price) - Math.abs(quote_transfer), ), symbol: 'USDC', } } else { fee = { value: formatNumericValue( - Math.abs(quote_transfer) - Math.abs(base_transfer * price) + Math.abs(quote_transfer) - Math.abs(base_transfer * price), ), symbol: 'USDC', } @@ -99,7 +99,7 @@ export const getFee = (activity: any, mangoAccountAddress: string) => { export const getCreditAndDebit = ( activity: any, - mangoAccountAddress: string + mangoAccountAddress: string, ) => { const { activity_type } = activity let credit = { value: '0', symbol: '' } @@ -270,7 +270,7 @@ const ActivityFeedTable = () => { const { connected } = useWallet() const [preferredExplorer] = useLocalStorageState( PREFERRED_EXPLORER_KEY, - EXPLORERS[0] + EXPLORERS[0], ) const { width } = useViewport() const showTableView = width ? width > breakpoints.md : false @@ -285,7 +285,7 @@ const ActivityFeedTable = () => { actions.fetchActivityFeed( mangoAccountAddress, offset + PAGINATION_PAGE_LENGTH, - queryParams + queryParams, ) }, [actions, offset, queryParams, mangoAccountAddress]) @@ -376,7 +376,7 @@ const ActivityFeedTable = () => {
@@ -515,7 +515,7 @@ const MobileActivityFeedItem = ({ const { t } = useTranslation(['common', 'activity']) const [preferredExplorer] = useLocalStorageState( PREFERRED_EXPLORER_KEY, - EXPLORERS[0] + EXPLORERS[0], ) const { mangoAccountAddress } = useMangoAccount() const { activity_type, block_datetime } = activity diff --git a/components/account/ActivityFilters.tsx b/components/account/ActivityFilters.tsx index e3b5121c..0833fe75 100644 --- a/components/account/ActivityFilters.tsx +++ b/components/account/ActivityFilters.tsx @@ -50,7 +50,7 @@ const ActivityFilters = () => { const actions = mangoStore((s) => s.actions) const { mangoAccountAddress } = useMangoAccount() const [advancedFilters, setAdvancedFilters] = useState( - DEFAULT_ADVANCED_FILTERS + DEFAULT_ADVANCED_FILTERS, ) const [params, setParams] = useState([]) const { t } = useTranslation(['common', 'activity']) @@ -64,7 +64,7 @@ const ActivityFilters = () => { if (entry[1].length) { // ETH should be renamed to ETH (Portal) in the database const alignSymbolsToBackend = entry[1].map((e: string) => - e === 'ETH (Portal)' ? 'ETH' : e + e === 'ETH (Portal)' ? 'ETH' : e, ) advancedParams = advancedParams + `&${entry[0]}=${alignSymbolsToBackend}` diff --git a/components/account/AssetsLiabilities.tsx b/components/account/AssetsLiabilities.tsx index d24d436b..eb34e2c9 100644 --- a/components/account/AssetsLiabilities.tsx +++ b/components/account/AssetsLiabilities.tsx @@ -19,7 +19,7 @@ const AssetsLiabilities = ({ isMobile }: { isMobile: boolean }) => { const { theme } = useTheme() const [animationSettings] = useLocalStorageState( ANIMATION_SETTINGS_KEY, - INITIAL_ANIMATION_SETTINGS + INITIAL_ANIMATION_SETTINGS, ) const [assetsValue, assetsRatio, liabsValue, liabsRatio] = useMemo(() => { diff --git a/components/account/CreateAccountForm.tsx b/components/account/CreateAccountForm.tsx index d22574fc..cfb3ba33 100644 --- a/components/account/CreateAccountForm.tsx +++ b/components/account/CreateAccountForm.tsx @@ -54,16 +54,16 @@ const CreateAccountForm = ({ group, newAccountNum, name || `Account ${newAccountNum + 1}`, - 16 // tokenCount + 16, // tokenCount ) if (tx) { const pk = wallet.adapter.publicKey const mangoAccounts = await client.getMangoAccountsForOwner(group, pk!) const reloadedMangoAccounts = await Promise.all( - mangoAccounts.map((ma) => ma.reloadSerum3OpenOrders(client)) + mangoAccounts.map((ma) => ma.reloadSerum3OpenOrders(client)), ) const newAccount = mangoAccounts.find( - (acc) => acc.accountNum === newAccountNum + (acc) => acc.accountNum === newAccountNum, ) if (newAccount) { await newAccount.reloadSerum3OpenOrders(client) diff --git a/components/account/FundingChart.tsx b/components/account/FundingChart.tsx index 4145a1bd..78550866 100644 --- a/components/account/FundingChart.tsx +++ b/components/account/FundingChart.tsx @@ -36,7 +36,7 @@ import SheenLoader from '@components/shared/SheenLoader' const fetchHourlyFunding = async (mangoAccountPk: string) => { try { const data = await fetch( - `${MANGO_DATA_API_URL}/stats/funding-account-hourly?mango-account=${mangoAccountPk}` + `${MANGO_DATA_API_URL}/stats/funding-account-hourly?mango-account=${mangoAccountPk}`, ) const res = await data.json() if (res) { @@ -80,7 +80,7 @@ const FundingChart = ({ hideChart }: { hideChart: () => void }) => { retry: 3, refetchOnWindowFocus: false, enabled: !!mangoAccountAddress, - } + }, ) useEffect(() => { @@ -100,7 +100,7 @@ const FundingChart = ({ hideChart }: { hideChart: () => void }) => { } const data = rawData.reduce((a: HourlyFundingChartData[], c) => { const found: HourlyFundingChartData | undefined = a.find( - (item) => item['time'] === c.time + (item) => item['time'] === c.time, ) const marketKey = Object.keys(c)[0] const marketFunding = Object.values(c)[0] @@ -123,7 +123,7 @@ const FundingChart = ({ hideChart }: { hideChart: () => void }) => { if (active && payload && payload.length) { const load = payload[0].payload const data: [string, any][] = Object.entries(load).filter( - (p) => p[0] !== 'time' && p[0] !== 'total' + (p) => p[0] !== 'time' && p[0] !== 'total', ) return (
diff --git a/components/account/HealthContributions.tsx b/components/account/HealthContributions.tsx index fb4253a0..801850d6 100644 --- a/components/account/HealthContributions.tsx +++ b/components/account/HealthContributions.tsx @@ -22,10 +22,10 @@ const HealthContributions = ({ hideView }: { hideView: () => void }) => { const { group } = useMangoGroup() const { mangoAccount, mangoAccountAddress } = useMangoAccount() const [initActiveIndex, setInitActiveIndex] = useState( - undefined + undefined, ) const [maintActiveIndex, setMaintActiveIndex] = useState( - undefined + undefined, ) const { initContributions, maintContributions } = useHealthContributions() @@ -37,7 +37,7 @@ const HealthContributions = ({ hideView }: { hideView: () => void }) => { if (item.asset === 'USDC') { const hasPerp = !!item.contributionDetails?.perpMarketContributions.find( - (perp: PerpMarketContribution) => Math.abs(perp.contributionUi) > 0 + (perp: PerpMarketContribution) => Math.abs(perp.contributionUi) > 0, ) initHealthContributions.push({ ...item, @@ -73,7 +73,7 @@ const HealthContributions = ({ hideView }: { hideView: () => void }) => { if (item.asset === 'USDC') { const hasPerp = !!item.contributionDetails?.perpMarketContributions.find( - (perp: PerpMarketContribution) => Math.abs(perp.contributionUi) > 0 + (perp: PerpMarketContribution) => Math.abs(perp.contributionUi) > 0, ) maintHealthContributions.push({ ...item, @@ -111,7 +111,7 @@ const HealthContributions = ({ hideView }: { hideView: () => void }) => { const splitData = initHealthContributions.reduce( ( acc: { market: HealthContribution[]; token: HealthContribution[] }, - obj: HealthContribution + obj: HealthContribution, ) => { const isPerp = obj.asset.includes('PERP') const isSpotMarket = obj.asset.includes('/') @@ -123,7 +123,7 @@ const HealthContributions = ({ hideView }: { hideView: () => void }) => { } return acc }, - { market: [], token: [] } + { market: [], token: [] }, ) return [splitData.market, splitData.token] }, [initHealthContributions]) @@ -133,7 +133,7 @@ const HealthContributions = ({ hideView }: { hideView: () => void }) => { const splitData = maintHealthContributions.reduce( ( acc: { market: HealthContribution[]; token: HealthContribution[] }, - obj: HealthContribution + obj: HealthContribution, ) => { const isPerp = obj.asset.includes('PERP') const isSpotMarket = obj.asset.includes('/') @@ -145,7 +145,7 @@ const HealthContributions = ({ hideView }: { hideView: () => void }) => { } return acc }, - { market: [], token: [] } + { market: [], token: [] }, ) const markets = splitData.market.filter((d) => d.contribution > 0) const tokens = splitData.token diff --git a/components/account/HistoryTabs.tsx b/components/account/HistoryTabs.tsx index 650f9457..a0014b28 100644 --- a/components/account/HistoryTabs.tsx +++ b/components/account/HistoryTabs.tsx @@ -109,7 +109,7 @@ const HistoryTabs = () => { paid: `${formatNumericValue(swap_in_amount, inDecimals)} ${inSymbol}`, received: `${formatNumericValue( swap_out_amount, - outDecimals + outDecimals, )} ${outSymbol}`, value: formatCurrencyValue(swap_out_price_usd * swap_out_amount), borrow: `${borrowAmount} ${inSymbol}`, @@ -135,7 +135,7 @@ const HistoryTabs = () => { let market if ('market' in trade) { market = group.getSerum3MarketByExternalMarket( - new PublicKey(trade.market) + new PublicKey(trade.market), ) } else if ('perp_market' in trade) { market = group.getPerpMarketByMarketIndex(trade.market_index) diff --git a/components/account/LiquidationDetails.tsx b/components/account/LiquidationDetails.tsx index 9ca33435..eb8d7993 100644 --- a/components/account/LiquidationDetails.tsx +++ b/components/account/LiquidationDetails.tsx @@ -22,7 +22,7 @@ const LiquidationDetails = ({ const { t } = useTranslation(['common', 'activity', 'settings']) const [preferredExplorer] = useLocalStorageState( PREFERRED_EXPLORER_KEY, - EXPLORERS[0] + EXPLORERS[0], ) const getAssetLiquidatedReturned = (details: SpotOrPerpLiquidationItem) => { @@ -209,7 +209,7 @@ const LiquidationDetails = ({ > {abbreviateAddress( - new PublicKey(activity.activity_details.counterparty) + new PublicKey(activity.activity_details.counterparty), )} diff --git a/components/account/MangoAccountSummary.tsx b/components/account/MangoAccountSummary.tsx index e35dff7e..6cb062ea 100644 --- a/components/account/MangoAccountSummary.tsx +++ b/components/account/MangoAccountSummary.tsx @@ -38,13 +38,13 @@ const MangoAccountSummary = () => { const [accountPnl, accountValue, freeCollateral, health] = useMemo(() => { if (!group || !mangoAccount) return [0, 0, 0, 0] const accountPnl = toUiDecimalsForQuote( - mangoAccount.getPnl(group).toNumber() + mangoAccount.getPnl(group).toNumber(), ) const accountValue = toUiDecimalsForQuote( - mangoAccount.getEquity(group).toNumber() + mangoAccount.getEquity(group).toNumber(), ) const freeCollateral = toUiDecimalsForQuote( - mangoAccount.getCollateralValue(group).toNumber() + mangoAccount.getCollateralValue(group).toNumber(), ) const health = mangoAccount.getHealthRatioUi(group, HealthType.maint) return [accountPnl, accountValue, freeCollateral, health] @@ -53,7 +53,7 @@ const MangoAccountSummary = () => { const leverage = useMemo(() => { if (!group || !mangoAccount) return 0 const assetsValue = toUiDecimalsForQuote( - mangoAccount.getAssetsValue(group).toNumber() + mangoAccount.getAssetsValue(group).toNumber(), ) if (isNaN(assetsValue / accountValue)) { diff --git a/components/account/MarketsHealthTable.tsx b/components/account/MarketsHealthTable.tsx index ae5a6175..4b83431b 100644 --- a/components/account/MarketsHealthTable.tsx +++ b/components/account/MarketsHealthTable.tsx @@ -63,7 +63,7 @@ const MarketsHealthTable = ({ const { asset, contribution, isAsset } = cont const market = group.getSerum3MarketByName(asset) const bank = group.banksMapByTokenIndex.get( - market.baseTokenIndex + market.baseTokenIndex, )?.[0] let initAssetWeight = 0 @@ -155,7 +155,7 @@ const MarketsHealthTable = ({ const { asset, contribution, isAsset } = cont const market = group.getSerum3MarketByName(asset) const bank = group.banksMapByTokenIndex.get( - market.baseTokenIndex + market.baseTokenIndex, )?.[0] let initAssetWeight = 0 diff --git a/components/account/PerpTradeDetails.tsx b/components/account/PerpTradeDetails.tsx index c8d51786..f40a0a42 100644 --- a/components/account/PerpTradeDetails.tsx +++ b/components/account/PerpTradeDetails.tsx @@ -19,7 +19,7 @@ const PerpTradeDetails = ({ activity }: { activity: PerpTradeActivity }) => { const { mangoAccountAddress } = useMangoAccount() const [preferredExplorer] = useLocalStorageState( PREFERRED_EXPLORER_KEY, - EXPLORERS[0] + EXPLORERS[0], ) const { maker, diff --git a/components/borrow/BorrowPage.tsx b/components/borrow/BorrowPage.tsx index 6de51e7c..ef390930 100644 --- a/components/borrow/BorrowPage.tsx +++ b/components/borrow/BorrowPage.tsx @@ -44,7 +44,7 @@ const BorrowPage = () => { } const [animationSettings] = useLocalStorageState( ANIMATION_SETTINGS_KEY, - INITIAL_ANIMATION_SETTINGS + INITIAL_ANIMATION_SETTINGS, ) const filteredBanks = useMemo(() => { @@ -58,7 +58,7 @@ const BorrowPage = () => { if (!filteredBanks.length) return 0 return filteredBanks.reduce( (a, c) => a + Math.abs(c.borrowedAmount) * c.bank.uiPrice, - 0 + 0, ) }, [filteredBanks]) @@ -75,7 +75,7 @@ const BorrowPage = () => { group, usdcBank, mangoAccount, - true + true, ).toNumber() if (borrowValue) { diff --git a/components/borrow/YourBorrowsTable.tsx b/components/borrow/YourBorrowsTable.tsx index 17d8228a..f1df0f3a 100644 --- a/components/borrow/YourBorrowsTable.tsx +++ b/components/borrow/YourBorrowsTable.tsx @@ -26,7 +26,7 @@ import TokenLogo from '@components/shared/TokenLogo' export const getAvailableToBorrow = ( bankWithBal: BankWithBalance, - group: Group + group: Group, ) => { const { balance, bank, maxBorrow } = bankWithBal const { mint, mintDecimals, minVaultToDepositsRatio } = bankWithBal.bank @@ -40,7 +40,7 @@ export const getAvailableToBorrow = ( const available = Decimal.min( availableAccountBorrow.toFixed(bank.mintDecimals), - Decimal.max(0, availableVaultBalance.toFixed(mintDecimals)) + Decimal.max(0, availableVaultBalance.toFixed(mintDecimals)), ) return available } @@ -61,7 +61,7 @@ const YourBorrowsTable = ({ banks }: { banks: BankWithBalance[] }) => { setSelectedToken(token) action === 'borrow' ? setShowBorrowModal(true) : setShowRepayModal(true) }, - [] + [], ) return ( diff --git a/components/chat/ChatForm.tsx b/components/chat/ChatForm.tsx index 16a41c75..6f30149d 100644 --- a/components/chat/ChatForm.tsx +++ b/components/chat/ChatForm.tsx @@ -17,7 +17,7 @@ const ChatForm = ({ const validateMessageText = useCallback(async (text: string) => { try { const response = await fetch( - `https://www.purgomalum.com/service/json?text=${text}&fill_char=*` + `https://www.purgomalum.com/service/json?text=${text}&fill_char=*`, ) const profanityCheck = await response.json() @@ -45,7 +45,7 @@ const ChatForm = ({ setLatestMessages(newMessages) setMessageText('') }, - [messageText, messages, publicKey, validateMessageText, setLatestMessages] + [messageText, messages, publicKey, validateMessageText, setLatestMessages], ) const callbackRef = useCallback((inputElement: HTMLInputElement) => { diff --git a/components/governance/GovernanceDelegate.tsx b/components/governance/GovernanceDelegate.tsx index d5a6a3d5..78c67505 100644 --- a/components/governance/GovernanceDelegate.tsx +++ b/components/governance/GovernanceDelegate.tsx @@ -17,7 +17,7 @@ const GovernanceDelegate = () => { const getCurrentVotingPower = GovernanceStore((s) => s.getCurrentVotingPower) const [selectedDelegatePk, setSelectedDelegatePk] = useLocalStorageState( - `${publicKey?.toBase58()}${GOVERNANCE_DELEGATE_KEY}` + `${publicKey?.toBase58()}${GOVERNANCE_DELEGATE_KEY}`, ) const currentDelegate = delegates .find((x) => x.pubkey.toBase58() === selectedDelegatePk) diff --git a/components/governance/ListMarket/ListMarket.tsx b/components/governance/ListMarket/ListMarket.tsx index 5ddb826d..7e9db044 100644 --- a/components/governance/ListMarket/ListMarket.tsx +++ b/components/governance/ListMarket/ListMarket.tsx @@ -90,7 +90,7 @@ const ListMarket = ({ goBack }: { goBack: () => void }) => { const [baseTokens, quoteTokens] = useMemo(() => { if (!group) return [[], []] const allTokens = [...group.banksMapByName.keys()].sort((a, b) => - a.localeCompare(b) + a.localeCompare(b), ) return [ allTokens.filter((t) => t !== quoteToken), @@ -152,7 +152,7 @@ const ListMarket = ({ goBack }: { goBack: () => void }) => { } return invalidFields }, - [t] + [t], ) const handlePropose = useCallback(async () => { const invalidFields = isFormValid(advForm) @@ -189,7 +189,7 @@ const ListMarket = ({ goBack }: { goBack: () => void }) => { advForm.proposalDescription, index, proposalTx, - vsrClient! + vsrClient!, ) setProposalPk(proposalAddress.toBase58()) setCurrentView(VIEWS.SUCCESS) @@ -255,7 +255,7 @@ const ListMarket = ({ goBack }: { goBack: () => void }) => { baseBank.uiPrice, quoteBank.uiPrice, baseBank.mintDecimals, - quoteBank.mintDecimals + quoteBank.mintDecimals, ) } return { @@ -289,7 +289,7 @@ const ListMarket = ({ goBack }: { goBack: () => void }) => { {t('market-pair')}{' '} {baseToken && quoteToken ? `- ${formatTokenSymbol(baseToken)}/${formatTokenSymbol( - quoteToken + quoteToken, )}` : null} @@ -506,7 +506,7 @@ const ListMarket = ({ goBack }: { goBack: () => void }) => { onChange={(e: ChangeEvent) => handleSetAdvForm( 'openBookMarketExternalPk', - e.target.value + e.target.value, ) } /> @@ -549,7 +549,7 @@ const ListMarket = ({ goBack }: { goBack: () => void }) => { onChange={(e: ChangeEvent) => handleSetAdvForm( 'proposalDescription', - e.target.value + e.target.value, ) } /> diff --git a/components/governance/ListToken/ListToken.tsx b/components/governance/ListToken/ListToken.tsx index 6e44c62b..35d311ce 100644 --- a/components/governance/ListToken/ListToken.tsx +++ b/components/governance/ListToken/ListToken.tsx @@ -128,7 +128,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { ? governances[MANGO_DAO_WALLET_GOVERNANCE.toBase58()].account.config .minCommunityTokensToCreateProposal : new BN(0), - [governances] + [governances], ) as BN const mintVoterWeightNumber = governances ? fmtTokenAmount(minVoterWeight, MANGO_MINT_DECIMALS) @@ -139,7 +139,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { baseTokenPrice, quoteBank.uiPrice, currentTokenInfo.decimals, - quoteBank.mintDecimals + quoteBank.mintDecimals, ) } return { @@ -190,7 +190,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { new BN(index).toArrayLike(Buffer, 'le', 2), new BN(bankNum).toArrayLike(Buffer, 'le', 4), ], - client.programId + client.programId, ) setAdvForm({ ...advForm, @@ -210,7 +210,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { }) setLoadingListingParams(false) }, - [advForm, client.programId, connection, group, mint, proposals] + [advForm, client.programId, connection, group, mint, proposals], ) const handleGetRoutesWithFixedArgs = useCallback( @@ -229,10 +229,10 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { mode, FEE, walletForCheck, - 'JUPITER' + 'JUPITER', ) }, - [wallet.publicKey] + [wallet.publicKey], ) const handleLiqudityCheck = useCallback( @@ -256,7 +256,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { (acc: { amount: string; priceImpactPct: number }[], val) => { if (val.swapMode === 'ExactIn') { const exactOutRoute = bestRoutesSwaps.find( - (x) => x.amount === val.amount && x.swapMode === 'ExactOut' + (x) => x.amount === val.amount && x.swapMode === 'ExactOut', ) acc.push({ amount: val.amount.toString(), @@ -267,14 +267,14 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { } return acc }, - [] + [], ) const midTierCheck = averageSwaps.find( - (x) => x.amount === TWENTY_K_USDC_BASE + (x) => x.amount === TWENTY_K_USDC_BASE, ) const indexForTierFromSwaps = averageSwaps.findIndex( - (x) => x?.priceImpactPct && x?.priceImpactPct * 100 < 1 + (x) => x?.priceImpactPct && x?.priceImpactPct * 100 < 1, ) const tier = indexForTierFromSwaps > -1 @@ -285,8 +285,8 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { handleGetPoolParams( swaps.find( - (x) => x.bestRoute!.amount.toString() === TWENTY_K_USDC_BASE - )!.routes + (x) => x.bestRoute!.amount.toString() === TWENTY_K_USDC_BASE, + )!.routes, ) return tier } catch (e) { @@ -297,7 +297,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { }) } }, - [t, handleGetRoutesWithFixedArgs] + [t, handleGetRoutesWithFixedArgs], ) const handleGetPoolParams = (routes: never[] | RouteInfo[]) => { @@ -378,7 +378,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { } return invalidFields }, - [t] + [t], ) const propose = useCallback(async () => { @@ -405,7 +405,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { group!.publicKey.toBuffer(), new PublicKey(advForm.mintPk).toBuffer(), ], - client.programId + client.programId, ) const proposalTx = [] @@ -436,7 +436,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { Number(tierPreset.liquidationFee), Number(tierPreset.minVaultToDepositsRatio), new BN(tierPreset.netBorrowLimitWindowSizeTs), - new BN(tierPreset.netBorrowLimitPerWindowQuote) + new BN(tierPreset.netBorrowLimitPerWindowQuote), ) .accounts({ admin: MANGO_DAO_WALLET, @@ -474,7 +474,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { false, null, null, - null + null, ) .accounts({ oracle: new PublicKey(advForm.oraclePk), @@ -531,7 +531,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { advForm.proposalDescription, advForm.tokenIndex, proposalTx, - vsrClient + vsrClient, ) setProposalPk(proposalAddress.toBase58()) } catch (e) { @@ -648,7 +648,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => {

{t('mint')}

{abbreviateAddress( - new PublicKey(currentTokenInfo?.address) + new PublicKey(currentTokenInfo?.address), )}

@@ -739,7 +739,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { onChange={(e: ChangeEvent) => handleSetAdvForm( 'openBookMarketExternalPk', - e.target.value + e.target.value, ) } /> @@ -801,7 +801,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { onChange={(e: ChangeEvent) => handleSetAdvForm( 'openBookProgram', - e.target.value + e.target.value, ) } /> @@ -842,7 +842,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { onChange={(e: ChangeEvent) => handleSetAdvForm( 'proposalTitle', - e.target.value + e.target.value, ) } /> @@ -866,7 +866,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => { onChange={(e: ChangeEvent) => handleSetAdvForm( 'proposalDescription', - e.target.value + e.target.value, ) } /> diff --git a/components/governance/OnBoarding.tsx b/components/governance/OnBoarding.tsx index e96ac7ce..4ff65a17 100644 --- a/components/governance/OnBoarding.tsx +++ b/components/governance/OnBoarding.tsx @@ -23,7 +23,7 @@ const OnBoarding = ({ minVotes }: { minVotes?: BN }) => { ? new BN( governances[ MANGO_DAO_WALLET_GOVERNANCE.toBase58() - ].account.config.minCommunityTokensToCreateProposal.toString() + ].account.config.minCommunityTokensToCreateProposal.toString(), ) : new BN(0) const mintVoterWeightNumber = governances @@ -50,7 +50,7 @@ const OnBoarding = ({ minVotes }: { minVotes?: BN }) => { } desc={`${t('on-boarding-deposit-info')} ${t( - 'on-boarding-description-1' + 'on-boarding-description-1', )}`} />
diff --git a/components/governance/Vote/ProposalCard.tsx b/components/governance/Vote/ProposalCard.tsx index 552c1f06..ae91e52a 100644 --- a/components/governance/Vote/ProposalCard.tsx +++ b/components/governance/Vote/ProposalCard.tsx @@ -58,7 +58,7 @@ const ProposalCard = ({ const [voteType, setVoteType] = useState(undefined) const [voteRecordAddress, setVoteRecordAddress] = useState( - null + null, ) const [isVoteCast, setIsVoteCast] = useState(false) const [description, setDescription] = useState('') @@ -73,7 +73,7 @@ const ProposalCard = ({ setProcessedVoteType( voteType === VoteKind.Approve ? PROCESSED_VOTE_TYPE.APPROVE - : PROCESSED_VOTE_TYPE.DENY + : PROCESSED_VOTE_TYPE.DENY, ) try { await castVote( @@ -83,7 +83,7 @@ const ProposalCard = ({ voter.tokenOwnerRecord!, voteType, vsrClient!, - client + client, ) await updateProposals(proposal.pubkey) } catch (e) { @@ -106,7 +106,7 @@ const ProposalCard = ({ proposal, voter.tokenOwnerRecord!, client, - voteRecordAddress! + voteRecordAddress!, ) await updateProposals(proposal.pubkey) } catch (e) { @@ -140,14 +140,14 @@ const ProposalCard = ({ const voteRecordAddress = await getVoteRecordAddress( MANGO_GOVERNANCE_PROGRAM, proposal.pubkey, - voter.tokenOwnerRecord!.pubkey! + voter.tokenOwnerRecord!.pubkey!, ) setVoteRecordAddress(voteRecordAddress) try { const governanceAccount = await getGovernanceAccount( connection, voteRecordAddress, - VoteRecord + VoteRecord, ) setIsVoteCast(true) setVoteType(governanceAccount.account.vote?.voteType) diff --git a/components/governance/Vote/Vote.tsx b/components/governance/Vote/Vote.tsx index f34a87e6..b3761aaf 100644 --- a/components/governance/Vote/Vote.tsx +++ b/components/governance/Vote/Vote.tsx @@ -89,7 +89,7 @@ const Vote = () => { proposal={x} mangoMint={mangoMint} > - ) + ), ) ) : (
diff --git a/components/governance/Vote/VoteProgress.tsx b/components/governance/Vote/VoteProgress.tsx index 55122724..7380e3a2 100644 --- a/components/governance/Vote/VoteProgress.tsx +++ b/components/governance/Vote/VoteProgress.tsx @@ -26,7 +26,7 @@ const QuorumProgress = ({ governance, proposal, communityMint }: Props) => { realm && getMintMaxVoteWeight( communityMint, - realm.account.config.communityMintMaxVoteWeightSource + realm.account.config.communityMintMaxVoteWeightSource, ) const minimumYesVotes = @@ -35,7 +35,7 @@ const QuorumProgress = ({ governance, proposal, communityMint }: Props) => { const yesVoteCount = fmtTokenAmount( new BN(proposal.account.getYesVoteCount().toString()), - communityMint.decimals + communityMint.decimals, ) const rawYesVotesRequired = minimumYesVotes - yesVoteCount diff --git a/components/governance/Vote/VoteResult.tsx b/components/governance/Vote/VoteResult.tsx index 39617db3..aca62dcd 100644 --- a/components/governance/Vote/VoteResult.tsx +++ b/components/governance/Vote/VoteResult.tsx @@ -15,11 +15,11 @@ const VoteResults = ({ proposal, communityMint }: VoteResultsProps) => { const yesVoteCount = fmtTokenAmount( proposal.getYesVoteCount() as BN, - communityMint.decimals + communityMint.decimals, ) const noVoteCount = fmtTokenAmount( proposal.getNoVoteCount() as BN, - communityMint.decimals + communityMint.decimals, ) const totalVoteCount = yesVoteCount + noVoteCount const getRelativeVoteCount = (voteCount: number) => diff --git a/components/leaderboard/LeaderboardPage.tsx b/components/leaderboard/LeaderboardPage.tsx index 8823d2b9..a208a8f8 100644 --- a/components/leaderboard/LeaderboardPage.tsx +++ b/components/leaderboard/LeaderboardPage.tsx @@ -23,7 +23,7 @@ export interface LeaderboardRes { type DaysToShow = '1DAY' | '1WEEK' | 'ALLTIME' const isLeaderboard = ( - response: null | EmptyObject | LeaderboardRes[] + response: null | EmptyObject | LeaderboardRes[], ): response is LeaderboardRes[] => { if (response && Array.isArray(response)) { return true @@ -33,10 +33,10 @@ const isLeaderboard = ( const fetchLeaderboard = async ( daysToShow: DaysToShow, - offset = 0 + offset = 0, ): Promise> => { const data = await fetch( - `${MANGO_DATA_API_URL}/leaderboard-pnl?over_period=${daysToShow}&offset=${offset}` + `${MANGO_DATA_API_URL}/leaderboard-pnl?over_period=${daysToShow}&offset=${offset}`, ) const parsedData: null | EmptyObject | LeaderboardRes[] = await data.json() @@ -63,7 +63,7 @@ const LeaderboardPage = () => { refetchOnWindowFocus: false, keepPreviousData: true, getNextPageParam: (_lastPage, pages) => pages.length * 20, - } + }, ) const leaderboardData = useMemo(() => { diff --git a/components/modals/CloseAccountModal.tsx b/components/modals/CloseAccountModal.tsx index 1a34316a..0abf9b99 100644 --- a/components/modals/CloseAccountModal.tsx +++ b/components/modals/CloseAccountModal.tsx @@ -27,11 +27,11 @@ const CloseAccountModal = ({ isOpen, onClose }: ModalProps) => { const mangoAccount = mangoStore((s) => s.mangoAccount) const perpPositions = mangoStore((s) => s.mangoAccount.perpPositions) const openPerpPositions = Object.values(perpPositions).filter((p) => - p.basePositionLots.toNumber() + p.basePositionLots.toNumber(), ) const group = mangoStore.getState().group const unsettledBalances = Object.values(mangoAccount.spotBalances).filter( - (x) => x.unsettled && x.unsettled > 0 + (x) => x.unsettled && x.unsettled > 0, ) const unsettledPerpPositions = useUnsettledPerpPositions() const [hasBorrows, setHasBorrows] = useState(false) @@ -49,7 +49,7 @@ const CloseAccountModal = ({ isOpen, onClose }: ModalProps) => { const tx = await client.emptyAndCloseMangoAccount(group, mangoAccount) if (tx) { const newMangoAccounts = mangoAccounts.filter( - (ma) => !ma.publicKey.equals(mangoAccount.publicKey) + (ma) => !ma.publicKey.equals(mangoAccount.publicKey), ) let newCurrentAccount: MangoAccount if (newMangoAccounts[0]) { @@ -99,7 +99,7 @@ const CloseAccountModal = ({ isOpen, onClose }: ModalProps) => { .filter((token: TokenPosition) => token .balance(group.getFirstBankByTokenIndex(token.tokenIndex)) - .isNeg() + .isNeg(), ).length ) { setHasBorrows(true) @@ -137,8 +137,8 @@ const CloseAccountModal = ({ isOpen, onClose }: ModalProps) => { mangoAccount && group ? formatCurrencyValue( toUiDecimalsForQuote( - mangoAccount!.current!.getEquity(group) - ) + mangoAccount!.current!.getEquity(group), + ), ) : 0, })} diff --git a/components/modals/CreateOpenbookMarketModal.tsx b/components/modals/CreateOpenbookMarketModal.tsx index 1690b90d..1e1de515 100644 --- a/components/modals/CreateOpenbookMarketModal.tsx +++ b/components/modals/CreateOpenbookMarketModal.tsx @@ -157,11 +157,11 @@ const CreateOpenbookMarketModal = ({ const getMinLamportsToCreateMarket = async () => { const accountsSpace = 84522 + MARKET_STATE_LAYOUT_V2.span const minLamports = await connection.getMinimumBalanceForRentExemption( - accountsSpace + accountsSpace, ) setSolNeededToCreateMarket( Math.round((minLamports / LAMPORTS_PER_SOL + Number.EPSILON) * 100) / - 100 + 100, ) } getMinLamportsToCreateMarket() diff --git a/components/modals/CreateSwitchboardOracleModal.tsx b/components/modals/CreateSwitchboardOracleModal.tsx index 4ccb4701..c74e73b1 100644 --- a/components/modals/CreateSwitchboardOracleModal.tsx +++ b/components/modals/CreateSwitchboardOracleModal.tsx @@ -135,7 +135,7 @@ const CreateSwitchboardOracleModal = ({ }, }, ], - }) + }), ).finish(), }, { @@ -201,7 +201,7 @@ const CreateSwitchboardOracleModal = ({ }, }, ], - }) + }), ).finish(), }, ], diff --git a/components/modals/DelegateModal.tsx b/components/modals/DelegateModal.tsx index 2ae4d27d..b09a6f4c 100644 --- a/components/modals/DelegateModal.tsx +++ b/components/modals/DelegateModal.tsx @@ -22,7 +22,7 @@ const DelegateModal = ({ isOpen, onClose }: ModalProps) => { const [delegateAddress, setDelegateAddress] = useState( mangoAccount?.delegate?.toString() !== DEFAULT_DELEGATE ? mangoAccount!.delegate.toString() - : '' + : '', ) const handleDelegateAccount = async (address: string) => { @@ -44,7 +44,7 @@ const DelegateModal = ({ isOpen, onClose }: ModalProps) => { group, mangoAccount, undefined, - delegateAddress ? new PublicKey(address) : undefined + delegateAddress ? new PublicKey(address) : undefined, ) onClose() notify({ @@ -82,7 +82,7 @@ const DelegateModal = ({ isOpen, onClose }: ModalProps) => {
diff --git a/components/modals/MangoAccountsListModal.tsx b/components/modals/MangoAccountsListModal.tsx index 88341ead..85af1ff1 100644 --- a/components/modals/MangoAccountsListModal.tsx +++ b/components/modals/MangoAccountsListModal.tsx @@ -117,11 +117,11 @@ const MangoAccountsListModal = ({ acc = mangoAccount } const accountValue = toUiDecimalsForQuote( - Number(acc.getEquity(group!)) + Number(acc.getEquity(group!)), ).toFixed(2) const maintHealth = acc.getHealthRatioUi( group!, - HealthType.maint + HealthType.maint, ) return (
{ @@ -99,13 +99,13 @@ const ModifyTvOrderModal = ({ Date.now(), PerpOrderType.limit, undefined, - undefined + undefined, ) } else { const marketPk = findSerum3MarketPkInOpenOrders(o) if (!marketPk) return const market = group.getSerum3MarketByExternalMarket( - new PublicKey(marketPk) + new PublicKey(marketPk), ) tx = await client.modifySerum3Order( group, @@ -118,7 +118,7 @@ const ModifyTvOrderModal = ({ Serum3SelfTradeBehavior.decrementTake, Serum3OrderType.limit, Date.now(), - 10 + 10, ) } actions.fetchOpenOrders() @@ -139,7 +139,7 @@ const ModifyTvOrderModal = ({ }) } }, - [findSerum3MarketPkInOpenOrders, modifiedOrderPrice, modifiedOrderSize] + [findSerum3MarketPkInOpenOrders, modifiedOrderPrice, modifiedOrderSize], ) return selectedMarket ? ( diff --git a/components/modals/SharePositionModal.tsx b/components/modals/SharePositionModal.tsx index 65f8969b..6835fdbe 100644 --- a/components/modals/SharePositionModal.tsx +++ b/components/modals/SharePositionModal.tsx @@ -129,7 +129,7 @@ const SharePositionModal = ({

{formatNumericValue( entryPrice, - getDecimalCount(market.tickSize) + getDecimalCount(market.tickSize), )}

@@ -140,7 +140,7 @@ const SharePositionModal = ({

{formatNumericValue( market.uiPrice, - getDecimalCount(market.tickSize) + getDecimalCount(market.tickSize), )}

diff --git a/components/modals/TradeVolumeAlertModal.tsx b/components/modals/TradeVolumeAlertModal.tsx index 24483994..1afe0965 100644 --- a/components/modals/TradeVolumeAlertModal.tsx +++ b/components/modals/TradeVolumeAlertModal.tsx @@ -26,11 +26,11 @@ const TradeVolumeAlertModal = ({ isOpen, onClose }: ModalProps) => { const { t } = useTranslation(['common', 'trade']) const [soundSettings, setSoundSettings] = useLocalStorageState( SOUND_SETTINGS_KEY, - INITIAL_SOUND_SETTINGS + INITIAL_SOUND_SETTINGS, ) const [alertSettings, setAlertSettings] = useLocalStorageState( TRADE_VOLUME_ALERT_KEY, - DEFAULT_VOLUME_ALERT_SETTINGS + DEFAULT_VOLUME_ALERT_SETTINGS, ) const [formValues, setFormValues] = useState(alertSettings) diff --git a/components/modals/UserSetupModal.tsx b/components/modals/UserSetupModal.tsx index 48b2264e..413002ef 100644 --- a/components/modals/UserSetupModal.tsx +++ b/components/modals/UserSetupModal.tsx @@ -70,7 +70,7 @@ const UserSetupModal = ({ const banks = useBanksWithBalances('walletBalance') const [, setAcceptTerms] = useLocalStorageState(ACCEPT_TERMS_KEY, '') const [walletsToDisplay, setWalletstoDisplay] = useState<'default' | 'all'>( - 'default' + 'default', ) const walletsDisplayed = useMemo(() => { @@ -78,7 +78,7 @@ const UserSetupModal = ({ const detectedWallets = wallets.filter( (w) => w.readyState === WalletReadyState.Installed || - w.readyState === WalletReadyState.Loadable + w.readyState === WalletReadyState.Loadable, ) if (walletsToDisplay === 'default') { @@ -107,7 +107,7 @@ const UserSetupModal = ({ group, 0, accountName || 'Account 1', - 16 // tokenCount + 16, // tokenCount ) actions.fetchMangoAccounts(publicKey) if (tx) { @@ -147,7 +147,7 @@ const UserSetupModal = ({ group, mangoAccount, bank.mint, - parseFloat(depositAmount) + parseFloat(depositAmount), ) notify({ title: 'Transaction confirmed', @@ -197,7 +197,7 @@ const UserSetupModal = ({ const setMax = useCallback(() => { const max = new Decimal(tokenMax.amount).toDecimalPlaces( tokenMax.decimals, - Decimal.ROUND_FLOOR + Decimal.ROUND_FLOOR, ) setDepositAmount(max.toString()) setSizePercentage('100') @@ -212,7 +212,7 @@ const UserSetupModal = ({ .toDecimalPlaces(tokenMax.decimals, Decimal.ROUND_FLOOR) setDepositAmount(amount.toString()) }, - [tokenMax] + [tokenMax], ) const handleNextStep = () => { @@ -456,7 +456,7 @@ const UserSetupModal = ({ value={depositAmount} onValueChange={(e: NumberFormatValues) => { setDepositAmount( - !Number.isNaN(Number(e.value)) ? e.value : '' + !Number.isNaN(Number(e.value)) ? e.value : '', ) }} isAllowed={withValueLimit} diff --git a/components/notifications/NotificationsDrawer.tsx b/components/notifications/NotificationsDrawer.tsx index c956e26e..3d4ef9c3 100644 --- a/components/notifications/NotificationsDrawer.tsx +++ b/components/notifications/NotificationsDrawer.tsx @@ -22,7 +22,7 @@ import { notify } from 'utils/notifications' export const createSolanaMessage = ( wallet: WalletContextState, - setCookie: (wallet: string, token: string) => void + setCookie: (wallet: string, token: string) => void, ) => { const payload = new Payload() payload.domain = window.location.host @@ -121,7 +121,7 @@ const NotificationsDrawer = ({ }) } }, - [NOTIFICATION_API, headers] + [NOTIFICATION_API, headers], ) const remove = useCallback( @@ -136,7 +136,7 @@ const NotificationsDrawer = ({ body: JSON.stringify({ ids: ids, }), - } + }, ) const body = await resp.json() const error = body.error @@ -158,7 +158,7 @@ const NotificationsDrawer = ({ } setIsRemoving(false) }, - [NOTIFICATION_API, headers] + [NOTIFICATION_API, headers], ) // Mark all notifications as seen when the inbox is opened @@ -241,7 +241,7 @@ const NotificationsDrawer = ({

{dayjs(notification.createdAt).format( - 'DD MMM YYYY, h:mma' + 'DD MMM YYYY, h:mma', )}

diff --git a/components/notifications/TransactionNotification.tsx b/components/notifications/TransactionNotification.tsx index 669e7cf3..a7a8cc38 100644 --- a/components/notifications/TransactionNotification.tsx +++ b/components/notifications/TransactionNotification.tsx @@ -39,7 +39,7 @@ const TransactionNotificationList = () => { const notEnoughSoLMessage = t('deposit-more-sol') const [notificationPosition] = useLocalStorageState( NOTIFICATION_POSITION_KEY, - 'bottom-left' + 'bottom-left', ) const [mounted, setMounted] = useState(false) const { maxSolDeposit } = useSolBalance() @@ -49,10 +49,10 @@ const TransactionNotificationList = () => { useEffect(() => { if (transactionNotifications.length) { const customErrorNotification = transactionNotifications.find( - (n) => n.description && n.description.includes('"Custom":1') + (n) => n.description && n.description.includes('"Custom":1'), ) const notEnoughSolNotification = transactionNotifications.find( - (n) => n.title && n.title.includes(notEnoughSoLMessage) + (n) => n.title && n.title.includes(notEnoughSoLMessage), ) if ( @@ -125,11 +125,11 @@ const TransactionNotification = ({ }) => { const [notificationPosition] = useLocalStorageState( NOTIFICATION_POSITION_KEY, - 'Bottom-Left' + 'Bottom-Left', ) const [preferredExplorer] = useLocalStorageState( PREFERRED_EXPLORER_KEY, - EXPLORERS[0] + EXPLORERS[0], ) const { type, title, description, txid, show, id } = notification @@ -151,7 +151,7 @@ const TransactionNotification = ({ if ((type === 'error' || type === 'success') && txid) { setMangoStore((s) => { const newNotifications = s.transactionNotifications.map((n) => - n.txid === txid && n.type === 'confirm' ? { ...n, show: false } : n + n.txid === txid && n.type === 'confirm' ? { ...n, show: false } : n, ) s.transactionNotifications = newNotifications }) @@ -161,7 +161,7 @@ const TransactionNotification = ({ const hideNotification = useCallback(() => { setMangoStore((s) => { const newNotifications = s.transactionNotifications.map((n) => - n.id === id ? { ...n, show: false } : n + n.id === id ? { ...n, show: false } : n, ) s.transactionNotifications = newNotifications }) diff --git a/components/profile/EditNftProfilePic.tsx b/components/profile/EditNftProfilePic.tsx index 784e658f..68ab1967 100644 --- a/components/profile/EditNftProfilePic.tsx +++ b/components/profile/EditNftProfilePic.tsx @@ -73,7 +73,7 @@ const EditNftProfilePic = ({ onClose }: { onClose: () => void }) => { } const response = await fetch( `${MANGO_DATA_API_URL}/user-data/profile-details`, - requestOptions + requestOptions, ) if (response.status === 200) { await actions.fetchProfileDetails(publicKey.toString()) @@ -119,7 +119,7 @@ const EditNftProfilePic = ({ onClose }: { onClose: () => void }) => { } const response = await fetch( `${MANGO_DATA_API_URL}/user-data/profile-details`, - requestOptions + requestOptions, ) if (response.status === 200) { await actions.fetchProfileDetails(publicKey.toString()) diff --git a/components/profile/EditProfileForm.tsx b/components/profile/EditProfileForm.tsx index 647c97bf..d55776f2 100644 --- a/components/profile/EditProfileForm.tsx +++ b/components/profile/EditProfileForm.tsx @@ -31,7 +31,7 @@ const EditProfileForm = ({ const profile = mangoStore((s) => s.profile.details) const { publicKey, signMessage } = useWallet() const [profileName, setProfileName] = useState( - startCase(profile?.profile_name) || '' + startCase(profile?.profile_name) || '', ) const [inputError, setInputError] = useState('') const [loadUniquenessCheck, setLoadUniquenessCheck] = useState(false) @@ -43,7 +43,7 @@ const EditProfileForm = ({ try { setLoadUniquenessCheck(true) const response = await fetch( - `${MANGO_DATA_API_URL}/user-data/check-profile-name-unique?profile-name=${name}` + `${MANGO_DATA_API_URL}/user-data/check-profile-name-unique?profile-name=${name}`, ) const uniquenessCheck = await response.json() @@ -105,7 +105,7 @@ const EditProfileForm = ({ } const response = await fetch( `${MANGO_DATA_API_URL}/user-data/profile-details`, - requestOptions + requestOptions, ) if (response.status === 200) { setLoadUpdateProfile(false) diff --git a/components/rewards/Leaderboards.tsx b/components/rewards/Leaderboards.tsx index d2ddc0b7..90b4585c 100644 --- a/components/rewards/Leaderboards.tsx +++ b/components/rewards/Leaderboards.tsx @@ -54,7 +54,7 @@ const Leaderboards = ({ staleTime: 1000 * 60, retry: 3, refetchOnWindowFocus: false, - } + }, ) const isLoading = @@ -96,7 +96,7 @@ const Leaderboards = ({ rewardsLeaderboardData.map( (wallet: RewardsLeaderboardItem, i: number) => ( - ) + ), ) ) : (
diff --git a/components/rewards/RewardsPage.tsx b/components/rewards/RewardsPage.tsx index d10238b7..e8cd543b 100644 --- a/components/rewards/RewardsPage.tsx +++ b/components/rewards/RewardsPage.tsx @@ -66,7 +66,7 @@ export const tiers = ['seed', 'mango', 'whale', 'bot'] const fetchRewardsPoints = async (walletPk: string | undefined) => { try { const data = await fetch( - `${MANGO_DATA_API_URL}/user-data/campaign-total-points-wallet?wallet-pk=${walletPk}` + `${MANGO_DATA_API_URL}/user-data/campaign-total-points-wallet?wallet-pk=${walletPk}`, ) const res = await data.json() return res @@ -78,7 +78,7 @@ const fetchRewardsPoints = async (walletPk: string | undefined) => { export const fetchLeaderboard = async (tier: string | undefined) => { try { const data = await fetch( - `${MANGO_DATA_API_URL}/user-data/campaign-leaderboard?tier=${tier}` + `${MANGO_DATA_API_URL}/user-data/campaign-leaderboard?tier=${tier}`, ) const res = await data.json() return res @@ -195,7 +195,7 @@ const Season = ({ retry: 3, refetchOnWindowFocus: false, enabled: !!wallet?.adapter, - } + }, ) const { @@ -210,7 +210,7 @@ const Season = ({ staleTime: 1000 * 60, retry: 3, refetchOnWindowFocus: false, - } + }, ) useEffect(() => { diff --git a/components/search/SearchPage.tsx b/components/search/SearchPage.tsx index c65e3184..d5b6e1c7 100644 --- a/components/search/SearchPage.tsx +++ b/components/search/SearchPage.tsx @@ -41,7 +41,7 @@ const SearchPage = () => { try { setLoading(true) const response = await fetch( - `${MANGO_DATA_API_URL}/user-data/profile-search?search-string=${searchString}&search-method=${searchType}` + `${MANGO_DATA_API_URL}/user-data/profile-search?search-string=${searchString}&search-method=${searchType}`, ) const data = await response.json() setSearchResults(data) @@ -115,7 +115,7 @@ const SearchPage = () => { ) : ( - ) + ), ) ) : showNoResults ? (
diff --git a/components/settings/AnimationSettings.tsx b/components/settings/AnimationSettings.tsx index c803e2a3..0442cae8 100644 --- a/components/settings/AnimationSettings.tsx +++ b/components/settings/AnimationSettings.tsx @@ -13,7 +13,7 @@ const AnimationSettings = () => { const { t } = useTranslation(['common', 'settings']) const [animationSettings, setAnimationSettings] = useLocalStorageState( ANIMATION_SETTINGS_KEY, - INITIAL_ANIMATION_SETTINGS + INITIAL_ANIMATION_SETTINGS, ) const handleToggleAnimationSetting = (settingName: string) => { diff --git a/components/settings/DisplaySettings.tsx b/components/settings/DisplaySettings.tsx index f8d7bd6e..943e60b2 100644 --- a/components/settings/DisplaySettings.tsx +++ b/components/settings/DisplaySettings.tsx @@ -63,21 +63,21 @@ const DisplaySettings = () => { const { theme, setTheme } = useTheme() const [savedLanguage, setSavedLanguage] = useLocalStorageState( 'language', - 'en' + 'en', ) const router = useRouter() const { pathname, asPath, query } = router const [notificationPosition, setNotificationPosition] = useLocalStorageState( NOTIFICATION_POSITION_KEY, - 'bottom-left' + 'bottom-left', ) const [tradeFormUi, setTradeFormUi] = useLocalStorageState( SIZE_INPUT_UI_KEY, - 'slider' + 'slider', ) const [tradeChartUi, setTradeChartUi] = useLocalStorageState( TRADE_CHART_UI_KEY, - 'trading-view' + 'trading-view', ) const [, setTradeLayout] = useLocalStorageState(TRADE_LAYOUT_KEY, 'chartLeft') @@ -87,7 +87,7 @@ const DisplaySettings = () => { router.push({ pathname, query }, asPath, { locale: l }) dayjs.locale(l == 'zh_tw' ? 'zh-tw' : l) }, - [router, pathname, query, asPath, setSavedLanguage] + [router, pathname, query, asPath, setSavedLanguage], ) return ( diff --git a/components/settings/HotKeysSettings.tsx b/components/settings/HotKeysSettings.tsx index be9060f2..c16e9d40 100644 --- a/components/settings/HotKeysSettings.tsx +++ b/components/settings/HotKeysSettings.tsx @@ -120,7 +120,7 @@ const HotKeysSettings = () => { {Object.entries(options).map((e) => { return e[1] ? `${e[0] !== 'margin' ? ', ' : ''}${t( - `trade:${e[0]}` + `trade:${e[0]}`, )}` : '' })} diff --git a/components/settings/NotificationSettings.tsx b/components/settings/NotificationSettings.tsx index adca0257..3e285e8d 100644 --- a/components/settings/NotificationSettings.tsx +++ b/components/settings/NotificationSettings.tsx @@ -49,7 +49,7 @@ const NotificationSettings = () => { onChange={() => handleSettingChange( 'fillsNotifications', - !data?.fillsNotifications + !data?.fillsNotifications, ) } /> diff --git a/components/settings/PreferredExplorerSettings.tsx b/components/settings/PreferredExplorerSettings.tsx index 80baa573..b1530be9 100644 --- a/components/settings/PreferredExplorerSettings.tsx +++ b/components/settings/PreferredExplorerSettings.tsx @@ -15,7 +15,7 @@ const PreferredExplorerSettings = () => { const { t } = useTranslation('settings') const [preferredExplorer, setPreferredExplorer] = useLocalStorageState( PREFERRED_EXPLORER_KEY, - EXPLORERS[0] + EXPLORERS[0], ) return ( <> diff --git a/components/settings/RpcSettings.tsx b/components/settings/RpcSettings.tsx index 8160321e..97a62805 100644 --- a/components/settings/RpcSettings.tsx +++ b/components/settings/RpcSettings.tsx @@ -50,11 +50,11 @@ const RpcSettings = () => { const [showCustomForm, setShowCustomForm] = useState(false) const [rpcEndpointProvider, setRpcEndpointProvider] = useLocalStorageState( RPC_PROVIDER_KEY, - RPC_URLS[0].value + RPC_URLS[0].value, ) const [storedPriorityFee, setStoredPriorityFee] = useLocalStorageState( PRIORITY_FEE_KEY, - DEFAULT_PRIORITY_FEE.value + DEFAULT_PRIORITY_FEE.value, ) const [storedUseOrderbookFeed, setStoredUseOrderbookFeed] = useLocalStorageState(USE_ORDERBOOK_FEED_KEY, true) @@ -77,7 +77,7 @@ const RpcSettings = () => { const handleSetEndpointProvider = (provider: string) => { const endpointProvider = RPC_URLS.find( - (node) => node.label === provider + (node) => node.label === provider, ) || { label: 'Custom', value: rpcEndpointProvider } setRpcEndpointProvider(endpointProvider.value) if (provider !== 'Custom') { @@ -96,7 +96,7 @@ const RpcSettings = () => { } } }, - [setStoredPriorityFee, actions, wallet] + [setStoredPriorityFee, actions, wallet], ) useEffect(() => { diff --git a/components/settings/SoundSettings.tsx b/components/settings/SoundSettings.tsx index b4a04482..02e77e0d 100644 --- a/components/settings/SoundSettings.tsx +++ b/components/settings/SoundSettings.tsx @@ -14,7 +14,7 @@ const SoundSettings = () => { const { t } = useTranslation(['common', 'settings']) const [soundSettings, setSoundSettings] = useLocalStorageState( SOUND_SETTINGS_KEY, - INITIAL_SOUND_SETTINGS + INITIAL_SOUND_SETTINGS, ) const handleToggleSoundSetting = (settingName: string) => { diff --git a/components/shared/BalancesTable.tsx b/components/shared/BalancesTable.tsx index 65e7e630..c2044ce8 100644 --- a/components/shared/BalancesTable.tsx +++ b/components/shared/BalancesTable.tsx @@ -293,7 +293,7 @@ const Balance = ({ bank }: { bank: BankWithBalance }) => { let tickDecimals: number if (selectedMarket instanceof Serum3Market) { const market = group.getSerum3ExternalMarket( - selectedMarket.serumMarketExternal + selectedMarket.serumMarketExternal, ) minOrderDecimals = getDecimalCount(market.minOrderSize) tickDecimals = getDecimalCount(market.tickSize) @@ -306,7 +306,7 @@ const Balance = ({ bank }: { bank: BankWithBalance }) => { const floorBalance = floorToDecimal(balance, tickDecimals).toNumber() const baseSize = floorToDecimal( floorBalance / price, - minOrderDecimals + minOrderDecimals, ).toNumber() const quoteSize = floorToDecimal(baseSize * price, tickDecimals) set((s) => { @@ -322,7 +322,7 @@ const Balance = ({ bank }: { bank: BankWithBalance }) => { }) } }, - [selectedMarket] + [selectedMarket], ) const handleSwapFormBalanceClick = useCallback( @@ -356,7 +356,7 @@ const Balance = ({ bank }: { bank: BankWithBalance }) => { }) } }, - [bank] + [bank], ) const balance = bank.balance @@ -393,7 +393,7 @@ const Balance = ({ bank }: { bank: BankWithBalance }) => { className="font-normal underline underline-offset-2 md:underline-offset-4 md:hover:no-underline" onClick={() => handleSwapFormBalanceClick( - Number(floorToDecimal(balance, tokenBank.mintDecimals)) + Number(floorToDecimal(balance, tokenBank.mintDecimals)), ) } > diff --git a/components/shared/DetailedAreaOrBarChart.tsx b/components/shared/DetailedAreaOrBarChart.tsx index 4f3a0a51..27dbc2e3 100644 --- a/components/shared/DetailedAreaOrBarChart.tsx +++ b/components/shared/DetailedAreaOrBarChart.tsx @@ -100,7 +100,7 @@ const DetailedAreaOrBarChart: FunctionComponent< const { theme } = useTheme() const [animationSettings] = useLocalStorageState( ANIMATION_SETTINGS_KEY, - INITIAL_ANIMATION_SETTINGS + INITIAL_ANIMATION_SETTINGS, ) const handleMouseMove = (coords: any) => { @@ -134,7 +134,7 @@ const DetailedAreaOrBarChart: FunctionComponent< if (filteredData.length) { if (mouseData) { const index = filteredData.findIndex( - (d: any) => d[xKey] === mouseData[xKey] + (d: any) => d[xKey] === mouseData[xKey], ) const change = index >= 0 ? filteredData[index][yKey] - filteredData[0][yKey] : 0 @@ -216,7 +216,7 @@ const DetailedAreaOrBarChart: FunctionComponent< mouseData[yKey] < 0 ? '-' : '' }${prefix}${formatNumericValue( Math.abs(mouseData[yKey]), - yDecimals + yDecimals, )}${suffix}`} /> ) : ( @@ -249,7 +249,7 @@ const DetailedAreaOrBarChart: FunctionComponent< {dayjs(mouseData[xKey]).format( tooltipDateFormat ? tooltipDateFormat - : 'DD MMM YY, h:mma' + : 'DD MMM YY, h:mma', )}

@@ -273,9 +273,9 @@ const DetailedAreaOrBarChart: FunctionComponent< : '' }${prefix}${formatNumericValue( Math.abs( - filteredData[filteredData.length - 1][yKey] + filteredData[filteredData.length - 1][yKey], ), - yDecimals + yDecimals, )}${suffix}`} /> ) : ( @@ -308,11 +308,11 @@ const DetailedAreaOrBarChart: FunctionComponent< } text-th-fgd-4`} > {dayjs( - filteredData[filteredData.length - 1][xKey] + filteredData[filteredData.length - 1][xKey], ).format( tooltipDateFormat ? tooltipDateFormat - : 'DD MMM YY, h:mma' + : 'DD MMM YY, h:mma', )}

@@ -341,7 +341,7 @@ const DetailedAreaOrBarChart: FunctionComponent< { const [favoriteMarkets, setFavoriteMarkets] = useLocalStorageState( FAVORITE_MARKETS_KEY, - [] + [], ) const addToFavorites = (marketName: string) => { @@ -24,7 +24,7 @@ const FavoriteMarketButton = ({ } return favoriteMarkets.find( - (marketName: string) => marketName === market.name + (marketName: string) => marketName === market.name, ) ? (