accounts

suspend fun accounts(jwt: String, after: String? = null): Sep30AccountsResponse

Lists all accounts accessible by the authenticated user.

Returns accounts that the authenticated user has permission to access. Supports cursor-based pagination via the after parameter.

Return

Sep30AccountsResponse with the list of accessible accounts

Parameters

jwt

SEP-10 authentication token

after

Optional cursor for pagination (Stellar account address to start after)

Throws

If the request is malformed (HTTP 400)

If the JWT token is invalid or expired (HTTP 401)

If the endpoint is not found (HTTP 404)

If there is a retrieval conflict (HTTP 409)

If the server returns HTTP 200 with a malformed body

If the server returns an unexpected HTTP status code

Example:

// Get first page
val page1 = sep30.accounts(jwt = jwtToken)
page1.accounts.forEach { println("Account: ${it.address}") }

// Get next page using last account address as cursor
if (page1.accounts.isNotEmpty()) {
val lastAddress = page1.accounts.last().address
val page2 = sep30.accounts(jwt = jwtToken, after = lastAddress)
}