mirror of
https://github.com/mempool/mempool.git
synced 2025-01-19 05:34:03 +01:00
update acceleration dashboard to match actual API format
This commit is contained in:
parent
6cf40489e5
commit
f409c67125
@ -18,16 +18,16 @@ export class AccelerationStatsComponent implements OnInit {
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.accelerationStats$ = this.apiService.getAccelerations$(this.timespan).pipe(
|
||||
this.accelerationStats$ = this.apiService.getAccelerationHistory$(this.timespan).pipe(
|
||||
switchMap(accelerations => {
|
||||
let totalFeeDelta = 0;
|
||||
let totalMined = 0;
|
||||
let totalCanceled = 0;
|
||||
for (const acceleration of accelerations) {
|
||||
if (acceleration.mined) {
|
||||
if (acceleration.status === 'completed' || acceleration.status === 'mined') {
|
||||
totalMined++;
|
||||
totalFeeDelta += acceleration.feeDelta;
|
||||
} else if (acceleration.canceled) {
|
||||
} else if (acceleration.status === 'failed') {
|
||||
totalCanceled++;
|
||||
}
|
||||
}
|
||||
|
@ -22,14 +22,14 @@
|
||||
</a>
|
||||
</td>
|
||||
<td class="fee text-right">
|
||||
{{ acceleration.fee | number }} <span class="symbol" i18n="shared.sat|sat">sat</span>
|
||||
{{ acceleration.feePaid | number }} <span class="symbol" i18n="shared.sat|sat">sat</span>
|
||||
</td>
|
||||
<td class="fee-delta text-right">
|
||||
{{ acceleration.feeDelta | number }} <span class="symbol" i18n="shared.sat|sat">sat</span>
|
||||
</td>
|
||||
<td class="status text-right">
|
||||
<span *ngIf="acceleration.mined" class="badge badge-success" i18n="transaction.rbf.mined">Mined</span>
|
||||
<span *ngIf="acceleration.canceled" class="badge badge-danger" i18n="accelerator.canceled">Canceled</span>
|
||||
<span *ngIf="acceleration.status === 'mined' || acceleration.status === 'completed'" class="badge badge-success" i18n="transaction.rbf.mined">Mined</span>
|
||||
<span *ngIf="acceleration.status === 'failed'" class="badge badge-danger" i18n="accelerator.canceled">Canceled</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -39,7 +39,7 @@ export class AccelerationsListComponent implements OnInit {
|
||||
this.skeletonLines = this.widget === true ? [...Array(6).keys()] : [...Array(15).keys()];
|
||||
this.paginationMaxSize = window.matchMedia('(max-width: 670px)').matches ? 3 : 5;
|
||||
|
||||
this.accelerations$ = this.apiService.getAccelerations$('24h').pipe(
|
||||
this.accelerations$ = this.apiService.getAccelerations$().pipe(
|
||||
switchMap(accelerations => {
|
||||
if (this.widget) {
|
||||
return of(accelerations.slice(0, 6));
|
||||
|
@ -46,7 +46,7 @@ export class AcceleratorDashboardComponent implements OnInit {
|
||||
return of(blocks as AccelerationBlock[]);
|
||||
})
|
||||
),
|
||||
this.apiService.getAccelerations$('24h').pipe(
|
||||
this.apiService.getAccelerationHistory$('24h').pipe(
|
||||
catchError((err) => {
|
||||
this.loadingBlocks = false;
|
||||
return of([]);
|
||||
@ -56,11 +56,11 @@ export class AcceleratorDashboardComponent implements OnInit {
|
||||
switchMap(([blocks, accelerations]) => {
|
||||
const accelerationsByBlock: { [ hash: string ]: Acceleration[] } = {};
|
||||
for (const acceleration of accelerations) {
|
||||
if (acceleration.mined && !accelerationsByBlock[acceleration.block_hash]) {
|
||||
accelerationsByBlock[acceleration.block_hash] = [];
|
||||
if (acceleration.mined && !accelerationsByBlock[acceleration.blockHash]) {
|
||||
accelerationsByBlock[acceleration.blockHash] = [];
|
||||
}
|
||||
if (acceleration.mined) {
|
||||
accelerationsByBlock[acceleration.block_hash].push(acceleration);
|
||||
accelerationsByBlock[acceleration.blockHash].push(acceleration);
|
||||
}
|
||||
}
|
||||
return of(blocks.slice(0, 6).map(block => {
|
||||
|
Loading…
Reference in New Issue
Block a user