mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 11:45:50 +00:00
JS Desktop wallet: fix other issues
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user