Revise payment tutorials, add/remove screenshots

This commit is contained in:
Dennis Dawson
2025-04-24 10:49:20 -07:00
parent d89f9fb2f0
commit 5bb552db12
108 changed files with 4940 additions and 3707 deletions

View File

@@ -0,0 +1,28 @@
// *******************************************************
// ******************** Send XRP *************************
// *******************************************************
async function sendXRP() {
const net = getNet()
const client = new xrpl.Client(net)
await client.connect()
let results = "\nConnected. Sending XRP.\n"
resultField.value = results
const wallet = xrpl.Wallet.fromSeed(accountSeedField.value)
const sendAmount = amountField.value
// -------------------------------------------------------- Prepare transaction
const prepared_tx = await client.autofill({
"TransactionType": "Payment",
"Account": wallet.address,
"Amount": xrpl.xrpToDrops(sendAmount),
"Destination": destinationField.value
})
// ------------------------------------------------- Sign prepared instructions
const signed = wallet.sign(prepared_tx)
// -------------------------------------------------------- Submit signed blob
const tx = await client.submitAndWait(signed.tx_blob)
results = "\nBalance changes: " +
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
resultField.value = results
xrpBalanceField.value = (await client.getXrpBalance(wallet.address))
client.disconnect()
} // End of sendXRP()