mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-05 04:15:50 +00:00
Fix disconnect in several js examples
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user