fromDomain static method

Future<WebAuth> fromDomain(
  1. String domain,
  2. Network network, {
  3. Client? httpClient,
})

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 NoWebAuthEndpointFoundException(domain);
  }
  if (toml.generalInformation.signingKey == null) {
    throw NoWebAuthServerSigningKeyFoundException(domain);
  }

  return new WebAuth(toml.generalInformation.webAuthEndpoint!, network,
      toml.generalInformation.signingKey!, domain, httpClient: httpClient);
}