copay-crown
Version:
A Secure Crown Wallet
85 lines (84 loc) • 5.01 kB
HTML
<ion-header>
<ion-navbar>
<ion-title>{{'Export wallet' | translate}}</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<page-wallet-item [wallet]="wallet"></page-wallet-item>
<div [attr.padding]="isIOS ? '' : null">
<ion-segment [(ngModel)]="segments">
<ion-segment-button value="file/text">
File/Text
</ion-segment-button>
<ion-segment-button value="qr-code" (click)="generateQrCode()">
QR Code
</ion-segment-button>
</ion-segment>
</div>
<div [ngSwitch]="segments">
<ion-list *ngSwitchCase="'file/text'">
<div *ngIf="!backupWalletPlainText">
<form [formGroup]="exportWalletForm">
<ion-item>
<ion-label stacked translate>Set up a password</ion-label>
<ion-input type="password" formControlName="password" placeholder="{{'Your password'|translate}}" required></ion-input>
</ion-item>
<ion-item>
<ion-label stacked translate>Repeat the password</ion-label>
<ion-input type="password" formControlName="confirmPassword" placeholder="{{'Repeat password'|translate}}" required></ion-input>
</ion-item>
<ion-item class='form-text error' *ngIf="exportWalletForm.controls.confirmPassword.touched && exportWalletForm.hasError('mismatchedPasswords') && exportWalletForm.controls.password.valid">
<div translate>Passwords do not match</div>
</ion-item>
<div *ngIf="canSign">
<ion-item-divider></ion-item-divider>
<ion-item (click)="showAdvChange()">
<span translate *ngIf="!showAdv">Show advanced options</span>
<span translate *ngIf="showAdv">Hide advanced options</span>
</ion-item>
<ion-item *ngIf="showAdv">
<ion-label stacked>Do not include private key</ion-label>
<ion-checkbox formControlName="noSignEnabled" (ionChange)="noSignEnabledChange()"></ion-checkbox>
</ion-item>
</div>
<ion-item-divider *ngIf="!canSign || exportWalletForm.value.noSignEnabled" text-wrap>
<div *ngIf="!canSign">
<span translate>
WARNING: The private key of this wallet is not available. The export allows to check the wallet balance, transaction history,
and create spend proposals from the export. However, does not allow to approve (sign) proposals, so
<b>funds will not be accessible from the export</b>.
</span>
</div>
<div *ngIf="exportWalletForm.value.noSignEnabled">
<span translate>
WARNING: Not including the private key allows to check the wallet balance, transaction history, and create spend proposals
from the export. However, does not allow to approve (sign) proposals, so
<b>funds will not be accessible from the export</b>.
</span>
</div>
</ion-item-divider>
<button *ngIf="!isSafari && !isCordova" ion-button block clear type="submit" (click)="downloadWalletBackup()" [disabled]="(!exportWalletForm.value.password || exportWalletForm.value.password != exportWalletForm.value.confirmPassword) || !exportWalletForm.valid ">Download</button>
<button *ngIf="isSafari && !isCordova" ion-button block clear type="submit" (click)="viewWalletBackup()" [disabled]="(!exportWalletForm.value.password || exportWalletForm.value.password != exportWalletForm.value.confirmPassword) || !exportWalletForm.valid ">View</button>
<div *ngIf="isCordova">
<button ion-button block clear type="submit" (click)="copyWalletBackup()" [disabled]="(!exportWalletForm.value.password || exportWalletForm.value.password != exportWalletForm.value.confirmPassword) || !exportWalletForm.valid ">Copy to clipboard</button>
<button ion-button block clear type="submit" (click)="sendWalletBackup()" [disabled]="(!exportWalletForm.value.password || exportWalletForm.value.password != exportWalletForm.value.confirmPassword) || !exportWalletForm.valid ">Send by email</button>
</div>
</form>
</div>
<div *ngIf="backupWalletPlainText">
<span translate>Backup wallet</span>
<p translate>Copy this text as it is to a safe place (notepad or email)</p>
<ion-textarea rows="12">{{backupWalletPlainText}}</ion-textarea>
</div>
</ion-list>
<ion-list *ngSwitchCase="'qrCode'">
<div class="qrCode" *ngIf="supported">
<ngx-qrcode qrc-value="{{exportWalletInfo}}" qrc-class="aclass" qrc-errorCorrectionLevel="M"></ngx-qrcode>
<div translate>From the destination device, go to Add wallet > Import wallet and scan this QR code</div>
</div>
<ion-card class="not-supported-message" *ngIf="!supported">
<ion-card-content>Exporting via QR not supported for this wallet</ion-card-content>
</ion-card>
</ion-list>
</div>
</ion-content>