Skip to content

Commit 48de7d4

Browse files
committed
refactor: clean up
1 parent f1fe51e commit 48de7d4

File tree

4 files changed

+5
-18
lines changed

4 files changed

+5
-18
lines changed

pages/payments/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export default function Payments ({ user, userId }: PaybuttonsProps): React.Reac
147147
accessor: 'amount',
148148
sortType: compareNumericString,
149149
Cell: (cellProps) => {
150-
const { networkId, amount } = cellProps.cell.row.original.amount
150+
const { networkId, amount } = cellProps.cell.row.original
151151
const networkTicker = NETWORK_TICKERS_FROM_ID[networkId]
152152
const formattedAmount = Number(amount).toLocaleString(undefined, {
153153
minimumFractionDigits: DECIMALS[networkTicker],

redis/paymentCache.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,9 @@ export const generatePaymentFromTx = async (tx: TransactionsWithPaybuttonsAndPri
8383
timestamp: tx.timestamp,
8484
values: {
8585
values,
86-
amount: tx.amount,
87-
networkId: tx.address.networkId
88-
},
89-
amount: {
90-
amount: tx.amount,
91-
networkId: tx.address.networkId
86+
amount: tx.amount
9287
},
88+
amount: tx.amount,
9389
networkId: tx.address.networkId,
9490
hash: tx.hash,
9591
buttonDisplayDataList,

redis/types.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,12 @@ export interface ButtonDisplayData {
4848
export interface AmountData {
4949
values: QuoteValues
5050
amount: Decimal
51-
networkId?: number
52-
}
53-
54-
export interface Amount {
55-
amount: Decimal
56-
networkId?: number
5751
}
5852

5953
export interface Payment {
6054
timestamp: number
6155
values: AmountData
62-
amount?: Amount
56+
amount?: Decimal
6357
networkId: number
6458
hash: string
6559
buttonDisplayDataList: ButtonDisplayData[]

services/transactionService.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -704,10 +704,7 @@ export async function getPaymentsByUserIdOrderedByButtonName (
704704
})
705705
if (tx.amount > 0) {
706706
payments.push({
707-
amount: {
708-
amount: tx.amount,
709-
networkId: tx.networkId
710-
},
707+
amount: tx.amount,
711708
timestamp: tx.timestamp,
712709
values: {
713710
values: ret,

0 commit comments

Comments
 (0)