StoredCredential

data class StoredCredential(val credentialId: String, val publicKey: ByteArray, val contractId: String? = null, val deploymentStatus: CredentialDeploymentStatus = CredentialDeploymentStatus.PENDING, val deploymentError: String? = null, val createdAt: Long = currentTimeMillis(), val lastUsedAt: Long? = null, val nickname: String? = null, val isPrimary: Boolean = false, val transports: List<String>? = null, val deviceType: String? = null, val backedUp: Boolean? = null)

A stored smart account credential with deployment and usage metadata.

Represents a WebAuthn credential (passkey) associated with a smart account. Tracks the credential's deployment status, contract address, and usage history.

Example:

val credential = StoredCredential(
credentialId = "base64url-encoded-id",
publicKey = secp256r1PublicKeyData,
contractId = "CBCD1234...",
deploymentStatus = CredentialDeploymentStatus.PENDING,
isPrimary = true
)

Constructors

Link copied to clipboard
constructor(credentialId: String, publicKey: ByteArray, contractId: String? = null, deploymentStatus: CredentialDeploymentStatus = CredentialDeploymentStatus.PENDING, deploymentError: String? = null, createdAt: Long = currentTimeMillis(), lastUsedAt: Long? = null, nickname: String? = null, isPrimary: Boolean = false, transports: List<String>? = null, deviceType: String? = null, backedUp: Boolean? = null)

Properties

Link copied to clipboard

Whether the passkey is backed up or synced to a cloud provider.

Link copied to clipboard

The smart account contract address (C-address).

Link copied to clipboard

Timestamp of when this credential was created.

Link copied to clipboard

The WebAuthn credential ID (Base64URL encoded).

Link copied to clipboard

Error message if deployment failed.

Link copied to clipboard

The current deployment status of the smart account contract.

Link copied to clipboard

Authenticator device type.

Link copied to clipboard

Whether this is the primary credential for this smart account.

Link copied to clipboard

Timestamp of when this credential was last used for signing.

Link copied to clipboard

Optional user-friendly nickname for this credential.

Link copied to clipboard

The uncompressed secp256r1 public key (65 bytes starting with 0x04).

Link copied to clipboard

Authenticator transport hints indicating how the browser can communicate with the authenticator (e.g., "usb", "nfc", "ble", "internal").

Functions

Link copied to clipboard

Applies the given updates to this credential, returning a new instance. Fields in updates that are null are left unchanged.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Custom equals implementation that properly compares ByteArray.

Link copied to clipboard
open override fun hashCode(): Int

Custom hashCode implementation that properly handles ByteArray.