Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Latest commit

 

History

History
1566 lines (999 loc) · 77.8 KB

modules.md

File metadata and controls

1566 lines (999 loc) · 77.8 KB

MATTR Wallet SDK React Native / Exports

MATTR Wallet SDK React Native

Table of contents

Namespaces

Enumerations

Interfaces

Type Aliases

Variables

Functions

Type Aliases

AddTrustedIssuerCertificatesError

Ƭ AddTrustedIssuerCertificatesError: MobileCredentialHolderError<InvalidCertificate>


AddTrustedIssuerCertificatesOptions

Ƭ AddTrustedIssuerCertificatesOptions: readonly string[]


AuthorizeRequestParameters

Ƭ AuthorizeRequestParameters: Object

Type declaration

Name Type
login_hint? string
prompt? string

BaseError

Ƭ BaseError<T>: Object

Base error type used for all sdk error responses

Type parameters

Name Type Description
T string the error type

Type declaration

Name Type Description
cause? Error | unknown Information about underlying root cause
details? unknown Additional details
message string Message containing error description
type T Error type

CloseWalletError

Ƭ CloseWalletError: BaseError<"CloseWalletError">


CompactCredentialOffered

Ƭ CompactCredentialOffered: BaseCredentialOffered & { profile: Compact ; type: string }


CompactCredentialPayload

Ƭ CompactCredentialPayload: ImplementsZodType<z.infer<typeof CompactCredentialPayloadValidator>, CwtPayload & CwtPayloadRecord>


CompactSemanticCredentialOffered

Ƭ CompactSemanticCredentialOffered: BaseCredentialOffered & { profile: CompactSemantic ; types: string[] }


CompactSemanticCredentialPayload

Ƭ CompactSemanticCredentialPayload: ImplementsZodType<z.infer<typeof CompactSemanticCredentialPayloadValidator>, { aud?: string ; exp?: number ; iat?: number ; iss: string ; jti: string ; nbf: number ; status?: CwtStatus ; sub?: string ; vc: CompactSemanticCredentialVcPayload }>


CompactSemanticVerifyFailureReasonType

Ƭ CompactSemanticVerifyFailureReasonType: VerifyFailureReasonType


CompactVerifyFailureReasonType

Ƭ CompactVerifyFailureReasonType: VerifyFailureReasonType


CreateDidError

Ƭ CreateDidError: BaseError<"CreateDidError">


CreateDidResponse

Ƭ CreateDidResponse: Object

Type declaration

Name Type Description
did string The new DID that has been created

CreateProximityPresentationSessionError

Ƭ CreateProximityPresentationSessionError: MobileCredentialHolderError<BluetoothPermissionDenied | BluetoothPermissionRestricted | ExistingProximityPresentationSession>


CreateProximityPresentationSessionOptions

Ƭ CreateProximityPresentationSessionOptions: z.infer<typeof CreateProximityPresentationSessionOptionsValidator>


CreateWebSemanticPresentationErrorCouldNotFindSubjectSigningKey

Ƭ CreateWebSemanticPresentationErrorCouldNotFindSubjectSigningKey: BaseError<"CreatePresentationErrorCouldNotFindSubjectSigningKey">


CreateWebSemanticPresentationErrorHolderNotADid

Ƭ CreateWebSemanticPresentationErrorHolderNotADid: BaseError<"CreatePresentationErrorHolderNotADid">


CreateWebSemanticPresentationErrorSubjectDidHasNoAuthenticationUrl

Ƭ CreateWebSemanticPresentationErrorSubjectDidHasNoAuthenticationUrl: BaseError<"CreatePresentationErrorSubjectDidHasNoAuthenticationUrl">


CreateWebSemanticPresentationErrorSubjectNotADid

Ƭ CreateWebSemanticPresentationErrorSubjectNotADid: BaseError<"CreatePresentationErrorSubjectNotADid">


CreateWebSemanticPresentationErrors

Ƭ CreateWebSemanticPresentationErrors: CreateWebSemanticPresentationErrorSubjectNotADid | CreateWebSemanticPresentationErrorHolderNotADid | CreateWebSemanticPresentationErrorSubjectDidHasNoAuthenticationUrl | CreateWebSemanticPresentationErrorCouldNotFindSubjectSigningKey


CreateWebSemanticPresentationOptions

Ƭ CreateWebSemanticPresentationOptions: Object

Type declaration

Name Type
challenge string
credentials? readonly VerifiableCredential[]
domain? string
holder? string

CredentialIssuer

Ƭ CredentialIssuer: string | { [key: string]: any; id: string }

See

https://www.w3.org/TR/vc-data-model/#issuer


CredentialNotFoundInTokenError

Ƭ CredentialNotFoundInTokenError: BaseError<"CredentialNotFoundInTokenError">


CredentialOffered

Ƭ CredentialOffered: CompactCredentialOffered | CompactSemanticCredentialOffered | WebSemanticCredentialOffered | DeprecatedWebSemanticCredentialOffered | MobileCredentialOffered


CwtPayload

Ƭ CwtPayload: ImplementsZodType<z.infer<typeof CwtPayloadValidator>, { aud?: string ; exp?: number ; iat?: number ; iss: string ; jti: string ; nbf?: number ; status?: CwtStatus ; sub?: string ; type?: string }>


CwtPayloadRecord

Ƭ CwtPayloadRecord: ImplementsZodType<z.infer<typeof CwtPayloadRecordValidator>, { [key: string]: string | boolean | number | Uint8Array | CwtStatus | undefined; }>


DecryptError

Ƭ DecryptError: BaseError<"DecryptError">


DeleteDidError

Ƭ DeleteDidError: DidNotFoundError | DidDeletionError


DeleteTrustedIssuerCertificateError

Ƭ DeleteTrustedIssuerCertificateError: MobileCredentialHolderError<TrustedIssuerCertificateInUse>


