Sep45No Endpoint Exception
Exception thrown when the domain's stellar.toml is missing the WEB_AUTH_FOR_CONTRACTS_ENDPOINT.
SEP-45 requires the server's stellar.toml to contain a WEB_AUTH_FOR_CONTRACTS_ENDPOINT field that specifies the URL for contract authentication. This endpoint is different from SEP-10's WEB_AUTH_ENDPOINT which handles traditional account authentication.
To resolve this error:
Verify the domain supports SEP-45 contract authentication
Check the stellar.toml at https://{domain}/.well-known/stellar.toml
Look for WEB_AUTH_FOR_CONTRACTS_ENDPOINT field
Contact the service provider if the endpoint should be available
Note: SEP-45 support is optional. Many services only implement SEP-10 for traditional accounts. If you need to authenticate a contract account (C...), you must use a service that explicitly supports SEP-45.
Example - Handle missing endpoint:
try {
val webAuth = WebAuthForContracts.fromDomain("example.com", Network.PUBLIC)
} catch (e: Sep45NoEndpointException) {
println("Domain ${e.domain} does not support SEP-45 contract authentication")
// Fall back to alternative authentication or inform user
}