Skip to main content

CredentialWallet class

Wallet instance is a wrapper of CRUD logic for W3C credentials, also it allows to fetch revocation statuses.

CredentialWallet implements ICredentialWallet interface

Signature:

export declare class CredentialWallet implements ICredentialWallet 

Implements: ICredentialWallet

Constructors

ConstructorModifiersDescription
(constructor)(_storage, _credentialStatusResolverRegistry)Creates an instance of CredentialWallet.

Properties

PropertyModifiersTypeDescription
createCredential(issuer: DID, request: CredentialRequest, schema: JSONSchema) => W3CCredentialCreates a W3C verifiable Credential object

Methods

MethodModifiersDescription
filterByCredentialSubject(credentials, subject)Filters given credentials with given credential subject
findByContextType(context, type)Finds credentials by JSON-LD schema and type
findById(id)Finds the credential by its id
findByQuery(query)Find credential using iden3 query language
findNonRevokedCredential(creds)
getAuthBJJCredential(did)Finds Auth BJJ credential for given user
getRevocationStatus(credStatus, credentialStatusResolveOptions)Fetches Revocation status depended on type
getRevocationStatusFromCredential(cred)Fetches or Builds a revocation status for a given credential Supported types for credentialStatus field: SparseMerkleTreeProof, Iden3ReverseSparseMerkleTreeProof
list()List of W3C Credential
remove(id)removes W3C credentials from data storage
save(credential)saves W3C credential (upsert)
saveAll(credentials)saves the batch of W3C credentials (upsert)