DeprecatedWebSemanticCredentialOffered

Ƭ DeprecatedWebSemanticCredentialOffered: Object

Type declaration

Name Type Description
claims? CredentialOfferedClaim[] -
cryptographicBindingMethodsSupported? "did" -
cryptographicSuitesSupported? "Ed25519Signature2018" -
name? string -
profile WebSemantic -
scope string -
type string Deprecated use OpenidIssuanceCredentialDefinition instead

DeriveWebSemanticCredentialError

Ƭ DeriveWebSemanticCredentialError: BaseError<DeriveWebSemanticCredentialErrorType>


DeriveWebSemanticCredentialOptions

Ƭ DeriveWebSemanticCredentialOptions: Object

Type declaration

Name Type
credential VerifiableCredential
credentialFrame CredentialFrame

DidConfigurationValidateResult

Ƭ DidConfigurationValidateResult: Object

Type declaration

Name Type
did string
domain string
isValid boolean

DidDeletionError

Ƭ DidDeletionError: BaseError<"DidDeletionError">


DidNotFoundError

Ƭ DidNotFoundError: BaseError<"DidNotFoundError">


DidResolutionError

Ƭ DidResolutionError: BaseError<"DidResolutionError">


DiscoverResult

Ƭ DiscoverResult: Object

Type declaration

Name Type Description
offer OidcCredentialOffer An OIDC credential offer

EncryptError

Ƭ EncryptError: BaseError<"EncryptError">


EncryptOptions

Ƭ EncryptOptions: Object

Type declaration

Name Type Description
payload string | Record<string, unknown> The payload to encrypt
recipientDids readonly string[] The DIDs of the message recipients
senderDid string The DID of the sender

ExpandWebSemanticCredentialOptions

Ƭ ExpandWebSemanticCredentialOptions: Object

Type declaration

Name Type
credential VerifiableCredential

FilterWebSemanticCredentialsByQueryError

Ƭ FilterWebSemanticCredentialsByQueryError: PresentationRequestError


FilterWebSemanticCredentialsByQueryOptions

Ƭ FilterWebSemanticCredentialsByQueryOptions<T>: Object

Filter credentials by query options

Type parameters

Name Type Description
T extends WebSemanticCredentialData Additional data extending WebSemanticCredentialData

Type declaration

Name Type Description
checkWithCompactJsonLdDocument? boolean When true, filter credentials by the compact form of the credentials and request query
credentials readonly T[] A list of credential data to query against
query VerifiablePresentationRequestQuery A VerifiablePresentationRequestQuery to filter the credentials with

FilterWebSemanticCredentialsByQueryResponse

Ƭ FilterWebSemanticCredentialsByQueryResponse<T>: FilterCredentialsByExampleResponse<T> | FilterCredentialsByFrameResponse<T> | FilterCredentialsByDidAuthResponse<T>

Filter credentials by query response

Type parameters

Name Type Description
T extends WebSemanticCredentialData Additional data extending WebSemanticCredentialData

GenerateAuthorizeResult

Ƭ GenerateAuthorizeResult: Object

Type declaration

Name Type
codeVerifier string
nonce string
url string

GenerateAuthorizeUrlOptions

Ƭ GenerateAuthorizeUrlOptions: Object

Type declaration

Name Type
clientId? string
did string
offer OidcCredentialOffer
redirectUri? string
state? string

GenericSdkError

Ƭ GenericSdkError: BaseError<"GenericError">


GetDidsError

Ƭ GetDidsError: BaseError<"GetDidsError">


GetMobileCredentialError

Ƭ GetMobileCredentialError: MobileCredentialHolderError<CredentialNotFound>


HttpCacheError

Ƭ HttpCacheError: BaseError<"HttpCacheError">


InitialiseOptions

Ƭ InitialiseOptions: Object

Options to configure when initialise a wallet

Type declaration

Name Type Description
credential? { compact?: { issuerResolverTtl?: number ; revocationListTtl?: number } ; compactSemantic?: { issuerResolverTtl?: number ; revocationListTtl?: number } } Configurations for credential operations
credential.compact? { issuerResolverTtl?: number ; revocationListTtl?: number } Configurations for compact credential operations
credential.compact.issuerResolverTtl? number Duration that an issuer is kept in the cache after it is added or re-added
credential.compact.revocationListTtl? number Duration that a revocation list is kept in the cache after it is added or re-added
credential.compactSemantic? { issuerResolverTtl?: number ; revocationListTtl?: number } Configurations for compact-semantic credential operations
credential.compactSemantic.issuerResolverTtl? number Duration that an issuer is kept in the cache after it is added or re-added
credential.compactSemantic.revocationListTtl? number Duration that a revocation list is kept in the cache after it is added or re-added
extensions? readonly MobileCredentialHolder[] A list of extension modules to enable additional features.
httpRequestTimeoutMs? number The number of milliseconds a request can take before automatically being terminated. The default value is 5000.
httpResolverBaseUrl? string Specifies the base URL including path that http resolver will use Default Value ts https://uniresolver-api.mattr.global
httpResolverPath? string Specifies the URL path that http resolver will use Default Value ts /1.0/identifiers/
walletId? string Specifies the wallet ID to use

InvalidBase64URLDecodeError

Ƭ InvalidBase64URLDecodeError: BaseError<"InvalidBase64URLDecodeError">


InvalidCborldDecodeError

Ƭ InvalidCborldDecodeError: BaseError<"InvalidCborldDecodeError">


InvalidCborldEncodeError

Ƭ InvalidCborldEncodeError: BaseError<"InvalidCborldEncodeError">


InvalidDidError

Ƭ InvalidDidError: BaseError<"InvalidDidError">


InvalidIdTokenError

Ƭ InvalidIdTokenError: BaseError<"InvalidIdTokenError">


InvalidIssuerUriError

