@atala/prism-wallet-sdk / Exports / Pollux
Class: Pollux
Implementation of Pollux
Export
Pollux
Implements
Table of contents
Constructors
Properties
Accessors
Methods
- createAnoncredsPresentationSubmission
- createJWTPresentationSubmission
- createPresentationDefinitionRequest
- createPresentationProof
- createPresentationSubmission
- encode
- extractEncodedList
- extractVerificationStatusFromCredential
- extractVerificationStatusFromResponse
- fetchCredentialDefinition
- fetchRevocationRegistry
- fetchSchema
- isCredentialRevoked
- isOfferPayload
- isPresentationDefinitionRequestType
- parseCredential
- parsePresentationSubmission
- processCredentialOffer
- revealCredentialFields
- start
- validPresentationSubmissionOptions
- verifyPresentationSubmission
- verifyPresentationSubmissionAnoncreds
- verifyPresentationSubmissionJWT
- verifyRevocationProof
Constructors
constructor
• new Pollux(apollo
, castor
, api?
, JWT?
, SDJWT?
): Pollux
Parameters
Name | Type |
---|---|
apollo | Apollo |
castor | Castor |
api | Api |
JWT | JWT |
SDJWT | SDJWT |
Returns
Defined in
Properties
JWT
• Private
JWT: JWT
Defined in
SDJWT
• Private
SDJWT: SDJWT
Defined in
_anoncreds
• Private
_anoncreds: undefined
| AnoncredsLoader
Defined in
_pako
• Private
_pako: typeof Pako
= pako
Defined in
api
• Private
api: Api
Defined in
apollo
• Private
apollo: Apollo
Defined in
castor
• Private
castor: Castor
Defined in
Accessors
anoncreds
• get
anoncreds(): AnoncredsLoader
Returns
AnoncredsLoader
Defined in
Methods
createAnoncredsPresentationSubmission
▸ createAnoncredsPresentationSubmission(presentationDefinitionRequest
, credential
, linkSecret
): Promise
<PresentationType
>
Parameters
Name | Type |
---|---|
presentationDefinitionRequest | PresentationRequestType |
credential | AnonCredsCredential |
linkSecret | LinkSecret |
Returns
Promise
<PresentationType
>
Defined in
createJWTPresentationSubmission
▸ createJWTPresentationSubmission(presentationDefinitionRequest
, credential
, privateKey
): Promise
<JWTPresentationSubmission
>
Parameters
Name | Type |
---|---|
presentationDefinitionRequest | any |
credential | JWTCredential |
privateKey | PrivateKey |
Returns
Promise
<JWTPresentationSubmission
>
Defined in
createPresentationDefinitionRequest
▸ createPresentationDefinitionRequest<Type
>(type
, presentationClaims
, presentationOptions
): Promise
<PresentationDefinitionRequest
<Type
>>
Creates a PresentationDefinitionRequest object for oob Verifications
Type parameters
Name | Type |
---|---|
Type | extends CredentialType = JWT |
Parameters
Name | Type |
---|---|
type | Type |
presentationClaims | PresentationClaims <Type > |
presentationOptions | PresentationOptions |
Returns
Promise
<PresentationDefinitionRequest
<Type
>>
Implementation of
Pollux.createPresentationDefinitionRequest
Defined in
createPresentationProof
▸ createPresentationProof(presentationRequest
, credential
, options
): Promise
<string
>
Process a PresentationRequest with Credential to create a Presentation.
Parameters
Name | Type | Description |
---|---|---|
presentationRequest | PresentationRequest <any , unknown > | |
credential | Credential | |
options | options | object containing necessary metadata |
Returns
Promise
<string
>
dependent on the CredentialType
Throws
Implementation of
Pollux.createPresentationProof
Defined in
createPresentationSubmission
▸ createPresentationSubmission<Type
>(presentationDefinitionRequest
, credential
, privateKey?
): Promise
<PresentationSubmission
<Type
>>
Type parameters
Name | Type |
---|---|
Type | extends CredentialType = JWT |
Parameters
Name | Type |
---|---|
presentationDefinitionRequest | PresentationDefinitionRequest <Type > |
credential | Credential |
privateKey? | PrivateKey | LinkSecret |
Returns
Promise
<PresentationSubmission
<Type
>>
Implementation of
Pollux.createPresentationSubmission
Defined in
encode
▸ encode(data
): Promise
<Buffer
>
Parameters
Name | Type |
---|---|
data | any |
Returns
Promise
<Buffer
>
Defined in
extractEncodedList
▸ extractEncodedList(body
): Uint8Array
Parameters
Name | Type |
---|---|
body | JWTStatusListResponse |
Returns
Uint8Array
Defined in
extractVerificationStatusFromCredential
▸ extractVerificationStatusFromCredential(credentialStatus
): credentialStatus is JWTRevocationStatus
Parameters
Name | Type |
---|---|
credentialStatus | any |
Returns
credentialStatus is JWTRevocationStatus
Defined in
extractVerificationStatusFromResponse
▸ extractVerificationStatusFromResponse(credentialStatus
): boolean
Parameters
Name | Type |
---|---|
credentialStatus | any |
Returns
boolean
Defined in
fetchCredentialDefinition
▸ fetchCredentialDefinition(credentialDefinitionId
): Promise
<CredentialDefinitionType
>
handle the retrieval of a Credential Definition
Parameters
Name | Type |
---|---|
credentialDefinitionId | string |
Returns
Promise
<CredentialDefinitionType
>
Defined in
fetchRevocationRegistry
▸ fetchRevocationRegistry(revocationStatus
): Promise
<JWTStatusListResponse
>
Parameters
Name | Type |
---|---|
revocationStatus | JWTRevocationStatus |
Returns
Promise
<JWTStatusListResponse
>
Defined in
fetchSchema
▸ fetchSchema(schemaURI
): Promise
<CredentialSchemaType
>
handle the retrieval of a Schema definition
Parameters
Name | Type | Description |
---|---|---|
schemaURI | string | URI used to retrieve the Schema definition |
Returns
Promise
<CredentialSchemaType
>
Defined in
isCredentialRevoked
▸ isCredentialRevoked(credential
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
credential | Credential |
Returns
Promise
<boolean
>
Implementation of
Defined in
isOfferPayload
▸ isOfferPayload<Type
>(offer
, type
): offer is CredentialOfferJWTBasePayload
Type parameters
Name | Type |
---|---|
Type | extends CredentialType |
Parameters
Name | Type |
---|---|
offer | any |
type | Type |
Returns
offer is CredentialOfferJWTBasePayload
Defined in
isPresentationDefinitionRequestType
▸ isPresentationDefinitionRequestType<Type
>(request
, type
): request is PresentationDefinitionRequest<Type>
Type parameters
Name | Type |
---|---|
Type | extends CredentialType = JWT |
Parameters
Name | Type |
---|---|
request | PresentationDefinitionRequest <Type > |
type | Type |
Returns
request is PresentationDefinitionRequest<Type>
Defined in
parseCredential
▸ parseCredential(credentialBuffer
, options?
): Promise
<AnonCredsCredential
| JWTCredential
| SDJWTCredential
>
Parameters
Name | Type |
---|---|
credentialBuffer | Uint8Array |
options? | Object |
options.credentialMetadata? | CredentialRequestMetadataType |
options.linkSecret? | string |
options.type | CredentialType |
Returns
Promise
<AnonCredsCredential
| JWTCredential
| SDJWTCredential
>
Implementation of
Defined in
parsePresentationSubmission
▸ parsePresentationSubmission<Type
>(data
, type
): data is PresentationSubmission<Type>
Type parameters
Name | Type |
---|---|
Type | extends CredentialType = JWT |
Parameters
Name | Type |
---|---|
data | any |
type | Type |
Returns
data is PresentationSubmission<Type>
Defined in
processCredentialOffer
▸ processCredentialOffer<Types
>(offer
, options
): Promise
<ProcessedCredentialOfferPayloads
[Types
]>
Type parameters
Name | Type |
---|---|
Types | extends CredentialOfferTypes |
Parameters
Name | Type |
---|---|
offer | CredentialOfferPayloads [Types ] |
options | CredentialRequestOptions |
Returns
Promise
<ProcessedCredentialOfferPayloads
[Types
]>
Implementation of
Defined in
revealCredentialFields
▸ revealCredentialFields(credential
, fields
, linkSecret?
): Promise
<Claim
>
Parameters
Name | Type |
---|---|
credential | Credential |
fields | string [] |
linkSecret? | string |
Returns
Promise
<Claim
>
Implementation of
Defined in
start
▸ start(): Promise
<void
>
Returns
Promise
<void
>
Defined in
validPresentationSubmissionOptions
▸ validPresentationSubmissionOptions<Response
, Type
>(options
, type
): options is Response
Type parameters
Name | Type |
---|---|
Response | extends options |
Type | extends CredentialType = JWT |
Parameters
Name | Type |
---|---|
options | any |
type | Type |
Returns
options is Response
Defined in
verifyPresentationSubmission
▸ verifyPresentationSubmission(presentationSubmission
, options
): Promise
<boolean
>
Process a PresentationSubmission, resolve the issuer did and verify the credential and the holder signature
Parameters
Name | Type | Description |
---|---|---|
presentationSubmission | PresentationType | - |
options | Anoncreds | object containing necessary metadata |
Returns
Promise
<boolean
>
true if the submission is valid or false if it is not
Implementation of
Pollux.verifyPresentationSubmission
Defined in
▸ verifyPresentationSubmission(presentationSubmission
, options
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
presentationSubmission | JWTPresentationSubmission |
options | JWT |
Returns
Promise
<boolean
>
Implementation of
Pollux.verifyPresentationSubmission
Defined in
verifyPresentationSubmissionAnoncreds
▸ verifyPresentationSubmissionAnoncreds(presentationSubmission
, options
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
presentationSubmission | PresentationType |
options | Anoncreds |
Returns
Promise
<boolean
>
Defined in
verifyPresentationSubmissionJWT
▸ verifyPresentationSubmissionJWT(presentationSubmission
, options
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
presentationSubmission | JWTPresentationSubmission |
options | JWT |
Returns
Promise
<boolean
>
Defined in
verifyRevocationProof
▸ verifyRevocationProof(revocation
, statusListIndex
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
revocation | JWTStatusListResponse |
statusListIndex | number |
Returns
Promise
<boolean
>