Skip to content

Latest commit

 

History

History
44 lines (27 loc) · 1.38 KB

README.md

File metadata and controls

44 lines (27 loc) · 1.38 KB

Blockchain.info Receive Module

Receive custom payment notifications. View full API documentation.

Importing

var Receive = require('blockchain.info/Receive')

Usage

Creating a new instance for receiving payments:

var myReceive = new Receive(xpub, callback, key)

Parameters (required):

  • xpub - a BIP32 extended public key for generating bitcoin addresses
  • callback - 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)

Methods

generate

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 a secret query parameter for security.

Responds with an object containing the following properties:

  • address - the newly generated address, this is where your customer should send bitcoin
  • index - the index of the newly generated address
  • callback - the full callback url to which payment notifications will be sent