fix txConfirmed type

This commit is contained in:
Mononaut 2023-06-04 11:44:40 -04:00
parent 9d4b58604b
commit 8b1dff6d15
No known key found for this signature in database
GPG key ID: A3F058E41374C04E
3 changed files with 5 additions and 5 deletions

View file

@ -6,7 +6,7 @@ export interface WebsocketResponse {
block?: BlockExtended; block?: BlockExtended;
blocks?: BlockExtended[]; blocks?: BlockExtended[];
conversions?: any; conversions?: any;
txConfirmed?: string | boolean; txConfirmed?: string;
historicalDate?: string; historicalDate?: string;
mempoolInfo?: MempoolInfo; mempoolInfo?: MempoolInfo;
vBytesPerSecond?: number; vBytesPerSecond?: number;

View file

@ -92,7 +92,7 @@ export class StateService {
networkChanged$ = new ReplaySubject<string>(1); networkChanged$ = new ReplaySubject<string>(1);
lightningChanged$ = new ReplaySubject<boolean>(1); lightningChanged$ = new ReplaySubject<boolean>(1);
blocks$: ReplaySubject<[BlockExtended, string | boolean]>; blocks$: ReplaySubject<[BlockExtended, string]>;
transactions$ = new ReplaySubject<TransactionStripped>(6); transactions$ = new ReplaySubject<TransactionStripped>(6);
conversions$ = new ReplaySubject<any>(1); conversions$ = new ReplaySubject<any>(1);
bsqPrice$ = new ReplaySubject<number>(1); bsqPrice$ = new ReplaySubject<number>(1);
@ -163,7 +163,7 @@ export class StateService {
} }
}); });
this.blocks$ = new ReplaySubject<[BlockExtended, boolean]>(this.env.KEEP_BLOCKS_AMOUNT); this.blocks$ = new ReplaySubject<[BlockExtended, string]>(this.env.KEEP_BLOCKS_AMOUNT);
if (this.env.BASE_MODULE === 'bisq') { if (this.env.BASE_MODULE === 'bisq') {
this.network = this.env.BASE_MODULE; this.network = this.env.BASE_MODULE;

View file

@ -241,7 +241,7 @@ export class WebsocketService {
blocks.forEach((block: BlockExtended) => { blocks.forEach((block: BlockExtended) => {
if (block.height > this.stateService.latestBlockHeight) { if (block.height > this.stateService.latestBlockHeight) {
maxHeight = Math.max(maxHeight, block.height); maxHeight = Math.max(maxHeight, block.height);
this.stateService.blocks$.next([block, false]); this.stateService.blocks$.next([block, '']);
} }
}); });
this.stateService.updateChainTip(maxHeight); this.stateService.updateChainTip(maxHeight);
@ -258,7 +258,7 @@ export class WebsocketService {
if (response.block) { if (response.block) {
if (response.block.height > this.stateService.latestBlockHeight) { if (response.block.height > this.stateService.latestBlockHeight) {
this.stateService.updateChainTip(response.block.height); this.stateService.updateChainTip(response.block.height);
this.stateService.blocks$.next([response.block, response.txConfirmed]); this.stateService.blocks$.next([response.block, response.txConfirmed || '']);
} }
if (response.txConfirmed) { if (response.txConfirmed) {