Wallet
Unified wallet interface.
A wallet is a composition of capability interfaces. All wallets must implement CredentialStorage. Other capabilities are optional and can be checked using Kotlin's type system against the narrowest interface you need.
Example Usage:
val wallet: Wallet = createWallet()
// Core operations (always available)
val id = wallet.store(credential)
val credential = wallet.get(id)
// Optional capabilities — prefer the narrowest interface you actually need
if (wallet is CredentialCollections) {
wallet.createCollection("My Collection")
}
if (wallet is CredentialTagging) {
wallet.tagCredential(id, setOf("important"))
}
if (wallet is CredentialPresentation) {
val presentation = wallet.createPresentation(
credentialIds = listOf(id),
holderDid = "did:key:holder",
options = proofOptions { ... }
)
}
if (wallet is DidManagement) {
val did = wallet.createDid("key")
println("Wallet DID: ${wallet.walletDid}")
}
// Get statistics
val stats = wallet.getStatistics()
println("Total credentials: ${stats.totalCredentials}")Inheritors
Functions
Get a credential by ID.
Get wallet statistics.
List credentials matching a filter.
Query credentials using a query builder.
Store a credential.
Extension function for type-safe access to the CredentialCollections capability.
Extension function for type-safe capability access.
Extension function for type-safe capability access.
Extension function for type-safe capability access.
Extension function for type-safe capability access.
Extension function for type-safe access to the combined CredentialOrganization capability.
Extension function for type-safe capability access.
Extension function for type-safe access to the CredentialTagging capability.
Wraps this wallet so its storage operations are reported to Telemetry.