Commit 2f5fdd71 authored by dev0tion's avatar dev0tion

Update components to reflect latest API spec

parent 91ce31b8
...@@ -18,6 +18,7 @@ export class CreateComponent { ...@@ -18,6 +18,7 @@ export class CreateComponent {
private responseMessage: string; private responseMessage: string;
private createWallet(password: string, network: string, folderPath: string, name: string, ) { private createWallet(password: string, network: string, folderPath: string, name: string, ) {
this.newWallet = new WalletCreation();
this.newWallet.password = password; this.newWallet.password = password;
this.newWallet.network = network; this.newWallet.network = network;
this.newWallet.folderPath = folderPath; this.newWallet.folderPath = folderPath;
......
...@@ -11,8 +11,12 @@ ...@@ -11,8 +11,12 @@
<input class="form-control" type="password" #walletPassword required> <input class="form-control" type="password" #walletPassword required>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="name">Date of creation (yyyy-MM-dd):</label> <label for="name">Wallet Path:</label>
<input class="form-control" type="password" #walletDate required> <input class="form-control" type="text" #walletPath required>
</div>
<div class="form-group">
<label for="name">Wallet Name:</label>
<input class="form-control" type="text" #walletName required>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="networklabel">Network:</label> <label for="networklabel">Network:</label>
...@@ -21,4 +25,4 @@ ...@@ -21,4 +25,4 @@
<option value="test">Testnet</option> <option value="test">Testnet</option>
</select> </select>
</div> </div>
<button type="submit" (click)="recoverWallet(walletMnemonic.value, walletPassword.value, walletDate.value, walletNetwork.value)">Recover</button> <button type="submit" (click)="recoverWallet(walletMnemonic.value, walletPassword.value, walletPath.value, walletName.value, walletNetwork.value)">Recover</button>
\ No newline at end of file \ No newline at end of file
...@@ -16,10 +16,11 @@ export class RecoverComponent implements OnInit { ...@@ -16,10 +16,11 @@ export class RecoverComponent implements OnInit {
ngOnInit() { ngOnInit() {
} }
private recoverWallet(mnemonic: string, password: string, creationDate: string, network: string) { private recoverWallet(mnemonic: string, password: string, folderPath: string, name: string, network: string) {
this.walletRecovery.mnemonic = mnemonic; this.walletRecovery.mnemonic = mnemonic;
this.walletRecovery.password = password; this.walletRecovery.password = password;
this.walletRecovery.date = creationDate; this.walletRecovery.folderPath = folderPath;
this.walletRecovery.name = name;
this.walletRecovery.network = network; this.walletRecovery.network = network;
this.apiService this.apiService
......
...@@ -16,7 +16,8 @@ import { Mnemonic } from '../mnemonic'; ...@@ -16,7 +16,8 @@ import { Mnemonic } from '../mnemonic';
export class ApiService { export class ApiService {
constructor(private http: Http) {}; constructor(private http: Http) {};
private webApiUrl = 'http://localhost:3000/api/v1'; private mockApiUrl = 'http://localhost:3000/api/v1';
private webApiUrl = 'http://localhost:5000/api/v1';
private headers = new Headers({'Content-Type': 'application/json'}); private headers = new Headers({'Content-Type': 'application/json'});
/** /**
...@@ -52,7 +53,7 @@ export class ApiService { ...@@ -52,7 +53,7 @@ export class ApiService {
*/ */
getWalletStatus(): Observable<any> { getWalletStatus(): Observable<any> {
return this.http return this.http
.get(this.webApiUrl + '/wallet/status') .get(this.mockApiUrl + '/wallet/status')
.map((response:Response) => response.json()) .map((response:Response) => response.json())
.catch(this.handleError); .catch(this.handleError);
} }
......
export class WalletRecovery { export class WalletRecovery {
mnemonic: string; mnemonic: string;
password: string; password: string;
date: string; folderPath: string;
name: string;
network: 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