Commit 2f5fdd71 authored by dev0tion's avatar dev0tion

Update components to reflect latest API spec

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