I started to listen to the "wss://ws.blockchain.info/inv" websocket address in the link below, but none of the transactions I made were sent to the messages. Later, when I tried the blockcyper's websocket, all the transactions came. Currently, I am looking for a free websocket service, not a paid one.
Asked
Active
Viewed 16 times
1 Answers
0
I had to solve the problem by listening to all transactions and checking the address 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);
}
});
BeycanDeveloper
- 11
- 3