|
@@ -80,7 +80,7 @@ export class BankClient {
|
|
|
return Number(nonce);
|
|
return Number(nonce);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public async getBalance() {
|
|
|
|
|
|
|
+ public async getBalance(): Promise<number> {
|
|
|
const nonce = await this.getNonce();
|
|
const nonce = await this.getNonce();
|
|
|
const retrieveRequest = await this.makePlaintextPayload(JSON.stringify({
|
|
const retrieveRequest = await this.makePlaintextPayload(JSON.stringify({
|
|
|
_date: new Date().toISOString(),
|
|
_date: new Date().toISOString(),
|
|
@@ -88,12 +88,13 @@ export class BankClient {
|
|
|
}));
|
|
}));
|
|
|
|
|
|
|
|
const topicURL = this.urlBase + '/bank/getbalance';
|
|
const topicURL = this.urlBase + '/bank/getbalance';
|
|
|
- const postResponse = this.webClient.requestJSON({
|
|
|
|
|
|
|
+ const postResponse:any = await this.webClient.requestJSON({
|
|
|
body: retrieveRequest,
|
|
body: retrieveRequest,
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
url: topicURL
|
|
url: topicURL
|
|
|
});
|
|
});
|
|
|
- return postResponse;
|
|
|
|
|
|
|
+ console.log('postResponse', postResponse);
|
|
|
|
|
+ return postResponse.balance;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|