@@ -3,7 +3,7 @@
|
||||
{{ addPlus && satoshis >= 0 ? '+' : '' }}
|
||||
{{
|
||||
(
|
||||
(blockConversion.price[currency] > 0 ? blockConversion.price[currency] : null) ??
|
||||
(blockConversion.price[currency] >= 0 ? blockConversion.price[currency] : null) ??
|
||||
(blockConversion.price['USD'] * blockConversion.exchangeRates['USD' + currency]) ?? 0
|
||||
) * satoshis / 100000000 | fiatCurrency : digitsInfo : currency
|
||||
}}
|
||||
|
||||
@@ -443,9 +443,9 @@ export class BlockComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
this.priceSubscription = block$.pipe(
|
||||
switchMap((block) => {
|
||||
return this.priceService.getPrices().pipe(
|
||||
tap(() => {
|
||||
this.blockConversion = this.priceService.getPriceForTimestamp(block.timestamp);
|
||||
return this.priceService.getBlockPrice$(block.timestamp).pipe(
|
||||
tap((price) => {
|
||||
this.blockConversion = price;
|
||||
})
|
||||
);
|
||||
})
|
||||
|
||||
@@ -327,9 +327,9 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.fetchRbfHistory$.next(this.tx.txid);
|
||||
}
|
||||
|
||||
this.priceService.getPrices().pipe(
|
||||
tap(() => {
|
||||
this.blockConversion = this.priceService.getPriceForTimestamp(tx.status.block_time);
|
||||
this.priceService.getBlockPrice$(tx.status.block_time).pipe(
|
||||
tap((price) => {
|
||||
this.blockConversion = price;
|
||||
})
|
||||
).subscribe();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Outspend, Transaction, Vin, Vout } from '../../interfaces/electrs.inter
|
||||
import { ElectrsApiService } from '../../services/electrs-api.service';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { AssetsService } from '../../services/assets.service';
|
||||
import { filter, map, tap, switchMap } from 'rxjs/operators';
|
||||
import { filter, map, tap, switchMap, shareReplay } from 'rxjs/operators';
|
||||
import { BlockExtended } from '../../interfaces/node-api.interface';
|
||||
import { ApiService } from '../../services/api.service';
|
||||
import { PriceService } from 'src/app/services/price.service';
|
||||
@@ -150,10 +150,8 @@ export class TransactionsListComponent implements OnInit, OnChanges {
|
||||
tx['addressValue'] = addressIn - addressOut;
|
||||
}
|
||||
|
||||
this.priceService.getPrices().pipe(
|
||||
tap(() => {
|
||||
tx['price'] = this.priceService.getPriceForTimestamp(tx.status.block_time);
|
||||
})
|
||||
this.priceService.getBlockPrice$(tx.status.block_time).pipe(
|
||||
tap((price) => tx['price'] = price)
|
||||
).subscribe();
|
||||
});
|
||||
const txIds = this.transactions.filter((tx) => !tx._outspends).map((tx) => tx.txid);
|
||||
|
||||
Reference in New Issue
Block a user