import { Component } from '@angular/core' ; import { AirGapWallet , MessageSignResponse } from '@airgap/coinlib-core' ; import { ErrorCategory , handleErrorLocal } from '../../services/error-handler/error-handler.service' ; import { NavigationService } from '../../services/navigation/navigation.service' ; import { TranslateService } from '@ngx-translate/core' ; enum TransactionQRType { SignedAirGap = 0 , SignedRaw = 1 } @ Component ( { selector : 'airgap-transaction-signed' , templateUrl : './transaction-signed.page.html' , styleUrls : [ './transaction-signed.page.scss' ] } ) export class TransactionSignedPage { public signedTxs : string [ ] ; public interactionUrl : string ; public splits : string [ ] ; public pageTitle : string ; public heading : string ; public translationKey : string ; public messageSignResponse : MessageSignResponse ; public wallets : AirGapWallet [ ] ; public qrType : TransactionQRType = 0 ; public signedTransactionSync : any ; constructor ( public navigationService , private readonly translateService ) { this . interactionUrl = this . navigationService . getState ( ) . interactionUrl ; this . wallets = this . navigationService . getState ( ) . wallets ; this . signedTxs = this . navigationService . getState ( ) . signedTxs ; this . translationKey = this . navigationService . getState ( ) . translationKey ; this . pageTitle = this . translateService . instant ( `${ this . translationKey }.title` ) ; this . heading = this . translateService . instant ( `${ this . translationKey }.heading` ) ; this . messageSignResponse = this . navigationService . getState ( ) . messageSignResponse ; } public done ( ) { this . navigationService . routeToAccountsTab ( ) . catch ( handleErrorLocal ( ErrorCategory . IONIC_NAVIGATION ) ) ; } }