Retrieving the Hash of any ID Graph

This document describes how to use the Litentry’s client-sdk to retrieve the id_graph hash for any user.

Before continuing, make sure you have completed all the steps in the Installation section.

import { request } from "@litentry/enclave";

// The Subject. Usually the prime identity.
const who = createLitentryIdentityType(api.registry, {
  addressOrHandle: '0xedb94607428De256494A8E7987D0F6F77E97e008',
  type: 'Evm',
});

const hash = await request.getIdGraphHash(api, {
  who,
});

console.log(`✨ success`);
console.log(`The id_graph hash of ${who.asEvm.toHex()} is: ${hash}`);

Use case: Retrieving the id_graph hash from the Litentry Enclave helps ensure that any ID stored in the local id_graph is up to date.

Note that this method requires no user signature because it is public.

To get the user’s id graph, check the next section.

Last updated