import { Component , OnInit } from '@angular/core' ; import { Account , SuggestedFees } from '@signumjs/core' ; import { ActivatedRoute } from '@angular/router' ; import { StoreService } from '../../../store/store.service' ; import { takeUntil } from 'rxjs/operators' ; import { UnsubscribeOnDestroy } from '../../../util/UnsubscribeOnDestroy' ; import { getBalancesFromAccount } from '../../../util/balance' ; import { TokenData } from '../../../shared/services/token.service' ; @ Component ( { selector : 'app-token-transfer' , templateUrl : './token-transfer.component.html' , styleUrls : [ './token-transfer.component.scss' ] } ) export class TokenTransferComponent extends UnsubscribeOnDestroy implements OnInit { account : Account ; fees : SuggestedFees ; token : TokenData ; locale : string ; constructor ( private route , private storeService ) { super ( ) ; } ngOnInit ( ) { this . account = this . route . snapshot . data . account as Account ; this . fees = this . route . snapshot . data . suggestedFees as SuggestedFees ; this . token = this . route . snapshot . data . token as TokenData ; this . storeService . settings . pipe ( takeUntil ( this . unsubscribeAll ) ) . subscribe ( ( { language } ) => { this . locale = language ; } ) ; } getBalance ( ) { return getBalancesFromAccount ( this . account ) . availableBalance . getSigna ( ) ; } }