From e4f5647fc4609ab1846874f205bcabe06614fbb6 Mon Sep 17 00:00:00 2001 From: port <108868128+portdeveloper@users.noreply.github.com> Date: Thu, 18 Jul 2024 09:38:31 +0300 Subject: [PATCH] Update heimdall backend url --- packages/nextjs/pages/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nextjs/pages/index.tsx b/packages/nextjs/pages/index.tsx index 9783dde1..157a78b5 100644 --- a/packages/nextjs/pages/index.tsx +++ b/packages/nextjs/pages/index.tsx @@ -134,7 +134,10 @@ const Home: NextPage = () => { const fetchAbiFromHeimdall = async (contractAddress: Address) => { setIsFetchingAbi(true); try { - const response = await fetch(`${process.env.NEXT_PUBLIC_HEIMDALL_URL}/${network}/${contractAddress}`); + const rpcUrlWithoutHttps = publicClient?.chain.rpcUrls.default.http[0].substring(8); + const response = await fetch( + `${process.env.NEXT_PUBLIC_HEIMDALL_URL}/${contractAddress}?rpc_url=${rpcUrlWithoutHttps}`, + ); const abi = await response.json(); if (abi.length === 0) { notification.error("Failed to fetch ABI from Heimdall. Please try again or enter ABI manually.");