createUserEmpty function

Future<User?> createUserEmpty({
  1. required String accountAddress,
})

Implementation

Future<User?> createUserEmpty({required String accountAddress}) async {
  final caip10 = walletToPCAIP10(accountAddress);

  final data = {
    "caip10": caip10,
    "did": caip10,
    "publicKey": '',
    "encryptedPrivateKey": '',
    "signature": "pgp",
    "sigType": "pgp"
  };

  final result = await http.post(path: '/v2/users', data: data);

  if (result == null || result is String) {
    throw Exception(result ?? 'Unable to create account for $accountAddress');
  } else {
    return User.fromJson(result);
  }
}