Ƭ InvalidIssuerUriError: BaseError<OidcErrorType.InvalidIssuerUriError>


InvalidJSONError

Ƭ InvalidJSONError: BaseError<"InvalidJSONError">


InvalidOpenIdConfigurationError

Ƭ InvalidOpenIdConfigurationError: BaseError<OidcErrorType.InvalidOpenIdConfigurationError>


MobileCredential

Ƭ MobileCredential: z.output<typeof MobileCredentialValidator>


OidcCredentialOffer

Ƭ OidcCredentialOffer: Object

Type declaration

Name Type
authorizeEndpoint string
claims readonly string[]
issuer string
name string
requestParameters? OidcRequestParameters
tokenEndpoint string
type CredentialOfferType

OpenDidCommError

Ƭ OpenDidCommError: BaseError<"OpenDidCommError">


OpenidIssuanceCredentialDefinition

Ƭ OpenidIssuanceCredentialDefinition: Object

Type declaration

Name Type
@context z.infer<typeof JsonLdContextValidator>
type string[]

OpenidIssuanceCredentialOffer

Ƭ OpenidIssuanceCredentialOffer: Object

Type declaration

Name Type
authorizeEndpoint string
authorizeRequestParameters? AuthorizeRequestParameters
credentialEndpoint string
credentials CredentialOffered[]
issuer string
mdocIacasUri? string
tokenEndpoint string

OpenidIssuanceDiscoverResult

Ƭ OpenidIssuanceDiscoverResult: Object

Result for discover

Type declaration

Name Type
offer OpenidIssuanceCredentialOffer

OpenidIssuanceGenerateAuthorizeResult

Ƭ OpenidIssuanceGenerateAuthorizeResult: Object

Result for generate authorize url

Type declaration

Name Type
codeVerifier string
url string

OpenidIssuanceGenerateAuthorizeUrlOptions

Ƭ OpenidIssuanceGenerateAuthorizeUrlOptions: Object

Options for generate authorize url

Type declaration

Name Type
clientId? string
offer OpenidIssuanceCredentialOffer
redirectUri? string
state? string

OpenidIssuanceRetrieveCompactCredentialsResult

Ƭ OpenidIssuanceRetrieveCompactCredentialsResult: Object

Type declaration

Name Type
credential string
profile Compact

OpenidIssuanceRetrieveCompactSemanticCredentialsResult

Ƭ OpenidIssuanceRetrieveCompactSemanticCredentialsResult: Object

Type declaration

Name Type
credential string
profile CompactSemantic

OpenidIssuanceRetrieveCredential

Ƭ OpenidIssuanceRetrieveCredential: OpenidIssuanceRetrieveWebSemanticCredentialsResult | OpenidIssuanceRetrieveCompactCredentialsResult | OpenidIssuanceRetrieveCompactSemanticCredentialsResult | OpenidIssuanceRetrieveMobileCredentialsResult


OpenidIssuanceRetrieveCredentialFailure

Ƭ OpenidIssuanceRetrieveCredentialFailure: Object

Type declaration

Name Type
error unknown
offer CredentialOffered

OpenidIssuanceRetrieveCredentialSuccess

Ƭ OpenidIssuanceRetrieveCredentialSuccess: Object

Type declaration

Name Type
offer CredentialOffered
result OpenidIssuanceRetrieveCredential

OpenidIssuanceRetrieveCredentialsOptions

Ƭ OpenidIssuanceRetrieveCredentialsOptions: Object

Options for retrieve credentials

Type declaration

Name Type Description
accessToken string -
autoTrustMobileCredentialIaca? boolean optional, default false when true and mdocIacasUri is available in the offer, it will automatically download and add all the certificates as trusted issuers certificates for any mobile credentials
clientId? string -
offer OpenidIssuanceCredentialOffer -

OpenidIssuanceRetrieveCredentialsResult

Ƭ OpenidIssuanceRetrieveCredentialsResult: (OpenidIssuanceRetrieveCredentialSuccess | OpenidIssuanceRetrieveCredentialFailure)[]


OpenidIssuanceRetrieveTokenOptions

Ƭ OpenidIssuanceRetrieveTokenOptions: Object

Options for retrieve token

Type declaration

Name Type
clientId? string
code string
codeVerifier string
offer OpenidIssuanceCredentialOffer
redirectUri? string

OpenidIssuanceRetrieveTokenResult

Ƭ OpenidIssuanceRetrieveTokenResult: Object

Result for retrieve token

Type declaration

Name Type Description
accessToken string -
expiresIn? number expires in second

OpenidIssuanceRetrieveWebSemanticCredentialsResult

Ƭ OpenidIssuanceRetrieveWebSemanticCredentialsResult: Object

Result for retrieve credentials

Type declaration

Name Type
credential VerifiableCredential
did string
profile WebSemantic

PresentationRequestError

Ƭ PresentationRequestError: BaseError$1<PresentationRequestErrorType>


PresentationRequestJwm

Ƭ PresentationRequestJwm: Jwm & { body: VerifiablePresentationRequest ; from: string ; reply_to: readonly string[] ; reply_url: string ; type: PresentationRequestType }


ProximityPresentationSession

Ƭ ProximityPresentationSession: z.infer<typeof ProximityPresentationSessionValidator>


Result

Ƭ Result<T, E>: Ok<T, E> | Err<T, E>

Type parameters

Name
T
E

RetrieveCredentialError

Ƭ RetrieveCredentialError: BaseError<"RetrieveCredentialError">


RetrieveCredentialOptions

Ƭ RetrieveCredentialOptions: Object

Type declaration

Name Type
clientId? string
code string
codeVerifier string
nonce string
offer OidcCredentialOffer
redirectUri? string

RetrieveCredentialResult

Ƭ RetrieveCredentialResult: Object

Type declaration

Name Type Description
credential VerifiableCredential The retrieved credential

