<ion-header>
  <head-nav [title]="'Address'"></head-nav>
</ion-header>

<ion-content padding>
  <div *ngIf="loading">
    <ion-spinner name="crescent"></ion-spinner>
  </div>

  <div *ngIf="!loading">
    <h1>Address</h1>
    <p class="ellipsis"><b>Address</b> {{ address.addrStr }}</p>
    <p>{{ currency.getConversion(address.balance) }}</p>

    <h2>Summary</h2>

    <ion-list class="list--summary">
      <ion-item>
        Total Received
        <ion-note item-end>
          {{ currency.getConversion(address.totalReceived) }}
        </ion-note>
      </ion-item>
      <ion-item>
        Total Sent
        <ion-note item-end>
          {{ currency.getConversion(address.totalSent) }}
        </ion-note>
      </ion-item>
      <ion-item>
        Final Balance
        <ion-note item-end>
          {{ currency.getConversion(address.balance) }}
        </ion-note>
      </ion-item>
      <ion-item>
        No. Transactions
        <ion-note item-end>
          {{ address.txApperances }}
        </ion-note>
      </ion-item>
    </ion-list>

    <p text-center>
      <qr-code [value]="address.addrStr" [size]="160"></qr-code>
      <p>

        <h2>Transactions</h2>

        <transaction-list [queryType]="'address'" [queryValue]="addrStr"></transaction-list>
  </div>

</ion-content>
