Update with review comments

This commit is contained in:
Maria Shodunke
2025-07-17 12:33:48 +01:00
parent d564619d7e
commit 1cc8a4b3c0
12 changed files with 29 additions and 104 deletions

View File

@@ -308,7 +308,7 @@ If the transaction fails with the result `tecNO_ALTERNATIVE_KEY`, your account d
### 4. Wait for validation
{% partial file="/docs/_snippets/wait-for-validation.md" /%}
{% raw-partial file="/docs/_snippets/wait-for-validation.md" /%}
### 5. Confirm Account Flags

View File

@@ -160,7 +160,7 @@ Make sure that the [Transaction Result](../../../references/protocol/transaction
## 4. Wait for validation
{% partial file="/docs/_snippets/wait-for-validation.md" /%}
{% raw-partial file="/docs/_snippets/wait-for-validation.md" /%}
## 5. Confirm the new signer list

View File

@@ -91,7 +91,7 @@ Take note of the transaction's identifying `hash` value so you can check its fin
## 4. Wait for validation
{% partial file="/docs/_snippets/wait-for-validation.md" /%}
{% raw-partial file="/docs/_snippets/wait-for-validation.md" /%}
## 5. Confirm final result

View File

@@ -118,7 +118,7 @@ Response:
## 4. Wait for validation
{% partial file="/docs/_snippets/wait-for-validation.md" /%}
{% raw-partial file="/docs/_snippets/wait-for-validation.md" /%}
## 5. Confirm that the escrow was created
@@ -178,7 +178,7 @@ Take note of the transaction's identifying `hash` value so you can check its fin
## 7. Wait for validation
{% partial file="/docs/_snippets/wait-for-validation.md" /%}
{% raw-partial file="/docs/_snippets/wait-for-validation.md" /%}
## 8. Confirm final result

View File

@@ -58,54 +58,11 @@ Response:
{% /tab %}
{% tab label="Javascript" %}
```js
// Prepare EscrowCreate transaction ------------------------------------
const escrowCreateTransaction = {
"TransactionType": "EscrowCreate",
"Account": wallet.address,
"Destination": wallet.address,
"Amount": "6000000", //drops XRP
"DestinationTag": 2023,
"Fee": "12",
"FinishAfter": xrpl.isoTimeToRippleTime(finishAfter.toISOString()),
};
xrpl.validate(escrowCreateTransaction);
// Sign and submit the transaction ----------------------------------------
console.log('Signing and submitting the transaction:',
JSON.stringify(escrowCreateTransaction, null, "\t"), "\n"
);
const response = await client.submitAndWait(escrowCreateTransaction, { wallet });
console.log(`Sequence number: ${response.result.tx_json.Sequence}`);
console.log(`Finished submitting! ${JSON.stringify(response.result, null, "\t")}`);
```
{% code-snippet file="/_code-samples/escrow/js/create-escrow.js" language="js" from="// Prepare EscrowCreate" before="await client.disconnect" /%}
{% /tab %}
{% tab label="Python" %}
```python
# Build escrow create transaction
create_txn = EscrowCreate(
account=sender_wallet.address,
amount=xrp_to_drops(10.000),
destination=receiver_addr,
finish_after=claim_date
)
# Autofill, sign, then submit transaction and wait for result
stxn_response = submit_and_wait(create_txn, client, sender_wallet)
# Return result of transaction
stxn_result = stxn_response.result
# Parse result and print out the neccesary info
print(stxn_result["tx_json"]["Account"])
print(stxn_result["tx_json"]["Sequence"])
print(stxn_result["meta"]["TransactionResult"])
print(stxn_result["hash"])
```
{% code-snippet file="/_code-samples/escrow/py/create_escrow.py" language="py" from="# Build escrow create" /%}
{% /tab %}
{% /tabs %}
@@ -114,7 +71,7 @@ Take note of the transaction's identifying `hash` value so you can check its fin
## 3. Wait for validation
{% partial file="/docs/_snippets/wait-for-validation.md" /%}
{% raw-partial file="/docs/_snippets/wait-for-validation.md" /%}
## 4. Confirm that the escrow was created
@@ -191,44 +148,11 @@ Response:
{% /tab %}
{% tab label="Javascript" %}
```js
// Prepare EscrowFinish transaction ---------------------------------
const escrowFinishTransaction = {
"Account": wallet.address,
"TransactionType": "EscrowFinish",
"Owner": wallet.address,
// This should equal the sequence number of the escrow transaction
"OfferSequence": offerSequence,
};
xrpl.validate(escrowFinishTransaction);
// Sign and submit the transaction ----------------------------------------
console.log('Signing and submitting the transaction:', JSON.stringify(escrowFinishTransaction, null, "\t"));
const response = await client.submitAndWait(escrowFinishTransaction, { wallet });
console.log(`Finished submitting! ${JSON.stringify(response.result, null, "\t")}`);
```
{% code-snippet file="/_code-samples/escrow/js/finish-escrow.js" language="js" from="// Prepare EscrowFinish" before="await client.disconnect" /%}
{% /tab %}
{% tab label="Python" %}
```python
# Build escrow finish transaction
finish_txn = EscrowFinish(
account=sender_wallet.address,
owner=escrow_creator,
offer_sequence=escrow_sequence, # The sequence number of the escrow transaction
)
# Autofill, sign, then submit transaction and wait for result
stxn_response = submit_and_wait(finish_txn, client, sender_wallet)
# Parse response and return result
stxn_result = stxn_response.result
# Parse result and print out the transaction result and transaction hash
print(stxn_result["meta"]["TransactionResult"])
print(stxn_result["hash"])
```
{% code-snippet file="/_code-samples/escrow/py/finish_escrow.py" language="py" from="# Build escrow finish" /%}
{% /tab %}
{% /tabs %}
@@ -237,7 +161,7 @@ Take note of the transaction's identifying `hash` value so you can check its fin
## 7. Wait for validation
{% partial file="/docs/_snippets/wait-for-validation.md" /%}
{% raw-partial file="/docs/_snippets/wait-for-validation.md" /%}
## 8. Confirm final result