Bisq markets dashboard: 24H Volume. WIP.

This commit is contained in:
softsimon
2021-02-28 17:18:29 +07:00
parent eeb7447988
commit 38e866995f
7 changed files with 63 additions and 13 deletions

View File

@@ -19,18 +19,23 @@ export class BisqDashboardComponent implements OnInit {
ngOnInit(): void {
this.tickers$ = combineLatest([
this.bisqApiService.getMarketsTicker$(),
this.bisqApiService.getMarkets$()
this.bisqApiService.getMarkets$(),
this.bisqApiService.getMarket24hVolumes$(),
])
.pipe(
map(([tickers, markets]) => {
map(([tickers, markets, volumes]) => {
const newTickers = [];
for (const t in tickers) {
tickers[t].pair_url = t;
tickers[t].pair = t.replace('_', '/').toUpperCase();
tickers[t].market = markets[t];
tickers[t].volume = volumes[t];
newTickers.push(tickers[t]);
}
console.log(newTickers);
newTickers.sort((a, b) => (b.volume && b.volume.volume || 0) - (a.volume && a.volume.volume || 0));
return newTickers;
})
);