Registering requested claims
The list of required claims is defined in the Claim Topics Registry. The list of trusted claim issuers and the list of claims they are trusted to issue are defined in the Trusted Issuers Registry.
Read operations
Required Claim Topics
You can get the list of claims required by the token validator. The function will return the list of claim topics. If the topic is standard as defined in the InvestorID documentation, the SDK will add some details about the claim topic.
This method will cache the claim rules in the Token object, so you can safely call it multiple times without overhead. You can also force the refresh.
const claimTopics = await token.getClaimTopics();
/*
[
CLAIMTOPIC,
CLAIMTOPIC,
]
*/
Get the list of Trusted Issuers
This call will return the list of Claim Issuer contracts allowed to issue claims for Identities and the list of claim topics where they are trusted.
const trustedClaimIssuers = await token.getTrustedClaimIssuers();
/*
[
{
contractAddress: 'CLAIM ISSUER ADDRESS',
trustedClaimTopics: [CLAIMTOPIC, CLAIMTOPIC],
},
]
*/
Get Trusted Issuer details
This call returns the list of topics where a Claim Issuer is trusted.
const trustedClaimIssuers = await token.getTrustedIssuer(INDEX);
/*
{
contractAddress: 'CLAIM ISSUER ADDRESS',
trustedClaimTopics: [CLAIMTOPIC, CLAIMTOPIC],
}
*/
Check if Claim Issuer is trusted
This call returns true if the given address is registered as a Trusted Issuer.
const trustedClaimIssuers = await token.isClaimIssuerTrusted('WALLET ADDRESS');
Check if Claim Issuer is trusted for a Claim Topic
This call returns true
if the given address
is registered as a Claim Issuer allowed to issue claims of the specified topic.
const trustedClaimIssuers = await token.isClaimIssuerTrustedForTopic('WALLET ADDRESS', CLAIMTOPIC);
Write operations
Add a required Claim Topic
const tx = await token.addRequiredClaimTopic(CLAIMTOPIC);
Remote a required Claim Topic
const tx = await token.removeRequiredClaimTopic(CLAIMTOPIC);
Trust a Claim Issuer
const tx = await token.trustClaimIssuer({
contractAddress: 'CLAIM ISSUER ADDRESS',
trustedClaimTopics: [CLAIMTOPICS],
});
Untrust a Claim Issuer
const tx = await token.untrustClaimIssuer('CLAIM ISSUER ADDRESS');
Update Claim Issuer trusted Topics
const tx = await token.setClaimIssuerTrustedTopics({
contractAddress: 'CLAIM ISSUER ADDRESS',
trustedClaimTopics: [CLAIMTOPICS]
});
Updated 14 days ago