fromDomain

suspend fun fromDomain(domain: String, httpClient: HttpClient? = null, httpRequestHeaders: Map<String, String>? = null): Sep24Service

Creates a Sep24Service by discovering the endpoint from stellar.toml.

Fetches the stellar.toml file from the specified domain and extracts the TRANSFER_SERVER_SEP0024 address. This is the recommended method for initializing the service as it automatically configures the correct endpoint.

Return

Sep24Service configured with the domain's transfer server endpoint

Parameters

domain

The domain name (without protocol). E.g., "anchor.example.com"

httpClient

Optional custom HTTP client for testing

httpRequestHeaders

Optional custom headers for requests

Throws

If TRANSFER_SERVER_SEP0024 is not found in stellar.toml

Example:

val sep24 = Sep24Service.fromDomain("testanchor.stellar.org")