From a2119f3581ab88ab00f7c68189f7d4b1b0637424 Mon Sep 17 00:00:00 2001 From: Riku Date: Sat, 18 Feb 2023 11:50:48 +0100 Subject: [PATCH] add python prerequisites --- .../trade-in-the-decentralized-exchange.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/content/tutorials/use-tokens/trade-in-the-decentralized-exchange.md b/content/tutorials/use-tokens/trade-in-the-decentralized-exchange.md index 9e43c04b20..d5ec7ec809 100644 --- a/content/tutorials/use-tokens/trade-in-the-decentralized-exchange.md +++ b/content/tutorials/use-tokens/trade-in-the-decentralized-exchange.md @@ -14,14 +14,16 @@ This tutorial demonstrates how you can buy and sell tokens in the [decentralized ## Prerequisites +- You need a connection to the XRP Ledger network. As shown in this tutorial, you can use public servers for testing. +- You should be familiar with the Getting Started instructions for your preferred client library. This page provides examples for the following: + - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](get-started-using-javascript.html) for setup steps. + - **Python** with the [`xrpl-py` library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](get-started-using-python.html) for setup steps. + - You can also read along and use the interactive steps in your browser without any setup. + -This page provides JavaScript examples that use the [xrpl.js](https://js.xrpl.org/) library. See [Get Started Using JavaScript](get-started-using-javascript.html) for setup instructions. - -Since JavaScript works in the web browser, you can read along and use the interactive steps without any setup. - ## Example Code Complete sample code for all of the steps of this tutorial is available under the [MIT license](https://github.com/XRPLF/xrpl-dev-portal/blob/master/LICENSE). @@ -49,6 +51,10 @@ _JavaScript_ {{ include_code("_code-samples/trade-in-the-decentralized-exchange/js/base-with-bignumber.js", language="js") }} +_Python_ + +{{ include_code("_code-samples/get-started/py/base.py", language="py") }} + **Note:** The JavaScript code samples in this tutorial use the [`async`/`await` pattern](https://javascript.info/async-await). Since `await` needs to be used from within an `async` function, the remaining code samples are written to continue inside the `main()` function started here. You can also use Promise methods `.then()` and `.catch()` instead of `async`/`await` if you prefer.