mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-07 05:15:48 +00:00
24 lines
665 B
JavaScript
24 lines
665 B
JavaScript
'use strict';
|
|
const RippleAPI = require('ripple-lib').RippleAPI;
|
|
|
|
const api = new RippleAPI({
|
|
server: 'wss://s1.ripple.com' // Public rippled server
|
|
});
|
|
api.connect().then(() => {
|
|
/* begin custom code ------------------------------------ */
|
|
const myAddress = 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn';
|
|
|
|
console.log('getting account info for', myAddress);
|
|
return api.getAccountInfo(myAddress);
|
|
|
|
}).then(info => {
|
|
console.log(info);
|
|
console.log('getAccountInfo done');
|
|
|
|
/* end custom code -------------------------------------- */
|
|
}).then(() => {
|
|
return api.disconnect();
|
|
}).then(() => {
|
|
console.log('done and disconnected.');
|
|
}).catch(console.error);
|