Skip to content

Commit

Permalink
coti-price-rate pkg update beta.8
Browse files Browse the repository at this point in the history
  • Loading branch information
gmesika-coti committed May 7, 2024
1 parent d44c780 commit f80c0d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@coti-io/coti-price-rate": "^1.2.0-beta.4",
"@coti-io/coti-price-rate": "^1.2.0-beta.8",
"@nestjs/common": "^8.0.0",
"@nestjs/config": "^1.1.6",
"@nestjs/core": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export async function getExchangeRate(configService: ConfigService, currency: Cu
const prices = await Promise.allSettled<{ exchangeName: string; price: number }>(sources);
const successPrices = prices.filter(x => x.status === 'fulfilled').map(x => x as PromiseFulfilledResult<{ exchangeName: string; price: number }>);
const failedPrices = prices.filter(x => x.status === 'rejected').map(x => x as PromiseRejectedResult);
failedPrices.forEach(failedPrice => logger.error(failedPrice.reason.message));
failedPrices.forEach(failedPrice => logger.error(failedPrice.reason.config.url + ":" + failedPrice.reason.message));

const binance = successPrices.find(price => price.value.exchangeName === Exchanges.BINANCE)?.value?.price;
const crypto = successPrices.find(price => price.value.exchangeName === Exchanges.CRYPTOCOM)?.value?.price;
Expand Down

0 comments on commit f80c0d6

Please sign in to comment.