Add transfer request to transaction reversal.
- Inverts sender and recipient addresses creating a request for transfer from recipient to sender.
This commit is contained in:
parent
0668abd62d
commit
71834deadc
@ -117,7 +117,7 @@
|
|||||||
<button mat-raised-button color="primary" type="button" class="btn btn-outline-success">Resend SMS</button>
|
<button mat-raised-button color="primary" type="button" class="btn btn-outline-success">Resend SMS</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<button mat-raised-button color="warn" type="button" class="btn btn-outline-danger ml-2">Reverse Transaction</button>
|
<button mat-raised-button color="warn" type="button" class="btn btn-outline-danger ml-2" (click)="reverseTransaction()">Reverse Transaction</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import {ChangeDetectionStrategy, Component, Input, OnInit} from '@angular/core';
|
import {ChangeDetectionStrategy, Component, Input, OnInit} from '@angular/core';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
|
import {TransactionService} from '@app/_services';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-transaction-details',
|
selector: 'app-transaction-details',
|
||||||
@ -12,7 +13,10 @@ export class TransactionDetailsComponent implements OnInit {
|
|||||||
senderBloxbergLink: string;
|
senderBloxbergLink: string;
|
||||||
recipientBloxbergLink: string;
|
recipientBloxbergLink: string;
|
||||||
|
|
||||||
constructor(private router: Router) { }
|
constructor(
|
||||||
|
private router: Router,
|
||||||
|
private transactionService: TransactionService
|
||||||
|
) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.senderBloxbergLink = 'https://blockexplorer.bloxberg.org/address/' + this.transaction?.from + '/transactions';
|
this.senderBloxbergLink = 'https://blockexplorer.bloxberg.org/address/' + this.transaction?.from + '/transactions';
|
||||||
@ -26,4 +30,13 @@ export class TransactionDetailsComponent implements OnInit {
|
|||||||
async viewRecipient(): Promise<void> {
|
async viewRecipient(): Promise<void> {
|
||||||
await this.router.navigateByUrl(`/accounts/${this.transaction.to}`);
|
await this.router.navigateByUrl(`/accounts/${this.transaction.to}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async reverseTransaction(): Promise<void> {
|
||||||
|
await this.transactionService.transferRequest(
|
||||||
|
this.transaction.token.address,
|
||||||
|
this.transaction.to,
|
||||||
|
this.transaction.from,
|
||||||
|
this.transaction.value
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user