48 lines
1.4 KiB
HTML
48 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Page Title</title>
|
|
<script src="./../../../dist/mempool.js"></script>
|
|
<script>
|
|
const init = async () => {
|
|
try {
|
|
const {
|
|
liquid: { websocket },
|
|
} = mempoolJS( { hostname: 'liquid.network' } );
|
|
|
|
const ws = websocket.wsInitBrowser();
|
|
|
|
ws.addEventListener('message', function incoming({data}) {
|
|
console.log(JSON.parse(data.toString()));
|
|
});
|
|
|
|
websocket.wsWantDataBrowser(ws, ['blocks', 'stats', 'mempool-blocks', 'live-2h-chart']);
|
|
|
|
websocket.wsTrackAddressBrowser(ws, "GiAi95k5JUPNPoDGNzSUZ8vWMijSiSMTon");
|
|
|
|
websocket.wsTrackAddressesBrowser(ws, [
|
|
"GsDhxpV4Voi3XJA22bnAH4q8117hjZrQMF",
|
|
]);
|
|
|
|
websocket.wsTrackTransactionBrowser(ws, "23195d459a70875c3b1f9fb9082acc9f0594f1c63dac71b40f2ff7298630a421");
|
|
|
|
websocket.wsTrackMempoolBlockBrowser(ws, 1);
|
|
|
|
setTimeout(() => {
|
|
websocket.wsStopDataBrowser(ws);
|
|
websocket.wsStopTrackingAddressBrowser(ws);
|
|
websocket.wsStopTrackingAddressesBrowser(ws);
|
|
websocket.wsStopTrackingTransactionBrowser(ws);
|
|
websocket.wsStopTrackingMempoolBlockBrowser(ws);
|
|
}, 60000);
|
|
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
};
|
|
init();
|
|
</script>
|
|
</head>
|
|
<body></body>
|
|
</html>
|