mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-30 00:31:03 +08:00
Resolve ENS name in Address component
Signed-off-by: Sebastian Martinez <sebastinez@me.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user