diff --git a/src/components/MethodName.tsx b/src/components/MethodName.tsx index 974e69e..3a4d710 100644 --- a/src/components/MethodName.tsx +++ b/src/components/MethodName.tsx @@ -26,7 +26,7 @@ const MethodName: React.FC = ({ data }) => { return; } - const signatureURL = fourBytesURL(config.assetsURLPrefix, fourBytes); + const signatureURL = fourBytesURL(config.assetsURLPrefix ?? "", fourBytes); fetch(signatureURL) .then(async (res) => { if (!res.ok) { diff --git a/src/components/TokenLogo.tsx b/src/components/TokenLogo.tsx index fab9e2c..cc2e756 100644 --- a/src/components/TokenLogo.tsx +++ b/src/components/TokenLogo.tsx @@ -19,7 +19,7 @@ const InternalTokenLogo: React.FC = ({ address, name }) => { const srcList: string[] = []; if (config) { - srcList.push(tokenLogoURL(config.assetsURLPrefix, address)); + srcList.push(tokenLogoURL(config.assetsURLPrefix ?? "", address)); } srcList.push("/eth-diamond-black.png"); const { src } = useImage({ srcList }); diff --git a/src/useConfig.ts b/src/useConfig.ts index 4e53fb6..3bb4858 100644 --- a/src/useConfig.ts +++ b/src/useConfig.ts @@ -1,8 +1,8 @@ import { useState, useEffect } from "react"; export type OtterscanConfig = { - erigonURL: string; - assetsURLPrefix: string; + erigonURL?: string; + assetsURLPrefix?: string; }; export const useConfig = (): [boolean?, OtterscanConfig?] => {