Update Bisq API paths to /api/bisq
This commit is contained in:
		
							parent
							
								
									4e6ba18f19
								
							
						
					
					
						commit
						cfb60c0bad
					
				@ -8,6 +8,13 @@
 | 
			
		||||
    "secure": false,
 | 
			
		||||
    "ws": true
 | 
			
		||||
  },
 | 
			
		||||
  "/api/bisq": {
 | 
			
		||||
    "target": "http://localhost:8999/",
 | 
			
		||||
    "secure": false,
 | 
			
		||||
    "pathRewrite": {
 | 
			
		||||
      "^/api/bisq": "/api/v1/bisq"
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "/api": {
 | 
			
		||||
    "target": "http://localhost:50001/",
 | 
			
		||||
    "secure": false,
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,7 @@ import { HttpClient, HttpResponse } from '@angular/common/http';
 | 
			
		||||
import { Observable } from 'rxjs';
 | 
			
		||||
import { BisqTransaction, BisqBlock, BisqStats } from './bisq.interfaces';
 | 
			
		||||
 | 
			
		||||
const API_BASE_URL = '/api/v1';
 | 
			
		||||
const API_BASE_URL = '/bisq/api';
 | 
			
		||||
 | 
			
		||||
@Injectable({
 | 
			
		||||
  providedIn: 'root'
 | 
			
		||||
@ -16,26 +16,26 @@ export class BisqApiService {
 | 
			
		||||
  ) { }
 | 
			
		||||
 | 
			
		||||
  getStats$(): Observable<BisqStats> {
 | 
			
		||||
    return this.httpClient.get<BisqStats>(API_BASE_URL + '/bisq/stats');
 | 
			
		||||
    return this.httpClient.get<BisqStats>(API_BASE_URL + '/stats');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getTransaction$(txId: string): Observable<BisqTransaction> {
 | 
			
		||||
    return this.httpClient.get<BisqTransaction>(API_BASE_URL + '/bisq/tx/' + txId);
 | 
			
		||||
    return this.httpClient.get<BisqTransaction>(API_BASE_URL + '/tx/' + txId);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  listTransactions$(start: number, length: number): Observable<HttpResponse<BisqTransaction[]>> {
 | 
			
		||||
    return this.httpClient.get<BisqTransaction[]>(API_BASE_URL + `/bisq/txs/${start}/${length}`, { observe: 'response' });
 | 
			
		||||
    return this.httpClient.get<BisqTransaction[]>(API_BASE_URL + `/txs/${start}/${length}`, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getBlock$(hash: string): Observable<BisqBlock> {
 | 
			
		||||
    return this.httpClient.get<BisqBlock>(API_BASE_URL + '/bisq/block/' + hash);
 | 
			
		||||
    return this.httpClient.get<BisqBlock>(API_BASE_URL + '/block/' + hash);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  listBlocks$(start: number, length: number): Observable<HttpResponse<BisqBlock[]>> {
 | 
			
		||||
    return this.httpClient.get<BisqBlock[]>(API_BASE_URL + `/bisq/blocks/${start}/${length}`, { observe: 'response' });
 | 
			
		||||
    return this.httpClient.get<BisqBlock[]>(API_BASE_URL + `/blocks/${start}/${length}`, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getAddress$(address: string): Observable<BisqTransaction[]> {
 | 
			
		||||
    return this.httpClient.get<BisqTransaction[]>(API_BASE_URL + '/bisq/address/' + address);
 | 
			
		||||
    return this.httpClient.get<BisqTransaction[]>(API_BASE_URL + '/address/' + address);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user