95 lines
2.5 KiB
TypeScript
95 lines
2.5 KiB
TypeScript
import { defineChain } from "viem";
|
|
import * as chains from "viem/chains";
|
|
import {
|
|
arbitrum,
|
|
avalanche,
|
|
base,
|
|
berachain,
|
|
blast,
|
|
forma,
|
|
mainnet,
|
|
optimism,
|
|
polygon,
|
|
unichain,
|
|
story,
|
|
sepolia,
|
|
baseSepolia,
|
|
} from "viem/chains";
|
|
|
|
const bnbSmartChain = defineChain({
|
|
id: 56,
|
|
name: "BNB Smart Chain",
|
|
nativeCurrency: {
|
|
name: "BNB",
|
|
symbol: "BNB",
|
|
decimals: 18,
|
|
},
|
|
rpcUrls: {
|
|
default: { http: ["https://evm-56.keplr.app"] },
|
|
},
|
|
blockExplorers: {
|
|
default: {
|
|
name: "BSCScan",
|
|
url: "https://bscscan.com",
|
|
apiUrl: "https://api.bscscan.com/api",
|
|
},
|
|
},
|
|
});
|
|
|
|
export type BaseConfig = {
|
|
targetNetworks: readonly chains.Chain[];
|
|
pollingInterval: number;
|
|
alchemyApiKey: string;
|
|
rpcOverrides?: Record<number, string>;
|
|
walletConnectProjectId: string;
|
|
onlyLocalBurnerWallet: boolean;
|
|
};
|
|
|
|
export type ScaffoldConfig = BaseConfig;
|
|
|
|
export const DEFAULT_ALCHEMY_API_KEY = "oKxs-03sij-U_N0iOlrSsZFr29-IqbuF";
|
|
|
|
const scaffoldConfig = {
|
|
// The networks on which your DApp is live
|
|
targetNetworks: [
|
|
arbitrum,
|
|
avalanche,
|
|
base,
|
|
berachain,
|
|
blast,
|
|
bnbSmartChain,
|
|
forma,
|
|
mainnet,
|
|
optimism,
|
|
polygon,
|
|
unichain,
|
|
story,
|
|
sepolia,
|
|
baseSepolia,
|
|
] as readonly chains.Chain[],
|
|
// The interval at which your front-end polls the RPC servers for new data (it has no effect if you only target the local network (default is 4000))
|
|
pollingInterval: 30000,
|
|
// This is ours Alchemy's default API key.
|
|
// You can get your own at https://dashboard.alchemyapi.io
|
|
// It's recommended to store it in an env variable:
|
|
// .env.local for local testing, and in the Vercel/system env config for live apps.
|
|
alchemyApiKey:
|
|
process.env.NEXT_PUBLIC_ALCHEMY_API_KEY || DEFAULT_ALCHEMY_API_KEY,
|
|
// If you want to use a different RPC for a specific network, you can add it here.
|
|
// The key is the chain ID, and the value is the HTTP RPC URL
|
|
rpcOverrides: {
|
|
// Example:
|
|
// [chains.mainnet.id]: "https://mainnet.buidlguidl.com",
|
|
},
|
|
// This is ours WalletConnect's default project ID.
|
|
// You can get your own at https://cloud.walletconnect.com
|
|
// It's recommended to store it in an env variable:
|
|
// .env.local for local testing, and in the Vercel/system env config for live apps.
|
|
walletConnectProjectId:
|
|
process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID ||
|
|
"3a8170812b534d0ff9d794f19a901d64",
|
|
onlyLocalBurnerWallet: true,
|
|
} as const satisfies ScaffoldConfig;
|
|
|
|
export default scaffoldConfig;
|