v0.12.2
v0.12.2
Modified issueDocumentsByOfferUrl method
/// Issue documents by offer URI.
/// - Parameters:
/// - offerUri: url with offer
/// - docTypes: offered doc models available to be issued. Contains key options (secure are name and other options)
/// - txCodeValue: Transaction code given to user (if available)
/// - promptMessage: prompt message for biometric authentication (optional)
/// - Returns: Array of issued and stored documents
public func issueDocumentsByOfferUrl(offerUri: String, docTypes: [OfferedDocModel], txCodeValue: String? = nil, promptMessage: String? = nil) async throws -> [WalletStorage.Document] {
Example usage:
// When resolving an offer, key options are now included
let offer = try await wallet.resolveOfferUrlDocTypes(uriOffer: offerUrl)
for docModel in offer.docModels {
// use recommended key options or modify them
let docTypes = offer.docModels.map { $0.copy(keyOptions: KeyOptions(credentialPolicy: .oneTimeUse, batchSize: 2))
// Issue with optimal settings
let newDocs = try await wallet.issueDocumentsByOfferUrl(offerUri: offerUrl, docTypes: docTypes, txCodeValue: txCode)
}
OfferedDocModel
struct enhancements
Added properties:
identifier: String?
- Issuer configuration identifier for the credentialkeyOptions: KeyOptions
- Default key options (batch size and credential policy) recommended by the issuer
Updated computed property:
docTypeOrVctOrScope
renamed todocTypeOrVctOrScope
- Now returns docType, vct, or scope in priority order