mirror of
https://github.com/mempool/mempool.git
synced 2025-02-23 06:35:15 +01:00
Add LN statistics interface
This commit is contained in:
parent
97053ab5cf
commit
464cffb5c1
7 changed files with 35 additions and 9 deletions
|
@ -254,6 +254,29 @@ export interface INodesRanking {
|
||||||
topByChannels: ITopNodesPerChannels[];
|
topByChannels: ITopNodesPerChannels[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface INodesStatisticsEntry {
|
||||||
|
added: string;
|
||||||
|
avg_base_fee_mtokens: number;
|
||||||
|
avg_capacity: number;
|
||||||
|
avg_fee_rate: number;
|
||||||
|
channel_count: number;
|
||||||
|
clearnet_nodes: number;
|
||||||
|
clearnet_tor_nodes: number;
|
||||||
|
id: number;
|
||||||
|
med_base_fee_mtokens: number;
|
||||||
|
med_capacity: number;
|
||||||
|
med_fee_rate: number;
|
||||||
|
node_count: number;
|
||||||
|
tor_nodes: number;
|
||||||
|
total_capacity: number;
|
||||||
|
unannounced_nodes: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface INodesStatistics {
|
||||||
|
latest: INodesStatisticsEntry;
|
||||||
|
previous: INodesStatisticsEntry;
|
||||||
|
}
|
||||||
|
|
||||||
export interface IOldestNodes {
|
export interface IOldestNodes {
|
||||||
publicKey: string,
|
publicKey: string,
|
||||||
alias: string,
|
alias: string,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
import { INodesStatistics } from '../../interfaces/node-api.interface';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-channels-statistics',
|
selector: 'app-channels-statistics',
|
||||||
|
@ -8,7 +9,7 @@ import { Observable } from 'rxjs';
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class ChannelsStatisticsComponent implements OnInit {
|
export class ChannelsStatisticsComponent implements OnInit {
|
||||||
@Input() statistics$: Observable<any>;
|
@Input() statistics$: Observable<INodesStatistics>;
|
||||||
mode: string = 'avg';
|
mode: string = 'avg';
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { AfterViewInit, ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
|
import { AfterViewInit, ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { share } from 'rxjs/operators';
|
import { share } from 'rxjs/operators';
|
||||||
import { INodesRanking } from '../../interfaces/node-api.interface';
|
import { INodesRanking, INodesStatistics } from '../../interfaces/node-api.interface';
|
||||||
import { SeoService } from '../../services/seo.service';
|
import { SeoService } from '../../services/seo.service';
|
||||||
import { StateService } from '../../services/state.service';
|
import { StateService } from '../../services/state.service';
|
||||||
import { LightningApiService } from '../lightning-api.service';
|
import { LightningApiService } from '../lightning-api.service';
|
||||||
|
@ -13,7 +13,7 @@ import { LightningApiService } from '../lightning-api.service';
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class LightningDashboardComponent implements OnInit, AfterViewInit {
|
export class LightningDashboardComponent implements OnInit, AfterViewInit {
|
||||||
statistics$: Observable<any>;
|
statistics$: Observable<INodesStatistics>;
|
||||||
nodesRanking$: Observable<INodesRanking>;
|
nodesRanking$: Observable<INodesRanking>;
|
||||||
officialMempoolSpace = this.stateService.env.OFFICIAL_MEMPOOL_SPACE;
|
officialMempoolSpace = this.stateService.env.OFFICIAL_MEMPOOL_SPACE;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
import { INodesStatistics } from '../../interfaces/node-api.interface';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-node-statistics',
|
selector: 'app-node-statistics',
|
||||||
|
@ -8,7 +9,7 @@ import { Observable } from 'rxjs';
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class NodeStatisticsComponent implements OnInit {
|
export class NodeStatisticsComponent implements OnInit {
|
||||||
@Input() statistics$: Observable<any>;
|
@Input() statistics$: Observable<INodesStatistics>;
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { ActivatedRoute } from '@angular/router';
|
||||||
import { LightningApiService } from '../lightning-api.service';
|
import { LightningApiService } from '../lightning-api.service';
|
||||||
import { share } from 'rxjs/operators';
|
import { share } from 'rxjs/operators';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
import { INodesStatistics } from '../../interfaces/node-api.interface';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-nodes-ranking',
|
selector: 'app-nodes-ranking',
|
||||||
|
@ -12,7 +13,7 @@ import { Observable } from 'rxjs';
|
||||||
})
|
})
|
||||||
export class NodesRanking implements OnInit {
|
export class NodesRanking implements OnInit {
|
||||||
type: string;
|
type: string;
|
||||||
statistics$: Observable<any>;
|
statistics$: Observable<INodesStatistics>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
||||||
import { map, Observable } from 'rxjs';
|
import { map, Observable } from 'rxjs';
|
||||||
import { INodesRanking, ITopNodesPerCapacity } from '../../../interfaces/node-api.interface';
|
import { INodesRanking, INodesStatistics, ITopNodesPerCapacity } from '../../../interfaces/node-api.interface';
|
||||||
import { SeoService } from '../../../services/seo.service';
|
import { SeoService } from '../../../services/seo.service';
|
||||||
import { StateService } from '../../../services/state.service';
|
import { StateService } from '../../../services/state.service';
|
||||||
import { GeolocationData } from '../../../shared/components/geolocation/geolocation.component';
|
import { GeolocationData } from '../../../shared/components/geolocation/geolocation.component';
|
||||||
|
@ -14,7 +14,7 @@ import { LightningApiService } from '../../lightning-api.service';
|
||||||
})
|
})
|
||||||
export class TopNodesPerCapacity implements OnInit {
|
export class TopNodesPerCapacity implements OnInit {
|
||||||
@Input() nodes$: Observable<INodesRanking>;
|
@Input() nodes$: Observable<INodesRanking>;
|
||||||
@Input() statistics$: Observable<any>;
|
@Input() statistics$: Observable<INodesStatistics>;
|
||||||
@Input() widget: boolean = false;
|
@Input() widget: boolean = false;
|
||||||
|
|
||||||
topNodesPerCapacity$: Observable<ITopNodesPerCapacity[]>;
|
topNodesPerCapacity$: Observable<ITopNodesPerCapacity[]>;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
||||||
import { map, Observable } from 'rxjs';
|
import { map, Observable } from 'rxjs';
|
||||||
import { INodesRanking, ITopNodesPerChannels } from '../../../interfaces/node-api.interface';
|
import { INodesRanking, INodesStatistics, ITopNodesPerChannels } from '../../../interfaces/node-api.interface';
|
||||||
import { SeoService } from '../../../services/seo.service';
|
import { SeoService } from '../../../services/seo.service';
|
||||||
import { StateService } from '../../../services/state.service';
|
import { StateService } from '../../../services/state.service';
|
||||||
import { GeolocationData } from '../../../shared/components/geolocation/geolocation.component';
|
import { GeolocationData } from '../../../shared/components/geolocation/geolocation.component';
|
||||||
|
@ -14,7 +14,7 @@ import { LightningApiService } from '../../lightning-api.service';
|
||||||
})
|
})
|
||||||
export class TopNodesPerChannels implements OnInit {
|
export class TopNodesPerChannels implements OnInit {
|
||||||
@Input() nodes$: Observable<INodesRanking>;
|
@Input() nodes$: Observable<INodesRanking>;
|
||||||
@Input() statistics$: Observable<any>;
|
@Input() statistics$: Observable<INodesStatistics>;
|
||||||
@Input() widget: boolean = false;
|
@Input() widget: boolean = false;
|
||||||
|
|
||||||
topNodesPerChannels$: Observable<ITopNodesPerChannels[]>;
|
topNodesPerChannels$: Observable<ITopNodesPerChannels[]>;
|
||||||
|
|
Loading…
Add table
Reference in a new issue