mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #4401 from gabrielbazan7/feat/testnetImport
add a testnet switch when importing mnemonics
This commit is contained in:
commit
1ecd1c7dd4
|
@ -82,6 +82,14 @@
|
|||
<span>Wallet Service URL</span>
|
||||
<input type="text" id="bwsurl" name="bwsurl" ng-model="bwsurl">
|
||||
</label>
|
||||
|
||||
<div class="oh">
|
||||
<label for="network-name" class="dbi">
|
||||
<span>Testnet</span>
|
||||
<ion-toggle ng-model="testnetEnabled" ng-change="setDerivationPath()" toggle-class="toggle-balanced" class="bct">
|
||||
</ion-toggle>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -125,6 +125,13 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
}, 100);
|
||||
};
|
||||
|
||||
$scope.setDerivationPath = function() {
|
||||
if ($scope.testnetEnabled)
|
||||
$scope.derivationPath = derivationPathHelper.defaultTestnet;
|
||||
else
|
||||
$scope.derivationPath = derivationPathHelper.default;
|
||||
}
|
||||
|
||||
$scope.getFile = function() {
|
||||
// If we use onloadend, we need to check the readyState.
|
||||
reader.onloadend = function(evt) {
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
angular.module('copayApp.services').factory('derivationPathHelper', function(lodash) {
|
||||
var root = {};
|
||||
|
||||
root.default = "m/44'/0'/0'"
|
||||
root.default = "m/44'/0'/0'";
|
||||
root.defaultTestnet = "m/44'/1'/0'";
|
||||
|
||||
root.parse = function(str) {
|
||||
var arr = str.split('/');
|
||||
|
||||
|
|
Loading…
Reference in New Issue