mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-30 08:40:52 +08:00
Allow passing ENS names in function
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { ethers } from "ethers";
|
||||
import type { Registration } from "@app/base/registrations/registrar";
|
||||
import type { BasicProfile } from "@ceramicstudio/idx-constants";
|
||||
import {
|
||||
@@ -63,6 +64,12 @@ export class Profile {
|
||||
private static async lookupAddress(address: string, config: Config): Promise<[IProfile, string]> {
|
||||
const profile: IProfile = { ens: null, idx: null };
|
||||
|
||||
try {
|
||||
address = ethers.utils.getAddress(address);
|
||||
} catch {
|
||||
address = await config.provider.resolveName(address);
|
||||
}
|
||||
|
||||
try {
|
||||
const [ens, idx] = await Promise.allSettled([
|
||||
resolveEnsProfile(address, config),
|
||||
|
||||
Reference in New Issue
Block a user