Skip to content

Commit

Permalink
Remove goerli properly
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonmanRolls committed Nov 28, 2024
1 parent df0b007 commit 4601acb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,6 @@ const Registration = ({ nameDetails, isLoading }: Props) => {
<Typography fontVariant="bodyBold" color="grey">
{t('steps.info.moonpayModalHeader')}
</Typography>
{chainId === 5 && (
<Typography fontVariant="body" color="grey">
{`${t('steps.info.moonpayTestCard')}: 4000 0209 5159 5032, 12/2030, 123`}
</Typography>
)}
</MoonPayHeader>
<MoonPayIFrame
title="Moonpay Checkout"
Expand Down
5 changes: 1 addition & 4 deletions src/constants/chains.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { holesky } from 'viem/chains'
import { goerli, localhost, mainnet, sepolia } from 'wagmi/chains'
import { localhost, mainnet, sepolia } from 'wagmi/chains'

import { addEnsContracts } from '@ensdomains/ensjs'

Expand All @@ -25,13 +25,11 @@ export const mainnetWithEns = {
},
},
}
export const goerliWithEns = addEnsContracts(goerli)
export const sepoliaWithEns = addEnsContracts(sepolia)
export const holeskyWithEns = addEnsContracts(holesky)

export const chainsWithEns = [
mainnetWithEns,
goerliWithEns,
sepoliaWithEns,
holeskyWithEns,
localhostWithEns,
Expand All @@ -42,7 +40,6 @@ export const getSupportedChainById = (chainId: number | undefined) =>

export type SupportedChain =
| typeof mainnetWithEns
| typeof goerliWithEns
| typeof sepoliaWithEns
| typeof holeskyWithEns
| typeof localhostWithEns
9 changes: 2 additions & 7 deletions src/hooks/useEthPrice.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
import { Address } from 'viem'
import { useChainId, useReadContract } from 'wagmi'
import { goerli } from 'wagmi/chains'
import { useReadContract } from 'wagmi'

import { useAddressRecord } from './ensjs/public/useAddressRecord'

const ORACLE_ENS = 'eth-usd.data.eth'
const ORACLE_GOERLI = '0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e' as const

export const useEthPrice = () => {
const chainId = useChainId()

const { data: address_ } = useAddressRecord({
name: ORACLE_ENS,
enabled: chainId !== goerli.id,
})

const address = chainId === 5 ? ORACLE_GOERLI : (address_?.value as Address) || undefined
const address = (address_?.value as Address) || undefined

return useReadContract({
abi: [
Expand Down
4 changes: 1 addition & 3 deletions src/utils/query/wagmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { holesky, localhost, mainnet, sepolia } from 'wagmi/chains'
import { ccipRequest } from '@ensdomains/ensjs/utils'

import {
goerliWithEns,
holeskyWithEns,
localhostWithEns,
mainnetWithEns,
Expand Down Expand Up @@ -33,7 +32,7 @@ const drpcUrl = (chainName: string) =>
chainName === 'mainnet' ? 'ethereum' : chainName
}&dkey=${drpcKey}`

type SupportedUrlFunc = typeof infuraUrl | typeof dRPCUrl | typeof tenderlyUrl
type SupportedUrlFunc = typeof infuraUrl | typeof drpcUrl | typeof tenderlyUrl

const initialiseTransports = <const UrlFuncArray extends SupportedUrlFunc[]>(
chainName: string,
Expand Down Expand Up @@ -87,7 +86,6 @@ const localStorageWithInvertMiddleware = (): Storage | undefined => {
const chains = [
...(isLocalProvider ? ([localhostWithEns] as const) : ([] as const)),
mainnetWithEns,
goerliWithEns,
sepoliaWithEns,
holeskyWithEns,
] as const
Expand Down

0 comments on commit 4601acb

Please sign in to comment.