Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@sushiswap/wagmi / hooks / useWETH9Contract.ts
Size: Mime:
import { WNATIVE_ADDRESS } from '@sushiswap/currency'
import { useContract, useProvider } from 'wagmi'

import WETH9_ABI from '../abis/weth9.json'

export const getWETH9ContractConfig = (chainId: number | undefined) => ({
  addressOrName: chainId ? WNATIVE_ADDRESS[chainId] : '',
  contractInterface: WETH9_ABI,
})

export function useWETH9Contract(chainId: number | undefined) {
  return useContract({
    ...getWETH9ContractConfig(chainId),
    signerOrProvider: useProvider({ chainId }),
  })
}