Skip to content

Commit

Permalink
chore: version bump (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick134-bit authored Jun 7, 2024
1 parent 6a485f9 commit cac0f85
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions components/AssetInput/AssetList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ const AssetList: FC<AssetListProps> = ({
const tokens = useMemo(() => {
if (!config) return []

if (!isBonding && !isIncentives) return [...(tokenList?.tokensBySymbol?.values() || [])].filter((token: any) => !token?.withoutPool);
if (!isBonding && !isIncentives) return [...(tokenList?.tokensBySymbol?.values() || [])].filter((token: any) => !token?.fromRegistry && !token?.withoutPool);

let res = isBonding ? config.bonding_tokens : [...(tokenList?.tokensBySymbol?.values() || [])];

return res.length > 0 ? res : [...(tokenList?.tokensBySymbol?.values() || [])].filter((token: any) => !token?.withoutPool);
return res.length > 0 ? res : [...(tokenList?.tokensBySymbol?.values() || [])].filter((token: any) => !token?.fromRegistry && !token?.withoutPool);
}, [config, isBonding, isIncentives, tokenList]);

const [tokenBalance = []] =
Expand Down
1 change: 1 addition & 0 deletions components/Pages/Trade/Pools/hooks/usePoolsListQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useRecoilValue } from 'recoil'
import { chainState } from 'state/chainState'

export type TokenInfo = {
fromRegistry?: boolean
id: string
chain_id: string
token_address: string
Expand Down
9 changes: 8 additions & 1 deletion hooks/usePrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ const getPrices = async ({
const baseTokenPrice = coingeckoPrices[baseToken.id]?.usd

for (const token of tokens) {
if (token?.fromRegistry) {
continue
}
if (coingeckoPrices[token.id]) {
prices[token.symbol] = coingeckoPrices[token.id].usd
} else {
Expand Down Expand Up @@ -131,7 +134,11 @@ export const usePrices = () => {
const { data: poolsList } = usePoolsListQuery()
const { cosmWasmClient } = useClients(walletChainName)
const [tokenList] = useTokenList()
const coingeckoIds = useMemo(() => tokenList?.tokens.map((token) => token.id),
const coingeckoIds = useMemo(() => tokenList?.tokens.map((token) => {
if (token.id && !token.fromRegistry) {
return token.id
}
}),
[tokenList?.tokens])
const coingeckoPrices = useCoinGecko(coingeckoIds)
const { data: prices } = useQuery({
Expand Down
4 changes: 2 additions & 2 deletions hooks/useTokenList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export const useTokenList = () => {
const native = (asset.type_asset === 'sdk.coin' || asset.type_asset === 'ics20' || asset.base.includes('factory/') || asset.base.charAt(0) == 'u') && asset.type_asset !== 'cw20'
const denom = !native ? asset.address : asset.base
const logoURI = asset.logo_URIs?.svg || asset.logo_URIs?.png || asset.images[0].svg || asset.images[0].png
let tmpAssetOBJ: any = { denom: denom, id: asset.coingecko_id || "", token_address: asset.address || asset.base, chain_id: chainId, symbol: asset.symbol, decimals: exponents.exponent, name: asset.name, logoURI: logoURI, tags: native ? ['native'] : [''], native: native, withoutPool: true }
let tmpAssetOBJ: any = { denom: denom, id: asset.coingecko_id || "", token_address: asset.address || asset.base, chain_id: chainId, symbol: asset.symbol, decimals: exponents.exponent, name: asset.name, logoURI: logoURI, tags: native ? ['native'] : [''], native: native, fromRegistry: true }
const res = Array.from(tokenMapBySymbol.values())
if (!res.find((token) => token.denom === denom)) {
if (denom && !res.find((token) => token.denom === denom)) {
tokenMapBySymbol.set(asset.symbol, tmpAssetOBJ)
}
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"bignumber.js": "^9.1.2",
"chain-registry": "^1.61.9",
"chain-registry": "^1.62.3",
"dayjs": "^1.11.11",
"eslint-plugin-import-helpers": "^1.3.1",
"intercept-stdout": "^0.1.2",
Expand Down

0 comments on commit cac0f85

Please sign in to comment.