SendProximityPresentationResponseError

Ƭ SendProximityPresentationResponseError: MobileCredentialHolderError<ExistingProximityPresentationSessionNotFound | ProximityPresentationSessionErrorType.UserAuthentication | ProximityPresentationSessionErrorType.UserAuthenticationCancelled | ProximityPresentationSessionErrorType.UserAuthenticationOnDeviceNotSetup | ProximityPresentationSessionErrorType.InvalidMobileCredentialId | ProximityPresentationSessionErrorType.MobileCredentialsWithDuplicateDocTypes | ProximityPresentationSessionErrorType.MobileCredentialRequestNotReceived | ProximityPresentationSessionErrorType.DataTransportFailed>


SendProximityPresentationSessionOptions

Ƭ SendProximityPresentationSessionOptions: z.infer<typeof SendProximityPresentationSessionOptionsValidator>


SendWebSemanticPresentationResponseOptions

Ƭ SendWebSemanticPresentationResponseOptions: Object

Type declaration

Name Type
presentation VerifiablePresentation
presentationRequest PresentationRequestJwm
senderDid? string

SignError

Ƭ SignError: BaseError<"SignError">


TrustedIssuerCertificate

Ƭ TrustedIssuerCertificate: z.infer<typeof TrustedIssuerCertificateValidator>


UserAuthenticationCancelledError

Ƭ UserAuthenticationCancelledError: BaseError<"UserAuthenticationCancelledError">

Error when user cancel the local authentication


UserAuthenticationOnDeviceNotSetupError

Ƭ UserAuthenticationOnDeviceNotSetupError: BaseError<"UserAuthenticationOnDeviceNotSetupError">


VerifiableCredential

Ƭ VerifiableCredential: Credential & { id?: string ; proof: VerifiableCredentialProof | readonly VerifiableCredentialProof[] }


VerifiablePresentationRequestQuery

Ƭ VerifiablePresentationRequestQuery: DidAuthQuery | QueryByExample | QueryByFrame


VerifyCompactCredentialError

Ƭ VerifyCompactCredentialError: BaseError<VerifyCredentialErrorType$1>


VerifyCompactCredentialOptions

Ƭ VerifyCompactCredentialOptions: Object

Type declaration

Name Type
assertExpiry? boolean
assertNotBefore? boolean
checkRevocation? boolean
payload string
trustedIssuers? string[]

VerifyCompactCredentialResult

Ƭ VerifyCompactCredentialResult: Omit<VerifyResult, "payload" | "reason"> & { header?: CwtHeader ; payload?: CompactCredentialPayload ; reason: { details?: VerifyFailedResultReasonDetails ; message: string ; type: CompactVerifyFailureReasonType } ; verified: false } | Omit<VerifyResult, "payload"> & { header: CwtHeader ; payload: CompactCredentialPayload ; verified: true }


VerifyCompactSemanticCredentialError

Ƭ VerifyCompactSemanticCredentialError: BaseError<VerifyCredentialErrorType>


VerifyCompactSemanticCredentialOptions

Ƭ VerifyCompactSemanticCredentialOptions: Object

Type declaration

Name Type
assertExpiry? boolean
assertNotBefore? boolean
checkRevocation? boolean
payload string
trustedIssuers? string[]

VerifyCompactSemanticCredentialResult

Ƭ VerifyCompactSemanticCredentialResult: Omit<VerifyResult, "payload" | "reason"> & { header?: CwtHeader ; payload?: CompactSemanticCredentialPayload ; reason: { details?: VerifyFailedResultReasonDetails ; message: string ; type: CompactSemanticVerifyFailureReasonType } ; verified: false } | Omit<VerifyResult, "payload"> & { header: CwtHeader ; payload: CompactSemanticCredentialPayload ; verified: true }


VerifyCredentialStatus

Ƭ VerifyCredentialStatus: CheckStatusResult | undefined


VerifyError

Ƭ VerifyError: BaseError<"VerifyError">


VerifyWebSemanticCredentialError

Ƭ VerifyWebSemanticCredentialError: BaseError<VerifyWebSemanticCredentialErrorType>


VerifyWebSemanticCredentialOptions

Ƭ VerifyWebSemanticCredentialOptions: Object

Type declaration

Name Type Description
credential VerifiableCredential The credential to verify

VerifyWebSemanticCredentialResult

Ƭ VerifyWebSemanticCredentialResult: Object

Type declaration

Name Type
credentialVerified boolean
expired? boolean
status? VerifyCredentialStatus

Wallet

Ƭ Wallet: WalletBase & WalletExtension

An instance of a wallet with React Native specific extensions.


WalletBase

Ƭ WalletBase: Object

An instance of a wallet

Type declaration

