Bitcoin
Transactions – Blockchain.com websocket not working
I had to resolve the issue by listening to all transactions and verifying addresses as follows:
ws.addEventListener('open', () =>
ws.send(JSON.stringify(
"op": "unconfirmed_sub"
));
);
ws.addEventListener('message', (res) =>
let data = JSON.parse(res.data);
let outs = data.x.out;
let out = outs.find(o =>
return String(o.addr).toLowerCase() == receiver.toLowerCase();
);
if (out)
setTimeout(() =>
startCallback(data);
, 6000);
);