Transaction tracking revamped.
Blockchain block arrow.
This commit is contained in:
@@ -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: '',
|
||||
|
||||
Reference in New Issue
Block a user