Create, import join wallet BCH
This commit is contained in:
parent
e85175ed6c
commit
5175e7e2c4
6 changed files with 44 additions and 2 deletions
|
|
@ -15,6 +15,7 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
$scope.formData.bwsurl = defaults.bws.url;
|
||||
$scope.formData.derivationPath = derivationPathHelper.default;
|
||||
$scope.formData.account = 1;
|
||||
$scope.formData.coin = 'btc';
|
||||
$scope.importErr = false;
|
||||
$scope.isCopay = appConfigService.name == 'copay';
|
||||
$scope.fromHardwareWallet = { value: false };
|
||||
|
|
@ -273,6 +274,7 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
}
|
||||
|
||||
opts.passphrase = $scope.formData.passphrase || null;
|
||||
opts.coin = $scope.formData.coin;
|
||||
|
||||
if ($scope.fromHardwareWallet.value) {
|
||||
$log.debug('Importing seed from hardware wallet');
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ angular.module('copayApp.controllers').controller('joinController',
|
|||
$scope.formData.derivationPath = derivationPathHelper.default;
|
||||
$scope.formData.account = 1;
|
||||
$scope.formData.secret = null;
|
||||
$scope.formData.coin = 'btc';
|
||||
resetPasswordFields();
|
||||
updateSeedSourceSelect();
|
||||
});
|
||||
|
|
@ -103,7 +104,8 @@ angular.module('copayApp.controllers').controller('joinController',
|
|||
var opts = {
|
||||
secret: $scope.formData.secret,
|
||||
myName: $scope.formData.myName,
|
||||
bwsurl: $scope.formData.bwsurl
|
||||
bwsurl: $scope.formData.bwsurl,
|
||||
coin: $scope.formData.coin
|
||||
}
|
||||
|
||||
var setSeed = $scope.formData.seedSource.id == 'set';
|
||||
|
|
|
|||
|
|
@ -334,6 +334,7 @@ console.log('[profileService.js:92]',wallet); //TODO/
|
|||
passphrase: opts.passphrase,
|
||||
account: opts.account || 0,
|
||||
derivationStrategy: opts.derivationStrategy || 'BIP44',
|
||||
coin: opts.coin
|
||||
});
|
||||
|
||||
} catch (ex) {
|
||||
|
|
@ -352,6 +353,7 @@ console.log('[profileService.js:92]',wallet); //TODO/
|
|||
walletClient.seedFromExtendedPublicKey(opts.extendedPublicKey, opts.externalSource, opts.entropySource, {
|
||||
account: opts.account || 0,
|
||||
derivationStrategy: opts.derivationStrategy || 'BIP44',
|
||||
coin: opts.coin
|
||||
});
|
||||
walletClient.credentials.hwInfo = opts.hwInfo;
|
||||
} catch (ex) {
|
||||
|
|
@ -366,6 +368,7 @@ console.log('[profileService.js:92]',wallet); //TODO/
|
|||
passphrase: opts.passphrase,
|
||||
language: lang,
|
||||
account: 0,
|
||||
coin: opts.coin
|
||||
});
|
||||
} catch (e) {
|
||||
$log.info('Error creating recovery phrase: ' + e.message);
|
||||
|
|
@ -375,6 +378,7 @@ console.log('[profileService.js:92]',wallet); //TODO/
|
|||
network: network,
|
||||
passphrase: opts.passphrase,
|
||||
account: 0,
|
||||
coin: opts.coin
|
||||
});
|
||||
} else {
|
||||
return cb(e);
|
||||
|
|
@ -442,7 +446,7 @@ console.log('[profileService.js:92]',wallet); //TODO/
|
|||
seedWallet(opts, function(err, walletClient) {
|
||||
if (err) return cb(err);
|
||||
|
||||
walletClient.joinWallet(opts.secret, opts.myName || 'me', {}, function(err) {
|
||||
walletClient.joinWallet(opts.secret, opts.myName || 'me', { coin: opts.coin }, function(err) {
|
||||
if (err) return bwcError.cb(err, gettextCatalog.getString('Could not join wallet'), cb);
|
||||
addAndBindWalletClient(walletClient, {
|
||||
bwsurl: opts.bwsurl
|
||||
|
|
@ -630,6 +634,7 @@ console.log('[profileService.js:92]',wallet); //TODO/
|
|||
entropySourcePath: opts.entropySourcePath,
|
||||
derivationStrategy: opts.derivationStrategy || 'BIP44',
|
||||
account: opts.account || 0,
|
||||
coin: opts.coin
|
||||
}, function(err) {
|
||||
if (err) {
|
||||
if (err instanceof errors.NOT_AUTHORIZED)
|
||||
|
|
@ -651,6 +656,7 @@ console.log('[profileService.js:92]',wallet); //TODO/
|
|||
walletClient.importFromExtendedPublicKey(opts.extendedPublicKey, opts.externalSource, opts.entropySource, {
|
||||
account: opts.account || 0,
|
||||
derivationStrategy: opts.derivationStrategy || 'BIP44',
|
||||
coin: opts.coin
|
||||
}, function(err) {
|
||||
if (err) {
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,17 @@
|
|||
<qr-scanner class="qr-icon size-24" on-scan="onQrCodeScannedJoin(data)"></qr-scanner>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="item item-input item-select">
|
||||
<div class="input-label" translate>
|
||||
Coin
|
||||
</div>
|
||||
<select ng-model="formData.coin">
|
||||
<option value="btc">BTC</option>
|
||||
<option value="bch">BCH</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<div class="item item-divider"></div>
|
||||
|
||||
<a class="item" ng-click="showAdvChange()">
|
||||
|
|
|
|||
|
|
@ -29,6 +29,16 @@
|
|||
ng-blur="formFocus(false)">
|
||||
</label>
|
||||
|
||||
<label class="item item-input item-select">
|
||||
<div class="input-label" translate>
|
||||
Coin
|
||||
</div>
|
||||
<select ng-model="formData.coin">
|
||||
<option value="btc">BTC</option>
|
||||
<option value="bch">BCH</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label class="item item-input item-select">
|
||||
<div class="input-label" translate>
|
||||
Total number of copayers
|
||||
|
|
|
|||
|
|
@ -26,6 +26,17 @@
|
|||
<qr-scanner class="qr-icon size-24" on-scan="processWalletInfo(data)"></qr-scanner>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="item item-input item-select">
|
||||
<div class="input-label" translate>
|
||||
Coin
|
||||
</div>
|
||||
<select ng-model="formData.coin">
|
||||
<option value="btc">BTC</option>
|
||||
<option value="bch">BCH</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<div class="item item-divider"></div>
|
||||
|
||||
<a class="item" ng-click="showAdvChange()">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue