mempool/frontend/src/app/components/fees-box/fees-box.component.ts

35 lines
1.1 KiB
TypeScript
Raw Normal View History

import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { StateService } from 'src/app/services/state.service';
import { map, filter, tap } from 'rxjs/operators';
2020-09-28 16:32:48 +07:00
import { merge, Observable } from 'rxjs';
import { MempoolBlock, Recommendedfees } from 'src/app/interfaces/websocket.interface';
interface FeeEstimations {
fastestFee: number;
halfHourFee: number;
hourFee: number;
}
@Component({
selector: 'app-fees-box',
templateUrl: './fees-box.component.html',
styleUrls: ['./fees-box.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FeesBoxComponent implements OnInit {
2020-07-30 13:13:22 +07:00
isLoadingWebSocket$: Observable<boolean>;
recommendedFees$: Observable<Recommendedfees>;
defaultFee: number;
constructor(
private stateService: StateService,
) { }
ngOnInit(): void {
this.defaultFee = this.stateService.network === 'liquid' || this.stateService.network === 'liquidtestnet' ? 0.1 : 1;
2020-07-30 13:13:22 +07:00
this.isLoadingWebSocket$ = this.stateService.isLoadingWebSocket$;
this.recommendedFees$ = this.stateService.recommendedFees$;
}
}