mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-26 22:55:49 +00:00
xrpl.js 2.0: address feedback, fix many TODOs
This commit is contained in:
@@ -21,7 +21,7 @@ This tutorial walks you through the basics of building a very simple XRP Ledger-
|
||||
|
||||
This tutorial is intended for beginners and should take no longer than 30 minutes to complete.
|
||||
|
||||
## Learning goals
|
||||
## Learning Goals
|
||||
|
||||
In this tutorial, you'll learn:
|
||||
|
||||
@@ -73,7 +73,7 @@ To install with Maven, add the following to your project's `pom.xml` file and th
|
||||
|
||||
Check out the [xrpl4j sample project](https://github.com/XRPLF/xrpl4j-sample) for a full Maven project containing the code from this tutorial.
|
||||
|
||||
## Start building
|
||||
## Start Building
|
||||
{% set n = cycler(* range(1,99)) %}
|
||||
|
||||
When you're working with the XRP Ledger, there are a few things you'll need to manage, whether you're adding XRP into your [wallet](wallets.html), integrating with the [decentralized exchange](decentralized-exchange.html), or [issuing tokens](issued-currencies.html). This tutorial walks you through basic patterns common to getting started with all of these use cases and provides sample code for implementing them.
|
||||
|
||||
@@ -17,7 +17,7 @@ This tutorial guides you through the basics of building an XRP Ledger-connected
|
||||
The scripts and config files used in this guide are [available in this website's GitHub Repository]({{target.github_forkurl}}/tree/{{target.github_branch}}/content/_code-samples/get-started/js/).
|
||||
|
||||
|
||||
## Learning goals
|
||||
## Learning Goals
|
||||
|
||||
In this tutorial, you'll learn:
|
||||
|
||||
@@ -42,13 +42,13 @@ npm install xrpl
|
||||
```
|
||||
|
||||
|
||||
## Start building
|
||||
## Start Building
|
||||
|
||||
When you're working with the XRP Ledger, there are a few things you'll need to manage, whether you're adding XRP into your [wallet](wallets.html), integrating with the [decentralized exchange](decentralized-exchange.html), or [issuing tokens](issued-currencies.html). This tutorial walks you through basic patterns common to getting started with all of these use cases and provides sample code for implementing them.
|
||||
|
||||
Here are some steps you use in many XRP Ledger projects:
|
||||
|
||||
1. [Import the library](#1-import-the-library)
|
||||
1. [Import the library.](#1-import-the-library)
|
||||
1. [Connect to the XRP Ledger.](#2-connect-to-the-xrp-ledger)
|
||||
1. [Generate a wallet.](#3-generate-wallet)
|
||||
1. [Query the XRP Ledger.](#4-query-the-xrp-ledger)
|
||||
@@ -95,9 +95,9 @@ To make queries and submit transactions, you need to establish a connection to t
|
||||
|
||||
{{ include_code("_code-samples/get-started/js/base.js", language="js") }}
|
||||
|
||||
#### Connect to the production XRP Ledger
|
||||
#### Connect to the XRP Ledger Mainnet
|
||||
|
||||
The sample code in the previous section shows you how to connect to the Testnet, which is one of the available [parallel networks](parallel-networks.html). When you're ready to integrate with the production XRP Ledger, you'll need to connect to the Mainnet. You can do that in two ways:
|
||||
The sample code in the previous section shows you how to connect to the Testnet, which is one of the available [parallel networks](parallel-networks.html). When you're ready to move to production, you'll need to connect to the XRP Ledger Mainnet. You can do that in two ways:
|
||||
|
||||
* By [installing the core server](install-rippled.html) (`rippled`) and running a node yourself. The core server connects to the Mainnet by default, but you can [change the configuration to use Testnet or Devnet](connect-your-rippled-to-the-xrp-test-net.html). [There are good reasons to run your own core server](the-rippled-server.html#reasons-to-run-your-own-server). If you run your own server, you can connect to it like so:
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ This tutorial walks you through the basics of building a very simple XRP Ledger-
|
||||
|
||||
This tutorial is intended for beginners and should take no longer than 30 minutes to complete.
|
||||
|
||||
## Learning goals
|
||||
## Learning Goals
|
||||
|
||||
In this tutorial, you'll learn:
|
||||
|
||||
@@ -42,7 +42,7 @@ The [`xrpl-py` library](https://github.com/XRPLF/xrpl-py) is available on [PyPI]
|
||||
pip3 install xrpl-py
|
||||
```
|
||||
|
||||
## Start building
|
||||
## Start Building
|
||||
{% set n = cycler(* range(1,99)) %}
|
||||
|
||||
When you're working with the XRP Ledger, there are a few things you'll need to manage, whether you're adding XRP into your [wallet](wallets.html), integrating with the [decentralized exchange](decentralized-exchange.html), or [issuing tokens](issued-currencies.html). This tutorial walks you through basic patterns common to getting started with all of these use cases and provides sample code for implementing them.
|
||||
|
||||
@@ -27,12 +27,12 @@ async function main() {
|
||||
|
||||
let response = await api.request({
|
||||
"command": "ledger",
|
||||
"ledger_index": "validated"
|
||||
"ledger_index": "validated",
|
||||
"transactions": true
|
||||
});
|
||||
console.log(response);
|
||||
}
|
||||
main()
|
||||
main();
|
||||
```
|
||||
|
||||
```js
|
||||
@@ -42,12 +42,12 @@ async function main() {
|
||||
|
||||
let response = await api.request({
|
||||
"command": "ledger",
|
||||
"ledger_index": "validated"
|
||||
"ledger_index": "validated",
|
||||
"transactions": true
|
||||
});
|
||||
console.log(response);
|
||||
}
|
||||
main()
|
||||
main();
|
||||
```
|
||||
|
||||
```js
|
||||
@@ -68,7 +68,7 @@ async function main() {
|
||||
});
|
||||
console.log(response2);
|
||||
}
|
||||
main()
|
||||
main();
|
||||
```
|
||||
|
||||
```js
|
||||
@@ -78,12 +78,12 @@ async function main() {
|
||||
|
||||
let response = await api.request({
|
||||
"command": "ledger",
|
||||
"ledger_index": "validated"
|
||||
"ledger_index": "validated",
|
||||
"transactions": true
|
||||
});
|
||||
console.log('Total XRP: '+xrpl.dropsToXrp(response.result.ledger.total_coins));
|
||||
}
|
||||
main()
|
||||
main();
|
||||
```
|
||||
|
||||
<!-- JS_EDITOR_END -->
|
||||
|
||||
@@ -36,7 +36,7 @@ If a power or network outage occurs, applications face more challenges finding t
|
||||
|
||||
### Transaction Timeline
|
||||
|
||||
When you submit a transaction to the XRP Ledger, regardless of whether used [HTTP API](rippled-api.html), a [client library](client-libraries.html), or some other app, process of applying the transaction to the ledger is the same. That process goes like this:
|
||||
When you submit a transaction to the XRP Ledger, regardless of whether you used [HTTP API](rippled-api.html), a [client library](client-libraries.html), or some other app, process of applying the transaction to the ledger is the same. That process goes like this:
|
||||
|
||||
1. An account owner creates and signs a transaction.
|
||||
2. The owner submits the transaction to the network as a candidate transaction.
|
||||
|
||||
@@ -167,7 +167,7 @@ Example Response:
|
||||
|
||||
### {{n.next()}}. (Optional) Send TrustSet Transaction to End the Freeze
|
||||
|
||||
If you decide that the trust line no longer needs to be frozen (for example, you investigated and decided that the suspicious activity was benign), you can end the individual freeze in much the same way that you froze the trust line in the first place. To end an individual freeze, send a [TrustSet transaction][] with the [`tfClearFreeze` flag enabled](trustset.html#trustset-flags). The other fields of the transaction should be the same as when you froze the trust line:
|
||||
If you decide that the trust line no longer needs to be frozen (for example, you investigated and decided that the suspicious activity was benign), you can end the individual freeze in almost the same way that you froze the trust line in the first place. To end an individual freeze, send a [TrustSet transaction][] with the [`tfClearFreeze` flag enabled](trustset.html#trustset-flags). The other fields of the transaction should be the same as when you froze the trust line:
|
||||
|
||||
| Field | Value | Description |
|
||||
|--------------------------|--------|-------------|
|
||||
|
||||
Reference in New Issue
Block a user