Name Type Description
close () => Promise<Result<void, CloseWalletError>> Closes the wallet Remarks Wallet instance will not function anymore after close
credential { compact: { verifyCredential: (options: VerifyCompactCredentialOptions) => Promise<Result<VerifyCompactCredentialResult, VerifyCompactCredentialError>> } ; compactSemantic: { verifyCredential: (options: VerifyCompactSemanticCredentialOptions) => Promise<Result<VerifyCompactSemanticCredentialResult, VerifyCompactSemanticCredentialError>> } ; mobile: { addTrustedIssuerCertificates: (certificates: AddTrustedIssuerCertificatesOptions) => Promise<Result<string[], AddTrustedIssuerCertificatesError>> ; createProximityPresentationSession: (options: CreateProximityPresentationSessionOptions) => Promise<Result<ProximityPresentationSession, CreateProximityPresentationSessionError>> ; deleteCredential: (credentialId: string) => Promise<void> ; deleteTrustedIssuerCertificate: (certificateId: string) => Promise<Result<void, DeleteTrustedIssuerCertificateError>> ; getCredential: (credentialId: string) => Promise<Result<MobileCredential, GetMobileCredentialError>> ; getCredentials: () => Promise<MobileCredential[]> ; getCurrentProximityPresentationSession: () => Promise<ProximityPresentationSession | undefined> ; getTrustedIssuerCertificates: () => Promise<TrustedIssuerCertificate[]> ; sendProximityPresentationResponse: (options: SendProximityPresentationSessionOptions) => Promise<Result<void, SendProximityPresentationResponseError>> ; terminateProximityPresentationSession: () => Promise<void> } ; webSemantic: { createPresentation: (options: CreateWebSemanticPresentationOptions) => Promise<Result<VerifiablePresentation, CreateWebSemanticPresentationErrors>> ; deriveCredential: (options: DeriveWebSemanticCredentialOptions) => Promise<Result<VerifiableCredential, DeriveWebSemanticCredentialError>> ; expandCredential: (options: ExpandWebSemanticCredentialOptions) => Promise<Result<Record<string, unknown>, BaseError<ExpandWebSemanticCredentialErrorType>>> ; filterCredentialsByQuery: <T>(options: FilterWebSemanticCredentialsByQueryOptions<T>) => Promise<Result<FilterWebSemanticCredentialsByQueryResponse<T>, FilterWebSemanticCredentialsByQueryError>> ; isSelectivelyDisclosable: (credential: VerifiableCredential) => boolean ; sendPresentationResponse: (options: SendWebSemanticPresentationResponseOptions) => Promise<Result<void, SendWebSemanticPresentationResponseError>> ; verifyCredential: (options: VerifyWebSemanticCredentialOptions) => Promise<Result<VerifyWebSemanticCredentialResult, VerifyWebSemanticCredentialError>> } } Namespace for credential operations
credential.compact { verifyCredential: (options: VerifyCompactCredentialOptions) => Promise<Result<VerifyCompactCredentialResult, VerifyCompactCredentialError>> } Namespace for compact credential operations
credential.compact.verifyCredential (options: VerifyCompactCredentialOptions) => Promise<Result<VerifyCompactCredentialResult, VerifyCompactCredentialError>> Attempts to verify a Compact credential
credential.compactSemantic { verifyCredential: (options: VerifyCompactSemanticCredentialOptions) => Promise<Result<VerifyCompactSemanticCredentialResult, VerifyCompactSemanticCredentialError>> } Namespace for compact semantic credential operations
credential.compactSemantic.verifyCredential (options: VerifyCompactSemanticCredentialOptions) => Promise<Result<VerifyCompactSemanticCredentialResult, VerifyCompactSemanticCredentialError>> Attempts to verify a Compact Semantic credential
credential.mobile { addTrustedIssuerCertificates: (certificates: AddTrustedIssuerCertificatesOptions) => Promise<Result<string[], AddTrustedIssuerCertificatesError>> ; createProximityPresentationSession: (options: CreateProximityPresentationSessionOptions) => Promise<Result<ProximityPresentationSession, CreateProximityPresentationSessionError>> ; deleteCredential: (credentialId: string) => Promise<void> ; deleteTrustedIssuerCertificate: (certificateId: string) => Promise<Result<void, DeleteTrustedIssuerCertificateError>> ; getCredential: (credentialId: string) => Promise<Result<MobileCredential, GetMobileCredentialError>> ; getCredentials: () => Promise<MobileCredential[]> ; getCurrentProximityPresentationSession: () => Promise<ProximityPresentationSession | undefined> ; getTrustedIssuerCertificates: () => Promise<TrustedIssuerCertificate[]> ; sendProximityPresentationResponse: (options: SendProximityPresentationSessionOptions) => Promise<Result<void, SendProximityPresentationResponseError>> ; terminateProximityPresentationSession: () => Promise<void> } Namespace for mobile credential operations
credential.mobile.addTrustedIssuerCertificates (certificates: AddTrustedIssuerCertificatesOptions) => Promise<Result<string[], AddTrustedIssuerCertificatesError>> Add a trusted issuer certificate to storage. Issuer certificates are used to verify mobile credentials when added storage. This function validates the certificate in accordance with the IACA profile defined in 18013-5 with the additional constraint of requiring the certificate to be self signed. The operation is idempotent meaning repeated calls to add the same issuer certificates do not result in duplicates instead the id's of the existing certificates as stored by the SDK are returned.
credential.mobile.createProximityPresentationSession (options: CreateProximityPresentationSessionOptions) => Promise<Result<ProximityPresentationSession, CreateProximityPresentationSessionError>> Create a proximity based presentation session with a mobile credential verifier using ISO 18013-5 based DeviceRetrieval.
credential.mobile.deleteCredential (credentialId: string) => Promise<void> Delete a mobile credential from storage by id
credential.mobile.deleteTrustedIssuerCertificate (certificateId: string) => Promise<Result<void, DeleteTrustedIssuerCertificateError>> Delete a trusted issuer certificate from storage. This operation is idempotent, meaning calls to this function for issuer certificates that do not exist will not return an error.
credential.mobile.getCredential (credentialId: string) => Promise<Result<MobileCredential, GetMobileCredentialError>> Get mobile credential from storage by id
credential.mobile.getCredentials () => Promise<MobileCredential[]> Get all mobile credentials from storage
credential.mobile.getCurrentProximityPresentationSession () => Promise<ProximityPresentationSession | undefined> Get the current proximity presentation session.
credential.mobile.getTrustedIssuerCertificates () => Promise<TrustedIssuerCertificate[]> Retrieve all trusted issuer certificates from storage.
credential.mobile.sendProximityPresentationResponse (options: SendProximityPresentationSessionOptions) => Promise<Result<void, SendProximityPresentationResponseError>> Use the referenced mobile credentials to construct and send a response to the current request from the verifier.
credential.mobile.terminateProximityPresentationSession () => Promise<void> Create a proximity based presentation session with a mobile credential verifier using ISO 18013-5 based DeviceRetrieval.
credential.webSemantic { createPresentation: (options: CreateWebSemanticPresentationOptions) => Promise<Result<VerifiablePresentation, CreateWebSemanticPresentationErrors>> ; deriveCredential: (options: DeriveWebSemanticCredentialOptions) => Promise<Result<VerifiableCredential, DeriveWebSemanticCredentialError>> ; expandCredential: (options: ExpandWebSemanticCredentialOptions) => Promise<Result<Record<string, unknown>, BaseError<ExpandWebSemanticCredentialErrorType>>> ; filterCredentialsByQuery: <T>(options: FilterWebSemanticCredentialsByQueryOptions<T>) => Promise<Result<FilterWebSemanticCredentialsByQueryResponse<T>, FilterWebSemanticCredentialsByQueryError>> ; isSelectivelyDisclosable: (credential: VerifiableCredential) => boolean ; sendPresentationResponse: (options: SendWebSemanticPresentationResponseOptions) => Promise<Result<void, SendWebSemanticPresentationResponseError>> ; verifyCredential: (options: VerifyWebSemanticCredentialOptions) => Promise<Result<VerifyWebSemanticCredentialResult, VerifyWebSemanticCredentialError>> } Namespace for web semantic credential operations
credential.webSemantic.createPresentation (options: CreateWebSemanticPresentationOptions) => Promise<Result<VerifiablePresentation, CreateWebSemanticPresentationErrors>> Create a Web Semantic verifiable presentation
credential.webSemantic.deriveCredential (options: DeriveWebSemanticCredentialOptions) => Promise<Result<VerifiableCredential, DeriveWebSemanticCredentialError>> Derives a Web Semantic credential based on a frame
credential.webSemantic.expandCredential (options: ExpandWebSemanticCredentialOptions) => Promise<Result<Record<string, unknown>, BaseError<ExpandWebSemanticCredentialErrorType>>> Expands a verifiable Web Semantic credential using jsonld
credential.webSemantic.filterCredentialsByQuery <T>(options: FilterWebSemanticCredentialsByQueryOptions<T>) => Promise<Result<FilterWebSemanticCredentialsByQueryResponse<T>, FilterWebSemanticCredentialsByQueryError>> Filters a list of Web Semantic credentials based on a query
credential.webSemantic.isSelectivelyDisclosable (credential: VerifiableCredential) => boolean Determines if a Web Semantic credential is capable of selective disclosure
credential.webSemantic.sendPresentationResponse (options: SendWebSemanticPresentationResponseOptions) => Promise<Result<void, SendWebSemanticPresentationResponseError>> Sends a Web Semantic presentation response
credential.webSemantic.verifyCredential (options: VerifyWebSemanticCredentialOptions) => Promise<Result<VerifyWebSemanticCredentialResult, VerifyWebSemanticCredentialError>> Attempts to verify a Web Semantic credential
did { createDid: () => Promise<Result<CreateDidResponse, CreateDidError>> ; deleteDid: (did: string) => Promise<Result<void, DeleteDidError>> ; listDids: () => Promise<Result<readonly string[], GetDidsError>> ; messaging: { encrypt: (options: EncryptOptions) => Promise<Result<JweJsonSerialization, BaseError<EncryptErrorType>>> ; openDidCommMessage: (message: unknown) => Promise<Result<Jwm, OpenDidCommError | VerifyError | DecryptError>> ; resolveDidCommUri: (didCommUri: string) => Promise<Result<unknown, BaseError<ResolveDidCommUriErrorType>>> ; sign: (payload: string | Record<string, unknown>, senderDid: string) => Promise<Result<string, SignError>> } ; resolveDid: (did: string) => Promise<Result<DidServiceInfoResponse, DidResolutionError>> ; wellKnownDidConfiguration: { validate: (domain: string, did: string) => Promise<boolean> ; validateMultipleDids: (domain: string, dids: readonly string[]) => Promise<ReadonlyArray<DidConfigurationValidateResult>> } } Namespace for DID operations
did.createDid () => Promise<Result<CreateDidResponse, CreateDidError>> Create a new DID in the wallet
did.deleteDid (did: string) => Promise<Result<void, DeleteDidError>> Delete an existing DID in the wallet
did.listDids () => Promise<Result<readonly string[], GetDidsError>> List all DIDs created within the wallet
did.messaging { encrypt: (options: EncryptOptions) => Promise<Result<JweJsonSerialization, BaseError<EncryptErrorType>>> ; openDidCommMessage: (message: unknown) => Promise<Result<Jwm, OpenDidCommError | VerifyError | DecryptError>> ; resolveDidCommUri: (didCommUri: string) => Promise<Result<unknown, BaseError<ResolveDidCommUriErrorType>>> ; sign: (payload: string | Record<string, unknown>, senderDid: string) => Promise<Result<string, SignError>> } Namespace for messaging operations
did.messaging.encrypt (options: EncryptOptions) => Promise<Result<JweJsonSerialization, BaseError<EncryptErrorType>>> Encrypts a message
did.messaging.openDidCommMessage (message: unknown) => Promise<Result<Jwm, OpenDidCommError | VerifyError | DecryptError>> Opens a DIDComm message
did.messaging.resolveDidCommUri (didCommUri: string) => Promise<Result<unknown, BaseError<ResolveDidCommUriErrorType>>> Resolves a DIDComm URI into an object
did.messaging.sign (payload: string | Record<string, unknown>, senderDid: string) => Promise<Result<string, SignError>> Signs a message
did.resolveDid (did: string) => Promise<Result<DidServiceInfoResponse, DidResolutionError>> Resolves any DID into a DID document and the local metadata
did.wellKnownDidConfiguration { validate: (domain: string, did: string) => Promise<boolean> ; validateMultipleDids: (domain: string, dids: readonly string[]) => Promise<ReadonlyArray<DidConfigurationValidateResult>> } Namespace for wellknown configuration operations
did.wellKnownDidConfiguration.validate (domain: string, did: string) => Promise<boolean> Validates a DID belongs to a domain
did.wellKnownDidConfiguration.validateMultipleDids (domain: string, dids: readonly string[]) => Promise<ReadonlyArray<DidConfigurationValidateResult>> Validates multiple DIDs belong to a domain
isOpen () => boolean Indicates if the wallet is open
linkedData { cborld: { decode: (byteArray: Uint8Array) => ResultAsync<unknown, InvalidCborldDecodeError> ; encode: (jsonldDocument: Record<string, unknown>) => ResultAsync<Uint8Array, InvalidCborldEncodeError> } } Namespace for linked data operations
linkedData.cborld { decode: (byteArray: Uint8Array) => ResultAsync<unknown, InvalidCborldDecodeError> ; encode: (jsonldDocument: Record<string, unknown>) => ResultAsync<Uint8Array, InvalidCborldEncodeError> } Namespace for cborld conversion operations
linkedData.cborld.decode (byteArray: Uint8Array) => ResultAsync<unknown, InvalidCborldDecodeError> Decode CBOR-LD bytes intoto JSON-LD document
linkedData.cborld.encode (jsonldDocument: Record<string, unknown>) => ResultAsync<Uint8Array, InvalidCborldEncodeError> Encode a JSON-LD document into CBOR-LD bytes
oidc { discover: (issuerUri: string) => Promise<Result<DiscoverResult, InvalidIssuerUriError | InvalidOpenIdConfigurationError>> ; generateAuthorizeUrl: (options: GenerateAuthorizeUrlOptions) => Promise<Result<GenerateAuthorizeResult, InvalidDidError | SignError>> ; retrieveCredential: (options: RetrieveCredentialOptions) => Promise<Result<RetrieveCredentialResult, RetrieveCredentialError | InvalidIdTokenError | CredentialNotFoundInTokenError>> } Namespace for OIDC operations
oidc.discover (issuerUri: string) => Promise<Result<DiscoverResult, InvalidIssuerUriError | InvalidOpenIdConfigurationError>> Discover credential offer from OIDC's wellknown configuration endpoint
oidc.generateAuthorizeUrl (options: GenerateAuthorizeUrlOptions) => Promise<Result<GenerateAuthorizeResult, InvalidDidError | SignError>> Generates an authorization URL
oidc.retrieveCredential (options: RetrieveCredentialOptions) => Promise<Result<RetrieveCredentialResult, RetrieveCredentialError | InvalidIdTokenError | CredentialNotFoundInTokenError>> Retrieves a credential from the OIDC provider
openid { issuance: { discover: (uri: string) => Promise<Result<OpenidIssuanceDiscoverResult, BaseError<DiscoverErrorType>>> ; generateAuthorizeUrl: (options: OpenidIssuanceGenerateAuthorizeUrlOptions) => Promise<Result<OpenidIssuanceGenerateAuthorizeResult, BaseError<GenerateAuthorizeUrlErrorType>>> ; retrieveCredentials: (options: OpenidIssuanceRetrieveCredentialsOptions) => Promise<OpenidIssuanceRetrieveCredentialsResult> ; retrieveToken: (options: OpenidIssuanceRetrieveTokenOptions) => Promise<Result<OpenidIssuanceRetrieveTokenResult, BaseError<RetrieveTokenErrorType>>> } } Namespace for openid operations
openid.issuance { discover: (uri: string) => Promise<Result<OpenidIssuanceDiscoverResult, BaseError<DiscoverErrorType>>> ; generateAuthorizeUrl: (options: OpenidIssuanceGenerateAuthorizeUrlOptions) => Promise<Result<OpenidIssuanceGenerateAuthorizeResult, BaseError<GenerateAuthorizeUrlErrorType>>> ; retrieveCredentials: (options: OpenidIssuanceRetrieveCredentialsOptions) => Promise<OpenidIssuanceRetrieveCredentialsResult> ; retrieveToken: (options: OpenidIssuanceRetrieveTokenOptions) => Promise<Result<OpenidIssuanceRetrieveTokenResult, BaseError<RetrieveTokenErrorType>>> } Namespace for openid issuance operations
openid.issuance.discover (uri: string) => Promise<Result<OpenidIssuanceDiscoverResult, BaseError<DiscoverErrorType>>> Discover credential offer
openid.issuance.generateAuthorizeUrl (options: OpenidIssuanceGenerateAuthorizeUrlOptions) => Promise<Result<OpenidIssuanceGenerateAuthorizeResult, BaseError<GenerateAuthorizeUrlErrorType>>> Generates an authorization URL
openid.issuance.retrieveCredentials (options: OpenidIssuanceRetrieveCredentialsOptions) => Promise<OpenidIssuanceRetrieveCredentialsResult> Retrieves credential from the openid issuance provider
openid.issuance.retrieveToken (options: OpenidIssuanceRetrieveTokenOptions) => Promise<Result<OpenidIssuanceRetrieveTokenResult, BaseError<RetrieveTokenErrorType>>> Retrieves token from the openid issuance provider

