Liquid: Display BTC as L-BTC.

This commit is contained in:
softsimon 2020-03-25 21:55:18 +07:00
parent 6b96dce478
commit 12546e1096
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
7 changed files with 18 additions and 7 deletions

View File

@ -18,15 +18,15 @@
<tbody>
<tr>
<td>Total received</td>
<td>{{ receieved / 100000000 | number: '1.8-8' }} BTC</td>
<td>{{ receieved / 100000000 | number: '1.8-8' }} <ng-template [ngIf]="network === 'liquid'">L-</ng-template>BTC</td>
</tr>
<tr>
<td>Total sent</td>
<td>{{ sent / 100000000 | number: '1.8-8' }} BTC</td>
<td>{{ sent / 100000000 | number: '1.8-8' }} <ng-template [ngIf]="network === 'liquid'">L-</ng-template>BTC</td>
</tr>
<tr>
<td>Balance</td>
<td>{{ (receieved - sent) / 100000000 | number: '1.8-8' }} BTC (<app-fiat [value]="receieved - sent"></app-fiat>)</td>
<td>{{ (receieved - sent) / 100000000 | number: '1.8-8' }} <ng-template [ngIf]="network === 'liquid'">L-</ng-template>BTC (<app-fiat [value]="receieved - sent"></app-fiat>)</td>
</tr>
</tbody>
</table>

View File

@ -9,6 +9,7 @@ import { AudioService } from 'src/app/services/audio.service';
import { ApiService } from 'src/app/services/api.service';
import { of, merge } from 'rxjs';
import { SeoService } from 'src/app/services/seo.service';
import { environment } from 'src/environments/environment';
@Component({
selector: 'app-address',
@ -16,6 +17,8 @@ import { SeoService } from 'src/app/services/seo.service';
styleUrls: ['./address.component.scss']
})
export class AddressComponent implements OnInit, OnDestroy {
network = environment.network;
address: Address;
addressString: string;
isLoadingAddress = true;

View File

@ -6,6 +6,6 @@
Confidential
</ng-template>
<ng-template #default>
{{ satoshis / 100000000 | number : '1.8-8' }} BTC
{{ satoshis / 100000000 | number : '1.8-8' }} <ng-template [ngIf]="network === 'liquid'">L-</ng-template>BTC
</ng-template>
</ng-template>

View File

@ -49,12 +49,12 @@
<ng-template [ngIf]="fees !== undefined" [ngIfElse]="loadingFees">
<tr>
<td>Total fees</td>
<td><span title="{{ fees | number: '1.2-8' }} BTC">{{ fees | number: '1.2-2' }} BTC</span> (<app-fiat [value]="fees * 100000000" digitsInfo="1.0-0"></app-fiat>)</td>
<td><span title="{{ fees | number: '1.2-8' }} BTC">{{ fees | number: '1.2-2' }} <ng-template [ngIf]="network === 'liquid'">L-</ng-template>BTC</span> (<app-fiat [value]="fees * 100000000" digitsInfo="1.0-0"></app-fiat>)</td>
</tr>
<tr>
<td>Reward + fees:</td>
<td>
<span title="{{ blockSubsidy + fees | number: '1.2-8' }} BTC">{{ blockSubsidy + fees | number: '1.2-2' }} BTC</span> (<app-fiat [value]="(blockSubsidy + fees) * 100000000" digitsInfo="1.0-0"></app-fiat>)
<span title="{{ blockSubsidy + fees | number: '1.2-8' }} BTC">{{ blockSubsidy + fees | number: '1.2-2' }} <ng-template [ngIf]="network === 'liquid'">L-</ng-template>BTC</span> (<app-fiat [value]="(blockSubsidy + fees) * 100000000" digitsInfo="1.0-0"></app-fiat>)
</td>
</tr>
</ng-template>

View File

@ -6,6 +6,7 @@ import { Block, Transaction, Vout } from '../../interfaces/electrs.interface';
import { of } from 'rxjs';
import { StateService } from '../../services/state.service';
import { SeoService } from 'src/app/services/seo.service';
import { environment } from 'src/environments/environment';
@Component({
selector: 'app-block',
@ -13,6 +14,7 @@ import { SeoService } from 'src/app/services/seo.service';
styleUrls: ['./block.component.scss']
})
export class BlockComponent implements OnInit, OnDestroy {
network = environment.network;
block: Block;
blockHeight: number;
blockHash: string;
@ -97,6 +99,10 @@ export class BlockComponent implements OnInit, OnDestroy {
}
setBlockSubsidy() {
if (this.network === 'liquid') {
this.blockSubsidy = 0;
return;
}
this.blockSubsidy = 50;
let halvenings = Math.floor(this.block.height / 210000);
while (halvenings > 0) {

View File

@ -19,7 +19,7 @@
</tr>
<tr>
<td>Total fees</td>
<td>{{ mempoolBlock.totalFees / 100000000 | number : '1.2-2' }} BTC (<app-fiat [value]="mempoolBlock.totalFees" digitsInfo="1.0-0"></app-fiat>)</td>
<td>{{ mempoolBlock.totalFees / 100000000 | number : '1.2-2' }} <ng-template [ngIf]="network === 'liquid'">L-</ng-template>BTC (<app-fiat [value]="mempoolBlock.totalFees" digitsInfo="1.0-0"></app-fiat>)</td>
</tr>
<tr>
<td>Transactions</td>

View File

@ -5,6 +5,7 @@ import { switchMap, map, tap } from 'rxjs/operators';
import { MempoolBlock } from 'src/app/interfaces/websocket.interface';
import { Observable } from 'rxjs';
import { SeoService } from 'src/app/services/seo.service';
import { environment } from 'src/environments/environment';
@Component({
selector: 'app-mempool-block',
@ -12,6 +13,7 @@ import { SeoService } from 'src/app/services/seo.service';
styleUrls: ['./mempool-block.component.scss']
})
export class MempoolBlockComponent implements OnInit, OnDestroy {
network = environment.network;
mempoolBlockIndex: number;
mempoolBlock$: Observable<MempoolBlock>;