from Domain
Creates a WebAuthForContracts instance by discovering configuration from a domain's stellar.toml.
This is the recommended way to initialize WebAuthForContracts. It automatically fetches the stellar.toml file from the specified domain and extracts the required configuration:
WEB_AUTH_FOR_CONTRACTS_ENDPOINT: The authentication endpoint URL
WEB_AUTH_CONTRACT_ID: The web auth contract ID (C... address)
SIGNING_KEY: The server's public signing key for validating challenges
The stellar.toml file is fetched from: https://{domain}/.well-known/stellar.toml
Return
WebAuthForContracts instance configured from the domain's stellar.toml
Parameters
The domain name (without protocol). E.g., "example.com"
The Stellar network (Network.PUBLIC or Network.TESTNET)
Optional custom HTTP client for testing or proxy configuration
Optional custom HTTP headers to include in requests
Throws
If WEB_AUTH_FOR_CONTRACTS_ENDPOINT is missing from stellar.toml
If WEB_AUTH_CONTRACT_ID is missing from stellar.toml
If SIGNING_KEY is missing from stellar.toml