Bisq markets: Volume and other fixes.

This commit is contained in:
softsimon
2021-03-10 23:02:55 +07:00
parent 894184204c
commit 0de2c105d4
9 changed files with 57 additions and 26 deletions

View File

@@ -8,13 +8,13 @@
<th i18n>Currency</th>
<th i18n>Pair</th>
<th i18n>Price</th>
<th i18n>Volume (24h)</th>
<th i18n>Trades (24h)</th>
<th i18n>Volume (7d)</th>
<th i18n>Trades (7d)</th>
</thead>
<tbody *ngIf="tickers.value; else loadingTmpl">
<tr *ngFor="let ticker of tickers.value; trackBy: trackByFn; let i = index">
<td>{{ i + 1 }}</td>
<td>{{ ticker.market.lname }}</td>
<td>{{ ticker.market.rtype === 'crypto' ? ticker.market.lname : ticker.market.rname }}</td>
<td><a [routerLink]="['/market' | relativeUrl, ticker.pair_url]">{{ ticker.pair }}</a></td>
<td>
<app-fiat *ngIf="ticker.market.rtype === 'crypto'; else fiat" [value]="ticker.last * 100000000"></app-fiat>

View File

@@ -24,7 +24,7 @@ export class BisqDashboardComponent implements OnInit {
this.tickers$ = combineLatest([
this.bisqApiService.getMarketsTicker$(),
this.bisqApiService.getMarkets$(),
this.bisqApiService.getMarket24hVolumes$(),
this.bisqApiService.getMarketVolumesByTime$('7d'),
])
.pipe(
map(([tickers, markets, volumes]) => {
@@ -37,7 +37,7 @@ export class BisqDashboardComponent implements OnInit {
newTickers.push(tickers[t]);
}
newTickers.sort((a, b) => (b.volume && b.volume.volume || 0) - (a.volume && a.volume.volume || 0));
newTickers.sort((a, b) => (b.volume && b.volume.num_trades || 0) - (a.volume && a.volume.num_trades || 0));
return newTickers;
})