Getting the User id_graph
This document describes how to use the Litentry’s client-sdk to retrieve a user’s the id_graph.
Before continuing, make sure you have completed all the steps from the Installation section.
1. Building the Request
Build a secure trusted request using:
The call
object has the following properties:
call.payloadToSign
: The hex-encoded trusted call.call.send
: A callback function to send the request to the Litentry Enclave.
The trusted call needs to be signed by the prime identity. This ensures the request is legit. The message to sign is found in call.payloadToSign
.
The signature should be a hex-encoded string. Optionally accepted formats are: base58-encoded string for Solana and base64-encoded for Bitcoin identities.
2. Sending the Request.
Once the call.payloadToSign
message is signed by the prime identity, you can send the transaction.
The result
object has the following properties:
result.response
: The raw Enclave’s response. AWorkerRpcReturnValue
struct.request.idGraph
: The representation of the id_graph. AVec<ITuple<[LitentryIdentity, IdentityContext]>>
struct.
3. Calculate the hash of the id_graph
The client-sdk
exposes a calculateIdGraphHash
helper to get the hash of a given id_graph:
Last updated