Transaction tracking revamped.

Blockchain block arrow.
This commit is contained in:
Simon Lindh
2020-02-19 23:50:23 +07:00
committed by wiz
parent 34645908e9
commit f3cfa038d3
15 changed files with 232 additions and 145 deletions

View File

@@ -15,6 +15,8 @@ export class SearchFormComponent implements OnInit {
searchBoxPlaceholderText = 'Transaction, address, block hash...';
regexAddress = /^([a-km-zA-HJ-NP-Z1-9]{26,35}|[a-km-zA-HJ-NP-Z1-9]{80}|[a-z]{2,5}1[ac-hj-np-z02-9]{8,87})$/;
regexBlockhash = /^[0]{8}[a-fA-F0-9]{56}$/;
regexTransaction = /^[a-fA-F0-9]{64}$/;
constructor(
private formBuilder: FormBuilder,
@@ -32,8 +34,12 @@ export class SearchFormComponent implements OnInit {
if (searchText) {
if (this.regexAddress.test(searchText)) {
this.router.navigate(['/address/', searchText]);
} else {
} else if (this.regexBlockhash.test(searchText)) {
this.router.navigate(['/block/', searchText]);
} else if (this.regexTransaction.test(searchText)) {
this.router.navigate(['/tx/', searchText]);
} else {
return;
}
this.searchForm.setValue({
searchText: '',