Sep30Service
SEP-30 Account Recovery service client.
Provides support for multi-party recovery of Stellar accounts. Recovery servers hold signing keys for registered accounts and can sign recovery transactions after the account owner authenticates via one or more identity verification methods.
This service handles:
Registering accounts with identity providers and authentication methods
Updating identity configurations for registered accounts
Requesting transaction signatures from recovery signers
Querying account recovery details and listing registered accounts
Deleting account recovery registrations
All endpoints require a SEP-10 JWT authentication token.
Typical workflow:
Create service instance with the recovery server URL
Authenticate via SEP-10 to obtain a JWT token
Register an account with identity providers via registerAccount
When recovery is needed, authenticate identities
Request transaction signatures via signTransaction
Example - Register an account:
val sep30 = Sep30Service("https://recovery.example.com")
val emailAuth = Sep30AuthMethod(type = "email", value = "user@example.com")
val phoneAuth = Sep30AuthMethod(type = "phone_number", value = "+14155551234")
val ownerIdentity = Sep30RequestIdentity(
role = "owner",
authMethods = listOf(emailAuth, phoneAuth)
)
val request = Sep30Request(identities = listOf(ownerIdentity))
val response = sep30.registerAccount(accountAddress, request, jwtToken)
println("Registered: ${response.address}")
response.signers.forEach { println("Signer: ${it.key}") }Example - Sign a recovery transaction:
val signatureResponse = sep30.signTransaction(
address = accountAddress,
signingAddress = response.signers.first().key,
transaction = transaction.toEnvelopeXdrBase64(),
jwt = jwtToken
)
println("Signature: ${signatureResponse.signature}")
println("Network: ${signatureResponse.networkPassphrase}")Example - List registered accounts:
val accountsResponse = sep30.accounts(jwt = jwtToken)
accountsResponse.accounts.forEach { account ->
println("Account: ${account.address}")
}See also:
Sep30Request for request construction
Sep30AccountResponse for account response details
Sep30SignatureResponse for signature response details
Parameters
Optional custom HTTP client for testing or custom configuration
Optional custom headers applied to all requests
Functions
Retrieves the recovery details for a registered account.
Lists all accounts accessible by the authenticated user.
Deletes an account's recovery registration from the server.
Registers an account with the recovery server.
Requests the recovery server to sign a transaction.
Updates the identity configuration for a registered account.