|
|
@@ -16,14 +16,6 @@ export class BcInfoService {
|
|
|
|
|
|
private readonly _bcConfig: BcConfig;
|
|
|
|
|
|
-
|
|
|
- // extent = [ //bottom left and top right point should be enough
|
|
|
- // [48.5, 17],
|
|
|
- // [49, 17],
|
|
|
- // [49, 16.5],
|
|
|
- // [48.5, 16.5]
|
|
|
- // ];
|
|
|
-
|
|
|
constructor(private httpClient: HttpClient, private appSettings: AppConfigService) {
|
|
|
this._bcConfig = appSettings.config;
|
|
|
|
|
|
@@ -56,35 +48,7 @@ export class BcInfoService {
|
|
|
} catch (err) {
|
|
|
console.error(err)
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- async getUserTransactions(user: string, userPrivateKey: string) {
|
|
|
- let queryOptions = {
|
|
|
- privateKey: userPrivateKey,
|
|
|
- creatorAccountId: user,
|
|
|
- queryService: this.queryService,
|
|
|
- timeoutLimit: 10000
|
|
|
- };
|
|
|
-
|
|
|
- let response = await queries.getAccountTransactions(queryOptions,
|
|
|
- {
|
|
|
- accountId: user,
|
|
|
- pageSize: 10,
|
|
|
- firstTxHash: undefined,
|
|
|
- ordering:
|
|
|
- {
|
|
|
- field: undefined,
|
|
|
- direction: undefined
|
|
|
- },
|
|
|
- firstTxTime: undefined,
|
|
|
- lastTxTime: undefined,
|
|
|
- firstTxHeight: undefined,
|
|
|
- lastTxHeight: undefined,
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- console.log(response);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
async transferAssets(user: string, userPrivateKey: string, assetId: string, extent: number[], amount: number): Promise<string> {
|
|
|
|
|
|
@@ -114,13 +78,21 @@ export class BcInfoService {
|
|
|
}
|
|
|
|
|
|
async getPrice(area: number): Promise<number> {
|
|
|
- let response = await this.httpClient.post(this._bcConfig.CHAIN4ALL_SERVICE_URL + '/price', { area }, { headers: this.basicAuthHeaders }).toPromise();
|
|
|
+ let response = await this.httpClient.post(
|
|
|
+ this._bcConfig.CHAIN4ALL_SERVICE_URL + '/price',
|
|
|
+ { area },
|
|
|
+ { headers: this.basicAuthHeaders }
|
|
|
+ ).toPromise();
|
|
|
|
|
|
return response["price"];
|
|
|
}
|
|
|
|
|
|
async requestData(paymentHash: string, user: string): Promise<string> {
|
|
|
- let response = await this.httpClient.post(this._bcConfig.CHAIN4ALL_SERVICE_URL + '/buy', { txHash: paymentHash, user }, { headers: this.basicAuthHeaders }).toPromise();
|
|
|
+ let response = await this.httpClient.post(
|
|
|
+ this._bcConfig.CHAIN4ALL_SERVICE_URL + '/buy',
|
|
|
+ { txHash: paymentHash, user },
|
|
|
+ { headers: this.basicAuthHeaders }
|
|
|
+ ).toPromise();
|
|
|
|
|
|
return response["dataUrl"];
|
|
|
}
|