diff --git a/content/_code-samples/issue-a-token/js/README.md b/content/_code-samples/issue-a-token/js/README.md index fc03c7529a..8c151a9bc1 100644 --- a/content/_code-samples/issue-a-token/js/README.md +++ b/content/_code-samples/issue-a-token/js/README.md @@ -2,6 +2,6 @@ This code demonstrates how to issue a (fungible) token on the XRP Ledger. For a detailed explanation, see . -The code is designed to run in-browser by loading `demo.html` and watching the console output. To run it in Node.js, you must uncomment three `require()` lines towards the top of `issue-a-token.js` and use your preferred package manager (such as `yarn` or `npm`) to install the dependencies. +The code is designed to run in-browser by loading `demo.html` and watching the console output or in Node.js. For Node.js, you must first install the dependencies using your preferred package manager (such as `yarn` or `npm`). In both cases you also need [the `submit-and-verify.js` code from another folder of this repository](../submit-and-verify/). It should already be in the right place if you cloned or download an archive of the repo. diff --git a/content/_code-samples/issue-a-token/js/demo.html b/content/_code-samples/issue-a-token/js/demo.html index 0f7a15174b..35ac0f1236 100644 --- a/content/_code-samples/issue-a-token/js/demo.html +++ b/content/_code-samples/issue-a-token/js/demo.html @@ -3,9 +3,8 @@ Code Sample - Issue a Token - - - + + Open your browser's console (F12) to see the logs. diff --git a/content/_code-samples/issue-a-token/js/issue-a-token.js b/content/_code-samples/issue-a-token/js/issue-a-token.js index ba10fbf85b..18fc376fbc 100644 --- a/content/_code-samples/issue-a-token/js/issue-a-token.js +++ b/content/_code-samples/issue-a-token/js/issue-a-token.js @@ -1,11 +1,13 @@ // Stand-alone code sample for the "issue a token" tutorial: // https://xrpl.org/issue-a-fungible-token.html -// Uncomment these dependencies for Node.js. In browsers, use - + diff --git a/content/_code-samples/require-destination-tags/package.json b/content/_code-samples/require-destination-tags/package.json new file mode 100644 index 0000000000..33c5e9c254 --- /dev/null +++ b/content/_code-samples/require-destination-tags/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "ripple-lib": "^1.10.0" + } +} diff --git a/content/_code-samples/require-destination-tags/require-destination-tags.js b/content/_code-samples/require-destination-tags/require-destination-tags.js index 0d28035bdd..c3af0b6226 100644 --- a/content/_code-samples/require-destination-tags/require-destination-tags.js +++ b/content/_code-samples/require-destination-tags/require-destination-tags.js @@ -1,24 +1,20 @@ +// Stand-alone code sample for the "Require Destination Tags" tutorial: +// https://xrpl.org/require-destination-tags.html + +// Dependencies for Node.js. +// In browsers, use - + diff --git a/content/_code-samples/send-xrp/send-xrp.js b/content/_code-samples/send-xrp/send-xrp.js index 6ea8587312..8d8f0da567 100644 --- a/content/_code-samples/send-xrp/send-xrp.js +++ b/content/_code-samples/send-xrp/send-xrp.js @@ -9,21 +9,7 @@ api.connect() api.on('connected', async () => { // Get credentials from the Testnet Faucet ----------------------------------- - // This doesn't technically need to happen after you call api.connect() but - // it's convenient to do here because we can use await on the faucet call and - // to wait for the new account to be funded. - const faucet_url = "https://faucet.altnet.rippletest.net/accounts" - const response = await fetch(faucet_url, { - method: 'POST', - headers: { - "Content-Type": "application/json" - }, - body: '{}' - }) - if (!response.ok) { - throw `Faucet returned an error: ${data.error}` - } - const data = await response.json() + const data = await api.generateFaucetWallet() address = data.account.address secret = data.account.secret diff --git a/content/tutorials/get-started/get-started-using-node-js.md b/content/tutorials/get-started/get-started-using-node-js.md index 55ffcec184..5642a5af8c 100644 --- a/content/tutorials/get-started/get-started-using-node-js.md +++ b/content/tutorials/get-started/get-started-using-node-js.md @@ -256,22 +256,20 @@ See [Reliable Transaction Submission](reliable-transaction-submission.html) for # RippleAPI in Web Browsers -RippleAPI can also be used in a web browser. To access it, load [Lodash](https://lodash.com/) and [RippleAPI for JavaScript (ripple-lib)](rippleapi-reference.html) in your site's HTML. For example: +RippleAPI can also be used in a web browser. To access it, load [RippleAPI for JavaScript (ripple-lib)](rippleapi-reference.html) in your site's HTML. For example: _unpkg_ ```html - - + ``` _jsDelivr_ ```html - - + ``` diff --git a/content/tutorials/get-started/get-started.md b/content/tutorials/get-started/get-started.md index 7830e53f4f..926be1f106 100644 --- a/content/tutorials/get-started/get-started.md +++ b/content/tutorials/get-started/get-started.md @@ -16,7 +16,6 @@ The following example gets the latest [ledger version](ledgers.html) and a list **Tip:** If you can, open your browser's Developer Tools by pressing **F12**. The "Console" tab provides a native JavaScript console and can give insight into what code is running on any webpage. -{{currentpage.lodash_tag}} {{currentpage.ripple_lib_tag}} @@ -101,14 +100,12 @@ Try editing the code above to do something different: ## Setup Steps -This page has the necessary prerequisites already loaded, but you can access the XRP Ledger from **any webpage** if you load [Lodash](https://lodash.com/) and [RippleAPI for JavaScript (ripple-lib)](rippleapi-reference.html) in that page's HTML. For example: +This page has the necessary prerequisites already loaded, but you can access the XRP Ledger from **any webpage** if you load [RippleAPI for JavaScript (ripple-lib)](rippleapi-reference.html) in that page's HTML. For example: ```html - - + ``` - ## Further Reading diff --git a/content/tutorials/get-started/monitor-incoming-payments-with-websocket.ja.md b/content/tutorials/get-started/monitor-incoming-payments-with-websocket.ja.md index 68c9382ed4..3f56285743 100644 --- a/content/tutorials/get-started/monitor-incoming-payments-with-websocket.ja.md +++ b/content/tutorials/get-started/monitor-incoming-payments-with-websocket.ja.md @@ -76,7 +76,7 @@ const socket = new WebSocket('ws://localhost:6006') δΎ‹: {{ start_step("Connect") }} - + Connection status: Not connected
Console:
@@ -85,7 +85,7 @@ const socket = new WebSocket('ws://localhost:6006') ' ripple_lib_tag: '' targets: diff --git a/template/base.html.jinja b/template/base.html.jinja index 7b7d02bad6..459e23ff6e 100644 --- a/template/base.html.jinja +++ b/template/base.html.jinja @@ -156,7 +156,6 @@ $(document).ready(() => { {% if currentpage.embed_ripple_lib %} -{{currentpage.lodash_tag}} {{currentpage.ripple_lib_tag}} {% endif %} diff --git a/template/page-rpc-tool.html.jinja b/template/page-rpc-tool.html.jinja index 9e748f0bce..55b6592537 100644 --- a/template/page-rpc-tool.html.jinja +++ b/template/page-rpc-tool.html.jinja @@ -99,7 +99,6 @@ {% endblock %} {% block endbody %} - {{currentpage.lodash_tag}} {{currentpage.ripple_lib_tag}}