Skip to content

Commit b75670d

Browse files
authored
Merge pull request #1892 from IndexCoop/fix/swap-approve
fix: swap approve check
2 parents af88c27 + 4d162cd commit b75670d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/lib/hooks/use-best-quote/index.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useCallback, useEffect, useMemo, useState } from 'react'
2-
import { usePublicClient } from 'wagmi'
32

43
import { ARBITRUM } from '@/constants/chains'
54
import { isAvailableForFlashMint } from '@/lib/hooks/use-best-quote/utils/available'
@@ -41,8 +40,7 @@ export const useBestQuote = (
4140
inputToken: Token,
4241
outputToken: Token,
4342
) => {
44-
const publicClient = usePublicClient()
45-
const { address, provider, rpcUrl } = useWallet()
43+
const { address, provider } = useWallet()
4644
const { chainId: networkChainId } = useNetwork()
4745
const { logEvent } = useAnalytics()
4846
// Assume mainnet when no chain is connected (to be able to fetch quotes)
@@ -80,8 +78,10 @@ export const useBestQuote = (
8078
return
8179
}
8280

83-
if (!provider || !publicClient || !chainId || !address || !rpcUrl) {
84-
console.error('Error fetching quotes - no provider or chain id present')
81+
if (!provider || !chainId || !address) {
82+
console.error(
83+
'Error fetching quotes - no provider | chain id | address present',
84+
)
8585
return
8686
}
8787

@@ -168,8 +168,6 @@ export const useBestQuote = (
168168
outputToken,
169169
nativeTokenPrice,
170170
provider,
171-
publicClient,
172-
rpcUrl,
173171
],
174172
)
175173

0 commit comments

Comments
 (0)