WalletExtension

Ƭ WalletExtension: Object

React Native specific wallet extensions.

Type declaration

Name Type Description
httpCache { clear: () => Promise<Result<void, HttpCacheError>> ; getSize: () => Promise<Result<number, HttpCacheError>> } Namespace for HTTP request cache
httpCache.clear () => Promise<Result<void, HttpCacheError>> Removes all entries from HTTP cache storage directory for the wallet Remarks This is a destructive operation that cannot be undone.
httpCache.getSize () => Promise<Result<number, HttpCacheError>> Retrieve the total number of cached contexts in the wallet

WalletNotFoundError

Ƭ WalletNotFoundError: BaseError<"WalletNotFoundError">


WebSemanticCredentialData

Ƭ WebSemanticCredentialData: Object

Type declaration

Name Type
credential Credential

WebSemanticCredentialOffered

Ƭ WebSemanticCredentialOffered: BaseCredentialOffered & { credentialDefinition: OpenidIssuanceCredentialDefinition ; profile: WebSemantic }

Variables

AuthorizeRequestParametersValidator

Const AuthorizeRequestParametersValidator: z.ZodType<AuthorizeRequestParameters>

request_parameters, that supported by wallet-sdk


CompactCredentialOfferedValidator

Const CompactCredentialOfferedValidator: z.ZodType<CompactCredentialOffered>


