get rid of preparing payment from getting started

This commit is contained in:
nkramer44
2021-05-04 13:19:38 -04:00
parent 5d4400f543
commit b1cbdeb331
2 changed files with 6 additions and 44 deletions

View File

@@ -39,8 +39,7 @@ The [`xrpl4j` library](https://github.com/XRPLF/xrpl4j) is available on [Maven C
In this tutorial, you will need the [xrpl4j-client](https://javadoc.io/doc/org.xrpl/xrpl4j-client/latest/index.html),
[xrpl4j-address-codec](https://javadoc.io/doc/org.xrpl/xrpl4j-address-codec/latest/index.html),
[xrpl4j-keypairs](https://javadoc.io/doc/org.xrpl/xrpl4j-keypairs/latest/index.html),
[xrpl4j-crypto-bouncycastle](https://javadoc.io/doc/org.xrpl/xrpl4j-crypto-bouncycastle/latest/index.html), and
[xrpl4j-keypairs](https://javadoc.io/doc/org.xrpl/xrpl4j-keypairs/latest/index.html), and
[xrpl4j-model](https://javadoc.io/doc/org.xrpl/xrpl4j-model/latest/index.html) modules.
Install with Maven:
@@ -61,11 +60,6 @@ Install with Maven:
<artifactId>xrpl4j-keypairs</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.xrpl</groupId>
<artifactId>xrpl4j-crypto-bouncycastle</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.xrpl</groupId>
<artifactId>xrpl4j-model</artifactId>
@@ -145,43 +139,6 @@ In order to fund the account on the XRP Ledger, you can use a `FaucetClient` con
{{ include_code("_code-samples/xrpl4j/GetAccountInfo.java", start_with="// Fund the account using the testnet Faucet", end_before="// Look up your Account Info", language="java") }}
#### Using the wallet
In this tutorial we only query details about the generated account from the XRP Ledger, but you can use the values in the `Wallet` instance to prepare, sign, and submit transactions with `xrpl4j`.
##### Prepare
To prepare the transaction, first you'll need your account sequence:
{{ include_code("_code-samples/xrpl4j/SendPayment.java", start_with="// Look up your Account Info", end_before="// Request current fee information from rippled", language="java") }}
Next, you'll need up-to-date network fee information:
{{ include_code("_code-samples/xrpl4j/SendPayment.java", start_with="// Request current fee information from rippled", end_before="// Construct a Payment", language="java") }}
Finally, construct a `Payment` with that information:
{{ include_code("_code-samples/xrpl4j/SendPayment.java", start_with="// Construct a Payment", end_before="// Print the Payment", language="java") }}
##### Sign
To sign the transaction, you'll need an instance of [`SignatureService`](https://javadoc.io/doc/org.xrpl/xrpl4j-crypto-core/latest/org/xrpl/xrpl4j/crypto/signing/SignatureService.html).
In this case, you can construct a [`SingleKeySignatureService`](https://javadoc.io/doc/org.xrpl/xrpl4j-crypto-bouncycastle/latest/org/xrpl/xrpl4j/crypto/signing/SingleKeySignatureService.html)
using the private key from `testWallet`:
{{ include_code("_code-samples/xrpl4j/SendPayment.java", start_with="// Construct a SignatureService to sign the Payment", end_before="// Sign the Payment", language="java") }}
Then, sign the `Payment` using the `SignatureService`:
{{ include_code("_code-samples/xrpl4j/SendPayment.java", start_with="// Sign the Payment", end_before="// Print the signed transaction", language="java") }}
##### Submit
To submit the transaction:
{{ include_code("_code-samples/xrpl4j/SendPayment.java", start_with="// Submit the Payment", end_before="// Print the response", language="java") }}
### {{n.next()}}. Query the XRP Ledger
You can query the XRP Ledger to get information about [a specific account](account-methods.html), [a specific transaction](tx.html), the state of a [current or a historical ledger](ledger-methods.html), and [the XRP Ledger's decentralized exhange](path-and-order-book-methods.html). You need to make these queries, among other reasons, to look up account info to follow best practices for [reliable transaction submission](reliable-transaction-submission.html).

View File

@@ -26,6 +26,7 @@ To interact with the XRP Ledger, you need to set up a dev environment with the n
- **JavaScript** with the [ripple-lib (RippleAPI) library](https://github.com/ripple/ripple-lib/). See the [RippleAPI Beginners Guide](get-started-with-rippleapi-for-javascript.html) for detailed instructions on getting started.
- **Python** with the [xrpl-py library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](get-started-using-python.html) for setup steps.
- **Java** with the [xrpl4j library](https://github.com/XRPLF/xrpl4j). See [Get Started Using Java](get-started-using-java.html) for setup steps.
## Send a Payment on the Test Net
@@ -45,6 +46,10 @@ _Python_
{{ include_code("_code-samples/send-xrp/send-xrp.py", end_before="# Connect", language="py") }}
_Java_
{{ include_code("_code-samples/send-xrp/send-xrp.py", end_before="# Connect", language="py") }}
<!-- MULTICODE_BLOCK_END -->
The secret key shown here is for example only. For development purposes, you can get your own credentials, pre-funded with XRP, on the Testnet using the following interface: