Channel component

This commit is contained in:
softsimon
2022-05-01 03:01:27 +04:00
parent f5325b3a6d
commit 795bb6a7a6
23 changed files with 536 additions and 59 deletions

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { HttpClient, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
const API_BASE_URL = '/lightning/api/v1';
@@ -16,8 +16,16 @@ export class LightningApiService {
return this.httpClient.get<any>(API_BASE_URL + '/nodes/' + publicKey);
}
getChannel$(shortId: string): Observable<any> {
return this.httpClient.get<any>(API_BASE_URL + '/channels/' + shortId);
}
getChannelsByNodeId$(publicKey: string): Observable<any> {
return this.httpClient.get<any>(API_BASE_URL + '/channels/' + publicKey);
let params = new HttpParams()
.set('public_key', publicKey)
;
return this.httpClient.get<any>(API_BASE_URL + '/channels', { params });
}
getLatestStatistics$(): Observable<any> {