CompactSemanticCredentialOfferedValidator

Const CompactSemanticCredentialOfferedValidator: z.ZodType<CompactSemanticCredentialOffered>


CredentialOfferedValidator

Const CredentialOfferedValidator: z.ZodObject<{ claims: z.ZodOptional<z.ZodArray<z.ZodObject<{ name: z.ZodString }, "strip", z.ZodTypeAny, { name: string }, { name: string }>, "many">> ; name: z.ZodOptional<z.ZodString> ; scope: z.ZodString }, "strip", z.ZodTypeAny, { claims?: { name: string }[] ; name?: string ; scope: string }, { claims?: { name: string }[] ; name?: string ; scope: string }>


DeprecatedWebSemanticCredentialOfferedValidator

Const DeprecatedWebSemanticCredentialOfferedValidator: z.ZodType<DeprecatedWebSemanticCredentialOffered>


OpenidIssuanceCredentialOfferValidator

Const OpenidIssuanceCredentialOfferValidator: z.ZodType<OpenidIssuanceCredentialOffer>


OpenidIssuanceGenerateAuthorizeUrlOptionsValidator

Const OpenidIssuanceGenerateAuthorizeUrlOptionsValidator: z.ZodType<OpenidIssuanceGenerateAuthorizeUrlOptions>


