mirror of
https://github.com/mempool/mempool.git
synced 2025-01-09 23:16:48 +01:00
30 lines
670 B
TypeScript
30 lines
670 B
TypeScript
|
import { Injectable } from '@angular/core';
|
||
|
import { HttpClient } from '@angular/common/http';
|
||
|
import { ReplaySubject } from 'rxjs';
|
||
|
import { environment } from 'src/environments/environment';
|
||
|
|
||
|
@Injectable({
|
||
|
providedIn: 'root'
|
||
|
})
|
||
|
export class AssetsService {
|
||
|
network = environment.network;
|
||
|
|
||
|
assetsMinimal$ = new ReplaySubject<any>(1);
|
||
|
|
||
|
constructor(
|
||
|
private httpClient: HttpClient,
|
||
|
) {
|
||
|
if (this.network === 'liquid') {
|
||
|
this.getAssetsMinimalJson$();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
getAssetsMinimalJson$() {
|
||
|
this.httpClient.get('/assets/assets.minimal.json')
|
||
|
.subscribe((data) => {
|
||
|
console.log(data);
|
||
|
this.assetsMinimal$.next(data);
|
||
|
});
|
||
|
}
|
||
|
}
|