AMM tutorial: fix explorer links, error handling

This commit is contained in:
mDuo13
2023-09-07 17:09:54 -07:00
parent fd273dccb8
commit a0978f86f0
4 changed files with 29 additions and 14 deletions

View File

@@ -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>

View File

@@ -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>