Apply suggestions from code review

Co-authored-by: Maria Shodunke <maria-robobug@users.noreply.github.com>
Co-authored-by: oeggert <117319296+oeggert@users.noreply.github.com>
This commit is contained in:
Carles
2025-08-25 10:58:26 +02:00
committed by GitHub
parent e1153eb008
commit 22d67e640d
12 changed files with 69 additions and 95 deletions

View File

@@ -28,7 +28,7 @@ To interact with the XRP Ledger, you need to set up a dev environment with the n
- **Python** with the [`xrpl-py` library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](../python/build-apps/get-started.md) for setup steps.
- **Java** with the [xrpl4j library](https://github.com/XRPLF/xrpl4j). See [Get Started Using Java](../java/build-apps/get-started.md) for setup steps.
- **PHP** with the [XRPL_PHP library](https://github.com/AlexanderBuzz/xrpl-php). See [Get Started Using PHP](../php/build-apps/get-started.md) for setup steps.
- **GoLang** with the [xrpl-go library](https://github.com/Peersyst/xrpl-go). See [Get Started Using GoLang](../go/build-apps/get-started.md) for setup steps.
- **Go** with the [xrpl-go library](https://github.com/Peersyst/xrpl-go). See [Get Started Using Go](../go/build-apps/get-started.md) for setup steps.
## Send a Payment on the Test Net
@@ -54,7 +54,7 @@ To transact on the XRP Ledger, you need an address and secret key, and some XRP.
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Example credentials" before="// Create" language="php" /%}
{% /tab %}
{% tab label="GoLang" %}
{% tab label="Go" %}
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="// Example credentials" before="// Funding" language="go" /%}
{% /tab %}
@@ -91,7 +91,7 @@ The following code connects to a public Testnet servers:
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Create a client" before="// Transaction definition" language="php" /%}
{% /tab %}
{% tab label="GoLang" %}
{% tab label="Go" %}
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="func main()" before="if !client.IsConnected() " language="go" /%}
{% /tab %}
@@ -150,7 +150,7 @@ Here's an example of preparing the above payment:
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Transaction definition" before="// Sign" language="php" /%}
{% /tab %}
{% tab label="GoLang" %}
{% tab label="Go" %}
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="// Prepare " before="// Sign" language="go" /%}
{% /tab %}
@@ -184,7 +184,7 @@ Signing a transaction uses your credentials to authorize the transaction on your
- **Python:** Use the [`xrpl.transaction.safe_sign_transaction()` method](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.transaction.html#xrpl.transaction.safe_sign_transaction) with a model and `Wallet` object.
- **Java:** Use a [`SignatureService`](https://javadoc.io/doc/org.xrpl/xrpl4j-crypto-core/latest/org/xrpl/xrpl4j/crypto/signing/SignatureService.html) instance to sign the transaction. For this tutorial, use the [`SingleKeySignatureService`](https://javadoc.io/doc/org.xrpl/xrpl4j-crypto-bouncycastle/latest/org/xrpl/xrpl4j/crypto/signing/SingleKeySignatureService.html).
- **PHP:** Use a [`sign()` method of a `Wallet` instance](https://alexanderbuzz.github.io/xrpl-php-docs/wallet.html#signing-a-transaction) instance to sign the transaction. The input to this step is a completed array of transaction instructions.
- **GoLang:** Use the [`Sign()` method of the `Wallet` package](https://pkg.go.dev/github.com/Peersyst/xrpl-go@v0.1.12/xrpl/wallet) to sign the transaction.
- **Go:** Use the [`Sign()` method of the `Wallet` package](https://pkg.go.dev/github.com/Peersyst/xrpl-go@v0.1.12/xrpl/wallet) to sign the transaction.
{% tabs %}
@@ -204,7 +204,7 @@ Signing a transaction uses your credentials to authorize the transaction on your
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Sign" before="// Submit" language="php" /%}
{% /tab %}
{% tab label="GoLang" %}
{% tab label="Go" %}
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="// Sign" before="// Submit" language="go" /%}
{% /tab %}
@@ -235,7 +235,7 @@ Now that you have a signed transaction, you can submit it to an XRP Ledger serve
- **Python:** Use the [`xrpl.transaction.submit_and_wait()` method](https://xrpl-py.readthedocs.io/en/stable/source/xrpl.transaction.html#xrpl.transaction.submit_and_wait) to submit a transaction to the network and wait for a response.
- **Java:** Use the [`XrplClient.submit(SignedTransaction)` method](https://javadoc.io/doc/org.xrpl/xrpl4j-client/latest/org/xrpl/xrpl4j/client/XrplClient.html#submit(org.xrpl.xrpl4j.crypto.signing.SignedTransaction)) to submit a transaction to the network. Use the [`XrplClient.ledger()`](https://javadoc.io/doc/org.xrpl/xrpl4j-client/latest/org/xrpl/xrpl4j/client/XrplClient.html#ledger(org.xrpl.xrpl4j.model.client.ledger.LedgerRequestParams)) method to get the latest validated ledger index.
- **PHP:** Use the [`submitAndWait()` method of the Client](https://alexanderbuzz.github.io/xrpl-php-docs/client.html) to submit a transaction to the network and wait for the response.
- **GoLang:** Use [`SubmitTxAndWait()` or `SubmitTxBlobAndWait()` methods os the Client](https://pkg.go.dev/github.com/Peersyst/xrpl-go@v0.1.12/xrpl/websocket#Client.SubmitTxAndWait) to submit a transaction to the network and wait for the response.
- **Go:** Use [`SubmitTxAndWait()` or `SubmitTxBlobAndWait()` methods os the Client](https://pkg.go.dev/github.com/Peersyst/xrpl-go@v0.1.12/xrpl/websocket#Client.SubmitTxAndWait) to submit a transaction to the network and wait for the response.
{% tabs %}
@@ -255,7 +255,7 @@ Now that you have a signed transaction, you can submit it to an XRP Ledger serve
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Submit" before="// Wait" language="php" /%}
{% /tab %}
{% tab label="GoLang" %}
{% tab label="Go" %}
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="// Submit" before="// Wait" language="go" /%}
{% /tab %}
@@ -296,7 +296,7 @@ Most transactions are accepted into the next ledger version after they're submit
- **PHP:** If you used the [`.submitAndWait()` method](https://alexanderbuzz.github.io/xrpl-php-docs/client.html), you can wait until the returned Promise resolves. Other, more asynchronous approaches are also possible.
- **GoLang:** If you used the `SubmitTxAndWait()` or `SubmitTxBlobAndWait()` methods, the client will handle submission and wait until the transaction is confirmed in a ledger. Internally, these methods use a polling mechanism, querying the transaction status with the client's `Request()` method and a `TxRequest`.
- **Go:** If you used the `SubmitTxAndWait()` or `SubmitTxBlobAndWait()` methods, the client will handle submission and wait until the transaction is confirmed in a ledger. Internally, these methods use a polling mechanism, querying the transaction status with the client's `Request()` method and a `TxRequest`.
{% tabs %}
@@ -316,7 +316,7 @@ Most transactions are accepted into the next ledger version after they're submit
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Wait" before="// Check" language="php" /%}
{% /tab %}
{% tab label="GoLang" %}
{% tab label="Go" %}
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="// Wait" before="// Check" language="go" /%}
{% /tab %}
@@ -339,7 +339,7 @@ To know for sure what a transaction did, you must look up the outcome of the tra
- **PHP:** Use the response from `submitAndWait()` or call the `tx method` using [`$client->syncRequest()`](https://alexanderbuzz.github.io/xrpl-php-docs/client.html).
- **GoLang:** Use the response from `SubmitTxAndWait()` or `SubmitTxBlobAndWait()`, or manually query the transaction status using a `TxRequest` with the client's `Request()` method.
- **Go:** Use the response from `SubmitTxAndWait()` or `SubmitTxBlobAndWait()`, or manually query the transaction status using a `TxRequest` with the client's `Request()` method.
{% tabs %}
@@ -359,7 +359,7 @@ To know for sure what a transaction did, you must look up the outcome of the tra
{% code-snippet file="/_code-samples/send-xrp/php/send-xrp.php" from="// Check" language="php" /%}
{% /tab %}
{% tab label="GoLang" %}
{% tab label="Go" %}
{% code-snippet file="/_code-samples/send-xrp/go/ws/main.go" from="// Check" language="go" /%}
{% /tab %}
@@ -426,12 +426,12 @@ print_r("Seed: " . $wallet->getSeed()); // Example: sp6JS7f14BuwFY8Mw6bTtLKWauoU
```
{% /tab %}
{% tab label="GoLang" %}
{% tab label="Go" %}
```go
wallet, err := wallet.New(crypto.ED25519())
fmt.Println("🌐 Classic Address:", wallet.ClassicAddress) // Example: r9ESeQQswbTxV8neiDTLTHXbXfUwiihyJk
fmt.Println("🌐 Seed:", wallet.Seed) // Example: sEd7XGFGSWteam777HQHvw7vHypEWy2
fmt.Println("Classic Address:", wallet.ClassicAddress) // Example: r9ESeQQswbTxV8neiDTLTHXbXfUwiihyJk
fmt.Println("Seed:", wallet.Seed) // Example: sEd7XGFGSWteam777HQHvw7vHypEWy2
```
{% /tab %}
@@ -478,7 +478,7 @@ $client = new JsonRpcClient("https://xrplcluster.com");
```
{% /tab %}
{% tab label="GoLang" %}
{% tab label="Go" %}
```go
client := websocket.NewClient(
@@ -528,7 +528,7 @@ $client = new JsonRpcClient("http://localhost:5005");
```
{% /tab %}
{% tab label="GoLang" %}
{% tab label="Go" %}
```go
client := websocket.NewClient(