From f47ae92a15ebf128e6796e4984d4fe61043b130e Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Mon, 8 Nov 2021 15:38:22 +0100 Subject: [PATCH] Fix support for new CAIP10 format Signed-off-by: Sebastian Martinez --- src/profile.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/profile.ts b/src/profile.ts index 9b5f5b3dd..a62a88542 100644 --- a/src/profile.ts +++ b/src/profile.ts @@ -1,4 +1,3 @@ -import { AccountID } from 'caip'; import type { EnsProfile } from "@app/base/registrations/registrar"; import type { BasicProfile } from '@datamodels/identity-profile-basic'; import { @@ -90,7 +89,9 @@ export class Profile { const addr = this.profile?.ens?.anchorsAccount; if (addr) { - const id = new AccountID(addr); + // TODO: Workaround until caip package supports both CAIP10 formats. + const [namespace, reference, address] = addr.split(":"); + const id = { "chainId": { namespace, reference }, address }; // Ethereum address. if (typeof id.chainId === "object" && id.chainId.namespace === "eip155") {