From a9eebfa033bc4d53e6692e86e8caf46f30e8b5cf Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Mon, 14 Jun 2021 01:04:54 -0300 Subject: [PATCH] Resolve ENS name in Address component Signed-off-by: Sebastian Martinez --- src/Address.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Address.svelte b/src/Address.svelte index 411f9fad9..681a2d2b8 100644 --- a/src/Address.svelte +++ b/src/Address.svelte @@ -5,6 +5,8 @@ import { safeLink } from '@app/utils'; import Loading from '@app/Loading.svelte'; import type { Config } from '@app/config'; + import type { Registration } from '@app/base/registrations/registrar'; + import { getRegistration } from '@app/base/registrations/registrar'; import { identifyAddress, formatAddress, AddressType } from '@app/utils'; export let address: string; @@ -17,12 +19,14 @@ ? formatAddress(address) : ethers.utils.getAddress(address); let loading: boolean = true; + let registration: Registration | null = null; let addressType: AddressType | null = null; let addressName: string | null = null; onMount(async () => { if (resolve) { addressName = await config.provider.lookupAddress(address); + if (addressName) registration = await getRegistration(addressName, config); } addressType = await identifyAddress(address, config); loading = false;