Skip to content

Commit

Permalink
Reenable BIP32 utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Cardona committed Jul 24, 2018
1 parent 0406530 commit 00ef24f
Show file tree
Hide file tree
Showing 6 changed files with 2,749 additions and 1,844 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let corsproxy = require('corsproxy');
let cmd = require('node-cmd');

program
.version('1.4.2');
.version('1.4.3');

program
.command('new <name>')
Expand Down
25 changes: 17 additions & 8 deletions lib/HDNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ var _coininfo = require('coininfo');

var _coininfo2 = _interopRequireDefault(_coininfo);

var _bip32Utils = require('bip32-utils');

var _bip32Utils2 = _interopRequireDefault(_bip32Utils);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

// let bip32utils = require('bip32-utils')

var HDNode = function () {
function HDNode() {
_classCallCheck(this, HDNode);
Expand Down Expand Up @@ -147,12 +149,19 @@ var HDNode = function () {
value: function fromBase58(base58, network) {
return _bitcoincashjsLib2.default.HDNode.fromBase58(base58, network);
}

//
// createChain(hdNode) {
// return new bip32utils.Chain(hdNode);
// }

}, {
key: 'createAccount',
value: function createAccount(hdNodes) {
var arr = hdNodes.map(function (item, index) {
return new _bip32Utils2.default.Chain(item.neutered());
});
return new _bip32Utils2.default.Account(arr);
}
}, {
key: 'createChain',
value: function createChain(hdNode) {
return new _bip32Utils2.default.Chain(hdNode);
}
}]);

return HDNode;
Expand Down
Loading

0 comments on commit 00ef24f

Please sign in to comment.