-
Notifications
You must be signed in to change notification settings - Fork 19
Identity module RPC API
Paul edited this page Jun 20, 2025
·
2 revisions
This document describes all the RPC API methods to interact with the identity
module. It covers both storage queries and extrinsics (transactions), including their interfaces and example responses.
- Description: Fetches the identity information for a given account address.
-
Arguments:
-
address
(string): The SS58-encoded account address.
-
-
Interface:
Option<IdentityInfo> // IdentityInfo example structure: { info: { display: { Raw: string }, legal: { Raw: string }, email: { Raw: string }, web: { Raw: string }, twitter: { Raw: string }, riot: { Raw: string }, additional: [[{ Raw: string }, { Raw: string }]] }, judgements: [[number, { FeePaid?: string } | { KnownGood?: null } | ...]] }
-
Example Response:
{ "info": { "display": { "Raw": "Alice" }, "legal": { "Raw": "Alice Liddell" }, "email": { "Raw": "alice@example.com" }, "web": { "Raw": "https://alice.me" }, "twitter": { "Raw": "@alice" }, "riot": { "Raw": "@alice:matrix.org" }, "additional": [[{ "Raw": "Discord" }, { "Raw": "alice#1234" }]] }, "judgements": [[0, { "FeePaid": "1000000000000" }]] }
-
Description: Fetches all entries in the
identityOf
storage map (all identities on chain). -
Arguments:
- None
-
Interface:
Array<[StorageKey, Option<IdentityInfo>]> // StorageKey contains address
-
Example Response:
[ ["5F3sa2TJ...", { "info": { "display": { "Raw": "Alice" } }, "judgements": [] }], ["5DAAnrj7...", { "info": { "display": { "Raw": "Bob" } }, "judgements": [] }] ]
- Description: Fetches the list of all registrars.
-
Arguments:
- None
-
Interface:
Vec<RegistrarInfo> // RegistrarInfo example structure: { account: string, fee: string, fields: number[], info: { display: { Raw: string }, email: { Raw: string }, web: { Raw: string }, twitter: { Raw: string }, image: { Raw: string }, additional: [[{ Raw: string }, { Raw: string }]] }, judgements: object[][], regIndex: number }
-
Example Response:
[ { "account": "5F3sa2TJ...", "fee": "1000000000000", "fields": [0, 1], "info": { "display": { "Raw": "Registrar 1" } }, "judgements": [], "regIndex": 0 }, { "account": "5DAAnrj7...", "fee": "2000000000000", "fields": [0], "info": { "display": { "Raw": "Registrar 2" } }, "judgements": [], "regIndex": 1 } ]
- Description: Fetches the indices of suspended registrars.
-
Arguments:
- None
-
Interface:
Vec<u32>
-
Example Response:
[1, 3]
- Description: Sets or updates the identity information for the sender's account.
-
Arguments:
-
identityInfo
(object): The identity fields to set (display, legal, email, web, etc.).
-
-
Interface:
setIdentity(identityInfo: IdentityInfo): SubmittableExtrinsic
-
Example:
api.tx.identity.setIdentity({ display: { Raw: "Alice" }, email: { Raw: "alice@example.com" } })
- Description: Requests a judgement from a registrar for the sender's identity.
-
Arguments:
-
registrarIndex
(number): The index of the registrar. -
fee
(string or number): The fee to pay (in plancks, smallest unit).
-
-
Interface:
requestJudgement(registrarIndex: number, fee: string | number): SubmittableExtrinsic
-
Example:
api.tx.identity.requestJudgement(0, "1000000000000")
- Description: Registrar provides a judgement for a given address.
-
Arguments:
-
registrarIndex
(number): The index of the registrar. -
address
(string): The address to judge. -
judgement
(string): The judgement level (e.g., "Reasonable", "KnownGood").
-
-
Interface:
provideJudgement(registrarIndex: number, address: string, judgement: string): SubmittableExtrinsic
-
Example:
api.tx.identity.provideJudgement(0, "5F3sa2TJ...", "Reasonable")
- Description: Cancels a pending judgement request for the sender's identity with the given registrar.
-
Arguments:
-
registrarIndex
(number): The index of the registrar.
-
-
Interface:
cancelRequest(registrarIndex: number): SubmittableExtrinsic
-
Example:
api.tx.identity.cancelRequest(0)
- Description: Clears the sender's identity information from the chain.
-
Arguments:
- None
-
Interface:
clearIdentity(): SubmittableExtrinsic
-
Example:
api.tx.identity.clearIdentity()
- Description: Registrar sets their fee for providing judgements.
-
Arguments:
-
registrarIndex
(number): The index of the registrar. -
fee
(string or number): The new fee (in plancks, smallest unit).
-
-
Interface:
setFee(registrarIndex: number, fee: string | number): SubmittableExtrinsic
-
Example:
api.tx.identity.setFee(0, "1000000000000")
- All extrinsics must be signed by the sender's account.
- Fees are denominated in the smallest unit (Crumbs), so conversion may be necessary (e.g.,
fee * 10 ** decimals
). - The actual types and available fields may depend on the chain's runtime configuration.
3dpass.org - The Ledger of Things
Join our community: Discord | Telegram | Bitcointalk