Skip to content

Commit 5610bc1

Browse files
committed
remove usage of infura (all requests to it fail anyway)
1 parent 0873924 commit 5610bc1

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

src/test-utils.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ const wagmiConfig = {
8787

8888
vi.mock('@app/utils/query/wagmi', () => ({
8989
wagmiConfig,
90-
infuraUrl: () => 'http://infura.io',
9190
drpcUrl: () => 'http://drpc.org',
9291
}))
9392

src/utils/query/wagmi.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,24 @@ import { rainbowKitConnectors } from './wallets'
2020

2121
const isLocalProvider = !!process.env.NEXT_PUBLIC_PROVIDER
2222

23-
const infuraKey = process.env.NEXT_PUBLIC_INFURA_KEY || 'cfa6ae2501cc4354a74e20432507317c'
2423
const tenderlyKey = process.env.NEXT_PUBLIC_TENDERLY_KEY || '4imxc4hQfRjxrVB2kWKvTo'
2524
const drpcKey = process.env.NEXT_PUBLIC_DRPC_KEY || 'AnmpasF2C0JBqeAEzxVO8aRuvzLTrWcR75hmDonbV6cR'
2625

27-
export const infuraUrl = (chainName: string) => `https://${chainName}.infura.io/v3/${infuraKey}`
2826
const tenderlyUrl = (chainName: string) => `https://${chainName}.gateway.tenderly.co/${tenderlyKey}`
2927
export const drpcUrl = (chainName: string) =>
3028
`https://lb.drpc.org/ogrpc?network=${
3129
chainName === 'mainnet' ? 'ethereum' : chainName
3230
}&dkey=${drpcKey}`
3331

34-
type SupportedUrlFunc = typeof infuraUrl | typeof drpcUrl | typeof tenderlyUrl
32+
type SupportedUrlFunc = typeof drpcUrl | typeof tenderlyUrl
3533

3634
const initialiseTransports = <const UrlFuncArray extends SupportedUrlFunc[]>(
3735
chainName: string,
3836
urlFuncArray: UrlFuncArray,
3937
) => {
4038
const transportArray: HttpTransport[] = []
4139

42-
for (const urlFunc of urlFuncArray) {
43-
// eslint-disable-next-line no-continue
44-
if (urlFunc === infuraUrl && process.env.NEXT_PUBLIC_IPFS) continue
45-
transportArray.push(http(urlFunc(chainName)))
46-
}
40+
for (const urlFunc of urlFuncArray) transportArray.push(http(urlFunc(chainName)))
4741

4842
return fallback(transportArray)
4943
}
@@ -91,8 +85,8 @@ export const transports = {
9185
// this is a hack to make the types happy, dont remove pls
9286
[localhost.id]: HttpTransport
9387
})),
94-
[mainnet.id]: initialiseTransports('mainnet', [drpcUrl, infuraUrl, tenderlyUrl]),
95-
[sepolia.id]: initialiseTransports('sepolia', [drpcUrl, infuraUrl, tenderlyUrl]),
88+
[mainnet.id]: initialiseTransports('mainnet', [drpcUrl, tenderlyUrl]),
89+
[sepolia.id]: initialiseTransports('sepolia', [drpcUrl, tenderlyUrl]),
9690
[holesky.id]: initialiseTransports('holesky', [drpcUrl, tenderlyUrl]),
9791
} as const
9892

0 commit comments

Comments
 (0)