Skip to content

Commit

Permalink
coti-price-rate pkg update
Browse files Browse the repository at this point in the history
  • Loading branch information
gmesika-coti committed May 7, 2024
1 parent de6c9c3 commit 167e20d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 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.1",
"@coti-io/coti-price-rate": "^1.2.0-beta.2",
"@nestjs/common": "^8.0.0",
"@nestjs/config": "^1.1.6",
"@nestjs/core": "^8.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ export async function getExchangeRate(configService: ConfigService, currency: Cu
}
let sources = [];
if (dex === Exchanges.CMC) {
sources = [priceRate.getCoinMarketCapPrice(CurrencySymbols[currency].COIN_MARKET_CAP, date?.getTime()).then(res => ({ exchangeName: 'cmc', price: res }))];
sources = [priceRate.getCoinMarketCapPriceV2(CurrencySymbols[currency].COIN_MARKET_CAP, date?.getTime()).then(res => ({ exchangeName: 'cmc', price: res }))];
} else {
sources = [
priceRate.getBinancePrice(CurrencySymbols[currency].BINANCE).then(res => ({ exchangeName: Exchanges.BINANCE, price: res })),
priceRate.getCryptoComPrice(CurrencySymbols[currency].CRYPTOCOM).then(res => ({ exchangeName: Exchanges.CRYPTOCOM, price: res })),
priceRate.getCoinBasePrice(CurrencySymbols[currency].COINBASE).then(res => ({ exchangeName: Exchanges.COINBASE, price: res })),
priceRate.getKuCoinPrice(CurrencySymbols[currency].KUCOIN).then(res => ({ exchangeName: Exchanges.KUCOIN, price: res })),
priceRate.getCoinMarketCapPrice(CurrencySymbols[currency].COIN_MARKET_CAP, exchangeRateTime).then(res => ({ exchangeName: 'cmc', price: res })),
priceRate.getCoinMarketCapPriceV2(CurrencySymbols[currency].COIN_MARKET_CAP, exchangeRateTime).then(res => ({ exchangeName: 'cmc', price: res })),
];
}
const prices = await Promise.allSettled<{ exchangeName: string; price: number }>(sources);
Expand Down

0 comments on commit 167e20d

Please sign in to comment.