mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 19:55:54 +00:00
Issue a token: interactive & node.js compatible
- Make sample code node.js compatible (need to uncomment a few lines) - Wire up interactive tutorial bits to actually run the relevant code - Edit instructions slightly, add notes on Require Destination Tags
This commit is contained in:
@@ -145,7 +145,7 @@ function lookup_tx_final(api, tx_id, max_ledger, min_ledger) {
|
||||
// warning written to the console can tell you more about what happened.
|
||||
async function submit_and_verify(api, tx_blob) {
|
||||
const prelim_result = await api.request("submit", {"tx_blob": tx_blob})
|
||||
console.log("Preliminary result:", prelim_result)
|
||||
console.log("Preliminary result code:", prelim_result.engine_result)
|
||||
const min_ledger = prelim_result.validated_ledger_index
|
||||
if (prelim_result.tx_json.LastLedgerSequence === undefined) {
|
||||
console.warn("Transaction has no LastLedgerSequence field. "+
|
||||
@@ -165,3 +165,11 @@ async function submit_and_verify(api, tx_blob) {
|
||||
|
||||
return final_result;
|
||||
}
|
||||
|
||||
// Exports for node.js; no-op for browsers
|
||||
if (typeof module !== "undefined") {
|
||||
module.exports = {
|
||||
submit_and_verify: submit_and_verify,
|
||||
lookup_tx_final: lookup_tx_final
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user