client – Watch incoming transaction with node.js

0
11


I would like to watch a set of Bitcoin addresses and be able to execute some logic as they receive a payment.

According to this answer it can be done using blockchain.info:

const Socket = require('blockchain.info/Socket');
const mySocket = new Socket();
mySocket.onTransaction(function() {
  console.log(arguments);
});

The code works just fine and I’m getting notified about transactions, I can even filter and watch specific addresses (using an options parameter) but I’m not clear at all about the meaning of the fields.
There are multiple fields in a transaction (here is an example one below). Which fields should I inspect in order to know the target address, the amount that came in and if it is confirmed?



Source link

Leave a reply