Mattr Verifier SDK React Native / Exports
- BaseSDKError
- CloseVerifierError
- CommonVerifyError
- CompactSemanticCredentialPayload
- CompactSemanticCredentialVcPayload
- CompactSemanticVerifyError
- CompactSemanticVerifyErrorType
- CompactSemanticVerifyFailureReasonType
- CompactSemanticVerifyResult
- CompactVerifyError
- CompactVerifyErrorType
- CompactVerifyFailureReasonType
- CompactVerifyResult
- DestroyVerifierError
- EncryptionKeyNotFoundError
- GenericPayload
- InitOptions
- IssuerResolverError
- MalformedEncryptionKeyError
- PropertiesMappingConfig
- RefreshCacheError
- RefreshCacheSuccess
- ResolverError
- Result
- Verifier
- VerifierBase
- VerifierExtension
- VerifyCredentialError
- VerifyCredentialOptions
- VerifyCredentialResult
Ƭ BaseSDKError: Object
Name | Type |
---|---|
cause? |
Error | unknown |
message |
string |
type |
string |
Ƭ CloseVerifierError: BaseSDKError
& { type
: "CloseVerifierError"
}
Ƭ CommonVerifyError: BaseSDKError
& { type
: CommonVerifyErrorType
}
Ƭ CompactSemanticCredentialPayload: ImplementsZodType
<TypeOf
<typeof CompactSemanticCredentialPayloadValidator
>, { aud?
: string
; exp?
: number
; iat?
: number
; iss
: string
; jti
: string
; nbf
: number
; status?
: CwtStatus
; sub?
: string
; vc
: CompactSemanticCredentialVcPayload
}>
Ƭ CompactSemanticCredentialVcPayload: ImplementsZodType
<TypeOf
<typeof CompactSemanticCredentialVcPayloadValidator
>, { @context
: JsonLdContext
; credentialSubject
: Record
<string
, string
| number
| boolean
> ; type
: string
[] }>
Ƭ CompactSemanticVerifyError: BaseError
& { type
: CompactSemanticVerifyErrorType
}
Ƭ CompactSemanticVerifyErrorType: VerifyErrorType
Ƭ CompactSemanticVerifyFailureReasonType: VerifyFailureReasonType
Ƭ CompactSemanticVerifyResult: 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
}
Ƭ CompactVerifyError: BaseError
& { type
: CompactVerifyErrorType
}
Ƭ CompactVerifyErrorType: VerifyErrorType
Ƭ CompactVerifyFailureReasonType: VerifyFailureReasonType
Ƭ CompactVerifyResult: 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
}
Ƭ DestroyVerifierError: BaseSDKError
& { type
: "DestroyVerifierError"
}
Ƭ EncryptionKeyNotFoundError: BaseSDKError
& { type
: "EncryptionKeyNotFoundError"
}
Ƭ GenericPayload: Record
<string
, unknown
>
Ƭ InitOptions: Object
Options to configure when initialising a verifier
Name | Type | Description |
---|---|---|
assertExpiry? |
boolean |
Set whether to check the credential's expiry date during verification. If true , verification will fail if the credential is expired. remarks Default to true . |
assertNotBefore? |
boolean |
Set whether to check the credential's not before date during verification. If true , verification will fail if the credential is not active i.e. current date is before the not before date. remarks Not before date is the date a credential is activated and becomes active. Default to true . |
checkRevocation? |
boolean |
Set whether to check the credential's revocation status during verification. If true , verification will fail if the credential is revoked. remarks Revocation status represents the validity of the credential as determined by the issuer. Default to true . |
issuerCacheTtl |
number |
Duration that an issuer is kept in the cache after it is added or re-added |
revocationListCacheTtl |
number |
Duration that a revocation list is kept in the cache after it is added or re-added |
trustedIssuers? |
ReadonlyArray <string > |
List of issuers we want to trust the credentials of remarks Issuers defined here are cached up front. If this is empty, all issuers will be considered trusted. |
Ƭ IssuerResolverError: BaseError
& { type
: IssuerResolverErrorType
}
Ƭ MalformedEncryptionKeyError: BaseSDKError
& { type
: "MalformedEncryptionKeyError"
}
Ƭ PropertiesMappingConfig: Record
<string
, (value
: unknown
) => [string
, unknown
]>
A record of transformation functions that maps an existing key and value to a new key and value The existing value is passed as the parameter to the transformation function
example
// Defines a single transformation to map an object of type { foo: any } to { bar: "something" }
const propertyMappingConfig = {
foo: (_foosValue) => ["bar", "something"],
};
Ƭ RefreshCacheError<E
>: BaseSDKError
& { cause?
: readonly ResolverError
<E
>[] ; expiryDate
: Date
| undefined
; type
: RefreshCacheErrorType
}
Name |
---|
E |
Ƭ RefreshCacheSuccess: Object
Name | Type |
---|---|
expiryDate |
Date | undefined |
Ƭ ResolverError<E
>: Object
Name |
---|
E |
Name | Type |
---|---|
error |
E |
key |
string |
Ƭ Result<T
, E
>: Ok
<T
, E
> | Err
<T
, E
>
Name |
---|
T |
E |
Ƭ Verifier: VerifierBase
& VerifierExtension
Ƭ VerifierBase: Object
An instance of a verifier
Name | Type |
---|---|
close |
() => Promise <Result <void , CloseVerifierError >> |
getCacheExpiry |
() => Promise <undefined | Date > |
isOpen |
() => boolean |
refreshCache |
() => Promise <Result <RefreshCacheSuccess , RefreshCacheError <IssuerResolverError | RevocationListResolverError >>> |
verify |
(options : VerifyCredentialOptions ) => Promise <Result <VerifyCredentialResult , VerifyCredentialError >> |
Ƭ VerifierExtension: Object
React Native specific verifier that has been extended with additional functionality
Name | Type |
---|---|
destroy |
() => Promise <Result <void , DestroyVerifierError >> |
Ƭ VerifyCredentialError: CommonVerifyError
| CompactVerifyError
| CompactSemanticVerifyError
Ƭ VerifyCredentialOptions: Object
Name | Type | Description |
---|---|---|
payload |
string |
The credential payload to verify |
propertyMappingConfig? |
PropertiesMappingConfig |
The mapping configuration that lists transformation functions to apply for designated properties of the returned payload |
Ƭ VerifyCredentialResult: CompactVerifyResult
| CompactSemanticVerifyResult
& { transformedPayload?
: GenericPayload
}
▸ init(options
): Promise
<Verifier
>
Initialise a verifier.
Name | Type | Description |
---|---|---|
options |
InitOptions |
InitOptions containing the options for the init function |
Promise
<Verifier
>
A Result containing the initialised Verifier object
▸ unwrap<T
>(result
): T
A utility function to get the value from a Result or throw if there was an error
remarks
Allows you to get the value of a result directly or handle an error Result as an exception
Name | Type | Description |
---|---|---|
T |
unknown |
the expected value of an ok result |
Name | Type | Description |
---|---|---|
result |
Result <T , unknown > |
The Result to unwrap |
T