0edb0fe5e2
* fix: memo-ize onchain results * fix: typeof omission
14 lines
592 B
TypeScript
14 lines
592 B
TypeScript
import useActiveWeb3React from 'hooks/useActiveWeb3React'
|
|
import { NEVER_RELOAD, useSingleCallResult } from 'lib/hooks/multicall'
|
|
import { useMemo } from 'react'
|
|
|
|
import { useArgentWalletDetectorContract } from './useContract'
|
|
|
|
export default function useIsArgentWallet(): boolean {
|
|
const { account } = useActiveWeb3React()
|
|
const argentWalletDetector = useArgentWalletDetectorContract()
|
|
const inputs = useMemo(() => [account ?? undefined], [account])
|
|
const call = useSingleCallResult(argentWalletDetector, 'isArgentWallet', inputs, NEVER_RELOAD)
|
|
return Boolean(call?.result?.[0])
|
|
}
|