Receive custom payment notifications. View full API documentation.
var Receive = require('blockchain.info/Receive')Creating a new instance for receiving payments:
var myReceive = new Receive(xpub, callback, key, options)Parameters (required):
xpub- a BIP32 extended public key for generating bitcoin addressescallback- the url that you want to receive payment notifications to (ex:'http://mysite.com/receive')key- your blockchain.info API v2 key (click here to request a key)
Options (optional):
__unsafe__gapLimit- manually override the limit of 20 consecutive unused addresses, see #30 before using
myReceive.generate(query)Generate the next address for the xpub used to initialize myReceive.
Parameters:
query- Object of key/value pairs that will be added to the query string of the callback url as arguments. Although this is not required, it is highly recommended that you include asecretquery parameter for security.
Responds with an object containing the following properties:
address- the newly generated address, this is where your customer should send bitcoinindex- the index of the newly generated addresscallback- the full callback url to which payment notifications will be sent
myReceive.checkgap()Check the current address gap for the xpub used to initialize myReceive.
Responds with an object containing the following properties:
gap- the current address gap (number of consecutive unused addresses)