-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwagmi.ts
39 lines (36 loc) · 1.03 KB
/
wagmi.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { connectorsForWallets } from "@rainbow-me/rainbowkit";
import {
metaMaskWallet,
walletConnectWallet,
} from "@rainbow-me/rainbowkit/wallets";
import { createConfig, http } from "wagmi";
import { mainnet, polygonAmoy, polygon } from "wagmi/chains";
import { coinbaseWallet, metaMask, walletConnect } from "wagmi/connectors";
import abi from "@/libs/abi.json";
const appName = "一块广告牌";
const connectors = connectorsForWallets(
[
{
groupName: "Recommended",
wallets: [metaMaskWallet, walletConnectWallet],
},
],
{
projectId: process.env.NEXT_PUBLIC_PROJECT_ID!,
appName,
}
);
export const config = createConfig({
connectors,
chains: [process.env.NODE_ENV === "development" ? polygonAmoy : polygonAmoy],
transports: {
[polygon.id]: http(process.env.INFURA_URL),
[polygonAmoy.id]: http(process.env.INFURA_URL),
},
multiInjectedProviderDiscovery: false,
ssr: true,
});
export const contractMsg = {
abi,
address: process.env.NEXT_PUBLIC_CONTRACT_ADDRESS! as `0x${string}`,
};