16.10. Approve transaction data in a presentation request
Feature guides / 16. Wallet workflows · Example context
Car Rental Company may ask Maya to approve information associated with a transaction. A correctly signed request alone is not a reason for the wallet to accept an unknown transaction type or misleading content.
How to use it
AuthorizationRequestOptions exposes verifyTransactionData. Completion invokes it after request-level checks with decoded data and the active queries bound to those transactions: the signed query, the host's scope mapping, or an immediate-Superior query override. A separately published authorization-scenario list remains in effectiveQueries; it is not substituted for the active query when checking transaction credential references. Signing workflows use scopeQuery when scope selects the query and no effective superior override supplies it. VP transaction data; Wallet verifier policy.
import type { CryptoEngine } from "@oidfed/crypto";
import { CredentialVerifierRole, type AuthorizationRequestOptions, type WalletAuthorizationRequest } from "@oidfed/wallet";
import type { TrustAnchorSet } from "@oidfed/core";
export async function completeDrivingLicenceTransaction(
engine: CryptoEngine,
outer: WalletAuthorizationRequest, signedRequestJwt: string, anchors: TrustAnchorSet,
verify: NonNullable<AuthorizationRequestOptions["verifyTransactionData"]>,
) {
const prepared = await CredentialVerifierRole.prepareAuthorizationRequest(outer, anchors, {
engine,
verifyTransactionData: verify,
});
if (!prepared.ok) return prepared;
return CredentialVerifierRole.completeAuthorizationRequest(prepared.value, signedRequestJwt);
}
What your application owns
Define supported transaction types, what the user sees, and how the host verifies content and response binding. The callback is an application policy decision, not a universal transaction parser. Do not release a presentation on a false, thrown, cancelled, or invalid callback outcome. The protocol engine remains responsible for the cryptographic presentation and transaction-binding checks required by the selected profile.
Make the transaction meaningful to the user
When a request contains Transaction Data, the host callback must interpret the relevant transaction type and decide whether it is acceptable. The library's federation checks cannot determine whether Maya intends the rental action described by arbitrary business data.
Present the interpreted terms through the wallet's trusted UI and connect that decision to the current request. Reject unknown or unacceptable transaction content rather than approving it because the verifier has a valid chain. Keep sensitive transaction details out of routine logs and only retain them according to the application's data policy.
Next: 16.11. Verify a credential using trusted issuer context