3

the Insight API has a websocket and publishes TX events as described here: https://github.com/bitpay/insight-api (see bottom of this page)

The documentation says the names are:

tx: new transaction received from network. This event is published in the 'inv' room. Data will be a app/models/Transaction object. Sample output:

{
  "txid":"00c1b1acb310b87085c7deaaeba478cef5dc9519fab87a4d943ecbb39bd5b053",
  "processed":false
  ...                        <------------- ?????????
}

There is literally a "..." and I dont know the other names of the websocket!

How do I know the other names execpt txid and processed? There has to be some addresses, value and so on. Where can I find a list of these outputs?

3

What you are looking for is in the lib\transactions.js file. Line 210 to 215.

  var transformed = {
    txid: transaction.txid(),
    valueOut: valueOut / 1e8,
    vout: vout,
    isRBF: isRBF,
  };

I took a quick glimpse, vout is an array and isRBS is a boolean.

Honestly, I don't know why "processed" is in the documentation example. I might possibly have overlooked it, or maybe it could be a local produced string.

  • Thanks! I think there are more values in tx event. Value "processed" is a working value. I search for values like inputaddresses, outputaddresses, amout of btc and so on. Like every value which belongs to the transaction event. – A.c Dec 20 '17 at 8:48
  • I dug deeper now. You can take a look at github.com/bitpay/insight-api/blob/master/lib/index.js - line 283 to 289 . That's the transactionEventHandler . Look at the variables assigned to 'var result' , txid, valueOut, vout and isRBF are the only variables. So I can confirm nothing else. The "processed" is probably a dud. – Chak Dec 20 '17 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.