from Domain
suspend fun fromDomain(domain: String, httpClient: HttpClient? = null, httpRequestHeaders: Map<String, String>? = null): Sep06Service
Creates a Sep06Service by discovering the endpoint from stellar.toml.
Fetches the stellar.toml file from the specified domain and extracts the TRANSFER_SERVER address. This is the recommended method for initializing the service as it automatically configures the correct endpoint.
Return
Sep06Service configured with the domain's transfer server endpoint
Parameters
domain
The domain name (without protocol). E.g., "anchor.example.com"
http Client
Optional custom HTTP client for testing
http Request Headers
Optional custom headers for requests
Throws
If TRANSFER_SERVER is not found in stellar.toml
Example:
val sep06 = Sep06Service.fromDomain("testanchor.stellar.org")Content copied to clipboard