|
|
|
@ -483,7 +483,8 @@ export class OrderService {
|
|
|
|
|
assetProfileIdentifiers
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const activities = orders.map((order) => {
|
|
|
|
|
const activities = await Promise.all(
|
|
|
|
|
orders.map(async (order) => {
|
|
|
|
|
const assetProfile = assetProfiles.find(({ dataSource, symbol }) => {
|
|
|
|
|
return (
|
|
|
|
|
dataSource === order.SymbolProfile.dataSource &&
|
|
|
|
@ -496,21 +497,24 @@ export class OrderService {
|
|
|
|
|
return {
|
|
|
|
|
...order,
|
|
|
|
|
value,
|
|
|
|
|
// TODO: Use exchange rate of date
|
|
|
|
|
feeInBaseCurrency: this.exchangeRateDataService.toCurrency(
|
|
|
|
|
feeInBaseCurrency:
|
|
|
|
|
await this.exchangeRateDataService.toCurrencyAtDate(
|
|
|
|
|
order.fee,
|
|
|
|
|
order.SymbolProfile.currency,
|
|
|
|
|
userCurrency
|
|
|
|
|
userCurrency,
|
|
|
|
|
order.date
|
|
|
|
|
),
|
|
|
|
|
SymbolProfile: assetProfile,
|
|
|
|
|
// TODO: Use exchange rate of date
|
|
|
|
|
valueInBaseCurrency: this.exchangeRateDataService.toCurrency(
|
|
|
|
|
valueInBaseCurrency:
|
|
|
|
|
await this.exchangeRateDataService.toCurrencyAtDate(
|
|
|
|
|
value,
|
|
|
|
|
order.SymbolProfile.currency,
|
|
|
|
|
userCurrency
|
|
|
|
|
userCurrency,
|
|
|
|
|
order.date
|
|
|
|
|
)
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return { activities, count };
|
|
|
|
|
}
|
|
|
|
|