Sep30ResponseIdentity

data class Sep30ResponseIdentity(val role: String?, val authenticated: Boolean?)

Represents an identity in a SEP-30 account recovery response.

Contains the role and optional authenticated status of a registered recovery identity. The recovery server returns this information when querying or modifying account recovery configurations.

Roles

  • "owner": Can sign transactions and modify account identities on the recovery server.

  • "other": Can only sign transactions (additional signers).

  • Custom roles are also supported (e.g., "sender", "receiver").

The role field is nullable because the SEP-30 specification does not require it in all response contexts. For example, the GET /accounts response may return identities without a role when the identity is authenticated but the role was not set during registration.

The authenticated field is optional. When present and true, it indicates that the currently authenticated client has successfully verified this identity. When absent, it is set to null (not false).

Usage

val json = Json.parseToJsonElement(responseBody).jsonObject
val identity = Sep30ResponseIdentity.fromJson(json)

println("Role: ${identity.role ?: "not specified"}")
if (identity.authenticated == true) {
println("Identity is authenticated")
}

Example JSON (with role)

{ "role": "owner", "authenticated": true }

Example JSON (without role)

{ "authenticated": true }

See also

Constructors

Link copied to clipboard
constructor(role: String?, authenticated: Boolean?)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Whether the identity has been authenticated, or null if not reported

Link copied to clipboard
val role: String?

The role of the identity (e.g., "owner", "other"), or null if not specified