Update WalletService to adjust transaction amount and fee calculations

- Modified the transaction amount to be divided by 1000 for accurate representation.
- Updated the fee calculation to also divide by 1000, ensuring consistency in transaction data.

These changes enhance the accuracy of transaction details displayed in the wallet module.
This commit is contained in:
padreug 2025-09-14 23:23:55 +02:00
parent 876eb4f20b
commit 86b1710030

View file

@ -269,12 +269,12 @@ export default class WalletService extends BaseService {
// Transform to our transaction format
this._transactions.value = payments.map((payment: any) => ({
id: payment.payment_hash,
amount: Math.abs(payment.amount),
amount: Math.abs(payment.amount) / 1000,
description: payment.memo || payment.description || 'No description',
timestamp: payment.time ? new Date(payment.time * 1000) : new Date(),
type: payment.amount > 0 ? 'received' : 'sent',
status: payment.pending ? 'pending' : 'confirmed',
fee: payment.fee
fee: payment.fee ? payment.fee / 1000 : undefined
})).sort((a: PaymentTransaction, b: PaymentTransaction) =>
b.timestamp.getTime() - a.timestamp.getTime()
)