Skip to main content

@atala/prism-wallet-sdk / Exports / Pollux

Class: Pollux

Implementation of Pollux

Export

Pollux

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Pollux(apollo, castor, api?, JWT?, SDJWT?): Pollux

Parameters

NameType
apolloApollo
castorCastor
apiApi
JWTJWT
SDJWTSDJWT

Returns

Pollux

Defined in

src/pollux/Pollux.ts:75

Properties

JWT

Private JWT: JWT

Defined in

src/pollux/Pollux.ts:79


SDJWT

Private SDJWT: SDJWT

Defined in

src/pollux/Pollux.ts:80


_anoncreds

Private _anoncreds: undefined | AnoncredsLoader

Defined in

src/pollux/Pollux.ts:72


_pako

Private _pako: typeof Pako = pako

Defined in

src/pollux/Pollux.ts:73


api

Private api: Api

Defined in

src/pollux/Pollux.ts:78


apollo

Private apollo: Apollo

Defined in

src/pollux/Pollux.ts:76


castor

Private castor: Castor

Defined in

src/pollux/Pollux.ts:77

Accessors

anoncreds

get anoncreds(): AnoncredsLoader

Returns

AnoncredsLoader

Defined in

src/pollux/Pollux.ts:84

Methods

createAnoncredsPresentationSubmission

createAnoncredsPresentationSubmission(presentationDefinitionRequest, credential, linkSecret): Promise<PresentationType>

Parameters

NameType
presentationDefinitionRequestPresentationRequestType
credentialAnonCredsCredential
linkSecretLinkSecret

Returns

Promise<PresentationType>

Defined in

src/pollux/Pollux.ts:396


createJWTPresentationSubmission

createJWTPresentationSubmission(presentationDefinitionRequest, credential, privateKey): Promise<JWTPresentationSubmission>

Parameters

NameType
presentationDefinitionRequestany
credentialJWTCredential
privateKeyPrivateKey

Returns

Promise<JWTPresentationSubmission>

Defined in

src/pollux/Pollux.ts:332


createPresentationDefinitionRequest

createPresentationDefinitionRequest<Type>(type, presentationClaims, presentationOptions): Promise<PresentationDefinitionRequest<Type>>

Creates a PresentationDefinitionRequest object for oob Verifications

Type parameters

NameType
Typeextends CredentialType = JWT

Parameters

NameType
typeType
presentationClaimsPresentationClaims<Type>
presentationOptionsPresentationOptions

Returns

Promise<PresentationDefinitionRequest<Type>>

Implementation of

Pollux.createPresentationDefinitionRequest

Defined in

src/pollux/Pollux.ts:467


createPresentationProof

createPresentationProof(presentationRequest, credential, options): Promise<string>

Process a PresentationRequest with Credential to create a Presentation.

Parameters

NameTypeDescription
presentationRequestPresentationRequest<any, unknown>
credentialCredential
optionsoptionsobject containing necessary metadata

Returns

Promise<string>

dependent on the CredentialType

Throws

Implementation of

Pollux.createPresentationProof

Defined in

src/pollux/Pollux.ts:1051


createPresentationSubmission

createPresentationSubmission<Type>(presentationDefinitionRequest, credential, privateKey?): Promise<PresentationSubmission<Type>>

Type parameters

NameType
Typeextends CredentialType = JWT

Parameters

NameType
presentationDefinitionRequestPresentationDefinitionRequest<Type>
credentialCredential
privateKey?PrivateKey | LinkSecret

Returns

Promise<PresentationSubmission<Type>>

Implementation of

Pollux.createPresentationSubmission

Defined in

src/pollux/Pollux.ts:416


encode

encode(data): Promise<Buffer>

Parameters

NameType
dataany

Returns

Promise<Buffer>

Defined in

src/pollux/Pollux.ts:174


extractEncodedList

extractEncodedList(body): Uint8Array

Parameters

NameType
bodyJWTStatusListResponse

Returns

Uint8Array

Defined in

src/pollux/Pollux.ts:165


extractVerificationStatusFromCredential

extractVerificationStatusFromCredential(credentialStatus): credentialStatus is JWTRevocationStatus

Parameters

NameType
credentialStatusany

Returns

credentialStatus is JWTRevocationStatus

Defined in

src/pollux/Pollux.ts:158


extractVerificationStatusFromResponse

extractVerificationStatusFromResponse(credentialStatus): boolean

Parameters

NameType
credentialStatusany

Returns

boolean

Defined in

src/pollux/Pollux.ts:151


fetchCredentialDefinition

fetchCredentialDefinition(credentialDefinitionId): Promise<CredentialDefinitionType>

handle the retrieval of a Credential Definition

Parameters

NameType
credentialDefinitionIdstring

Returns

Promise<CredentialDefinitionType>

Defined in

src/pollux/Pollux.ts:965


fetchRevocationRegistry

fetchRevocationRegistry(revocationStatus): Promise<JWTStatusListResponse>

Parameters

NameType
revocationStatusJWTRevocationStatus

Returns

Promise<JWTStatusListResponse>

