From b89ff006cea1493d910bd7f15898d27b4e823269 Mon Sep 17 00:00:00 2001 From: Daniel Krol Date: Sat, 9 Apr 2022 17:38:19 -0400 Subject: [PATCH] Remove DeSo's GetTransactionSpending. LBRY will get this info from parsing psbts. --- src/app/approve/approve.component.html | 4 ++-- src/app/approve/approve.component.ts | 9 +++++---- src/app/backend-api.service.ts | 20 -------------------- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/src/app/approve/approve.component.html b/src/app/approve/approve.component.html index 137bf2e..c8fecde 100644 --- a/src/app/approve/approve.component.html +++ b/src/app/approve/approve.component.html @@ -9,9 +9,9 @@ {{ globalVars.hostname }} wants to {{ transactionDescription }}


-
+

- Total Cost: {{ transactionDeSoSpent }} $DESO + Total Cost: {{ transactionSpent }} $DESO

diff --git a/src/app/approve/approve.component.ts b/src/app/approve/approve.component.ts index c2d6230..3d2102c 100644 --- a/src/app/approve/approve.component.ts +++ b/src/app/approve/approve.component.ts @@ -46,7 +46,7 @@ export class ApproveComponent implements OnInit { transactionHex: any; username: any; transactionDescription: any; - transactionDeSoSpent: string | boolean = false; + transactionSpent: string | boolean = false; constructor( private activatedRoute: ActivatedRoute, @@ -61,9 +61,10 @@ export class ApproveComponent implements OnInit { ngOnInit(): void { this.activatedRoute.queryParams.subscribe(params => { this.transactionHex = params.tx; - this.backendApi.GetTransactionSpending(this.transactionHex).subscribe( res => { - this.transactionDeSoSpent = res ? this.nanosToUnitString(res) : false; - }); + + // TODO - for LBRY + this.transactionSpent = false; + const txBytes = new Buffer(this.transactionHex, 'hex'); this.transaction = Transaction.fromBytes(txBytes)[0]; this.publicKey = this.base58KeyCheck(this.transaction.publicKey); diff --git a/src/app/backend-api.service.ts b/src/app/backend-api.service.ts index 03803cd..652b66c 100644 --- a/src/app/backend-api.service.ts +++ b/src/app/backend-api.service.ts @@ -93,24 +93,4 @@ export class BackendAPIService { return of(userProfiles); } } - - GetTransactionSpending( - transactionHex: string - ): Observable { - const req = this.httpClient.post( - `${this.endpoint}/get-transaction-spending`, - { - TransactionHex: transactionHex, - }, - ); - return req.pipe( - map( res => { - return res.TotalSpendingNanos as number; - }) - ).pipe( - catchError(() => { - return of(0); - }) - ); - } }