Fixing missing assets data for Liquid Testnet native asset

fixes #1068
This commit is contained in:
softsimon
2022-01-04 05:26:46 +04:00
parent 990ab3da5f
commit c8639ec71d
2 changed files with 15 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { shareReplay, switchMap } from 'rxjs/operators';
import { map, shareReplay, switchMap } from 'rxjs/operators';
import { StateService } from './state.service';
@Injectable({
@@ -29,6 +29,13 @@ export class AssetsService {
this.getAssetsMinimalJson$ = this.stateService.networkChanged$
.pipe(
switchMap(() => this.httpClient.get(`${apiBaseUrl}/resources/assets${this.stateService.network === 'liquidtestnet' ? '-testnet' : ''}.minimal.json`)),
map((assetsMinimal) => {
if (this.stateService.network === 'liquidtestnet') {
// Hard coding the Liquid Testnet native asset
assetsMinimal['144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49'] = [null, "tL-BTC", "Test Liquid Bitcoin", 8];
}
return assetsMinimal;
}),
shareReplay(1),
);
this.getMiningPools$ = this.httpClient.get(apiBaseUrl + '/resources/pools.json').pipe(shareReplay(1));