mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 11:45:50 +00:00
27 lines
706 B
JavaScript
27 lines
706 B
JavaScript
'use strict'
|
|
const RippleAPI = require('ripple-lib').RippleAPI
|
|
|
|
// This example connects to a public Test Net server
|
|
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
|
api.connect().then(() => {
|
|
console.log('Connected')
|
|
|
|
const account_objects_request = {
|
|
command: "account_objects",
|
|
account: "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
|
ledger_index: "validated",
|
|
type: "check"
|
|
}
|
|
|
|
return api.connection.request(account_objects_request)
|
|
}).then(response => {
|
|
console.log("account_objects response:", response)
|
|
|
|
// Disconnect and return
|
|
}).then(() => {
|
|
api.disconnect().then(() => {
|
|
console.log('Disconnected')
|
|
process.exit()
|
|
})
|
|
}).catch(console.error)
|