Class: Claims
Defined in: src/api/client/Claims.ts:61
Handles all Claims related functionality
Methods
addClaims()
addClaims(
args:Pick<ModifyClaimsParams,"claims">,opts?:ProcedureOpts):Promise<GenericPolymeshTransaction<void,void>>
Defined in: src/api/client/Claims.ts:133
Add claims to Identities
Parameters
| Parameter | Type |
|---|---|
|
|
|
Returns
Promise<GenericPolymeshTransaction<void, void>>
Note
required roles:
- Customer Due Diligence Provider: if there is at least one CDD claim in the arguments
Note
this method is of type ProcedureMethod, which means you can call addClaims.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
editClaims()
editClaims(
args:Pick<ModifyClaimsParams,"claims">,opts?:ProcedureOpts):Promise<GenericPolymeshTransaction<void,void>>
Defined in: src/api/client/Claims.ts:141
Edit claims associated to Identities (only the expiry date can be modified)
Parameters
| Parameter | Type |
|---|---|
|
|
|
Returns
Promise<GenericPolymeshTransaction<void, void>>
Note
required roles:
- Customer Due Diligence Provider: if there is at least one CDD claim in the arguments
Note
this method is of type ProcedureMethod, which means you can call editClaims.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
getAllCustomClaimTypes()
getAllCustomClaimTypes(
opts:object):Promise<ResultSet<CustomClaimTypeWithDid>>
Defined in: src/api/client/Claims.ts:623
Retrieve registered CustomClaimTypes
Parameters
| Parameter | Type | Description |
|---|---|---|
| { | ‐ |
|
| Fetch CustomClaimTypes issued by the given |
|
| ‐ |
|
| ‐ |
Returns
Promise<ResultSet<CustomClaimTypeWithDid>>
Note
supports pagination
Note
uses the middlewareV2 (Required)
getCddClaims()
Defined in: src/api/client/Claims.ts:395
Retrieve the list of CDD claims for a target Identity
Parameters
| Parameter | Type | Description |
|---|---|---|
| { | ‐ |
|
| whether to include expired claims. Defaults to true |
|
| Identity for which to fetch CDD claims (optional, defaults to the signing Identity) |
Returns
Promise<ClaimData<CddClaim>[]>
getClaimScopes()
getClaimScopes(
opts:object):Promise<ClaimScope[]>
Defined in: src/api/client/Claims.ts:281
Retrieve all scopes in which claims have been made for the target Identity. If the scope is an asset DID, the corresponding ticker is returned as well
Parameters
| Parameter | Type | Description |
|---|---|---|
| { | ‐ |
|
| Identity for which to fetch claim scopes (optional, defaults to the signing Identity) |
Returns
Promise<ClaimScope[]>
Note
in order for scopes to include scopes for custom claims, middlewareV2 is required
getCustomClaimTypeById()
getCustomClaimTypeById(
id:BigNumber):Promise<null|CustomClaimType>
Defined in: src/api/client/Claims.ts:598
Retrieves a custom claim type based on its ID
Parameters
| Parameter | Type | Description |
|---|---|---|
|
| The ID of the custom claim type to retrieve |
Returns
Promise<null | CustomClaimType>
getCustomClaimTypeByName()
getCustomClaimTypeByName(
name:string):Promise<null|CustomClaimType>
Defined in: src/api/client/Claims.ts:575
Retrieves a custom claim type based on its name
Parameters
| Parameter | Type | Description |
|---|---|---|
|
| The name of the custom claim type to retrieve |
Returns
Promise<null | CustomClaimType>
getIdentitiesWithClaims()
getIdentitiesWithClaims(
opts:object):Promise<ResultSet<IdentityWithClaims>>
Defined in: src/api/client/Claims.ts:195
Retrieve a list of Identities with claims associated to them. Can be filtered using parameters
Parameters
| Parameter | Type | Description |
|---|---|---|
| { | ‐ |
| types of the claims to fetch. Defaults to any type | |
|
| whether to include expired claims. Defaults to true |
| scope of the claims to fetch. Defaults to any scope | |
|
| page size |
|
| page offset |
| ( | Identities (or Identity IDs) for which to fetch targeting claims. Defaults to all targets |
| ( | Identity IDs of claim issuers. Defaults to all claim issuers |
Returns
Promise<ResultSet<IdentityWithClaims>>
Note
supports pagination
Note
uses the middleware V2
getIssuedClaims()
getIssuedClaims(
opts:object):Promise<ResultSet<ClaimData<Claim>>>
Defined in: src/api/client/Claims.ts:160
Retrieve all claims issued by an Identity
Parameters
| Parameter | Type | Description |
|---|---|---|
| { | ‐ |
|
| whether to include expired claims. Defaults to true |
|
| ‐ |
|
| ‐ |
|
| Identity (optional, defaults to the signing Identity) |
Returns
Promise<ResultSet<ClaimData<Claim>>>
Note
supports pagination
Note
uses the middlewareV2
getTargetingClaims()
getTargetingClaims(
opts:object):Promise<ResultSet<IdentityWithClaims>>
Defined in: src/api/client/Claims.ts:483
Retrieve all claims issued about an Identity, grouped by claim issuer
Parameters
| Parameter | Type | Description |
|---|---|---|
| { | ‐ |
|
| whether to include expired claims. Defaults to true |
| ‐ | |
|
| ‐ |
|
| ‐ |
|
| Identity for which to fetch targeting claims (optional, defaults to the signing Identity) |
| ( | ‐ |
Returns
Promise<ResultSet<IdentityWithClaims>>
Note
supports pagination
Note
uses the middlewareV2 (optional)
registerCustomClaimType()
registerCustomClaimType(
args:RegisterCustomClaimTypeParams,opts?:ProcedureOpts):Promise<GenericPolymeshTransaction<BigNumber,BigNumber>>
Defined in: src/api/client/Claims.ts:568
Creates a custom claim type using the name and returns the id of the created claim type
Parameters
| Parameter | Type |
|---|---|
| |
|
Returns
Promise<GenericPolymeshTransaction<BigNumber, BigNumber>>
Throws
if
- the
nameis longer than allowed - a custom claim type with the same
namealready exists
Note
this method is of type ProcedureMethod, which means you can call registerCustomClaimType.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
revokeClaims()
revokeClaims(
args:Pick<ModifyClaimsParams,"claims">,opts?:ProcedureOpts):Promise<GenericPolymeshTransaction<void,void>>
Defined in: src/api/client/Claims.ts:149
Revoke claims from Identities
Parameters
| Parameter | Type |
|---|---|
|
|
|
Returns
Promise<GenericPolymeshTransaction<void, void>>
Note
required roles:
- Customer Due Diligence Provider: if there is at least one CDD claim in the arguments
Note
this method is of type ProcedureMethod, which means you can call revokeClaims.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it