|
|
@ -36,8 +36,8 @@ var JSUtil = require('./util/js'); |
|
|
|
* ``` |
|
|
|
* |
|
|
|
* @param {*} data - The encoded data in various formats |
|
|
|
* @param {Network|String|number} [network] - The network: 'livenet' or 'testnet' |
|
|
|
* @param {string} [type] - The type of address: 'script' or 'pubkey' |
|
|
|
* @param {Network|String|number=} network - The network: 'livenet' or 'testnet' |
|
|
|
* @param {string=} type - The type of address: 'script' or 'pubkey' |
|
|
|
* @returns {Address} A new valid and frozen instance of an Address |
|
|
|
* @constructor |
|
|
|
*/ |
|
|
@ -86,8 +86,8 @@ function Address(data, network, type) { |
|
|
|
/** |
|
|
|
* Internal function used to split different kinds of arguments of the constructor |
|
|
|
* @param {*} data - The encoded data in various formats |
|
|
|
* @param {Network|String|number} [network] - The network: 'livenet' or 'testnet' |
|
|
|
* @param {string} [type] - The type of address: 'script' or 'pubkey' |
|
|
|
* @param {Network|String|number=} network - The network: 'livenet' or 'testnet' |
|
|
|
* @param {string=} type - The type of address: 'script' or 'pubkey' |
|
|
|
* @returns {Object} An "info" object with "type", "network", and "hashBuffer" |
|
|
|
*/ |
|
|
|
Address.prototype._classifyArguments = function(data, network, type) { |
|
|
@ -186,8 +186,8 @@ Address._classifyFromVersion = function(buffer){ |
|
|
|
* Internal function to transform a bitcoin address buffer |
|
|
|
* |
|
|
|
* @param {Buffer} buffer - An instance of a hex encoded address Buffer |
|
|
|
* @param {string} [network] - The network: 'livenet' or 'testnet' |
|
|
|
* @param {string} [type] - The type: 'pubkeyhash' or 'scripthash' |
|
|
|
* @param {string=} network - The network: 'livenet' or 'testnet' |
|
|
|
* @param {string=} type - The type: 'pubkeyhash' or 'scripthash' |
|
|
|
* @returns {Object} An object with keys: hashBuffer, network and type |
|
|
|
* @private |
|
|
|
*/ |
|
|
@ -285,8 +285,8 @@ Address.createMultisig = function(publicKeys, threshold, network) { |
|
|
|
* Internal function to transform a bitcoin address string |
|
|
|
* |
|
|
|
* @param {string} data |
|
|
|
* @param {String|Network} [network] - either a Network instance, 'livenet', or 'testnet' |
|
|
|
* @param {string} [type] - The type: 'pubkeyhash' or 'scripthash' |
|
|
|
* @param {String|Network=} network - either a Network instance, 'livenet', or 'testnet' |
|
|
|
* @param {string=} type - The type: 'pubkeyhash' or 'scripthash' |
|
|
|
* @returns {Object} An object with keys: hashBuffer, network and type |
|
|
|
* @private |
|
|
|
*/ |
|
|
@ -352,8 +352,8 @@ Address.fromScript = function(script, network) { |
|
|
|
* Instantiate an address from a buffer of the address |
|
|
|
* |
|
|
|
* @param {Buffer} buffer - An instance of buffer of the address |
|
|
|
* @param {String|Network} [network] - either a Network instance, 'livenet', or 'testnet' |
|
|
|
* @param {string} [type] - The type of address: 'script' or 'pubkey' |
|
|
|
* @param {String|Network=} network - either a Network instance, 'livenet', or 'testnet' |
|
|
|
* @param {string=} type - The type of address: 'script' or 'pubkey' |
|
|
|
* @returns {Address} A new valid and frozen instance of an Address |
|
|
|
*/ |
|
|
|
Address.fromBuffer = function(buffer, network, type) { |
|
|
@ -365,8 +365,8 @@ Address.fromBuffer = function(buffer, network, type) { |
|
|
|
* Instantiate an address from an address string |
|
|
|
* |
|
|
|
* @param {string} str - An string of the bitcoin address |
|
|
|
* @param {String|Network} [network] - either a Network instance, 'livenet', or 'testnet' |
|
|
|
* @param {string} [type] - The type of address: 'script' or 'pubkey' |
|
|
|
* @param {String|Network=} network - either a Network instance, 'livenet', or 'testnet' |
|
|
|
* @param {string=} type - The type of address: 'script' or 'pubkey' |
|
|
|
* @returns {Address} A new valid and frozen instance of an Address |
|
|
|
*/ |
|
|
|
Address.fromString = function(str, network, type) { |
|
|
|