Bisq markets: General trading volume graph.

This commit is contained in:
softsimon
2021-03-16 01:17:40 +07:00
parent 8e29a4cefd
commit da77dbece1
9 changed files with 385 additions and 9 deletions

View File

@@ -14,6 +14,8 @@ import { BisqApiService } from '../bisq-api.service';
})
export class BisqDashboardComponent implements OnInit {
tickers$: Observable<any>;
volumes$: Observable<any>;
allowCryptoCoins = ['usdc', 'l-btc', 'bsq'];
constructor(
@@ -27,6 +29,30 @@ export class BisqDashboardComponent implements OnInit {
this.seoService.setTitle(`Markets`);
this.websocketService.want(['blocks']);
this.volumes$ = this.bisqApiService.getAllVolumesDay$()
.pipe(
map((volumes) => {
const data = volumes.map((volume) => {
return {
time: volume.period_start,
value: volume.volume,
};
});
const linesData = volumes.map((volume) => {
return {
time: volume.period_start,
value: volume.num_trades,
};
});
return {
data: data,
linesData: linesData,
};
})
);
this.tickers$ = combineLatest([
this.bisqApiService.getMarketsTicker$(),
this.bisqApiService.getMarkets$(),