sweep paper wallet from scanner tab

This commit is contained in:
Gabriel Bazán 2016-11-22 11:37:19 -03:00
commit ec6d78237c
8 changed files with 10119 additions and 175 deletions

View file

@ -75,4 +75,28 @@
</a>
</div>
<div ng-if="type === 'privateKey'">
<div class="incoming-data-menu__item head">
<div class="incoming-data-menu__header">Private Key</div>
<div class="incoming-data-menu__url">
<div class="incoming-data-menu__url__text" style="border: 0;">
{{data}}
</div>
</div>
</div>
<a class="incoming-data-menu__item item item-icon-right" ng-click="scanPaperWallet(data)">
<img src="img/icon-activity.svg">
<div class="incoming-data-menu__item__text">Sweep paper wallet</div>
<i class="icon bp-arrow-right"></i>
</a>
<a class="incoming-data-menu__item item item-icon-right" copy-to-clipboard="data">
<img src="img/icon-paperclip.svg">
<div class="incoming-data-menu__item__text">Copy to clipboard</div>
<i class="icon bp-arrow-right"></i>
</a>
<a class="incoming-data-menu__cancel item" ng-click="hide()">
Cancel
</a>
</div>
</action-sheet>

View file

@ -1,91 +1,37 @@
<ion-view>
<ion-view hide-tabs>
<ion-nav-bar class="bar-royal">
<ion-nav-title>{{'Sweep paper wallet' | translate}}</ion-nav-title>
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="secondary">
<button ng-disabled="sending || balanceSat <= 0 || noMatchingWallet" class="button no-border" ng-click="sweepWallet()" translate>
Sweep
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<div class="settings ng-hide" class="row" ng-show="needsBackup">
<div class="settings-explanation">
<div class="settings-heading" translate>Backup Needed</div>
<div class="settings-description" translate>
Before receiving funds, you must backup your wallet. If this device is lost, it is impossible to access your funds without a backup.
</div>
<a class="button button-standard button-primary" href ui-sref="tabs.preferences.backupWarning({from: 'tabs.preferences'})" translate>Backup Now</a>
</div>
</div>
<div class="ng-hide" ng-show="!needsBackup">
<h4 ng-show="!error"></h4>
<div class="box-notification m20b" ng-show="error">
<span class="text-warning">{{error|translate}}</span>
</div>
<form ng-show="!balance" ng-submit="scanFunds()" novalidate>
<div class="list card">
<div class="row">
<div class="col col-90">
<label class="item item-input item-stacked-label">
<span class="input-label" translate>Paper Wallet Private Key</span>
<input type="text" placeholder="{{'Paste your paper wallet private key here'|translate}}" ng-model="formData.inputData" id="inputData" ng-change="onData(formData.inputData)">
</label>
</div>
<div class="col text-center">
<qr-scanner class="size-24" ng-style="{'line-height': '45px'}" on-scan="onQrCodeScannedPaperWallet(data)"></qr-scanner>
</div>
</div>
<div class="row" ng-show="isPkEncrypted">
<div class="col">
<label class="item item-input item-stacked-label">
<span class="input-label" translate>Password</span>
<input type="text" name="passphrase" placeholder="{{'Passphrase'|translate}}" ng-model="passphrase">
</label>
<p class="card size-12 text-gray" translate>
Decrypting a paper wallet could take around 5 minutes on this device. please be patient and keep the app open.
</p>
</div>
</div>
</div>
<button type="submit"
ng-disabled="scanning || !scannedKey"
class="button button-standard button-primary"
ng-style="{'background-color': wallet.color}"
translate>Scan Wallet Funds
</button>
</form>
<ion-content scroll="false">
<div ng-class="ng-hide" ng-show="!noMatchingWallet">
<div class="row">
<div class="col text-center">
<div ng-show="scanned">
<h4 class="text-bold" translate>Funds found</h4>
<div class="size-24">{{balance}}</div>
</div>
<button
ng-show="balanceSat > 0"
ng-disabled="sending"
class="button button-standard button-primary"
ng-style="{'background-color': wallet.color}"
ng-click="sweepWallet()"
translate>Sweep Wallet
</button>
<button
ng-show="balanceSat <= 0 && scanned"
class="button button-standard button-primary"
ng-style="{'background-color': wallet.color}"
ng-click="init()"
translate>Scan Again
</button>
<h4 class="text-bold" translate>Funds found:</h4>
<div ng-show="balance" class="size-24 ng-hide">{{balance}}</div>
<div ng-show="!balance" class="size-24 ng-hide">...</div>
</div>
</div>
<wallets id="wallet-slider" wallets="wallets" options="sliderOptions"></wallets>
<div class="text-center size-12 text-gray">
<span translate>Funds will be transferred to</span>:
<b>{{walletAlias || walletName}}</b>
<b>{{wallet.walletAlias || wallet.name}}</b>
</div>
</div>
<div class="text-center padding ng-hide" ng-show="noMatchingWallet">
<span class="badge badge-energized" translate>No wallets available to receive funds</span>
</div>
<slide-to-accept-success
slide-success-show="sendStatus === 'success'"
slide-success-on-confirm="onSuccessConfirm()"
slide-success-hide-on-confirm="true">
<span translate>Founds transferred</span>
</slide-to-accept-success>
</ion-content>
</ion-view>

View file

@ -12,10 +12,6 @@
<span translate>Wallet Information</span>
<i class="icon bp-arrow-right"></i>
</a>
<a class="item item-icon-right" ng-show="network == 'livenet'" ui-sref="tabs.preferences.paperWallet">
<span translate>Sweep paper wallet</span>
<i class="icon bp-arrow-right"></i>
</a>
<a class="item item-icon-right" ui-sref="tabs.preferences.export">
<span translate>Export Wallet</span>
<i class="icon bp-arrow-right"></i>