diff --git a/assets/js/tutorials/issue-a-token.js b/assets/js/tutorials/issue-a-token.js new file mode 100644 index 0000000000..94f5c40c86 --- /dev/null +++ b/assets/js/tutorials/issue-a-token.js @@ -0,0 +1,70 @@ +// Variant setup for generate creds button from interactive-tutorial.js. +// This version generates two sets of creds, one for the issuer and one for +// the hot wallet / receiver + +const EXAMPLE_COLD_ADDR = "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe" +const EXAMPLE_COLD_SECRET = "sIss█████████████████████████" +function setup_2x_generate_step() { + + $("#generate-2x-creds-button").click( async (event) => { + const block = $(event.target).closest(".interactive-block") + block.find(".output-area").html("") + block.find(".loader").show() + // Get faucet URL (Testnet/Devnet/etc.) + const faucet_url = $("#generate-2x-creds-button").data("fauceturl") + + try { + const data = await call_faucet(faucet_url) + const data2 = await call_faucet(faucet_url) + + block.find(".loader").hide() + block.find(".output-area").html(`
${tl("Populated this page's examples with these credentials.")}
`) + + complete_step("Generate") + + } catch(err) { + block.find(".loader").hide() + block.find(".output-area").html( + `${tl("Error:")} + ${tl("There was an error connecting to the Faucet. Please try again.")} +
`) + return + } + }) +} + + + +$(document).ready(() => { + setup_2x_generate_step() +}) diff --git a/content/tutorials/manage-account-settings/require-destination-tags.md b/content/tutorials/manage-account-settings/require-destination-tags.md index 09ebcfccfd..67f2a9cbfb 100644 --- a/content/tutorials/manage-account-settings/require-destination-tags.md +++ b/content/tutorials/manage-account-settings/require-destination-tags.md @@ -42,7 +42,7 @@ When you're [building actual production-ready software](production-readiness.htm You must be connected to the network to submit transactions to it. -The following code uses a [ripple-lib for JavaScript](rippleapi-reference.html) instance to connect to a public XRP Testnet server: +The following code uses a [ripple-lib for JavaScript](rippleapi-reference.html) instance to connect to a public XRP Ledger Testnet server: ```js ripple = require('ripple-lib') // Node.js only. Use a + + +## Steps +{% set n = cycler(* range(1,99)) %} +### {{n.next()}}. Get Credentials + +To transact on the XRP Ledger, you need an address and secret key, and some XRP. For development purposes, you can get these using the following interface: + + +{% if use_network is undefined or use_network == "Testnet" %} + {% set use_network = "Testnet" %} + {% set faucet_url = "https://faucet.altnet.rippletest.net/accounts" %} +{% elif use_network == "Devnet" %} + {% set faucet_url = "https://faucet.devnet.rippletest.net/accounts" %} +{# No faucet for Mainnet! #} +{% endif %} +{{ start_step("Generate") }} + +
Generating Keys...