Skip to content

Commit 3ce87fb

Browse files
committed
refactor config
1 parent 82f12f6 commit 3ce87fb

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/lib/torch/config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { sepolia } from "viem/chains"
2+
import { createConfig, http } from "@wagmi/core"
3+
4+
export const config = createConfig({
5+
chains: [sepolia],
6+
transports: {
7+
[sepolia.id]: http(
8+
`https://eth-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`
9+
),
10+
// [hardhat.id]: http("http://127.0.0.1:8545"),
11+
},
12+
})

src/lib/torch/index.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import blockies from "ethereum-blockies-base64"
22
import type { Address } from "viem"
3-
import { sepolia } from "viem/chains"
4-
import { createConfig, getPublicClient, http } from "@wagmi/core"
3+
import { getPublicClient } from "@wagmi/core"
54

65
import Torch from "@/data/Torch.json"
76

7+
import { config } from "./config"
8+
89
const TORCH_CONTRACT_ADDRESS = Torch.address as Address
910
const TORCH_ABI = Torch.abi
1011
const TORCH_BLOCK_NUMBER = Torch.blockNumber
@@ -21,16 +22,6 @@ export const isAddressFiltered = (address: string): boolean => {
2122
return FILTERED_ADDRESSES.includes(address.toLowerCase())
2223
}
2324

24-
export const config = createConfig({
25-
chains: [sepolia],
26-
transports: {
27-
[sepolia.id]: http(
28-
`https://eth-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`
29-
),
30-
// [hardhat.id]: http("http://127.0.0.1:8545"),
31-
},
32-
})
33-
3425
type TransferEvent = {
3526
from: Address
3627
to: Address

0 commit comments

Comments
 (0)