WalletPresentationBuilder

class WalletPresentationBuilder(wallet: Wallet, credentialService: CredentialService)

Wallet Presentation Builder DSL.

Provides a fluent API for creating presentations from wallet credentials. Automatically retrieves credentials from wallet by ID or query.

Example Usage:

val pr = trustWeave.presentationFromWalletResult(wallet) {
fromWallet(masterId, job1Id, job2Id)
holder(professionalDid.value)
selectiveDisclosure { reveal("degree.field", "employment.company") }
}
// when (pr) { Success / Failure.* }

Published docs: docs/api-reference/result-types-guide.md, docs/how-to/create-presentations.md.

Constructors

Link copied to clipboard
constructor(wallet: Wallet, credentialService: CredentialService)

Functions

Link copied to clipboard

Build the verifiable presentation as a PresentationResult.

Link copied to clipboard
fun challenge(challenge: String)

Set challenge.

Link copied to clipboard
fun domain(domain: String)

Set domain.

Link copied to clipboard
fun fromQuery(block: QueryBuilder.() -> Unit)

Add credentials from wallet query.

Link copied to clipboard
fun fromWallet(credentialIds: List<String>)

Add credentials from wallet by ID list.

fun fromWallet(vararg credentialIds: String)

Add credentials from wallet by ID.

Link copied to clipboard
fun holder(did: String)

Set holder DID.

Link copied to clipboard

Configure selective disclosure.

Link copied to clipboard
fun verificationMethod(verificationMethod: String)

Set verification method for signing.