From 1b8892c44550d732b7bb69307301b193a82b2e41 Mon Sep 17 00:00:00 2001 From: Matthew Russell Date: Fri, 8 Mar 2024 10:59:41 +0000 Subject: [PATCH] chore: remove helpers only used by lp dashboard --- .../src/lib/utils/liquidity-utils.spec.tsx | 12 ------------ .../src/lib/utils/liquidity-utils.ts | 19 ------------------- 2 files changed, 31 deletions(-) diff --git a/libs/liquidity/src/lib/utils/liquidity-utils.spec.tsx b/libs/liquidity/src/lib/utils/liquidity-utils.spec.tsx index d8bac4074..1ab8cca2e 100644 --- a/libs/liquidity/src/lib/utils/liquidity-utils.spec.tsx +++ b/libs/liquidity/src/lib/utils/liquidity-utils.spec.tsx @@ -2,7 +2,6 @@ import { renderHook } from '@testing-library/react'; import { Intent } from '@vegaprotocol/ui-toolkit'; import BigNumber from 'bignumber.js'; import { - formatWithAsset, sumLiquidityCommitted, getFeeLevels, calcDayVolume, @@ -23,17 +22,6 @@ const CANDLES_2 = [ { volume: '10', open: '21', close: '21' }, ]; -describe('formatWithAsset', () => { - it('should return formatted string', () => { - const result = formatWithAsset('103926176181', { - decimals: 5, - symbol: 'tEURO', - }); - - expect(result).toEqual('1,039,261.76181 tEURO'); - }); -}); - describe('sumLiquidityCommitted', () => { it('should return the total sum', () => { const provider1 = 10; diff --git a/libs/liquidity/src/lib/utils/liquidity-utils.ts b/libs/liquidity/src/lib/utils/liquidity-utils.ts index 65b9f41e1..27916a8f2 100644 --- a/libs/liquidity/src/lib/utils/liquidity-utils.ts +++ b/libs/liquidity/src/lib/utils/liquidity-utils.ts @@ -1,5 +1,4 @@ import BigNumber from 'bignumber.js'; -import { addDecimalsFormatNumber } from '@vegaprotocol/utils'; import type { MarketNodeFragment } from './../__generated__/MarketsLiquidity'; import { Intent } from '@vegaprotocol/ui-toolkit'; @@ -21,20 +20,6 @@ export const sumLiquidityCommitted = ( : 0; }; -export const formatWithAsset = ( - value: string, - settlementAsset: { - decimals?: number; - symbol?: string; - } -) => { - const { decimals, symbol } = settlementAsset; - const formattedValue = decimals - ? addDecimalsFormatNumber(value, decimals) - : value; - return `${formattedValue} ${symbol}`; -}; - interface Candle { open: string; close: string; @@ -48,10 +33,6 @@ export const getCandle24hAgo = ( return candles24hAgo.find((c) => c.marketId === marketId)?.candles?.[0]; }; -export const displayChange = (value: string) => { - return parseFloat(value) > 0 ? `+${value}` : value; -}; - export const EMPTY_VALUE = ' - '; export const getChange = (candles: (Candle | null)[], lastClose?: string) => { const firstCandle = candles.find((item) => item?.open);