From 00331bbb359d18e93550b929139a31343ad1e49f Mon Sep 17 00:00:00 2001 From: jinchung Date: Sat, 21 Oct 2023 14:25:09 -0400 Subject: [PATCH] Remove unused transaction helper functions --- src/helpers/transactions.ts | 39 ------------------------------------- 1 file changed, 39 deletions(-) diff --git a/src/helpers/transactions.ts b/src/helpers/transactions.ts index dfdbd5eac2a..b8057fd0314 100644 --- a/src/helpers/transactions.ts +++ b/src/helpers/transactions.ts @@ -1,16 +1,8 @@ -import { format } from 'date-fns'; import { TransactionStatus, - TransactionStatusTypes, TransactionType, TransactionTypes, } from '@/entities'; -import { getDateFnsLocale } from '@/languages'; - -export const buildTransactionUniqueIdentifier = ({ - hash, - displayDetails, -}: any) => hash || displayDetails?.timestampInMs; export const calculateTimestampOfToday = () => { const d = new Date(); @@ -45,37 +37,6 @@ export const yesterdayTimestamp = calculateTimestampOfYesterday(); export const thisMonthTimestamp = calculateTimestampOfThisMonth(); export const thisYearTimestamp = calculateTimestampOfThisYear(); -export function getHumanReadableDate(date: any) { - const timestamp = new Date(date * 1000); - - // i18n - return format( - timestamp, - // @ts-expect-error ts-migrate(2365) FIXME: Operator '>' cannot be applied to types 'Date' and... Remove this comment to see the full error message - timestamp > todayTimestamp - ? `'Today'` - : // @ts-expect-error ts-migrate(2365) FIXME: Operator '>' cannot be applied to types 'Date' and... Remove this comment to see the full error message - timestamp > yesterdayTimestamp - ? `'Yesterday'` - : // @ts-expect-error ts-migrate(2365) FIXME: Operator '>' cannot be applied to types 'Date' and... Remove this comment to see the full error message - `'on' MMM d${timestamp > thisYearTimestamp ? '' : ' yyyy'}`, - { locale: getDateFnsLocale() } - ); -} - -export function hasAddableContact(status: any, type: any) { - if ( - (status === TransactionStatusTypes.received && - type !== TransactionTypes.trade) || - status === TransactionStatusTypes.receiving || - status === TransactionStatusTypes.sending || - status === TransactionStatusTypes.sent - ) { - return true; - } - return false; -} - /** * Returns the `TransactionStatus` that represents completion for a given * transaction type.