import working
This commit is contained in:
parent
2782832fb2
commit
aef26ed992
9 changed files with 413 additions and 322 deletions
|
|
@ -56,21 +56,19 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div ng-hide="create.hideWalletName">
|
||||||
<div class="large-12 columns" ng-hide="create.hideWalletName">
|
<label><span translate>Wallet name</span>
|
||||||
<label><span translate>Wallet name</span>
|
<div class="input">
|
||||||
<div class="input">
|
<input type="text" placeholder="{{'Family vacation funds'|translate}}" class="form-control" name="walletName" ng-model="walletName" ng-required="true" ng-focus="create.formFocus('wallet-name')" ng-blur="create.formFocus(false)">
|
||||||
<input type="text" placeholder="{{'Family vacation funds'|translate}}" class="form-control" name="walletName" ng-model="walletName" ng-required="true" ng-focus="create.formFocus('wallet-name')" ng-blur="create.formFocus(false)">
|
</div>
|
||||||
</div>
|
</label>
|
||||||
</label>
|
</div>
|
||||||
</div>
|
<div ng-show="totalCopayers != 1">
|
||||||
<div class="large-12 columns" ng-show="totalCopayers != 1">
|
<label><span translate>Your nickname</span>
|
||||||
<label><span translate>Your nickname</span>
|
<div class="input">
|
||||||
<div class="input">
|
<input type="text" placeholder="{{'John'|translate}}" class="form-control" name="myName" ng-model="myName" ng-required="totalCopayers != 1" ng-disabled="totalCopayers == 1" ng-focus="create.formFocus('my-name')" ng-blur="create.formFocus(false)">
|
||||||
<input type="text" placeholder="{{'John'|translate}}" class="form-control" name="myName" ng-model="myName" ng-required="totalCopayers != 1" ng-disabled="totalCopayers == 1" ng-focus="create.formFocus('my-name')" ng-blur="create.formFocus(false)">
|
</div>
|
||||||
</div>
|
</label>
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row" ng-show="totalCopayers != 1">
|
<div class="row" ng-show="totalCopayers != 1">
|
||||||
<div class="large-6 medium-6 columns">
|
<div class="large-6 medium-6 columns">
|
||||||
|
|
@ -98,27 +96,25 @@
|
||||||
<i ng-if="!hideAdv" class="icon-arrow-up4"></i>
|
<i ng-if="!hideAdv" class="icon-arrow-up4"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-hide="hideAdv" class="row">
|
<div ng-hide="hideAdv" class="row">
|
||||||
|
|
||||||
|
|
||||||
<div class="large-12 columns">
|
<div class="large-12 columns">
|
||||||
<label for="bws" class="oh">
|
<div>
|
||||||
<span>Wallet Service URL</span>
|
<label for="bws" class="oh">
|
||||||
<input type="text" id="bwsurl" name="bwsurl" ng-model="bwsurl">
|
<span>Wallet Service URL</span>
|
||||||
</label>
|
<input type="text" id="bwsurl" name="bwsurl" ng-model="bwsurl">
|
||||||
</div>
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label><span translate>Wallet Seed</span>
|
||||||
|
<select class="m10t" ng-model="seedSource"
|
||||||
|
ng-options="seed as seed.label for seed in create.seedOptions"
|
||||||
|
ng-change="create.setSeedSource()">
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="large-12 columns">
|
|
||||||
<label><span translate>Wallet Seed</span>
|
|
||||||
<select class="m10t" ng-model="seedSource"
|
|
||||||
ng-options="seed as seed.label for seed in create.seedOptions"
|
|
||||||
ng-change="create.setSeedSource()">
|
|
||||||
</select>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="large-12 columns">
|
|
||||||
<div ng-show="create.seedSourceId == 'trezor' || create.seedSourceId == 'ledger'">
|
<div ng-show="create.seedSourceId == 'trezor' || create.seedSourceId == 'ledger'">
|
||||||
|
|
||||||
<label class="oh"><span translate>Account</span>
|
<label class="oh"><span translate>Account</span>
|
||||||
|
|
@ -127,42 +123,51 @@
|
||||||
</label>
|
</label>
|
||||||
<div class="oh text-gray line-b size-12 p10b m20b"><span translate>Multiple wallets accounts are supported on the device simultaneously. Select which account should be used for this wallet</div>
|
<div class="oh text-gray line-b size-12 p10b m20b"><span translate>Multiple wallets accounts are supported on the device simultaneously. Select which account should be used for this wallet</div>
|
||||||
</div>
|
</div>
|
||||||
<label for="createPassphrase" class="oh" ng-show="create.seedSourceId=='new' " ><span translate>Add a Seed Passphrase</span> <small translate>Add an optional passphrase to secure the seed</small>
|
|
||||||
<div class="input">
|
|
||||||
<input type="text" class="form-control"
|
|
||||||
name="createPassphrase" ng-model="createPassphrase">
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label for="ext-master" class="m10t" ng-show="create.seedSourceId=='set'">
|
<div class="box-notification" ng-show="create.seedSourceId=='new' && createPassphrase">
|
||||||
<span translate>Wallet Seed</span>
|
<span class="text-warning size-14">
|
||||||
<small translate>Enter the seed words (BIP39)</small>
|
<i class="fi-alert"></i>
|
||||||
<input id="ext-master"
|
<span translate>
|
||||||
type="text"
|
WARNING: Passphrase cannot be recovered. <b>Be sure to write it down</b>. The wallet can not be restored without the passphrase.
|
||||||
name="privateKey" ng-model="privateKey">
|
</span>
|
||||||
</label>
|
</span>
|
||||||
<label for="passphrase" class="oh" ng-show="create.seedSourceId=='set'"><span translate>Seed Passphrase</span> <small translate>The seed could require a passphrase to be imported</small>
|
</div>
|
||||||
<div class="input">
|
|
||||||
<input type="text" class="form-control" name="passphrase" ng-model="passphrase">
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
<label for="network-name" class="oh" ng-show="create.seedSourceId == 'set' || create.seedSourceId == 'new'">
|
|
||||||
<span translate>Testnet</span>
|
|
||||||
<switch id="network-name" name="isTestnet" ng-model="isTestnet" class="green right m5t m10b"></switch>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
|
<div ng-show="create.seedSourceId=='new' ">
|
||||||
|
<label for="createPassphrase" ><span translate>Add a Seed Passphrase</span> <small translate>Add an optional passphrase to secure the seed</small>
|
||||||
|
<div class="input">
|
||||||
|
<input type="text" class="form-control"
|
||||||
|
name="createPassphrase" ng-model="createPassphrase">
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
<div ng-show="create.seedSourceId=='set'">
|
||||||
|
<label for="ext-master">
|
||||||
|
<span translate>Wallet Seed</span>
|
||||||
|
<small translate>Enter the seed words (BIP39)</small>
|
||||||
|
<input id="ext-master"
|
||||||
|
type="text"
|
||||||
|
name="privateKey" ng-model="privateKey">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="box-notification" ng-show="create.seedSourceId=='new' && createPassphrase">
|
<div ng-show="create.seedSourceId=='set'">
|
||||||
<span class="text-warning size-14">
|
<label for="passphrase"> <span translate>Seed Passphrase</span> <small translate>The seed could require a passphrase to be imported</small>
|
||||||
<i class="fi-alert"></i>
|
<div class="input">
|
||||||
<span translate>
|
<input type="text" class="form-control" name="passphrase" ng-model="passphrase">
|
||||||
WARNING: Passphrase cannot be recovered. <b>Be sure to write it down</b>. The wallet can not be restored without the passphrase.
|
</div>
|
||||||
</span>
|
</label>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
<div ng-show="create.seedSourceId == 'set' || create.seedSourceId == 'new'">
|
||||||
|
<label for="network-name" >
|
||||||
|
<span translate>Testnet</span>
|
||||||
|
<switch id="network-name" name="isTestnet" ng-model="isTestnet" class="green right m5t m10b"></switch>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div> <!-- columns -->
|
||||||
|
</div> <!-- advanced -->
|
||||||
|
|
||||||
<button type="submit" class="button round black expand m0" ng-show="totalCopayers != 1" ng-disabled="setupForm.$invalid || create.loading || create.hwWallet">
|
<button type="submit" class="button round black expand m0" ng-show="totalCopayers != 1" ng-disabled="setupForm.$invalid || create.loading || create.hwWallet">
|
||||||
<span translate>Create {{requiredCopayers}}-of-{{totalCopayers}} wallet</span>
|
<span translate>Create {{requiredCopayers}}-of-{{totalCopayers}} wallet</span>
|
||||||
|
|
@ -171,8 +176,9 @@
|
||||||
<button type="submit" class="button round black expand m0" ng-show="totalCopayers == 1" ng-disabled="setupForm.$invalid || create.loading || create.hwWallet">
|
<button type="submit" class="button round black expand m0" ng-show="totalCopayers == 1" ng-disabled="setupForm.$invalid || create.loading || create.hwWallet">
|
||||||
<span translate>Create new wallet</span>
|
<span translate>Create new wallet</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
|
||||||
</div>
|
</div> <!-- large-12 columns -->
|
||||||
|
</div> <!-- row -->
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="extra-margin-bottom"></div>
|
<div class="extra-margin-bottom"></div>
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="create-tab pr small-only-text-center" ng-hide="create.hideTabs">
|
<div class="create-tab pr small-only-text-center" ng-hide="create.hideTabs">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="tab-container small-4 medium-4 large-4" ng-class="{'selected': type =='12'}">
|
<div class="tab-container small-4 medium-4 large-4" ng-class="{'selected': type =='12'}">
|
||||||
|
|
@ -46,21 +44,21 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" ng-show="type == '12' ">
|
<div class="row" ng-show="type == '12' ">
|
||||||
<div class="large-12 columns">
|
<div class="large-12 columns">
|
||||||
<form name="importForm12" ng-submit="import.importMnemonic(importForm12)" novalidate>
|
<form name="importForm12" ng-submit="import.importMnemonic(importForm12)" novalidate>
|
||||||
<div class="box-notification" ng-show="import.error">
|
<div class="box-notification" ng-show="import.error">
|
||||||
<span class="text-warning size-14">
|
<span class="text-warning size-14">
|
||||||
{{import.error|translate}}
|
{{import.error|translate}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div >
|
<div >
|
||||||
<label for="words">
|
<label for="words">
|
||||||
<span translate>Type the Seed Word (usually 12 words)</span>:
|
<span translate>Type the Seed Word (usually 12 words)</span>:
|
||||||
</label>
|
</label>
|
||||||
<textarea class="form-control" name="words" ng-model="import.words" rows="2"></textarea>
|
<textarea class="form-control" name="words" ng-model="import.words" rows="2"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="m10t oh" ng-init="hideAdv=true">
|
<div class="m10t oh" ng-init="hideAdv=true">
|
||||||
<a class="button outline light-gray expand tiny" ng-click="hideAdv=!hideAdv">
|
<a class="button outline light-gray expand tiny" ng-click="hideAdv=!hideAdv">
|
||||||
|
|
@ -78,7 +76,7 @@
|
||||||
<switch id="network-name" name="isTestnet" ng-model="isTestnet" class="green right m5t m10b"></switch>
|
<switch id="network-name" name="isTestnet" ng-model="isTestnet" class="green right m5t m10b"></switch>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label for="passphrase" class="oh"><span translate>Passphrase</span> <small translate>Wallet Seed could require a passphrase to be imported</small>
|
<label for="passphrase" class="oh"><span translate>Passphrase</span> <small translate>Wallet Seed could require a passphrase to be imported</small>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<input type="password" class="form-control" placeholder="{{'Seed passphrase'|translate}}"
|
<input type="password" class="form-control" placeholder="{{'Seed passphrase'|translate}}"
|
||||||
name="passphrase" ng-model="import.passphrase">
|
name="passphrase" ng-model="import.passphrase">
|
||||||
|
|
@ -92,45 +90,117 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button translate type="submit" class="button round expand black m10t"
|
<button translate type="submit" class="button round expand black m10t"
|
||||||
ng-disabled="importForm12.$invalid || import.loading">
|
ng-disabled="importForm12.$invalid || import.loading">
|
||||||
Import
|
Import
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row" ng-show="type == 'file' ">
|
||||||
|
<div class="large-12 columns">
|
||||||
|
<form name="importForm" ng-submit="import.importBlob(importForm)" novalidate>
|
||||||
|
<div class="box-notification" ng-show="import.error">
|
||||||
|
<span class="text-warning size-14">
|
||||||
|
{{import.error|translate}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-show="!index.isSafari && !index.isCordova" class="line-b m10b">
|
||||||
<div class="row" ng-show="type == 'file' ">
|
<label for="backupFile">
|
||||||
<div class="large-12 columns">
|
<span translate>Choose a backup file from your computer</span> <i class="fi-laptop"></i>
|
||||||
<form name="importForm" ng-submit="import.importBlob(importForm)" novalidate>
|
|
||||||
<div class="box-notification" ng-show="import.error">
|
|
||||||
<span class="text-warning size-14">
|
|
||||||
{{import.error|translate}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-show="!index.isSafari && !index.isCordova" class="line-b m10b">
|
|
||||||
<label for="backupFile">
|
|
||||||
<span translate>Choose a backup file from your computer</span> <i class="fi-laptop"></i>
|
|
||||||
</label>
|
|
||||||
<input type="file" class="form-control" placeholder="{{'Select a backup file'|translate}}"
|
|
||||||
name="backupFile" ng-model="import.backupFile" ng-file-select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-show="index.isSafari || index.isCordova">
|
|
||||||
<label for="backupText">
|
|
||||||
<span translate>Paste the backup plain text code</span> <i class="fi-clipboard"></i>
|
|
||||||
</label>
|
|
||||||
<textarea class="form-control" name="backupText" ng-model="import.backupText" rows="5"></textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<label for="password"><span translate>Password</span>
|
|
||||||
</label>
|
</label>
|
||||||
<div class="input">
|
<input type="file" class="form-control" placeholder="{{'Select a backup file'|translate}}"
|
||||||
<input type="password" class="form-control" placeholder="{{'Your backup password'|translate}}"
|
name="backupFile" ng-model="import.backupFile" ng-file-select>
|
||||||
name="password" ng-model="import.password">
|
</div>
|
||||||
|
|
||||||
|
<div ng-show="index.isSafari || index.isCordova">
|
||||||
|
<label for="backupText">
|
||||||
|
<span translate>Paste the backup plain text code</span> <i class="fi-clipboard"></i>
|
||||||
|
</label>
|
||||||
|
<textarea class="form-control" name="backupText" ng-model="import.backupText" rows="5"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label for="password"><span translate>Password</span>
|
||||||
|
</label>
|
||||||
|
<div class="input">
|
||||||
|
<input type="password" class="form-control" placeholder="{{'Your backup password'|translate}}"
|
||||||
|
name="password" ng-model="import.password">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="m10t oh" ng-init="hideAdv=true">
|
||||||
|
<a class="button outline light-gray expand tiny" ng-click="hideAdv=!hideAdv">
|
||||||
|
<i class="fi-widget m3r"></i>
|
||||||
|
<span translate ng-hide="!hideAdv">Show advanced options</span>
|
||||||
|
<span translate ng-hide="hideAdv">Hide advanced options</span>
|
||||||
|
<i ng-if="hideAdv" class="icon-arrow-down4"></i>
|
||||||
|
<i ng-if="!hideAdv" class="icon-arrow-up4"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div ng-hide="hideAdv" class="row">
|
||||||
|
<div class="large-12 columns">
|
||||||
|
|
||||||
|
<label for="bws" class="oh">
|
||||||
|
<span>Wallet Service URL</span>
|
||||||
|
<input type="text" id="bwsurl" name="bwsurl" ng-model="bwsurl">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button translate type="submit" class="button round expand black"
|
||||||
|
ng-disabled="importForm.$invalid || !import.password || import.loading">
|
||||||
|
Import backup
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="text-center text-gray p20v" ng-click="$root.go('importLegacy')">
|
||||||
|
<p class="text-gray m5b size-14" translate> Have a Backup from Copay v0.9?</p>
|
||||||
|
<button class=" outline dark-gray tiny round"> <span translate>Import here</span>
|
||||||
|
<i class="icon-arrow-right3 size-14"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row" ng-show="type == 'hwWallet'">
|
||||||
|
<div class="large-12 columns">
|
||||||
|
<div class="box-notification" ng-show="import.error">
|
||||||
|
<span class="text-warning size-14">
|
||||||
|
{{import.error|translate}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form name="importForm3" ng-submit="import.importHW(importForm3)" novalidate>
|
||||||
|
<div class="large-12 columns">
|
||||||
|
<div ng-show="!import.seedOptions[0]">
|
||||||
|
<span translate>No harware wallets supported on this device</span>
|
||||||
|
</div>
|
||||||
|
<div ng-show="import.seedOptions[0]">
|
||||||
|
<div>
|
||||||
|
<label><span translate>Wallet Seed</span>
|
||||||
|
<select class="m10t" ng-model="seedSource"
|
||||||
|
ng-options="seed as seed.label for seed in import.seedOptions"
|
||||||
|
ng-change="import.setSeedSource()">
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-show="import.seedSourceId == 'trezor'">
|
||||||
|
<label for="isMultisig" class="oh">
|
||||||
|
<span translate>Shared Wallet</span>
|
||||||
|
<switch id="isMultisig" name="isMultisig" ng-model="isMultisig" class="green right m5t m10b"></switch>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-show="import.seedSourceId == 'trezor' || import.seedSourceId == 'ledger'">
|
||||||
|
|
||||||
|
<label class="oh"><span translate>Account</span>
|
||||||
|
<select class="m10t" ng-model="account" ng-options="externalIndex as externalIndex for externalIndex in import.accountValues">
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
<div class="oh text-gray line-b size-12 p10b m20b"><span translate>Multiple wallets accounts are supported on the device simultaneously. Select which account should be imported</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="m10t oh" ng-init="hideAdv=true">
|
<div class="m10t oh" ng-init="hideAdv=true">
|
||||||
|
|
@ -152,100 +222,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button translate type="submit" class="button round expand black"
|
|
||||||
ng-disabled="importForm.$invalid || !import.password || import.loading">
|
|
||||||
Import backup
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<div class="text-center text-gray p20v" ng-click="$root.go('importLegacy')">
|
|
||||||
<p class="text-gray m5b size-14" translate> Have a Backup from Copay v0.9?</p>
|
|
||||||
<button class=" outline dark-gray tiny round"> <span translate>Import here</span>
|
|
||||||
<i class="icon-arrow-right3 size-14"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row" ng-show="type == 'hwWallet'">
|
|
||||||
<div class="large-12 columns">
|
|
||||||
<div class="box-notification" ng-show="import.error">
|
|
||||||
<span class="text-warning size-14">
|
|
||||||
{{import.error|translate}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form name="importForm3" ng-submit="import.importLedger(importForm3)" ng-show="index.isChromeApp" novalidate>
|
|
||||||
<div class="large-12 columns">
|
|
||||||
|
|
||||||
<!-- TODO: account
|
|
||||||
<label class=" oh">
|
|
||||||
<span translate>Ledger Slot</span>
|
|
||||||
<select class="m10t" ng-model="externalIndex" ng-options="externalIndex as externalIndex for externalIndex in import.externalIndexValues">
|
|
||||||
</select>
|
|
||||||
</label>
|
|
||||||
<div class="oh text-gray line-b size-12 p10b m20b"><span translate>Ledger supports up to 20 Copay wallets simultaneously. Select which slot to import</div>
|
|
||||||
-->
|
|
||||||
<button translate type="submit" class="button round expand black"
|
<button translate type="submit" class="button round expand black"
|
||||||
ng-disabled="import.loading || import.ledger">
|
ng-disabled="import.loading || import.ledger">
|
||||||
Import from Ledger
|
Import
|
||||||
</button>
|
</button>
|
||||||
|
</div> <!-- seedoptions show -->
|
||||||
<div class="m10t oh" ng-init="hideAdvLedger=true">
|
</div>
|
||||||
<a class="button outline light-gray expand tiny" ng-click="hideAdvLedger=!hideAdvLedger">
|
</form>
|
||||||
<i class="fi-widget m3r"></i>
|
|
||||||
<span translate ng-hide="!hideAdvLedger">Show advanced options</span>
|
|
||||||
<span translate ng-hide="hideAdvLedger">Hide advanced options</span>
|
|
||||||
<i ng-if="hideAdvLedger" class="icon-arrow-down4"></i>
|
|
||||||
<i ng-if="!hideAdvLedger" class="icon-arrow-up4"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div ng-hide="hideAdvLedger" class="row">
|
|
||||||
<div class="large-12 columns">
|
|
||||||
|
|
||||||
<label for="bws" class="oh">
|
|
||||||
<span>Wallet Service URL</span>
|
|
||||||
<input type="text" id="bwsurl" name="bwsurl" ng-model="bwsurl">
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<form name="importForm4" ng-submit="import.importTrezor(importForm4)" novalidate>
|
|
||||||
<div class="large-12 columns">
|
|
||||||
|
|
||||||
<div class="m10t oh" ng-init="hideAdvTrezor=true">
|
|
||||||
<a class="button outline light-gray expand tiny" ng-click="hideAdvTrezor=!hideAdvTrezor">
|
|
||||||
<i class="fi-widget m3r"></i>
|
|
||||||
<span translate ng-hide="!hideAdvTrezor">Show advanced options</span>
|
|
||||||
<span translate ng-hide="hideAdvTrezor">Hide advanced options</span>
|
|
||||||
<i ng-if="hideAdvTrezor" class="icon-arrow-down4"></i>
|
|
||||||
<i ng-if="!hideAdvTrezor" class="icon-arrow-up4"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div ng-hide="hideAdvTrezor" class="row">
|
|
||||||
<div class="large-12 columns">
|
|
||||||
|
|
||||||
<label for="bws" class="oh">
|
|
||||||
<span>Wallet Service URL</span>
|
|
||||||
<input type="text" id="bwsurl" name="bwsurl" ng-model="bwsurl">
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ng-disabled="import.loading || import.ledger" -->
|
|
||||||
<button translate type="submit" class="button round expand black" ng-disabled="true">
|
|
||||||
Import from TREZOR
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="extra-margin-bottom"></div>
|
<div class="extra-margin-bottom"></div>
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,7 @@
|
||||||
<div ng-show="index.isPrivKeyExternal" style="text-transform: capitalize">
|
<div ng-show="index.isPrivKeyExternal" style="text-transform: capitalize">
|
||||||
<span translate>External Private Key:</span>
|
<span translate>External Private Key:</span>
|
||||||
{{index.externalSource}}
|
{{index.externalSource}}
|
||||||
|
<span>(<span translate>Account</span>:
|
||||||
|
#{{index.account || 0}})
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -32,118 +32,123 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<form name="joinForm" ng-submit="join.join(joinForm)" novalidate>
|
||||||
<div class="large-12 columns">
|
<div class="row">
|
||||||
|
<div class="large-12 columns">
|
||||||
|
<div class="box-notification" ng-show="join.error ">
|
||||||
|
<span class="text-warning size-14">
|
||||||
|
{{join.error|translate}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="box-notification" ng-show="join.error ">
|
<div>
|
||||||
<span class="text-warning size-14">
|
|
||||||
{{join.error|translate}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form name="joinForm" ng-submit="join.join(joinForm)" novalidate>
|
|
||||||
<label><span translate>Your nickname</span>
|
<label><span translate>Your nickname</span>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<input type="text" placeholder="{{'John'|translate}}" class="form-control" name="myName" ng-model="myName" ng-required="true">
|
<input type="text" placeholder="{{'John'|translate}}" class="form-control" name="myName" ng-model="myName" ng-required="true">
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row collapse">
|
<div class="row collapse">
|
||||||
<label for="secret" class="left"><span translate>Wallet Invitation</span>
|
<label for="secret" class="left"><span translate>Wallet Invitation</span>
|
||||||
<small translate ng-show="joinForm.secret.$pristine">Required</small>
|
<small translate ng-show="joinForm.secret.$pristine">Required</small>
|
||||||
</label>
|
</label>
|
||||||
<span class="has-error right size-12" ng-show="joinForm.secret.$invalid
|
<span class="has-error right size-12" ng-show="joinForm.secret.$invalid
|
||||||
&& !joinForm.secret.$pristine">
|
&& !joinForm.secret.$pristine">
|
||||||
<span class="icon-input"><i class="fi-x"></i></span>
|
<span class="icon-input"><i class="fi-x"></i></span>
|
||||||
<span translate>Wallet Invitation is not valid!</span>
|
<span translate>Wallet Invitation is not valid!</span>
|
||||||
</span>
|
</span>
|
||||||
<small class="icon-input right" ng-show="joinForm.secret.$valid
|
<small class="icon-input right" ng-show="joinForm.secret.$valid
|
||||||
&& !joinForm.secret.$pristine"><i class="fi-check"></i></small>
|
&& !joinForm.secret.$pristine"><i class="fi-check"></i></small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input">
|
||||||
|
<input id="secret" type="text" placeholder="{{'Paste invitation here'|translate}}" name="secret" ng-model="secret" wallet-secret required>
|
||||||
|
<div class="qr-scanner-input">
|
||||||
|
<qr-scanner on-scan="join.onQrCodeScanned(data)"></qr-scanner>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="input">
|
<div class="m10t oh" ng-init="hideAdv=true">
|
||||||
<input id="secret" type="text" placeholder="{{'Paste invitation here'|translate}}" name="secret" ng-model="secret" wallet-secret required>
|
<a class="button outline light-gray expand tiny" ng-click="hideAdv=!hideAdv">
|
||||||
<div class="qr-scanner-input">
|
|
||||||
<qr-scanner on-scan="join.onQrCodeScanned(data)"></qr-scanner>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a class="button outline light-gray tiny expand" ng-click="join.hideAdv=!join.hideAdv">
|
|
||||||
<i class="fi-widget m3r"></i>
|
<i class="fi-widget m3r"></i>
|
||||||
<span translate ng-show="!join.hideAdv">Show advanced options</span>
|
<span translate ng-hide="!hideAdv">Show advanced options</span>
|
||||||
<span translate ng-show="join.hideAdv">Hide advanced options</span>
|
<span translate ng-hide="hideAdv">Hide advanced options</span>
|
||||||
<i ng-show="!join.hideAdv" class="icon-arrow-down4"></i>
|
<i ng-if="hideAdv" class="icon-arrow-down4"></i>
|
||||||
<i ng-show="join.hideAdv" class="icon-arrow-up4"></i>
|
<i ng-if="!hideAdv" class="icon-arrow-up4"></i>
|
||||||
</a>
|
</a>
|
||||||
<div ng-show="join.hideAdv" class="row">
|
</div>
|
||||||
<div class="large-12 columns">
|
|
||||||
|
|
||||||
<label for="hw-ledger" class="oh" ng-show="index.isChromeApp">
|
<div ng-hide="hideAdv" class="row">
|
||||||
<span translate>Use Ledger hardware wallet</span>
|
<div class="large-12 columns">
|
||||||
<switch id="hw-ledger" name="hwLedger" ng-model="hwLedger" class="green right m5t m10b"></switch>
|
<div>
|
||||||
</label>
|
<label for="bws" class="oh">
|
||||||
|
<span>Wallet Service URL</span>
|
||||||
|
<input type="text" id="bwsurl" name="bwsurl" ng-model="bwsurl">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<label ng-show="!index.isCordova && 0" for="hw-trezor" class="oh">
|
<div>
|
||||||
<span translate>Use TREZOR hardware wallet</span>
|
<label><span translate>Wallet Seed</span>
|
||||||
<switch id="hw-trezor" name="hwTrezor" ng-model="hwTrezor" class="green right m5t m10b"></switch>
|
<select class="m10t" ng-model="seedSource"
|
||||||
</label>
|
ng-options="seed as seed.label for seed in join.seedOptions"
|
||||||
|
ng-change="join.setSeedSource()">
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- TODO account
|
<div ng-show="join.seedSourceId == 'trezor' || join.seedSourceId == 'ledger'">
|
||||||
<div class="large-12 columns" ng-hide="!hwLedger">
|
|
||||||
<label class="oh">
|
<label class="oh"><span translate>Account</span>
|
||||||
<span translate>Ledger Slot</span>
|
<select class="m10t" ng-model="account" ng-options="externalIndex as externalIndex for externalIndex in join.accountValues">
|
||||||
<select class="m10t" ng-model="externalIndex" ng-options="externalIndex as externalIndex for externalIndex in join.externalIndexValues">
|
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<div class="oh text-gray line-b size-12 p10b m20b"><span translate>Ledger supports up to 20 Copay wallets simultaneously. Select which slot should be used to host this wallet</div>
|
<div class="oh text-gray line-b size-12 p10b m20b"><span translate>Multiple wallets accounts are supported on the device simultaneously. Select which account should be used for this wallet</div>
|
||||||
</div>
|
</div>
|
||||||
-->
|
|
||||||
<label ng-show="!hwLedger && !hwTrezor" for="seed" class="oh">
|
|
||||||
<span translate>Specify your wallet seed</span>
|
|
||||||
<switch id="seed" name="setSeed" ng-model="setSeed" class="green right m5t m10b"></switch>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label for="createPassphrase" class="oh" ng-show="!setSeed && !hwLedger && !hwTrezor" ><span translate>Add a Seed Passphrase</span> <small translate>Add an optional passphrase to secure the seed</small>
|
<div class="box-notification" ng-show="join.seedSourceId=='new' && createPassphrase">
|
||||||
<div class="input">
|
<span class="text-warning size-14">
|
||||||
<input type="text" class="form-control"
|
<i class="fi-alert"></i>
|
||||||
name="createPassphrase" ng-model="createPassphrase">
|
<span translate>
|
||||||
</div>
|
WARNING: Passphrase cannot be recovered. <b>Be sure to write it down</b>. The wallet can not be restored without the passphrase.
|
||||||
</label>
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<label for="ext-master" class="m10t" ng-show="setSeed">
|
<div ng-show="join.seedSourceId=='new' ">
|
||||||
<span translate>Wallet Seed</span>
|
<label for="createPassphrase" ><span translate>Add a Seed Passphrase</span> <small translate>Add an optional passphrase to secure the seed</small>
|
||||||
<small translate>Enter the seed words (BIP39)</small>
|
<div class="input">
|
||||||
<input id="ext-master"
|
<input type="text" class="form-control"
|
||||||
type="text"
|
name="createPassphrase" ng-model="createPassphrase">
|
||||||
name="privateKey" ng-model="privateKey">
|
</div>
|
||||||
</label>
|
</label>
|
||||||
<label for="passphrase" class="oh" ng-show="setSeed"><span translate>Seed Passphrase</span> <small translate>The seed could require a passphrase to be imported</small>
|
</div>
|
||||||
<div class="input">
|
|
||||||
<input type="text" class="form-control" name="passphrase" ng-model="passphrase">
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label for="bws" class="oh">
|
<div ng-show="join.seedSourceId=='set'">
|
||||||
<span>Wallet Service URL</span>
|
<label for="ext-master">
|
||||||
<input type="text" id="bwsurl" name="bwsurl" ng-model="bwsurl">
|
<span translate>Wallet Seed</span>
|
||||||
</label>
|
<small translate>Enter the seed words (BIP39)</small>
|
||||||
</div>
|
<input id="ext-master"
|
||||||
</div>
|
type="text"
|
||||||
|
name="privateKey" ng-model="privateKey">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="box-notification" ng-show="!setSeed && createPassphrase">
|
<div ng-show="join.seedSourceId=='set'">
|
||||||
<span class="text-warning size-14">
|
<label for="passphrase"> <span translate>Seed Passphrase</span> <small translate>The seed could require a passphrase to be imported</small>
|
||||||
<i class="fi-alert"></i>
|
<div class="input">
|
||||||
<span translate>
|
<input type="text" class="form-control" name="passphrase" ng-model="passphrase">
|
||||||
WARNING: Passphrase cannot be recovered. <b>Be sure to write it down</b>. The wallet can not be restored without the passphrase.
|
</div>
|
||||||
</span>
|
</label>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</div> <!-- columns -->
|
||||||
|
</div> <!-- advanced -->
|
||||||
|
|
||||||
<button translate type="submit" class="button expand black m0 round"
|
<button translate type="submit" class="button expand black m0 round"
|
||||||
ng-disabled="joinForm.$invalid || join.loading">Join</button>
|
ng-disabled="joinForm.$invalid || join.loading">Join</button>
|
||||||
</form>
|
</div> <!-- large-12 columns -->
|
||||||
</div>
|
</div> <!-- row -->
|
||||||
</div>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="extra-margin-bottom"></div>
|
<div class="extra-margin-bottom"></div>
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,8 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
label: gettext('Specify Seed...'),
|
label: gettext('Specify Seed...'),
|
||||||
}];
|
}];
|
||||||
$scope.seedSource = self.seedOptions[0];
|
$scope.seedSource = self.seedOptions[0];
|
||||||
|
// TODO
|
||||||
// TODO
|
// if (!isChromeApp) return;
|
||||||
// if (!isChromeApp) return;
|
|
||||||
|
|
||||||
if (n > 1)
|
if (n > 1)
|
||||||
self.seedOptions.push({
|
self.seedOptions.push({
|
||||||
|
|
@ -187,6 +186,7 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
$scope.$on("$destroy", function() {
|
$scope.$on("$destroy", function() {
|
||||||
$rootScope.hideWalletNavigation = false;
|
$rootScope.hideWalletNavigation = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
updateSeedSourceSelect(1);
|
updateSeedSourceSelect(1);
|
||||||
self.seedSourceId = 'new'
|
self.setSeedSource('new');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('importController',
|
angular.module('copayApp.controllers').controller('importController',
|
||||||
function($scope, $rootScope, $location, $timeout, $log, profileService, configService, notification, go, sjcl, gettext, lodash, ledger, trezor) {
|
function($scope, $rootScope, $location, $timeout, $log, profileService, configService, notification, go, sjcl, gettext, lodash, ledger, trezor, isChromeApp) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
|
|
@ -15,6 +15,25 @@ angular.module('copayApp.controllers').controller('importController',
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var updateSeedSourceSelect = function() {
|
||||||
|
self.seedOptions = [];
|
||||||
|
// TODO
|
||||||
|
// if (!isChromeApp) return;
|
||||||
|
|
||||||
|
self.seedOptions.push({
|
||||||
|
id: 'ledger',
|
||||||
|
label: gettext('Ledger Hardware Wallet'),
|
||||||
|
});
|
||||||
|
|
||||||
|
self.seedOptions.push({
|
||||||
|
id: 'trezor',
|
||||||
|
label: gettext('Trezor Hardware Wallet'),
|
||||||
|
});
|
||||||
|
$scope.seedSource = self.seedOptions[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.setType = function(type) {
|
this.setType = function(type) {
|
||||||
$scope.type = type;
|
$scope.type = type;
|
||||||
this.error = null;
|
this.error = null;
|
||||||
|
|
@ -178,19 +197,8 @@ angular.module('copayApp.controllers').controller('importController',
|
||||||
_importMnemonic(words, opts);
|
_importMnemonic(words, opts);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.importTrezor = function(form) {
|
this.importTrezor = function(account, isMultisig) {
|
||||||
var self = this;
|
var self = this;
|
||||||
if (form.$invalid) {
|
|
||||||
this.error = gettext('There is an error in the form');
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.$apply();
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
self.hwWallet = 'Trezor';
|
|
||||||
var account = form.account.$modelValue;
|
|
||||||
var isMultisig = form.isMultisig.$modelValue;
|
|
||||||
|
|
||||||
trezor.getInfoForNewWallet(isMultisig, account, function(err, lopts) {
|
trezor.getInfoForNewWallet(isMultisig, account, function(err, lopts) {
|
||||||
self.hwWallet = false;
|
self.hwWallet = false;
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
@ -219,8 +227,7 @@ angular.module('copayApp.controllers').controller('importController',
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.importLedger = function(form) {
|
this.importHW = function(form) {
|
||||||
var self = this;
|
|
||||||
if (form.$invalid) {
|
if (form.$invalid) {
|
||||||
this.error = gettext('There is an error in the form');
|
this.error = gettext('There is an error in the form');
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
|
@ -228,8 +235,40 @@ angular.module('copayApp.controllers').controller('importController',
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.hwWallet = 'Ledger';
|
|
||||||
var account = form.account.$modelValue;
|
var account = $scope.account;
|
||||||
|
var isMultisig = form.isMultisig.$modelValue;
|
||||||
|
|
||||||
|
switch (self.seedSourceId) {
|
||||||
|
case ('ledger'):
|
||||||
|
self.hwWallet = 'Ledger';
|
||||||
|
self.importLedger(account);
|
||||||
|
break;
|
||||||
|
case ('trezor'):
|
||||||
|
self.hwWallet = 'Trezor';
|
||||||
|
self.importTrezor(account, isMultisig);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw ('Error: bad source id');
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setSeedSource = function() {
|
||||||
|
if (!$scope.seedSource) return;
|
||||||
|
self.seedSourceId = $scope.seedSource.id;
|
||||||
|
|
||||||
|
if (self.seedSourceId == 'ledger')
|
||||||
|
self.accountValues = lodash.range(0, 99);
|
||||||
|
else
|
||||||
|
self.accountValues = lodash.range(1, 100);
|
||||||
|
|
||||||
|
$timeout(function() {
|
||||||
|
$rootScope.$apply();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.importLedger = function(account) {
|
||||||
|
var self = this;
|
||||||
ledger.getInfoForNewWallet(true, account, function(err, lopts) {
|
ledger.getInfoForNewWallet(true, account, function(err, lopts) {
|
||||||
self.hwWallet = false;
|
self.hwWallet = false;
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
@ -257,4 +296,6 @@ angular.module('copayApp.controllers').controller('importController',
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
updateSeedSourceSelect();
|
||||||
|
self.setSeedSource('new');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,11 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
self.canSign = fc.canSign();
|
self.canSign = fc.canSign();
|
||||||
self.isPrivKeyExternal = fc.isPrivKeyExternal();
|
self.isPrivKeyExternal = fc.isPrivKeyExternal();
|
||||||
self.externalSource = fc.getPrivKeyExternalSourceName();
|
self.externalSource = fc.getPrivKeyExternalSourceName();
|
||||||
|
self.account = fc.credentials.account;
|
||||||
|
|
||||||
|
if (self.externalSource == 'trezor')
|
||||||
|
self.account++;
|
||||||
|
|
||||||
self.txps = [];
|
self.txps = [];
|
||||||
self.copayers = [];
|
self.copayers = [];
|
||||||
self.updateColor();
|
self.updateColor();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('joinController',
|
angular.module('copayApp.controllers').controller('joinController',
|
||||||
function($scope, $rootScope, $timeout, go, notification, profileService, configService, isCordova, storageService, applicationService, $modal, gettext, lodash, ledger, trezor) {
|
function($scope, $rootScope, $timeout, go, notification, profileService, configService, isCordova, storageService, applicationService, $modal, gettext, lodash, ledger, trezor, isChromeApp) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var defaults = configService.getDefaults();
|
var defaults = configService.getDefaults();
|
||||||
|
|
@ -13,6 +13,44 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
$scope.joinForm.secret.$render();
|
$scope.joinForm.secret.$render();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var updateSeedSourceSelect = function() {
|
||||||
|
self.seedOptions = [{
|
||||||
|
id: 'new',
|
||||||
|
label: gettext('New Random Seed'),
|
||||||
|
}, {
|
||||||
|
id: 'set',
|
||||||
|
label: gettext('Specify Seed...'),
|
||||||
|
}];
|
||||||
|
$scope.seedSource = self.seedOptions[0];
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
// if (!isChromeApp) return;
|
||||||
|
|
||||||
|
self.seedOptions.push({
|
||||||
|
id: 'ledger',
|
||||||
|
label: gettext('Ledger Hardware Wallet'),
|
||||||
|
});
|
||||||
|
|
||||||
|
self.seedOptions.push({
|
||||||
|
id: 'trezor',
|
||||||
|
label: gettext('Trezor Hardware Wallet'),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setSeedSource = function(src) {
|
||||||
|
self.seedSourceId = $scope.seedSource.id;
|
||||||
|
|
||||||
|
if (self.seedSourceId == 'ledger')
|
||||||
|
self.accountValues = lodash.range(0, 99);
|
||||||
|
else
|
||||||
|
self.accountValues = lodash.range(1, 100);
|
||||||
|
|
||||||
|
$timeout(function() {
|
||||||
|
$rootScope.$apply();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
this.join = function(form) {
|
this.join = function(form) {
|
||||||
if (form && form.$invalid) {
|
if (form && form.$invalid) {
|
||||||
self.error = gettext('Please enter the required fields');
|
self.error = gettext('Please enter the required fields');
|
||||||
|
|
@ -26,7 +64,7 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
bwsurl: $scope.bwsurl
|
bwsurl: $scope.bwsurl
|
||||||
}
|
}
|
||||||
|
|
||||||
var setSeed = form.setSeed.$modelValue;
|
var setSeed = self.seedSourceId =='set';
|
||||||
if (setSeed) {
|
if (setSeed) {
|
||||||
var words = form.privateKey.$modelValue;
|
var words = form.privateKey.$modelValue;
|
||||||
if (words.indexOf(' ') == -1 && words.indexOf('prv') == 1 && words.length > 108) {
|
if (words.indexOf(' ') == -1 && words.indexOf('prv') == 1 && words.length > 108) {
|
||||||
|
|
@ -44,10 +82,14 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (form.hwLedger.$modelValue || form.hwTrezor.$modelValue) {
|
if (self.seedSourceId == 'ledger' || self.seedSourceId == 'trezor') {
|
||||||
self.hwWallet = form.hwLedger.$modelValue ? 'Ledger' : 'TREZOR';
|
var account = $scope.account;
|
||||||
var src = form.hwLedger.$modelValue ? ledger : trezor;
|
if (!account) {
|
||||||
var account = form.account.$modelValue;
|
this.error = gettext('Please select account');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.hwWallet = self.seedSourceId == 'ledger' ? 'Ledger' : 'Trezor';
|
||||||
|
var src = self.seedSourceId == 'ledger' ? ledger : trezor;
|
||||||
|
|
||||||
src.getInfoForNewWallet(true, account, function(err, lopts) {
|
src.getInfoForNewWallet(true, account, function(err, lopts) {
|
||||||
self.hwWallet = false;
|
self.hwWallet = false;
|
||||||
|
|
@ -82,4 +124,7 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
});
|
});
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
updateSeedSourceSelect();
|
||||||
|
self.setSeedSource('new');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.services')
|
angular.module('copayApp.services')
|
||||||
.factory('ledger', function($log, bwcService, gettext) {
|
.factory('ledger', function($log, bwcService, gettext, hwWallet) {
|
||||||
var root = {};
|
var root = {};
|
||||||
var LEDGER_CHROME_ID = "kkdpmhnladdopljabkgpacgpliggeeaf";
|
var LEDGER_CHROME_ID = "kkdpmhnladdopljabkgpacgpliggeeaf";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue