diff --git a/src/utils.ts b/src/utils.ts index 5d043fe20..6d7a85254 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -151,7 +151,7 @@ export function formatProjectHash(multihash: Uint8Array): string { // Identify an address by checking whether it's a contract or an externally-owned address. export async function identifyAddress(address: string, config: Config): Promise { - const safe = await getSafe(address, config); + const safe = await isSafe(address, config); if (safe) { return AddressType.Safe; } @@ -173,6 +173,15 @@ export async function resolveLabel(label: string, config: Config): Promise { + if (! config.safe.api) return false; + + const response = await fetch(`${config.safe.api}/safes/${address}`, { method: 'HEAD' }); + + return response.ok; +} + // Get a Gnosis Safe at an address. export async function getSafe(address: string, config: Config): Promise { if (! config.safe.api) return null;