Replace acceleration API polling with websocket

This commit is contained in:
Mononaut
2024-05-04 00:18:33 +00:00
parent 8ec5dd70e0
commit a29b29300e
8 changed files with 136 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
import { SafeResourceUrl } from '@angular/platform-browser';
import { ILoadingIndicators } from '../services/state.service';
import { Transaction } from './electrs.interface';
import { BlockExtended, DifficultyAdjustment, RbfTree, TransactionStripped } from './node-api.interface';
import { Acceleration, BlockExtended, DifficultyAdjustment, RbfTree, TransactionStripped } from './node-api.interface';
export interface WebsocketResponse {
backend?: 'esplora' | 'electrum' | 'none';
@@ -35,6 +35,7 @@ export interface WebsocketResponse {
'track-mempool-block'?: number;
'track-rbf'?: string;
'track-rbf-summary'?: boolean;
'track-accelerations'?: boolean;
'watch-mempool'?: boolean;
'refresh-blocks'?: boolean;
}
@@ -92,6 +93,12 @@ export interface MempoolBlockDeltaCompressed {
changed: MempoolDeltaChange[];
}
export interface AccelerationDelta {
added: Acceleration[];
removed: string[];
reset?: boolean;
}
export interface MempoolInfo {
loaded: boolean; // (boolean) True if the mempool is fully loaded
size: number; // (numeric) Current tx count