diff --git a/src/app/hub.service.ts b/src/app/hub.service.ts index 44c297d..306bd09 100644 --- a/src/app/hub.service.ts +++ b/src/app/hub.service.ts @@ -1,13 +1,20 @@ import {Injectable} from '@angular/core'; +import {HttpClient} from '@angular/common/http'; @Injectable({ providedIn: 'root' }) export class HubService { + hubEndpoint = `https://${environment.hubHostname}/api/v0`; constructor( + private httpClient: HttpClient, ) { } + post(path: string, body: any): Observable { + return this.httpClient.post(`${this.hubEndpoint}/${path}`, body); + } + // Just for stubbing until we get the real thing private rndStr() { return (Math.random() + 1).toString(16).substring(2); @@ -15,6 +22,7 @@ export class HubService { // Obviously just a stub for the actual API public getChannels(xPubs: string[]): any { + return [{ claimId: this.rndStr(), handle: '@test-' + this.rndStr(),