Commit c4c8e131 authored by dev0tion's avatar dev0tion

Show balance in dashboard

parent 34dcb8ff
......@@ -86,7 +86,7 @@ export class LoginComponent implements OnInit {
if (response.status >= 200 && response.status < 400) {
let responseMessage = response.json();
this.globalService.setWalletName(walletLoad.name)
this.globalService.setCoinType(1);
this.globalService.setCoinType(0);
this.router.navigate(['/wallet']);
}
},
......
......@@ -100,6 +100,7 @@ export class ApiService {
let params: URLSearchParams = new URLSearchParams();
params.set('walletName', data.walletName);
params.set('coinType', data.coinType.toString());
params.set('accountName', "account 0"); //temporary
return this.http
.get(this.webApiUrl + '/wallet/address', new RequestOptions({headers: this.headers, search: params}))
......
......@@ -27,8 +27,8 @@ export class DashboardComponent {
response => {
if (response.status >= 200 && response.status < 400) {
this.balanceResponse = response.json();
this.confirmedBalance = this.balanceResponse.confirmed;
this.unconfirmedBalance = this.balanceResponse.unconfirmed;
this.confirmedBalance = this.balanceResponse.balances[0].amountConfirmed;
this.unconfirmedBalance = this.balanceResponse.balances[0].amountUnconfirmed;
}
},
error => {
......
import { Component, OnInit } from '@angular/core';
import { ApiService } from '../../shared/services/api.service';
import { GlobalService } from '../../shared/services/global.service';
import { WalletInfo } from '../../shared/classes/wallet-info';
......@@ -11,19 +12,18 @@ import { WalletInfo } from '../../shared/classes/wallet-info';
})
export class ReceiveComponent {
constructor(private apiService: ApiService) {}
constructor(private apiService: ApiService, private globalService: GlobalService) {}
private address: any;
private errorMessage: string;
private walletInfo: WalletInfo;
ngOnInit() {
this.getUnusedReceiveAddresses();
}
private getUnusedReceiveAddresses() {
this.walletInfo = new WalletInfo("Test", 0, "Test")
this.apiService.getUnusedReceiveAddress(this.walletInfo)
let walletInfo = new WalletInfo(this.globalService.getWalletName(), this.globalService.getCoinType())
this.apiService.getUnusedReceiveAddress(walletInfo)
.subscribe(
response => {
if (response.status >= 200 && response.status < 400) {
......
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