fromDomain method

Future<StellarToml> fromDomain (
  1. String domain
)

Implementation

static Future<StellarToml> fromDomain(String domain) async {
  Uri uri = Uri.parse("https://" + domain + "/.well-known/stellar.toml");

  return await http.Client()
      .get(uri, headers: RequestBuilder.headers)
      .then((response) {
    if (response.statusCode != 200) {
      throw Exception(
          "Stellar toml not found, response status code ${response.statusCode}");
    }
    return new StellarToml(response.body);
  });
}