<commit_before>import { Injectable } from '@angular/core';
import { Http, Headers, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';

import { WalletCreation } from '../wallet-creation';
import { WalletRecovery } from '../wallet-recovery';
import { WalletLoad } from '../wallet-load';
import { Mnemonic } from '../mnemonic';

/**
 * For information on the API specification have a look at our Github:
 * https://github.com/stratisproject/Breeze/blob/master/Breeze.Documentation/ApiSpecification.md
 */
@Injectable()
export class ApiService {
    constructor(private http: Http) {};

    private mockApiUrl = 'http://localhost:3000/api/v1';
    private webApiUrl = 'http://localhost:5000/api/v1';
    private headers = new Headers({'Content-Type': 'application/json'});

    /**
     * Gets available wallets at the default path
     */
     getWalletFiles(): Observable<any> {
        return this.http
          .get(this.mockApiUrl + '/wallet/files')
          .map((response: Response) => response);
     }

    /**
     * Create a new wallet.
     */
    createWallet(data: WalletCreation): Observable<any> {
      return this.http
        .post(this.webApiUrl + '/wallet/create/', JSON.stringify(data), {headers: this.headers})
        .map((response: Response) => response);
    }

    /**
     * Recover a wallet.
     */
    recoverWallet(data: WalletRecovery): Observable<any> {
      return this.http
        .post(this.webApiUrl + '/wallet/recover/', JSON.stringify(data), {headers: this.headers})
        .map((response: Response) => response);
    }

    /**
     * Load a wallet
     */
    loadWallet(data: WalletLoad): Observable<any> {
      return this.http
        .post(this.webApiUrl + '/wallet/load/', JSON.stringify(data), {headers: this.headers})
        .map((response: Response) => response);
    }

    /**
     * Get wallet status info from the API.
     */
    getWalletStatus(): Observable<any> {
      return this.http
        .get(this.mockApiUrl + '/wallet/status')
        .map((response: Response) => response);
    }

    /**
     * Get wallet balance info from the API. 
     */
    getWalletBalance(): Observable<any> {
      return this.http
        .get(this.webApiUrl + '/wallet/balance')
        .map((response: Response) => response);
    }

    /**
     * Get a wallets transaction history info from the API.
     */
    getWalletHistory(): Observable<any> {
      return this.http
        .get(this.webApiUrl + '/wallet/history')
        .map((response: Response) => response);
    }

    /**
     * Get unused receive addresses for a certain wallet from the API.
     */
    getUnusedReceiveAddresses(): Observable<any> {
      return this.http
        .get(this.webApiUrl + '/wallet/receive')
        .map((response: Response) => response);
    }
}<commit_msg>Switch some API functions to mock API<commit_after>import { Injectable } from '@angular/core';
import { Http, Headers, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';

import { WalletCreation } from '../wallet-creation';
import { WalletRecovery } from '../wallet-recovery';
import { WalletLoad } from '../wallet-load';
import { Mnemonic } from '../mnemonic';

/**
 * For information on the API specification have a look at our Github:
 * https://github.com/stratisproject/Breeze/blob/master/Breeze.Documentation/ApiSpecification.md
 */
@Injectable()
export class ApiService {
    constructor(private http: Http) {};

    private mockApiUrl = 'http://localhost:3000/api/v1';
    private webApiUrl = 'http://localhost:5000/api/v1';
    private headers = new Headers({'Content-Type': 'application/json'});

    /**
     * Gets available wallets at the default path
     */
     getWalletFiles(): Observable<any> {
        return this.http
          .get(this.mockApiUrl + '/wallet/files')
          .map((response: Response) => response);
     }

    /**
     * Create a new wallet.
     */
    createWallet(data: WalletCreation): Observable<any> {
      return this.http
        .post(this.webApiUrl + '/wallet/create/', JSON.stringify(data), {headers: this.headers})
        .map((response: Response) => response);
    }

    /**
     * Recover a wallet.
     */
    recoverWallet(data: WalletRecovery): Observable<any> {
      return this.http
        .post(this.webApiUrl + '/wallet/recover/', JSON.stringify(data), {headers: this.headers})
        .map((response: Response) => response);
    }

    /**
     * Load a wallet
     */
    loadWallet(data: WalletLoad): Observable<any> {
      return this.http
        .post(this.webApiUrl + '/wallet/load/', JSON.stringify(data), {headers: this.headers})
        .map((response: Response) => response);
    }

    /**
     * Get wallet status info from the API.
     */
    getWalletStatus(): Observable<any> {
      return this.http
        .get(this.mockApiUrl + '/wallet/status')
        .map((response: Response) => response);
    }

    /**
     * Get wallet balance info from the API. 
     */
    getWalletBalance(): Observable<any> {
      return this.http
        .get(this.mockApiUrl + '/wallet/balance')
        .map((response: Response) => response);
    }

    /**
     * Get a wallets transaction history info from the API.
     */
    getWalletHistory(): Observable<any> {
      return this.http
        .get(this.mockApiUrl + '/wallet/history')
        .map((response: Response) => response);
    }

    /**
     * Get unused receive addresses for a certain wallet from the API.
     */
    getUnusedReceiveAddresses(): Observable<any> {
      return this.http
        .get(this.mockApiUrl + '/wallet/receive')
        .map((response: Response) => response);
    }
}
{'fraction_non_alphanumeric': 0.14788128323897753, 'fraction_numerical': 0.0034311202607651397, 'mean_word_length': 2.6460287679799874, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 35, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3509291', 'n_tokens_mistral': 1729, 'n_tokens_neox': 1731, 'n_words': 406}