createAccount method

Future<Tuple2> createAccount(
  1. String email,
  2. String handle,
  3. String password, {
  4. String? did,
  5. String? inviteCode,
  6. String? recoveryKey,
})

Implementation

Future<Tuple2> createAccount(String email, String handle, String password,
    {String? did, String? inviteCode, String? recoveryKey}) async {
  // TODO format check for handle.
  Map<String, dynamic> params = {
    "email": email,
    "handle": handle,
    "password": password
  };
  API.add(params, {
    "did": did,
    "inviteCode": inviteCode,
    "recoveryKey": recoveryKey,
  });
  http.Response res = await api.post("com.atproto.server.createAccount",
      headers: {"Content-Type": "application/json"},
      body: json.encode(params));
  return Tuple2<int, Map<String, dynamic>>(
      res.statusCode, json.decode(res.body));
}