BitCoin OP_RETURN - Check presence on the blockchain and return block depth
confirmOpReturnAsync only parses the response got from the insight service to check the presence of the Merkle root. This behavior leads the function to validate the receipt even when the corresponding BitCoin transaction is pending (ie. not mined yet).
This is misleading: isValidReceipt acknowledges the receipt whereas there is no guarantee that it will eventually be stored on the blockchain.
In addition, the block depth would be a valuable piece of information.
Both points can be addressed by checking blockheight in the insight service response.
In order to not break the existing clients, isValidReceipt could still return true as soon as the transaction is spotted by the insight service. The presence on a blockheight field passed to the callback could help new clients decide for themselves.
Note: I didn't check the other services, only BitCoin/OP_RETURN. Thus, this issue may or may not apply to the other techniques.
Actually the confirmations field would be more relevant (in place of blockheight)
Thanks for the feedback. We'll look into your enhancement request.
Accidentally closed. Re-opened.