update docs pertaining to address maps.

This commit is contained in:
Christopher Jeffrey 2016-05-19 18:27:27 -07:00
parent 1bc60a3e0e
commit 8d5d6dbd88
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
5 changed files with 23 additions and 10 deletions

View File

@ -207,8 +207,8 @@ Input.prototype.isCoinbase = function isCoinbase() {
/** /**
* Test the input against an address, an * Test the input against an address, an
* array of addresses, or a map of addresses. * array of addresses, or a map of hashes.
* @param {String|String[]|Object} addressMap * @param {Hash|Hash[]|AddressHashMap} addressMap
* @returns {Boolean} Whether the input matched. * @returns {Boolean} Whether the input matched.
*/ */

View File

@ -99,7 +99,7 @@ Output.prototype.getHash = function getHash() {
/** /**
* Test the output against an address, an * Test the output against an address, an
* array of addresses, or a map of addresses. * array of addresses, or a map of addresses.
* @param {String|String[]|Object} addressMap * @param {Hash|Hash[]|AddressHashMap} addressMap
* @returns {Boolean} Whether the output matched. * @returns {Boolean} Whether the output matched.
*/ */

View File

@ -835,8 +835,8 @@ TX.prototype.getHashes = function getHashes() {
/** /**
* Test the inputs against an address, an * Test the inputs against an address, an
* array of addresses, or a map of addresses. * array of address hashes, or a map of address hashes.
* @param {Base58Address|Base58Address[]|Object} addressMap * @param {Hash|Hash[]|AddressHashMap} addressMap
* @param {Number?} index * @param {Number?} index
* @returns {Boolean} Whether the transaction matched. * @returns {Boolean} Whether the transaction matched.
*/ */
@ -866,8 +866,8 @@ TX.prototype.testInputs = function testInputs(addressMap, index) {
/** /**
* Test the outputs against an address, an * Test the outputs against an address, an
* array of addresses, or a map of addresses. * array of address hashes, or a map of address hashes.
* @param {Base58Address|Base58Address[]|Object} addressMap * @param {Hash|Hash[]|AddressHashMap} addressMap
* @param {Number?} index * @param {Number?} index
* @returns {Boolean} Whether the transaction matched. * @returns {Boolean} Whether the transaction matched.
*/ */

View File

@ -47,6 +47,18 @@
* @global * @global
*/ */
/**
* A map of addresses ({@link Base58Address} -> value).
* @typedef {Object} AddressMap
* @global
*/
/**
* A map of address hashes ({@link Hash} -> value).
* @typedef {Object} AddressHashMap
* @global
*/
/** /**
* @typedef {Object} ParsedURI * @typedef {Object} ParsedURI
* @property {Base58Address} address * @property {Base58Address} address
@ -107,8 +119,8 @@
* A satoshi amount. This is technically a * A satoshi amount. This is technically a
* JS double float, but it is regularly * JS double float, but it is regularly
* enforced to be less than 53 bits and * enforced to be less than 53 bits and
* less than MAX_MONEY regularly in * less than MAX_MONEY in various
* various functions. * functions.
* @typedef {Number} Amount * @typedef {Number} Amount
* @global * @global
*/ */

View File

@ -21,7 +21,8 @@ var BufferWriter = require('./writer');
* present, no coins will be available. * present, no coins will be available.
* @param {(HDPrivateKey|HDPublicKey)?} options.master - Master HD key. If not * @param {(HDPrivateKey|HDPublicKey)?} options.master - Master HD key. If not
* present, it will be generated. * present, it will be generated.
* @param {Object?} options.addressMap - Map of addresses to paths (internal). * @param {AddressHashMap?} options.addressMap - Map of address
* hashes to paths (internal).
* @param {Boolean?} options.witness - Whether to use witness programs. * @param {Boolean?} options.witness - Whether to use witness programs.
* @param {Number?} options.accountIndex - The BIP44 account index (default=0). * @param {Number?} options.accountIndex - The BIP44 account index (default=0).
* @param {Number?} options.receiveDepth - The index of the _next_ receiving * @param {Number?} options.receiveDepth - The index of the _next_ receiving