getChallenge method

Future<String> getChallenge(
  1. String clientAccountId, [
  2. int? memo,
  3. String? homeDomain,
  4. String? clientDomain,
])

Get challenge transaction from the web auth server. Returns base64 xdr transaction envelope received from the web auth server.

  • Parameter clientAccountId: The account id of the client/user that requests the challenge.
  • Parameter memo: optional, ID memo of the client account if muxed and accountId starts with G
  • Parameter homeDomain: optional, used for requesting the challenge depending on the home domain if needed. The web auth server may serve multiple home domains.
  • Parameter clientDomain: optional, domain of the client hosting it's stellar.toml

Implementation

Future<String> getChallenge(String clientAccountId,
    [int? memo, String? homeDomain, String? clientDomain]) async {
  ChallengeResponse challengeResponse = await getChallengeResponse(
      clientAccountId, memo, homeDomain, clientDomain);

  String? transaction = challengeResponse.transaction;
  if (transaction == null) {
    throw MissingTransactionInChallengeResponseException();
  }
  return transaction;
}