mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 03:35:51 +00:00
AMM tutorial: fix explorer links, error handling
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -177,6 +177,9 @@ $(document).ready(() => {
|
||||
amm_fee_drops = $("#ammcreate-cost-drops").text()
|
||||
if (!amm_fee_drops) {return}
|
||||
|
||||
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()
|
||||
@@ -205,7 +208,8 @@ $(document).ready(() => {
|
||||
<pre><code>${pretty_print(ammcreate_result)}</code></pre>`)
|
||||
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()
|
||||
})
|
||||
|
||||
@@ -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") }}
|
||||
<button id="connect-button" class="btn btn-primary" data-wsurl="{{ws_url}}">{{use_network}}に接続する</button>
|
||||
<button id="connect-button" class="btn btn-primary" data-wsurl="{{ws_url}}" data-explorer="{{explorer_url}}">{{use_network}}に接続する</button>
|
||||
<div>
|
||||
<strong>接続ステータス:</strong>
|
||||
<span id="connection-status">接続されていません</span>
|
||||
|
||||
@@ -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") }}
|
||||
<button id="connect-button" class="btn btn-primary" data-wsurl="{{ws_url}}">Connect to {{use_network}}</button>
|
||||
<button id="connect-button" class="btn btn-primary" data-wsurl="{{ws_url}}" data-explorer="{{explorer_url}}">Connect to {{use_network}}</button>
|
||||
<div>
|
||||
<strong>Connection status:</strong>
|
||||
<span id="connection-status">Not connected</span>
|
||||
|
||||
Reference in New Issue
Block a user