From e9a54b64d6c55e263fbde11da6b8d9734750dc1e Mon Sep 17 00:00:00 2001 From: hkey <81494947+hkey0@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:51:26 +0300 Subject: [PATCH] update rpc --- app/components/Deposit/DepositContent.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/components/Deposit/DepositContent.tsx b/app/components/Deposit/DepositContent.tsx index 9692195..ff57954 100644 --- a/app/components/Deposit/DepositContent.tsx +++ b/app/components/Deposit/DepositContent.tsx @@ -78,7 +78,12 @@ export const DepositContent: React.FC<DepositContentProps> = ({ modalStuff, amou if (!wallet) return; // ignore this for sepolia if (( !provider && process.env.NEXT_PUBLIC_CURRENT_CHAIN === "mainnet")|| !(wallet.chain == "EVM")) return; - const balance = await getBalance(client, { + const balClient = createPublicClient({ + chain: (process.env.NEXT_PUBLIC_CURRENT_CHAIN === "mainnet") ? mainnet : sepolia, + transport: (process.env.NEXT_PUBLIC_CURRENT_CHAIN === "mainnet") ? http() : http("https://sepolia.drpc.org"), + cacheTime: 0 + }) + const balance = await getBalance(balClient, { //@ts-ignore address: wallet.address, blockTag: 'safe'