format Structure.js

This commit is contained in:
Manuel Araoz 2014-05-30 11:07:34 -03:00
commit 2b3c29a563

View file

@ -1,15 +1,13 @@
'use strict';
var imports = require('soop').imports();
var imports = require('soop').imports();
function Structure() {
}
function Structure() {}
/*
* Based on https://github.com/maraoz/bips/blob/master/bip-NNNN.mediawiki
* m / purpose' / cosigner_index / change / address_index
* m / purpose' / cosigner_index / change / address_index
*/
var PURPOSE = 45;
var MAX_NON_HARDENED = 0x80000000 - 1;
@ -17,13 +15,13 @@ var MAX_NON_HARDENED = 0x80000000 - 1;
var SHARED_INDEX = MAX_NON_HARDENED - 0;
var ID_INDEX = MAX_NON_HARDENED - 1;
var BIP45_PUBLIC_PREFIX = 'm/'+ PURPOSE+'\'';
var BIP45_PUBLIC_PREFIX = 'm/' + PURPOSE + '\'';
Structure.BIP45_PUBLIC_PREFIX = BIP45_PUBLIC_PREFIX;
Structure.Branch = function(address_index, isChange, cosigner_index) {
var ret = 'm/'+
(typeof cosigner_index !== 'undefined'? cosigner_index: SHARED_INDEX)+'/'+
(isChange?1:0)+'/'+
var ret = 'm/' +
(typeof cosigner_index !== 'undefined' ? cosigner_index : SHARED_INDEX) + '/' +
(isChange ? 1 : 0) + '/' +
address_index;
return ret;
};