Commit ee8ee60b authored by dev0tion's avatar dev0tion

Add wallet recovery method

parent 4d60bfc8
......@@ -4,7 +4,8 @@ import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import { SafeCreation } from '../safe-creation';
import { WalletCreation } from '../wallet-creation';
import { WalletRecovery } from '../wallet-recovery';
import { Mnemonic } from '../mnemonic';
/**
......@@ -21,10 +22,18 @@ export class ApiService {
/**
* Create a new wallet.
*/
createWallet(data: SafeCreation): Observable<any> {
console.log(JSON.stringify(data));
createWallet(data: WalletCreation): Observable<any> {
return this.http
.post(this.webApiUrl + 'api/safe', JSON.stringify(data), {headers: this.headers})
.post(this.webApiUrl + '/wallet/create/', JSON.stringify(data), {headers: this.headers})
.map(response => response.json());
}
/**
* 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.json());
}
......
export class WalletRecovery {
mnemonic: string;
password: string;
date: string;
network: string;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment