diff --git a/assets/js/interactive-tutorial.js b/assets/js/interactive-tutorial.js index 48dcf46d50..0d2d6ee136 100644 --- a/assets/js/interactive-tutorial.js +++ b/assets/js/interactive-tutorial.js @@ -622,6 +622,11 @@ async function do_submit(block, submit_opts, wait_step_name) { } } +async function show_log(block, msg) { + block.find(".output-area").append(msg) +} + + $(document).ready(() => { disable_followup_steps() setup_generate_step() diff --git a/assets/js/tutorials/create-amm.js b/assets/js/tutorials/create-amm.js index df13add292..7dcb6d1ada 100644 --- a/assets/js/tutorials/create-amm.js +++ b/assets/js/tutorials/create-amm.js @@ -12,13 +12,13 @@ $(document).ready(() => { const currency_code = "FOO" const issue_quantity = "1000" - + block.find(".loader").show() show_log(block, "
Funding an issuer address with the faucet...
") const issuer = (await api.fundWallet()).wallet show_log(block, `Got issuer ${issuer.address}.
`) $(".foo-issuer").text(issuer.address) // Update display in the "Create AMM" step - + // Enable issuer DefaultRipple ---------------------------------------------- const issuer_setup_tx = { "TransactionType": "AccountSet", @@ -32,7 +32,7 @@ $(document).ready(() => { } else { show_error(block, `Error sending transaction:${pretty_print(issuer_setup_result)}`)
}
-
+
// Create trust line to issuer ----------------------------------------------
const trust_tx = {
"TransactionType": "TrustSet",
@@ -50,7 +50,7 @@ $(document).ready(() => {
} else {
show_error(block, `Error sending transaction: ${pretty_print(trust_result)}`)
}
-
+
// Issue tokens -------------------------------------------------------------
const issue_tx = {
"TransactionType": "Payment",
@@ -115,7 +115,7 @@ $(document).ready(() => {
show_error(block, `Transaction failed:
${pretty_print(offer_result)}`)
}
block.find(".loader").hide()
-
+
if ($("#get-foo").data("foo-acquired") && $("#buy-tst").data("tst-acquired")) {
complete_step("Acquire tokens")
}
@@ -124,7 +124,7 @@ $(document).ready(() => {
$("#check-for-amm").click( async (event) => {
const block = $(event.target).closest(".interactive-block")
const foo_issuer_address = $("#issuer-address").text()
-
+
block.find(".output-area").html("")
block.find(".loader").show()
try {
@@ -143,8 +143,8 @@ $(document).ready(() => {
show_log(block, `${pretty_print}amm_info`)
} catch(err) {
if (err.data.error === 'actNotFound') {
- show_log(block, `✅ No AMM exists yet for the pair - FOO.${foo_issuer_address} / + show_log(block, `
✅ No AMM exists yet for the pair + FOO.${foo_issuer_address} / TST.rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd.`) complete_step("Check for AMM") } else { @@ -177,7 +177,10 @@ $(document).ready(() => { amm_fee_drops = $("#ammcreate-cost-drops").text() if (!amm_fee_drops) {return} - const asset_amount = $("#asset-amount").val() + block.find(".output-area").html("") + block.find(".loader").show() + + const asset_amount = $("#asset-amount").val() const asset2_amount = $("#asset2-amount").val() const asset2_issuer_address = $("#issuer-address").text() const trading_fee = Math.floor($("#trading-fee").val()*1000) // Convert from % @@ -205,7 +208,8 @@ $(document).ready(() => {
${pretty_print(ammcreate_result)}`)
complete_step("Create AMM")
} else {
- throw `Error sending transaction: ${ammcreate_result}`
+ console.error(ammcreate_result)
+ show_error(block, `Error sending transaction: ${ammcreate_result.result.meta.TransactionResult}`)
}
block.find(".loader").hide()
})
@@ -213,7 +217,7 @@ $(document).ready(() => {
$("#check-amm-info").click( async (event) => {
const block = $(event.target).closest(".interactive-block")
const foo_issuer_address = $("#issuer-address").text()
-
+
block.find(".output-area").html("")
block.find(".loader").show()
try {
@@ -248,7 +252,7 @@ $(document).ready(() => {
const block = $(event.target).closest(".interactive-block")
const address = get_address()
if (!address) {return}
-
+
block.find(".output-area").html("")
block.find(".loader").show()
try {
diff --git a/content/_snippets/interactive-tutorials/connect-step.ja.md b/content/_snippets/interactive-tutorials/connect-step.ja.md
index b9c2f66c79..bb1480fa61 100644
--- a/content/_snippets/interactive-tutorials/connect-step.ja.md
+++ b/content/_snippets/interactive-tutorials/connect-step.ja.md
@@ -1,14 +1,17 @@
{% if use_network is undefined or use_network == "Testnet" %}
{% set ws_url = "wss://s.altnet.rippletest.net:51233" %}
+ {% set explorer_url = "https://testnet.xrpl.org" %}
{% set use_network = "Testnet" %}
{% elif use_network == "Devnet" %}
{% set ws_url = "wss://s.devnet.rippletest.net:51233" %}
+ {% set explorer_url = "https://devnet.xrpl.org" %}
{% elif use_network == "Mainnet" %}
{% set ws_url = "wss://xrplcluster.com" %}
+ {% set explorer_url = "https://livenet.xrpl.org" %}
{% endif %}
{{ start_step("Connect") }}
-
+