Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fix support for new CAIP10 format
Sebastian Martinez committed 4 years ago
commit f47ae92a15ebf128e6796e4984d4fe61043b130e
parent b73177ad06e2f48eb067c08eff1e76cc1e46b5ae
1 file changed +3 -2
modified 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") {