types for wallet.openid.issuance.generateAuthorizeUrl()



OpenidIssuanceRetrieveCredentialsOptionsValidator

Const OpenidIssuanceRetrieveCredentialsOptionsValidator: z.ZodType<OpenidIssuanceRetrieveCredentialsOptions>


types for wallet.openid.issuance.retrieveCredentials()



RNSecureKeyStoreLegacy

RNSecureKeyStoreLegacy: any


WebSemanticCredentialOfferedValidator

Const WebSemanticCredentialOfferedValidator: z.ZodType<WebSemanticCredentialOffered>

Functions

assertType

assertType<T, InputData>(validator, message): (data: InputData) => void

Asserts data against either internal Validator functions or Zod object schemas Throws CoreTypeError if assertion fails

Type parameters

Name Type
T T
InputData T

Parameters

Name Type
validator Validator<T> | ZodType<T, ZodTypeDef, T>
message string

Returns

fn

▸ (data): void

Parameters
Name Type
data InputData
Returns

void


assertUnreachable

assertUnreachable(x): never

Used for exhaustive if/switch statements Example:

enum Fruit {
 orange = "orange",
 apple = "apple",
}

const getFruitName = (fruit: Fruit): string => {
 if (fruit === Fruit.orange) {
   return "Orange";
 }

 // Should fail TS compilation as Fruit.apple is not being handled in the code above
 return assertUnreachable(fruit);
}

Parameters

Name Type
x never

Returns

never


destroy

destroy(walletIdOrOptions?): Promise<Result<void, WalletNotFoundError>>

Removes encryption keys and storage directories associated with the wallet

When destroying the current wallet instance, it will also be closed.

Parameters

Name Type
walletIdOrOptions? string | DestroyOptions

Returns

Promise<Result<void, WalletNotFoundError>>

A Result containing void on ok and a WalletNotFoundError on error

Remarks

This is a destructive operation that cannot be undone. The wallet will have to be re created from scratch if destroyed.

The same list of extensions used when initialising the wallet instance must be provided so that resources created and managed by extension modules can also be removed properly.

You must also close the wallet instance that is currently initialised before calling this function, otherwise an exception will be thrown.


initialise

initialise(options): Promise<Result<Wallet, UserAuthenticationCancelledError | UserAuthenticationOnDeviceNotSetupError>>

Initialise a wallet instance.

Parameters

Name Type
options InitialiseOptions

Returns

Promise<Result<Wallet, UserAuthenticationCancelledError | UserAuthenticationOnDeviceNotSetupError>>

Remarks

It's possible to maintain multiple isolated wallet instances by providing a different walletIds. However, you must close the current one first before initialising a new wallet instance.

Also note that currently UserAuthenticationCancelledError and UserAuthenticationOnDeviceNotSetupError would only occur if the mobile credential extension is provided becuase the initialisation of the mobile credential extension require user local authentication


isPresentationRequestJwm

isPresentationRequestJwm(val): val is PresentationRequestJwm

Parameters

Name Type
val unknown

Returns

val is PresentationRequestJwm


isType

isType<T>(validator): (value: unknown) => value is T

Provide typeguards and boolean result of a zod validator

Type parameters

Name
T

Parameters

Name Type
validator ZodType<T, ZodTypeDef, T>

Returns

fn

▸ (value): value is T

Parameters
Name Type
value unknown
Returns

value is T


isVerifiableCredential

isVerifiableCredential(val): val is VerifiableCredential

Parameters

Name Type
val unknown

Returns

val is VerifiableCredential


unwrap

unwrap<T>(result): T

A utility function to get the value from a Result or throw if there was an error

Type parameters

Name Type Description
T unknown the expected value of an ok result

Parameters

Name Type Description
result Result<T, unknown> The Result to unwrap

Returns

T

Remarks

Allows you to get the value of a result directly or handle an error Result as an exception