Fix disconnect in several js examples

This commit is contained in:
mDuo13
2023-09-07 16:01:57 -07:00
parent 98e95a9629
commit dce8ced522
5 changed files with 8 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ async function main() {
// ... custom code goes here
// Disconnect when done (If you omit this, Node.js won't end the process)
client.disconnect()
await client.disconnect()
}
main()

View File

@@ -32,7 +32,7 @@ async function main() {
})
// Disconnect when done so Node.js can end the process
client.disconnect()
await client.disconnect()
}
// call the async function

View File

@@ -17,11 +17,11 @@ async function main() {
function printLedgerResult(){
console.log(ledger["result"])
}
// Execute function at least once before checking for markers.
do {
printLedgerResult()
if (ledger["result"]["marker"] === undefined) {
break
}
@@ -37,7 +37,7 @@ async function main() {
} while (true)
// Disconnect when done. If you omit this, Node.js won't end the process.
client.disconnect()
await client.disconnect()
}
main()

View File

@@ -1,6 +1,6 @@
// In browsers, add the following <script> tags to the HTML to load dependencies
// instead of using require():
// <script src="https://unpkg.com/xrpl@2.2.0/build/xrpl-latest-min.js"></script>
// <script src="https://unpkg.com/xrpl@2.11.0/build/xrpl-latest-min.js"></script>
// <script src='https://cdn.jsdelivr.net/npm/bignumber.js@9.0.2/bignumber.min.js'></script>
const xrpl = require('xrpl')
const BigNumber = require('bignumber.js')
@@ -15,7 +15,7 @@ async function main() {
// ... custom code goes here
// Disconnect when done (If you omit this, Node.js won't end the process)
client.disconnect()
await client.disconnect()
}
main()

View File

@@ -70,7 +70,7 @@ async function main() {
// Wait for Validation (again) -----------------------------------------------
// Disconnect when done (If you omit this, Node.js won't end the process)
client.disconnect()
await client.disconnect()
}
main()