mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-24 21:55:52 +00:00
Restructured Step 2 - 7 to "code along" style
This commit is contained in:
@@ -47,6 +47,14 @@ const main = async () => {
|
||||
appWindow.webContents.send('update-ledger-data', ledger)
|
||||
})
|
||||
|
||||
// Initial Ledger Request -> Get account details on startup
|
||||
// Reference: https://xrpl.org/ledger.html
|
||||
const ledgerResponse = await client.request({
|
||||
"command": "ledger"
|
||||
})
|
||||
const initialLedgerData = prepareLedgerData(ledgerResponse.result.closed.ledger)
|
||||
appWindow.webContents.send('update-ledger-data', initialLedgerData)
|
||||
|
||||
// Reference: https://xrpl.org/subscribe.html#transaction-streams
|
||||
client.on("transaction", async (transaction) => {
|
||||
// Reference: https://xrpl.org/account_info.html
|
||||
@@ -67,8 +75,8 @@ const main = async () => {
|
||||
"account": address,
|
||||
"ledger_index": "current"
|
||||
})
|
||||
const accountData = prepareAccountData(accountInfoResponse.result.account_data)
|
||||
appWindow.webContents.send('update-account-data', accountData)
|
||||
const initialAccountData = prepareAccountData(accountInfoResponse.result.account_data)
|
||||
appWindow.webContents.send('update-account-data', initialAccountData)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user