created a new branch with alert functionality and added the compose files etc ..

This commit is contained in:
Siavash Sameni
2025-08-26 16:15:20 +04:00
parent 0d06090865
commit 6c4a8dfe83
13 changed files with 980 additions and 58 deletions

View File

@@ -1,17 +1,10 @@
'use client';
import { createWeb3Modal } from '@web3modal/wagmi/react';
import { WagmiProvider, createConfig, http } from 'wagmi';
import { mainnet, sepolia, base, arbitrum } from 'wagmi/chains';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { PropsWithChildren, useEffect, useState } from 'react';
const projectId = process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID || '';
if (!projectId) {
// eslint-disable-next-line no-console
console.warn('[Web3] Missing NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID. WalletConnect will be limited.');
}
const metadata = {
name: 'MortgageFi',
description: 'Decentralized Mortgage Lending Platform',
@@ -19,29 +12,21 @@ const metadata = {
icons: ['https://mortgagefi.app/logo.png']
};
// Prefer custom RPCs to avoid public-provider rate limits (429)
const baseRpc = process.env.NEXT_PUBLIC_RPC_BASE;
const arbitrumRpc = process.env.NEXT_PUBLIC_RPC_ARBITRUM;
const config = createConfig({
chains: [base, arbitrum, mainnet, sepolia],
transports: {
[base.id]: http(),
[arbitrum.id]: http(),
[base.id]: baseRpc ? http(baseRpc, { batch: true, retryCount: 2, retryDelay: 250 }) : http(undefined, { batch: true, retryCount: 2, retryDelay: 250 }),
[arbitrum.id]: arbitrumRpc ? http(arbitrumRpc, { batch: true, retryCount: 2, retryDelay: 250 }) : http(undefined, { batch: true, retryCount: 2, retryDelay: 250 }),
[mainnet.id]: http(),
[sepolia.id]: http(),
},
ssr: true,
});
createWeb3Modal({
wagmiConfig: config,
projectId: projectId || 'missing_project_id',
enableAnalytics: true,
enableOnramp: true,
themeMode: 'light',
themeVariables: {
'--w3m-accent': '#4F46E5',
'--w3m-font-family': 'Inter, sans-serif',
},
});
const queryClient = new QueryClient();
export function Web3Provider({ children }: PropsWithChildren) {