Skip to content

Commit

Permalink
Update heimdall backend url (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
portdeveloper authored Jul 22, 2024
1 parent 7d80207 commit 9b8a61e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 9b8a61e

Please sign in to comment.