Skip to content

Commit

Permalink
feat: Add log
Browse files Browse the repository at this point in the history
  • Loading branch information
ChefMomota committed Oct 17, 2024
1 parent fb21f05 commit ca87570
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
7 changes: 4 additions & 3 deletions apps/web/src/state/farmsV4/state/extendPools/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ export const fetchExplorerPoolInfo = async <TPoolType extends PoolInfo>(
// @ts-ignore
resp.data.chainId = chainId
const farmConfig = await fetchAllUniversalFarms()
const isFarming = farmConfig.some((farm) => farm.lpAddress === poolAddress)
console.log('gg0', farmConfig)
console.log('gg1', isFarming)
const isFarming = farmConfig.some((farm) => farm.lpAddress.toLowerCase() === poolAddress.toLowerCase())
console.log('resp', resp)
console.log('farmConfig', farmConfig)
console.log('isFarming', isFarming)

const data = await composeFarmConfig(parseFarmPools([resp.data], { isFarming })[0])
console.log('ggg', data)
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/state/farmsV4/state/extendPools/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,14 @@ export const usePoolInfo = <TPoolType extends PoolInfo>({
poolAddress: string | null
chainId: number
}): TPoolType | undefined | null => {
console.log('hi', poolAddress, chainId)
const { data: poolInfo } = useQuery({
queryKey: ['poolInfo', chainId, poolAddress],
queryFn: async () => {
const result = await fetchExplorerPoolInfo(poolAddress ?? '', chainId)
console.log('h2', result)
return result
},
enabled: !!poolAddress && !!chainId,
})

console.log('usePoolInfo', poolInfo)

return poolInfo as TPoolType | undefined | null
}
1 change: 1 addition & 0 deletions apps/web/src/state/farmsV4/state/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const parseFarmPools = async (
options: { isFarming?: boolean } = {},
): Promise<PoolInfo[]> => {
const fetchFarmConfig = await fetchAllUniversalFarms()
console.log('sss', fetchFarmConfig)

return data.map((pool) => {
let stableSwapAddress: Address | undefined
Expand Down

0 comments on commit ca87570

Please sign in to comment.