postCreateAccountAuthorization function

Future<Response?> postCreateAccountAuthorization(
  1. String? hezEthereumAddress,
  2. String? bjj,
  3. String signature
)

POST request to the /account-creation-authorization endpoint. Sends an authorization to the coordinator to register token accounts on their behalf @param {String} hezEthereumAddress - The Hermez Ethereum address of the account that makes the authorization @param {String} bjj - BabyJubJub address of the account that makes the authorization @param {String} signature - The signature of the request @returns {Object} Response data

Implementation

Future<http.Response?> postCreateAccountAuthorization(
    String? hezEthereumAddress, String? bjj, String signature) async {
  Map<String, String?> params = {};
  params.putIfAbsent('hezEthereumAddress',
      () => hezEthereumAddress!.isNotEmpty ? hezEthereumAddress : '');
  params.putIfAbsent('bjj', () => bjj!.isNotEmpty ? bjj : '');
  params.putIfAbsent('signature', () => signature.isNotEmpty ? signature : '');
  try {
    return await post(baseApiUrl, ACCOUNT_CREATION_AUTH_URL, body: params);
  } catch (e) {
    return null;
  }
}