Defined in

src/pollux/Pollux.ts:282


fetchSchema

fetchSchema(schemaURI): Promise<CredentialSchemaType>

handle the retrieval of a Schema definition

Parameters

NameTypeDescription
schemaURIstringURI used to retrieve the Schema definition

Returns

Promise<CredentialSchemaType>

Defined in

src/pollux/Pollux.ts:985


isCredentialRevoked

isCredentialRevoked(credential): Promise<boolean>

Parameters

NameType
credentialCredential

Returns

Promise<boolean>

Implementation of

Pollux.isCredentialRevoked

Defined in

src/pollux/Pollux.ts:299


isOfferPayload

isOfferPayload<Type>(offer, type): offer is CredentialOfferJWTBasePayload

Type parameters

NameType
Typeextends CredentialType

Parameters

NameType
offerany
typeType

Returns

offer is CredentialOfferJWTBasePayload

Defined in

src/pollux/Pollux.ts:836


isPresentationDefinitionRequestType

isPresentationDefinitionRequestType<Type>(request, type): request is PresentationDefinitionRequest<Type>

Type parameters

NameType
Typeextends CredentialType = JWT

Parameters

NameType
requestPresentationDefinitionRequest<Type>
typeType

Returns

request is PresentationDefinitionRequest<Type>

Defined in

src/pollux/Pollux.ts:324


parseCredential

parseCredential(credentialBuffer, options?): Promise<AnonCredsCredential | JWTCredential | SDJWTCredential>

Parameters

NameType
credentialBufferUint8Array
options?Object
options.credentialMetadata?CredentialRequestMetadataType
options.linkSecret?string
options.typeCredentialType

Returns

Promise<AnonCredsCredential | JWTCredential | SDJWTCredential>

Implementation of

Pollux.parseCredential

Defined in

src/pollux/Pollux.ts:997


parsePresentationSubmission

parsePresentationSubmission<Type>(data, type): data is PresentationSubmission<Type>

Type parameters

NameType
Typeextends CredentialType = JWT

Parameters

NameType
dataany
typeType

Returns

data is PresentationSubmission<Type>

Defined in

src/pollux/Pollux.ts:461


processCredentialOffer

processCredentialOffer<Types>(offer, options): Promise<ProcessedCredentialOfferPayloads[Types]>

Type parameters

NameType
Typesextends CredentialOfferTypes

Parameters

NameType
offerCredentialOfferPayloads[Types]
optionsCredentialRequestOptions

Returns

Promise<ProcessedCredentialOfferPayloads[Types]>

Implementation of

Pollux.processCredentialOffer

Defined in

src/pollux/Pollux.ts:884


revealCredentialFields

revealCredentialFields(credential, fields, linkSecret?): Promise<Claim>

Parameters

NameType
credentialCredential
fieldsstring[]
linkSecret?string

Returns

Promise<Claim>

Implementation of

Pollux.revealCredentialFields

Defined in

src/pollux/Pollux.ts:91


start

start(): Promise<void>

Returns

Promise<void>

Defined in

src/pollux/Pollux.ts:832


validPresentationSubmissionOptions

validPresentationSubmissionOptions<Response, Type>(options, type): options is Response

Type parameters

NameType
Responseextends options
Typeextends CredentialType = JWT

Parameters

NameType
optionsany
typeType

Returns

options is Response

Defined in

src/pollux/Pollux.ts:613


verifyPresentationSubmission

verifyPresentationSubmission(presentationSubmission, options): Promise<boolean>

Process a PresentationSubmission, resolve the issuer did and verify the credential and the holder signature

Parameters

NameTypeDescription
presentationSubmissionPresentationType-
optionsAnoncredsobject containing necessary metadata

Returns

Promise<boolean>

true if the submission is valid or false if it is not

Implementation of

Pollux.verifyPresentationSubmission

Defined in

src/pollux/Pollux.ts:797

verifyPresentationSubmission(presentationSubmission, options): Promise<boolean>

Parameters

NameType
presentationSubmissionJWTPresentationSubmission
optionsJWT

Returns

Promise<boolean>

Implementation of

Pollux.verifyPresentationSubmission

Defined in

src/pollux/Pollux.ts:798


verifyPresentationSubmissionAnoncreds

verifyPresentationSubmissionAnoncreds(presentationSubmission, options): Promise<boolean>

Parameters

NameType
presentationSubmissionPresentationType
optionsAnoncreds

Returns

Promise<boolean>

Defined in

src/pollux/Pollux.ts:766


verifyPresentationSubmissionJWT

verifyPresentationSubmissionJWT(presentationSubmission, options): Promise<boolean>

Parameters

NameType
presentationSubmissionJWTPresentationSubmission
optionsJWT

Returns

Promise<boolean>

Defined in

src/pollux/Pollux.ts:623


verifyRevocationProof

verifyRevocationProof(revocation, statusListIndex): Promise<boolean>

Parameters

NameType
revocationJWTStatusListResponse
statusListIndexnumber

Returns

Promise<boolean>

Defined in

src/pollux/Pollux.ts:211