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