TicketBatch tutorial fixes

This commit is contained in:
mDuo13
2020-12-16 13:52:42 -08:00
parent d1c20192a4
commit ed32c6737b
4 changed files with 30 additions and 23 deletions

View File

@@ -4,8 +4,6 @@ funnel: Build
doc_type: Tutorials doc_type: Tutorials
category: Manage Account Settings category: Manage Account Settings
blurb: Use Tickets to send a transaction outside of normal Sequence order. blurb: Use Tickets to send a transaction outside of normal Sequence order.
filters:
- interactive_steps
--- ---
# Use Tickets # Use Tickets
@@ -64,7 +62,7 @@ For this tutorial, you can connect directly from your browser by pressing the fo
{{ end_step() }} {{ end_step() }}
<script type="application/javascript"> <script type="application/javascript">
api = new ripple.RippleAPI({server: 'wss://localhost:'}) //TODO: change to Devnet when possible api = new ripple.RippleAPI({server: 'ws://localhost:6006'}) //TODO: change to Devnet when possible
api.on('connected', async function() { api.on('connected', async function() {
$("#connection-status").text("Connected") $("#connection-status").text("Connected")
$("#connect-button").prop("disabled", true) $("#connect-button").prop("disabled", true)
@@ -72,8 +70,8 @@ api.on('connected', async function() {
// Update breadcrumbs & active next step // Update breadcrumbs & active next step
complete_step("Connect") complete_step("Connect")
$("#interactive-prepare button").prop("disabled", false)//TODO: change ID $("#interactive-check_sequence button").prop("disabled", false)//TODO: change ID
$("#interactive-prepare button").prop("title", "") $("#interactive-check_sequence button").prop("title", "")
// TODO: remove this standalone mode "faucet" code // TODO: remove this standalone mode "faucet" code
resp = await api.request('wallet_propose') resp = await api.request('wallet_propose')
@@ -143,15 +141,15 @@ let current_sequence = get_sequence()
{{ end_step() }} {{ end_step() }}
<script type="application/javascript"> <script type="application/javascript">
$("#check-sequence-button").click( async function() { $("#check-sequence").click( async function() {
const address = $("#use-address").text() const address = $("#use-address").text()
// Wipe previous output // Wipe previous output
$("#check-sequence-output").html("") $("#check-sequence-output").html("")
const account_info = await api.request("account_info", {account: address}) const account_info = await api.request("account_info", {account: address})
$("#check-sequence").append("Current sequence: "+account_info.account_data.Sequence) $("#check-sequence-output").append("Current sequence: "+account_info.account_data.Sequence)
// TODO: populate Sequence number in next example // TODO: populate Sequence number in next example
} })
</script> </script>
@@ -184,7 +182,7 @@ Submit the signed transaction blob that you created in the previous step. For ex
```js ```js
let prelim_result = await api.submit(tx_blob) let prelim_result = await api.submit(tx_blob)
console.log("Preliminary result:", prelim_result)
``` ```
### {{n.next()}}. Wait for Validation ### {{n.next()}}. Wait for Validation
@@ -216,14 +214,14 @@ api.on('ledger', ledger => {
<script type="application/javascript"> <script type="application/javascript">
// TODO: change this to wait for a specific tx // TODO: change this to wait for a specific tx
api.on('ledger', ledger => { //api.on('ledger', ledger => {
$("#current-ledger-version").text(ledger.ledgerVersion) // $("#current-ledger-version").text(ledger.ledgerVersion)
//
if ( $(".breadcrumb-item.bc-wait").hasClass("active") ) { // if ( $(".breadcrumb-item.bc-wait").hasClass("active") ) {
complete_step("Wait") // complete_step("Wait")
//TODO // //TODO
} // }
}) //})
</script> </script>
### (Optional) Intermission ### (Optional) Intermission
@@ -259,6 +257,10 @@ let prepared_t = await api.prepareTransaction({
"MessageKey": "DEADBEEF", "MessageKey": "DEADBEEF",
"TicketSequence": use_ticket, "TicketSequence": use_ticket,
"Sequence": 0 "Sequence": 0
}, {
// Adjust instructions to allow more time before submitting the transaction
maxLedgerVersionOffset: 20
//maxLedgerVersion: null // or, let the transaction remain valid indefinitely
}) })
console.log("Prepared JSON:", prepared_t.txJSON) console.log("Prepared JSON:", prepared_t.txJSON)
@@ -269,13 +271,16 @@ let tx_blob_t = signed.signedTransaction
console.log("Signed transaction blob:", tx_blob_t) console.log("Signed transaction blob:", tx_blob_t)
``` ```
**Tip:** If you don't plan to submit the TicketCreate transaction right away, you should explicitly set the [instructions'](rippleapi-reference.html#transaction-instructions) `maxLedgerVersionOffset` to a larger number of ledgers. To create a transaction that could remain valid indefinitely, set the `maxLedgerVersion` to `null`.
### {{n.next()}}. Submit Ticketed Transaction ### {{n.next()}}. Submit Ticketed Transaction
Submit the signed transaction blob that you created in the previous step. For example: Submit the signed transaction blob that you created in the previous step. For example:
```js ```js
TODO let prelim_result_t = await api.submit(tx_blob_t)
console.log("Preliminary result:", prelim_result_t)
``` ```
### {{n.next()}}. Wait for Validation ### {{n.next()}}. Wait for Validation

View File

@@ -5,8 +5,6 @@ doc_type: Tutorials
category: Get Started category: Get Started
blurb: Test Netを使用してXRPの送金をテストします。 blurb: Test Netを使用してXRPの送金をテストします。
cta_text: XRPを送金しよう cta_text: XRPを送金しよう
filters:
- interactive_steps
--- ---
# XRPの送金 # XRPの送金

View File

@@ -5,8 +5,6 @@ doc_type: Tutorials
category: Get Started category: Get Started
blurb: Learn how to send test payments right from your browser. blurb: Learn how to send test payments right from your browser.
cta_text: Send XRP cta_text: Send XRP
filters:
- interactive_steps
--- ---
# Send XRP # Send XRP

View File

@@ -71,7 +71,7 @@ targets:
github_forkurl: https://github.com/ripple/xrpl-dev-portal github_forkurl: https://github.com/ripple/xrpl-dev-portal
github_branch: master github_branch: master
prefix: "" prefix: ""
ripple_lib_url: assets/js/ripple-lib-1.8.2-min.js ripple_lib_url: assets/js/ripple-lib-1.8.2.min.js
link_subs: link_subs:
"./src/api-v3/paths/preparations/payments.ts": "https://github.com/xpring-eng/xrp-api/blob/master/src/api-v3/paths/preparations/payments.ts" "./src/api-v3/paths/preparations/payments.ts": "https://github.com/xpring-eng/xrp-api/blob/master/src/api-v3/paths/preparations/payments.ts"
readability_goals: readability_goals:
@@ -1619,10 +1619,14 @@ pages:
- ja - ja
- md: tutorials/use-simple-xrp-payments/send-xrp.md - md: tutorials/use-simple-xrp-payments/send-xrp.md
filters:
- interactive_steps
targets: targets:
- en - en
- md: tutorials/use-simple-xrp-payments/send-xrp.ja.md - md: tutorials/use-simple-xrp-payments/send-xrp.ja.md
filters:
- interactive_steps
targets: targets:
- ja - ja
@@ -1881,6 +1885,8 @@ pages:
- ja - ja
- md: tutorials/manage-account-settings/use-tickets.md - md: tutorials/manage-account-settings/use-tickets.md
filters:
- interactive_steps
targets: targets:
- en - en
- ja - ja