change to camelCase
This commit is contained in:
parent
6418f5f8b1
commit
1d5238b2b8
1 changed files with 7 additions and 7 deletions
|
|
@ -7,7 +7,7 @@ function Structure() {}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Based on https://github.com/maraoz/bips/blob/master/bip-NNNN.mediawiki
|
* Based on https://github.com/maraoz/bips/blob/master/bip-NNNN.mediawiki
|
||||||
* m / purpose' / cosigner_index / change / address_index
|
* m / purpose' / copayerIndex / change / addressIndex
|
||||||
*/
|
*/
|
||||||
var PURPOSE = 45;
|
var PURPOSE = 45;
|
||||||
var MAX_NON_HARDENED = 0x80000000 - 1;
|
var MAX_NON_HARDENED = 0x80000000 - 1;
|
||||||
|
|
@ -18,18 +18,18 @@ 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.BIP45_PUBLIC_PREFIX = BIP45_PUBLIC_PREFIX;
|
||||||
|
|
||||||
Structure.Branch = function(address_index, isChange, cosigner_index) {
|
Structure.Branch = function(addressIndex, isChange, copayerIndex) {
|
||||||
preconditions.shouldBeNumber(address_index);
|
preconditions.shouldBeNumber(addressIndex);
|
||||||
preconditions.shouldBeBoolean(isChange);
|
preconditions.shouldBeBoolean(isChange);
|
||||||
var ret = 'm/' +
|
var ret = 'm/' +
|
||||||
(typeof cosigner_index !== 'undefined' ? cosigner_index : SHARED_INDEX) + '/' +
|
(typeof copayerIndex !== 'undefined' ? copayerIndex : SHARED_INDEX) + '/' +
|
||||||
(isChange ? 1 : 0) + '/' +
|
(isChange ? 1 : 0) + '/' +
|
||||||
address_index;
|
addressIndex;
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
Structure.FullBranch = function(address_index, isChange, cosigner_index) {
|
Structure.FullBranch = function(addressIndex, isChange, copayerIndex) {
|
||||||
var sub = Structure.Branch(address_index, isChange, cosigner_index);
|
var sub = Structure.Branch(addressIndex, isChange, copayerIndex);
|
||||||
sub = sub.substring(2);
|
sub = sub.substring(2);
|
||||||
return BIP45_PUBLIC_PREFIX + '/' + sub;
|
return BIP45_PUBLIC_PREFIX + '/' + sub;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue