Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Allow passing ENS names in function
Alexis Sellier committed 4 years ago
commit 44abcdee679b25caa4a1cac1e0664c96eaac75b5
parent cb130474bc2130854d5a2440d9a8c0e9f61f6196
1 file changed +7 -0
modified src/profile.ts
@@ -1,3 +1,4 @@
+
import { ethers } from "ethers";
import type { Registration } from "@app/base/registrations/registrar";
import type { BasicProfile } from "@ceramicstudio/idx-constants";
import {
@@ -64,6 +65,12 @@ export class Profile {
    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),
        resolveIdxProfile(formatCAIP10Address(address, "eip155", config.network.chainId), config)