28 lines
812 B
TypeScript
28 lines
812 B
TypeScript
|
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;
|
||
|
}));
|
||
|
}
|
||
|
}
|