Arrow navigation fix.
Liquid native asset notification fix.
This commit is contained in:
parent
c08a4c8424
commit
1d542c15e4
@ -11,6 +11,7 @@ import fiatConversion from './fiat-conversion';
|
|||||||
class WebsocketHandler {
|
class WebsocketHandler {
|
||||||
private wss: WebSocket.Server | undefined;
|
private wss: WebSocket.Server | undefined;
|
||||||
private latestGitCommitHash = '';
|
private latestGitCommitHash = '';
|
||||||
|
private nativeAssetId = '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d';
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.setLatestGitCommit();
|
this.setLatestGitCommit();
|
||||||
@ -168,14 +169,23 @@ class WebsocketHandler {
|
|||||||
const foundTransactions: TransactionExtended[] = [];
|
const foundTransactions: TransactionExtended[] = [];
|
||||||
|
|
||||||
newTransactions.forEach((tx) => {
|
newTransactions.forEach((tx) => {
|
||||||
const someVin = tx.vin.some((vin) => !!vin.issuance && vin.issuance.asset_id === client['track-asset']);
|
|
||||||
if (someVin) {
|
if (client['track-asset'] === this.nativeAssetId) {
|
||||||
foundTransactions.push(tx);
|
if (tx.vin.some((vin) => !!vin.is_pegin)) {
|
||||||
return;
|
foundTransactions.push(tx);
|
||||||
}
|
return;
|
||||||
const someVout = tx.vout.some((vout) => !!vout.asset && vout.asset === client['track-asset']);
|
}
|
||||||
if (someVout) {
|
if (tx.vout.some((vout) => !!vout.pegout)) {
|
||||||
foundTransactions.push(tx);
|
foundTransactions.push(tx);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (tx.vin.some((vin) => !!vin.issuance && vin.issuance.asset_id === client['track-asset'])) {
|
||||||
|
foundTransactions.push(tx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (tx.vout.some((vout) => !!vout.asset && vout.asset === client['track-asset'])) {
|
||||||
|
foundTransactions.push(tx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -244,12 +254,22 @@ class WebsocketHandler {
|
|||||||
const foundTransactions: TransactionExtended[] = [];
|
const foundTransactions: TransactionExtended[] = [];
|
||||||
|
|
||||||
transactions.forEach((tx) => {
|
transactions.forEach((tx) => {
|
||||||
if (tx.vin && tx.vin.some((vin) => !!vin.issuance && vin.issuance.asset_id === client['track-asset'])) {
|
if (client['track-asset'] === this.nativeAssetId) {
|
||||||
foundTransactions.push(tx);
|
if (tx.vin && tx.vin.some((vin) => !!vin.is_pegin)) {
|
||||||
return;
|
foundTransactions.push(tx);
|
||||||
}
|
return;
|
||||||
if (tx.vout && tx.vout.some((vout) => !!vout.asset && vout.asset === client['track-asset'])) {
|
}
|
||||||
foundTransactions.push(tx);
|
if (tx.vout && tx.vout.some((vout) => !!vout.pegout)) {
|
||||||
|
foundTransactions.push(tx);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (tx.vin && tx.vin.some((vin) => !!vin.issuance && vin.issuance.asset_id === client['track-asset'])) {
|
||||||
|
foundTransactions.push(tx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (tx.vout && tx.vout.some((vout) => !!vout.asset && vout.asset === client['track-asset'])) {
|
||||||
|
foundTransactions.push(tx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ export interface Vin {
|
|||||||
sequence: any;
|
sequence: any;
|
||||||
witness?: string[];
|
witness?: string[];
|
||||||
inner_witnessscript_asm?: string;
|
inner_witnessscript_asm?: string;
|
||||||
|
is_pegin?: boolean;
|
||||||
issuance?: Issuance;
|
issuance?: Issuance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,6 +79,7 @@ export interface Vout {
|
|||||||
scriptpubkey_address?: string;
|
scriptpubkey_address?: string;
|
||||||
value: number;
|
value: number;
|
||||||
|
|
||||||
|
pegout?: any;
|
||||||
asset?: string;
|
asset?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import { Router } from '@angular/router';
|
|||||||
styleUrls: ['./blockchain-blocks.component.scss']
|
styleUrls: ['./blockchain-blocks.component.scss']
|
||||||
})
|
})
|
||||||
export class BlockchainBlocksComponent implements OnInit, OnDestroy {
|
export class BlockchainBlocksComponent implements OnInit, OnDestroy {
|
||||||
|
network = '';
|
||||||
blocks: Block[] = [];
|
blocks: Block[] = [];
|
||||||
markHeight: number;
|
markHeight: number;
|
||||||
blocksSubscription: Subscription;
|
blocksSubscription: Subscription;
|
||||||
@ -26,6 +27,8 @@ export class BlockchainBlocksComponent implements OnInit, OnDestroy {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.stateService.networkChanged$.subscribe((network) => this.network = network);
|
||||||
|
|
||||||
this.blocksSubscription = this.stateService.blocks$
|
this.blocksSubscription = this.stateService.blocks$
|
||||||
.subscribe((block) => {
|
.subscribe((block) => {
|
||||||
if (this.blocks.some((b) => b.height === block.height)) {
|
if (this.blocks.some((b) => b.height === block.height)) {
|
||||||
@ -60,14 +63,16 @@ export class BlockchainBlocksComponent implements OnInit, OnDestroy {
|
|||||||
if (event.key === 'ArrowRight') {
|
if (event.key === 'ArrowRight') {
|
||||||
const blockindex = this.blocks.findIndex((b) => b.height === this.markHeight);
|
const blockindex = this.blocks.findIndex((b) => b.height === this.markHeight);
|
||||||
if (this.blocks[blockindex + 1]) {
|
if (this.blocks[blockindex + 1]) {
|
||||||
this.router.navigate(['/block/', this.blocks[blockindex + 1].id], { state: { data: { block: this.blocks[blockindex + 1] } } });
|
this.router.navigate([(this.network ? '/' + this.network : '') + '/block/',
|
||||||
|
this.blocks[blockindex + 1].id], { state: { data: { block: this.blocks[blockindex + 1] } } });
|
||||||
}
|
}
|
||||||
} else if (event.key === 'ArrowLeft') {
|
} else if (event.key === 'ArrowLeft') {
|
||||||
const blockindex = this.blocks.findIndex((b) => b.height === this.markHeight);
|
const blockindex = this.blocks.findIndex((b) => b.height === this.markHeight);
|
||||||
if (blockindex === 0) {
|
if (blockindex === 0) {
|
||||||
this.router.navigate(['/mempool-block/', '0']);
|
this.router.navigate([(this.network ? '/' + this.network : '') + '/mempool-block/', '0']);
|
||||||
} else {
|
} else {
|
||||||
this.router.navigate(['/block/', this.blocks[blockindex - 1].id], { state: { data: { block: this.blocks[blockindex - 1] }}});
|
this.router.navigate([(this.network ? '/' + this.network : '') + '/block/',
|
||||||
|
this.blocks[blockindex - 1].id], { state: { data: { block: this.blocks[blockindex - 1] }}});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,19 +74,19 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
if (event.key === 'ArrowRight') {
|
if (event.key === 'ArrowRight') {
|
||||||
if (this.mempoolBlocks[this.markIndex - 1]) {
|
if (this.mempoolBlocks[this.markIndex - 1]) {
|
||||||
this.router.navigate(['/mempool-block/', this.markIndex - 1]);
|
this.router.navigate([(this.network ? '/' + this.network : '') + '/mempool-block/', this.markIndex - 1]);
|
||||||
} else {
|
} else {
|
||||||
this.stateService.blocks$
|
this.stateService.blocks$
|
||||||
.pipe(take(8))
|
.pipe(take(8))
|
||||||
.subscribe((block) => {
|
.subscribe((block) => {
|
||||||
if (this.stateService.latestBlockHeight === block.height) {
|
if (this.stateService.latestBlockHeight === block.height) {
|
||||||
this.router.navigate(['/block/', block.id], { state: { data: { block } }});
|
this.router.navigate([(this.network ? '/' + this.network : '') + '/block/', block.id], { state: { data: { block } }});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (event.key === 'ArrowLeft') {
|
} else if (event.key === 'ArrowLeft') {
|
||||||
if (this.mempoolBlocks[this.markIndex + 1]) {
|
if (this.mempoolBlocks[this.markIndex + 1]) {
|
||||||
this.router.navigate(['/mempool-block/', this.markIndex + 1]);
|
this.router.navigate([(this.network ? '/' + this.network : '') + '/mempool-block/', this.markIndex + 1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user