Bugfix Websocket hostname. (#21)
* Add yarn-error.log to gitignore. * Add ts-node to devDependencies. Add script to only build tsc. Add websocket to keywords. * Update yarn.lock libs. * FIX websocket endpoint hostname. FIX corrent import for all examples. FIX websocket instrucions on readme.
This commit is contained in:
@@ -8,12 +8,12 @@
|
||||
const {
|
||||
bitcoin: { websocket },
|
||||
} = mempoolJS();
|
||||
// console.log(mempoolJS());
|
||||
|
||||
const ws = websocket.initClient({
|
||||
options: ['blocks', 'stats', 'mempool-blocks', 'live-2h-chart'],
|
||||
});
|
||||
|
||||
ws.on('message', function incoming(data) {
|
||||
ws.addEventListener('message', function incoming({data}) {
|
||||
const res = JSON.parse(data.toString());
|
||||
if (res.blocks) {
|
||||
console.log(res.blocks);
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
const {
|
||||
liquid: { websocket },
|
||||
} = mempoolJS();
|
||||
|
||||
const ws = websocket.initServer({
|
||||
|
||||
const ws = websocket.initClient({
|
||||
options: ['blocks', 'stats', 'mempool-blocks', 'live-2h-chart'],
|
||||
});
|
||||
|
||||
ws.on('message', function incoming(data) {
|
||||
ws.addEventListener('message', function incoming({data}) {
|
||||
const res = JSON.parse(data.toString());
|
||||
if (res.blocks) {
|
||||
console.log(res.blocks);
|
||||
|
||||
Reference in New Issue
Block a user