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:
Miguel Medeiros
2021-05-20 12:03:40 -03:00
committed by GitHub
parent 0aa3757217
commit e3068c2d8d
28 changed files with 236 additions and 169 deletions

View File

@@ -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);

View File

@@ -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);