fromDomain method Null safety
Creates a WebAuth instance by loading the needed data from the stellar.toml file hosted on the given domain. e.g. fromDomain("soneso.com", Network.TESTNET)
- Parameter domain: The domain from which to get the stellar information
- Parameter network: The network used.
Implementation
static Future<WebAuth> fromDomain(
String domain,
Network network, {
http.Client? httpClient,
}) async {
final StellarToml toml = await StellarToml.fromDomain(
domain,
httpClient: httpClient,
);
if (toml.generalInformation.webAuthEndpoint == null) {
throw Exception("No WEB_AUTH_ENDPOINT found in stellar.toml");
}
if (toml.generalInformation.signingKey == null) {
throw Exception("No auth server SIGNING_KEY found in stellar.toml");
}
return new WebAuth(toml.generalInformation.webAuthEndpoint, network,
toml.generalInformation.signingKey, domain);
}