mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 04:05:49 +00:00
Re-level non-docs content to top of repo and rename content→docs
This commit is contained in:
17
_code-samples/get-started/js/base.js
Normal file
17
_code-samples/get-started/js/base.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// In browsers, use a <script> tag. In Node.js, uncomment the following line:
|
||||
// const xrpl = require('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()
|
||||
|
||||
// ... custom code goes here
|
||||
|
||||
// Disconnect when done (If you omit this, Node.js won't end the process)
|
||||
await client.disconnect()
|
||||
}
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user