0

I'm trying to use "Balance Updates [POST] Monitor addresses for received and spent payments" from https://blockchain.info/api/api_receive

I subscribe to an address and get the response:

{
  "id": 15108,
  "addr": "1P9RQEr2XeE3PEb44ZE35sfZRRW1JHU8qx",
  "op": "ALL",
  "confs": 3,
  "callback": "https://d83bb66d.ngrok.io/bitcoin/confirmations",
  "onNotification": "DELETE"
}

then with each new transaction I get a notification with 0 confirmations, that looks like this:

{ 
   "address" : "1P9RQEr2XeE3PEb44ZE35sfZRRW1JHU8qx", 
   "confirmations" : 0, 
   "transaction_hash" : "38dbb8083a8c3006eae6c1194789941943cb60201ebfb03963188d4eb1d01d23", 
   "value" : -9030800 
 }

but I never get a notification with the 3rd confirmation

confs - Optional (Default 3). The number of confirmations the transaction needs to have before a notification is sent.

I tried setting confs to 1, 2 and leaving it as default, but I never get any confirmations, I have tried with different addresses, right now the transaction in this message has 5 confirmations but I didn't get any notification.

https://btc.com/38dbb8083a8c3006eae6c1194789941943cb60201ebfb03963188d4eb1d01d23

does any one know what's wrong ?

thanks

1 Answer 1

1

You need to set onNotification to KEEP, otherwise all future notifications such as those for confirmation number will not be sent.

From the docs:

You are required to specify the request's notification behaviour. Setting the behaviour to 'DELETE' will delete the request after the first relelvant notification is sent to your callback address. Setting the behaviour to 'KEEP' will send additional notifications every time a transaction with the specified confirmations and operation type is sent to or from the address in the request.

1
  • Thanks for answering. Yes the documentation says after the first relevant notification, in the default case would be when a transaction gets 3 confirmations and that never happens, I don't get any confirmation. I also tried setting it to keep, but got the same behavior
    – kronolynx
    Commented Sep 15, 2017 at 20:45

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