mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 20:25:51 +00:00
Add improvements to walkthrough
This commit is contained in:
@@ -1,17 +1,11 @@
|
||||
// In browsers, use a <script> tag. In Node.js, uncomment the following line:
|
||||
const xrpl = require('xrpl')
|
||||
import xrpl from 'xrpl'
|
||||
|
||||
// Wrap code in an async function so we can use await
|
||||
async function main() {
|
||||
// Define the network client
|
||||
const client = new xrpl.Client("wss://s.altnet.rippletest.net:51233")
|
||||
await client.connect()
|
||||
|
||||
// Define the network client
|
||||
const client = new xrpl.Client("wss://s.altnet.rippletest.net:51233")
|
||||
await client.connect()
|
||||
// ... custom code goes here
|
||||
|
||||
// ... custom code goes here
|
||||
|
||||
// Disconnect when done (If you omit this, Node.js won't end the process)
|
||||
await client.disconnect()
|
||||
}
|
||||
|
||||
main()
|
||||
// Disconnect when done (If you omit this, Node.js won't end the process)
|
||||
client.disconnect()
|
||||
|
||||
Reference in New Issue
Block a user