Skip to content

Commit

Permalink
[Update] USDT information (#3600)
Browse files Browse the repository at this point in the history
* [hotfix][662] add USDC as default

* move get usdc token to account service

* fix: usdc token type

* fix: wrong usdc token url

* fix: conflict between token-market api and evm-token-detail api

* update: usdt token infomation
  • Loading branch information
TranTrungTien authored Jul 8, 2024
1 parent 68ffe33 commit de33950
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/app/core/data-services/api-cw20-token.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ApiCw20TokenService {
);

const usdcCoin = this.parseUSDCToken(USDCToken, coinsMarkets);

const idx = tokens?.findIndex((f) => f.contract_address?.toLowerCase() === USDC_ADDRESS);
if (idx >= 0) {
tokens[idx] = usdcCoin;
Expand Down Expand Up @@ -133,17 +133,22 @@ export class ApiCw20TokenService {

parseUSDCToken(token, coinsMarkets) {
const USDCMarket = coinsMarkets?.find((item) => item.coinId === USDC_COIN_ID);

const value = new BigNumber(token?.balance).multipliedBy(Number(USDCMarket?.currentPrice || 0));

return {
...token,
change: null,
isValueUp: true,
type: COIN_TOKEN_TYPE.ERC20,
tokenUrl: USDC_ADDRESS,
denom: USDC_ADDRESS,
price: USDCMarket?.currentPrice,
priceChangePercentage24h: USDCMarket?.priceChangePercentage24h,
value: Number(USDCMarket?.currentPrice) * token?.balance,
price: USDCMarket?.currentPrice || 0,
priceChangePercentage24h: USDCMarket?.priceChangePercentage24h || 0,
value: value.toNumber(),
image: USDCMarket?.image,
max_total_supply: USDCMarket?.totalSupply,
verify_status: USDCMarket?.verifyStatus || '',
verify_text: USDCMarket?.verifyText || '',
};
}

Expand Down

0 comments on commit de33950

Please sign in to comment.