|
|
@ -19,6 +19,7 @@ var JSUtil = require('./util/js'); |
|
|
|
* or `Address.PayToScriptHash` (the string `'scripthash'`). The network is an instance of {@link Network}. |
|
|
|
* |
|
|
|
* @example |
|
|
|
* ```javascript
|
|
|
|
* // validate that an input field is valid
|
|
|
|
* var error = Address.getValidationError(input, 'testnet'); |
|
|
|
* if (!error) { |
|
|
@ -30,6 +31,7 @@ var JSUtil = require('./util/js'); |
|
|
|
* |
|
|
|
* // get an address from a public key
|
|
|
|
* var address = Address(publicKey, 'testnet').toString(); |
|
|
|
* ``` |
|
|
|
* |
|
|
|
* @param {*} data - The encoded data in various formats |
|
|
|
* @param {Network|String|number} [network] - The network: 'livenet' or 'testnet' |
|
|
@ -358,9 +360,11 @@ Address.fromJSON = function fromJSON(json) { |
|
|
|
* Will return a validation error if exists |
|
|
|
* |
|
|
|
* @example |
|
|
|
* ```javascript
|
|
|
|
* |
|
|
|
* var error = Address.getValidationError('15vkcKf7gB23wLAnZLmbVuMiiVDc1Nm4a2', 'testnet'); |
|
|
|
* // a network mismatch error
|
|
|
|
* ``` |
|
|
|
* |
|
|
|
* @param {String} data - The encoded data |
|
|
|
* @param {String} network - The network: 'livenet' or 'testnet' |
|
|
@ -381,9 +385,11 @@ Address.getValidationError = function(data, network, type) { |
|
|
|
* Will return a boolean if an address is valid |
|
|
|
* |
|
|
|
* @example |
|
|
|
* ```javascript
|
|
|
|
* |
|
|
|
* var valid = Address.isValid('15vkcKf7gB23wLAnZLmbVuMiiVDc1Nm4a2', 'livenet'); |
|
|
|
* // true
|
|
|
|
* ``` |
|
|
|
* |
|
|
|
* @param {String} data - The encoded data |
|
|
|
* @param {String} network - The network: 'livenet' or 'testnet' |
|
|
|