Commit 1287341d authored by herbepau's avatar herbepau Committed by Dan Gershony

Extpubkey use correct coin (#396)

* The advanced-service calls weren't using the correct URL prefix based on the selected coin - they now do.

* advanced-service: simple improvement to the forming of URL prefix.

* Removed a console.log from advanced-service

* Bumped version.
parent b17bd83e
{
"name": "BreezeWallet",
"description": "Breeze Wallet: Stratis' dual-currency full block light wallet with a strong focus on privacy.",
"version": "1.0.0",
"version": "1.0.1",
"author": {
"name": "Stratis Group",
"email": "info@stratisplatform.com"
......
......@@ -24,27 +24,31 @@ export class AdvancedService {
}
public getExtPubKey(): Observable<string> {
const url = `${this.urlPrefix}extpubkey?WalletName=${this.walletName}&AccountName=${this.accountName}`;
const url = this.makeUrl(`extpubkey?WalletName=${this.walletName}&AccountName=${this.accountName}`);
return this.httpClient.get(url).map(x => x.toString());
}
public generateAddresses(count: number): Observable<string[]> {
const url = `${this.urlPrefix}unusedaddresses?WalletName=${this.walletName}&AccountName=${this.accountName}&Count=${count}`;
const url = this.makeUrl(`unusedaddresses?WalletName=${this.walletName}&AccountName=${this.accountName}&Count=${count}`);
return this.httpClient.get(url).map(x => this.processAddresses(x));
}
public resyncFromDate(date: Date): Observable<any> {
date = new Date(date.getFullYear(), date.getMonth(), date.getDate()); //<- Strip any time values
const url = `${this.urlPrefix}syncfromdate`;
const url = this.makeUrl('syncfromdate');
const data = JSON.stringify(new dateRequest(date));
return this.httpClient.post(url, data, {headers: this.headers}).map((x: Response) => x);
}
private processAddresses(response: any): string[] {
let addresses = new Array<string>();
const addresses = new Array<string>();
for (const address of response) {
addresses.push(address);
}
return addresses;
}
private makeUrl(urlPostfix: string): string {
return `${this.urlPrefix}${urlPostfix}`;
}
}
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