Use Tickets tutorial upgrades

- Use Devnet for live examples
- Move code to a dedicated JS file instead of having it all inline
- Improve transaction submission logic
This commit is contained in:
mDuo13
2021-02-01 19:05:33 -08:00
parent fb9174f51d
commit eb0b9a66e5
4 changed files with 450 additions and 385 deletions

View File

@@ -135,7 +135,7 @@ txJSON = JSON.stringify(doPrepare())
// Wipe existing results
$("#prepare-output").html("")
const sender = $("#test-net-faucet-address").text() || "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe"
const sender = $("#use-address").text() || "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe"
const preparedTx = await api.prepareTransaction({
"TransactionType": "Payment",
"Account": sender,
@@ -195,7 +195,7 @@ The signing API also returns the transaction's ID, or identifying hash, which yo
$("#sign-output").html("")
const preparedTxJSON = $("#prepared-tx-json").text()
const secret = $("#test-net-faucet-secret").text()
const secret = $("#use-secret").text()
if (!secret) {
alert("Can't sign transaction without a real secret. Generate credentials first.")