|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
/**
|
|
|
|
|
* Working with Bitmessage addresses.
|
|
|
|
|
* @see {@link https://bitmessage.org/wiki/Address}
|
|
|
|
|
* @module bitmessage/address
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
@ -36,8 +37,7 @@ function Address(opts) {
|
|
|
|
|
/**
|
|
|
|
|
* Parse Bitmessage address into address object.
|
|
|
|
|
* @param {String} str - Address string (with or without `BM-` prefix)
|
|
|
|
|
* @return {Promise.<Address,Error>} Decoded address object
|
|
|
|
|
* @static
|
|
|
|
|
* @return {Promise.<Address>} Decoded address object.
|
|
|
|
|
*/
|
|
|
|
|
Address.decode = function(str) {
|
|
|
|
|
str = str.trim();
|
|
|
|
@ -110,7 +110,7 @@ function keys2ripe(signKey, encKey) {
|
|
|
|
|
/**
|
|
|
|
|
* Calculate the Ripe hash of the address.
|
|
|
|
|
* @param {?Object} opts - Options
|
|
|
|
|
* @return {Promise.<Buffer,Error>} Resulting Ripe hash
|
|
|
|
|
* @return {Promise.<Buffer>} Resulting Ripe hash.
|
|
|
|
|
*/
|
|
|
|
|
Address.prototype.getRipe = function(opts) {
|
|
|
|
|
var self = this;
|
|
|
|
@ -179,7 +179,7 @@ function checkripelen(ripelen, version) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Encode Bitmessage address object into address string.
|
|
|
|
|
* @return {Promise.<string,Error>} Address string
|
|
|
|
|
* @return {Promise.<string>} Address string.
|
|
|
|
|
*/
|
|
|
|
|
Address.prototype.encode = function() {
|
|
|
|
|
var self = this;
|
|
|
|
@ -200,8 +200,7 @@ Address.prototype.encode = function() {
|
|
|
|
|
* Create new Bitmessage address from random encryption and signing
|
|
|
|
|
* private keys.
|
|
|
|
|
* @param {?Object} opts - Address options
|
|
|
|
|
* @return {Promise.<Address,Error>} Generated address object
|
|
|
|
|
* @static
|
|
|
|
|
* @return {Promise.<Address>} Generated address object.
|
|
|
|
|
*/
|
|
|
|
|
Address.fromRandom = function(opts) {
|
|
|
|
|
opts = opts || {};
|
|
|
|
|