@bloock/sdk / IdentityClient
Class: IdentityClient
Represents a client for interacting with the Bloock Identity service.
Table of contents
Constructors
Properties
Methods
- buildCredential
- buildSchema
- createHolder
- createIssuer
- createVerification
- forcePublishIssuerState
- getCredential
- getCredentialOffer
- getCredentialProof
- getSchema
- getVerificationStatus
- importIssuer
- revokeCredential
- waitVerification
Constructors
constructor
• new IdentityClient(configData?
): IdentityClient
Creates a new instance of the IdentityClient with default configuration.
Parameters
Name | Type |
---|---|
configData? | ConfigData |
Returns
Defined in
Properties
bridge
• Private
bridge: BloockBridge
Defined in
configData
• Private
configData: ConfigData
Defined in
Methods
buildCredential
▸ buildCredential(issuer
, schemaId
, holderDid
, expiration
, version
): CredentialBuilder
Creates a new credential builder for defining a credential on the Bloock Identity service.
Parameters
Name | Type |
---|---|
issuer | Issuer |
schemaId | string |
holderDid | string |
expiration | number |
version | number |
Returns
Defined in
buildSchema
▸ buildSchema(displayName
, schemaType
, version
, description
): SchemaBuilder
Creates a new schema builder for defining a schema on the Bloock Identity service.
Parameters
Name | Type |
---|---|
displayName | string |
schemaType | string |
version | string |
description | string |
Returns
Defined in
createHolder
▸ createHolder(holderKey
, didMethod
): Promise
<Holder
>
Creates a new holder identity.
Parameters
Name | Type |
---|---|
holderKey | Key |
didMethod | DidMethod |
Returns
Promise
<Holder
>
Defined in
createIssuer
▸ createIssuer(issuerKey
, publishInterval
, didMethod
, name?
, description?
, image?
): Promise
<Issuer
>
Creates a new issuer on the Bloock Identity service.
Parameters
Name | Type |
---|---|
issuerKey | Key |
publishInterval | PublishIntervalParams |
didMethod | DidMethod |
name? | string |
description? | string |
image? | string |
Returns
Promise
<Issuer
>
Defined in
createVerification
▸ createVerification(proofRequest
): Promise
<VerificationReceipt
>
Creates a new verification session on the identity managed API provided.
Parameters
Name | Type |
---|---|
proofRequest | string |
Returns
Promise
<VerificationReceipt
>
Defined in
forcePublishIssuerState
▸ forcePublishIssuerState(issuer
): Promise
<IssuerStateReceipt
>
Publishes the state of an issuer on the Bloock Identity service.
Parameters
Name | Type |
---|---|
issuer | Issuer |
Returns
Promise
<IssuerStateReceipt
>
Defined in
getCredential
▸ getCredential(credentialId
): Promise
<Credential
>
Retrieves the Verifiable Credential entity based on the credential ID (UUID). (ex: 1bf0c79e-55e6-4f14-aa9d-fb55619ba0cf)
Parameters
Name | Type |
---|---|
credentialId | string |
Returns
Promise
<Credential
>
Defined in
getCredentialOffer
▸ getCredentialOffer(issuer
, credentialId
): Promise
<string
>
Retrieves the json raw offer based on the credential ID (UUID). (ex: 1bf0c79e-55e6-4f14-aa9d-fb55619ba0cf)
Parameters
Name | Type |
---|---|
issuer | Issuer |
credentialId | string |
Returns
Promise
<string
>
Defined in
getCredentialProof
▸ getCredentialProof(issuerDid
, credentialId
): Promise
<CredentialProof
>
Gets the proof of a credential on the Bloock Identity service.
Parameters
Name | Type |
---|---|
issuerDid | string |
credentialId | string |
Returns
Promise
<CredentialProof
>
Defined in
getSchema
▸ getSchema(id
): Promise
<Schema
>
Gets a schema from the Bloock Identity service based on the schema ID (ex: Qma1t4uzbnB93E4rasNdu5UWMDh5qg3wMkPm68cnEyfnoM).
Parameters
Name | Type |
---|---|
id | string |
Returns
Promise
<Schema
>
Defined in
getVerificationStatus
▸ getVerificationStatus(sessionID
): Promise
<boolean
>
Gets the status of a verification session on the identity managed API provided.
Parameters
Name | Type |
---|---|
sessionID | number |
Returns
Promise
<boolean
>
Defined in
importIssuer
▸ importIssuer(issuerKey
, didMethod
): Promise
<Issuer
>
Gets the issuer based on the issuer key and DID method.
Parameters
Name | Type |
---|---|
issuerKey | Key |
didMethod | DidMethod |
Returns
Promise
<Issuer
>
Defined in
revokeCredential
▸ revokeCredential(credential
, issuer
): Promise
<boolean
>
Revokes a credential on the Bloock Identity service.
Parameters
Name | Type |
---|---|
credential | Credential |
issuer | Issuer |
Returns
Promise
<boolean
>
Defined in
waitVerification
▸ waitVerification(sessionID
, timeout?
): Promise
<boolean
>
Waits for the completion of a verification session on the identity managed API provided.
Parameters
Name | Type |
---|---|
sessionID | number |
timeout? | number |
Returns
Promise
<boolean
>