lib/messages/index.js
function Messages(options) {
  this.builder = Messages.builder(options);

  // map message constructors by name
  for(var key in this.builder.commandsMap) {
    var name = this.builder.commandsMap[key];
    this[name] = this.builder.commands[key];
  }

  if (!options) {
    options = {};
  }
  this.network = options.network || axecore.Networks.defaultNetwork;
}
function Messages(options) {
  this.builder = Messages.builder(options);

  // map message constructors by name
  for(var key in this.builder.commandsMap) {
    var name = this.builder.commandsMap[key];
    this[name] = this.builder.commands[key];
  }

  if (!options) {
    options = {};
  }
  this.network = options.network || axecore.Networks.defaultNetwork;
}
function Messages ( options ) { this . builder = Messages . builder ( options ) ; // map message constructors by name for ( var key in this . builder . commandsMap ) { var name = this . builder . commandsMap [ key ] ; this [ name ] = this . builder . commands [ key ] ; } if ( ! options ) { options = { } ; } this . network = options . network || axecore . Networks . defaultNetwork ; }
A factory to build Bitcoin protocol messages.
@param {Object=} options
@param {Network=} options.network
@param {Function=} options.Block - A block constructor
@param {Function=} options.BlockHeader - A block header constructor
@param {Function=} options.MerkleBlock - A merkle block constructor
@param {Function=} options.Transaction - A transaction constructor
@param {Function=} options.MnListDiff - A masternode difference list constructor
@constructor
A factory to build Bitcoin protocol messages .