Created
July 23, 2018 15:09
-
-
Save WietseWind/b8879a123b432485f68a3e4a1139af23 to your computer and use it in GitHub Desktop.
Browserified, Babelified rippled-ws-client-pool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://rygrfwx.dlvr.cloud/rippled-ws-client-pool.js"></script> | |
<script> | |
var RippledWsClientPool = require('rippled-ws-client-pool') | |
var connectionPool = new RippledWsClientPool() | |
var isReady = false | |
function launchApp () { | |
connectionPool.getTransactions('rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY', {}) | |
.then(function (transactions) { | |
console.log(transactions) | |
}) | |
} | |
connectionPool.addServer('wss://s1.ripple.com') | |
connectionPool.on('ledger', function (l) { | |
console.log('Ledger closed: ' + l) | |
if (!isReady) { | |
isReady = true | |
launchApp() | |
} | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment