mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
17 lines
405 B
TypeScript
17 lines
405 B
TypeScript
import {RippleAPIBroadcast} from '../../src'
|
|
|
|
function main() {
|
|
const servers = ['wss://s1.ripple.com', 'wss://s2.ripple.com']
|
|
const api = new RippleAPIBroadcast(servers)
|
|
api.connect().then(() => {
|
|
api.getServerInfo().then(info => {
|
|
console.log(JSON.stringify(info, null, 2))
|
|
})
|
|
api.on('ledger', ledger => {
|
|
console.log(JSON.stringify(ledger, null, 2))
|
|
})
|
|
})
|
|
}
|
|
|
|
main()
|