JS Desktop wallet: fix other issues

This commit is contained in:
mDuo13
2023-09-22 18:12:33 -07:00
parent 3a8da5157c
commit f5fc6c2fc4
3 changed files with 91 additions and 57 deletions

View File

@@ -14,7 +14,6 @@ function openAccountAddressDialog(){
accountAddressDialog.showModal()
}
// Step 3 - Section start - this remains as it is, the rest is new
const ledgerIndexEl = document.getElementById('ledger-index')
const ledgerHashEl = document.getElementById('ledger-hash')
const ledgerCloseTimeEl = document.getElementById('ledger-close-time')
@@ -24,7 +23,6 @@ window.electronAPI.onUpdateLedgerData((_event, ledger) => {
ledgerHashEl.innerText = ledger.ledgerHash
ledgerCloseTimeEl.innerText = ledger.ledgerCloseTime
})
// Step 3 - Section end
const accountAddressClassicEl = document.getElementById('account-address-classic')
const accountAddressXEl = document.getElementById('account-address-x')

View File

@@ -1,14 +1,21 @@
const xrpl = require("xrpl");
const prepareTxData = (transactions) => {
return transactions.map(transaction => ({
confirmed: transaction.tx.date,
type: transaction.tx.TransactionType,
from: transaction.tx.Account,
to: transaction.tx.Destination,
value: getDisplayableAmount(transaction.meta.delivered_amount),
hash: transaction.tx.hash
}))
return transactions.map(transaction => {
let tx_value = "-"
if (transaction.meta !== undefined && transaction.meta.delivered_amount !== undefined) {
tx_value = getDisplayableAmount(transaction.meta.delivered_amount)
}
return {
confirmed: transaction.tx.date,
type: transaction.tx.TransactionType,
from: transaction.tx.Account,
to: transaction.tx.Destination ?? "-",
value: tx_value,
hash: transaction.tx.hash
}
})
}
const getDisplayableAmount = (rawAmount) => {