cic-staff-client/src/app/_services/transaction.service.ts

28 lines
812 B
TypeScript
Raw Normal View History

2020-11-04 13:35:20 +01:00
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {map} from 'rxjs/operators';
import {Observable} from 'rxjs';
import {environment} from '../../environments/environment';
@Injectable({
providedIn: 'root'
})
export class TransactionService {
constructor(private http: HttpClient) { }
getAllTransactions(offset: number, limit: number): Observable<any> {
return this.http.get(`${environment.cicCacheUrl}/tx/${offset}/${limit}`)
.pipe(map(response => {
return response;
}));
}
getAddressTransactions(address: string, offset: number, limit: number): Observable<any> {
return this.http.get(`${environment.cicCacheUrl}/tx/${address}/${offset}/${limit}`)
.pipe(map(response => {
return response;
}));
}
}