importPrivateKey method

Future<TImportPrivateKeyResponse> importPrivateKey({
  1. required TImportPrivateKeyBody input,
})

Import a private key.

Sign the provided TImportPrivateKeyBody with the client's stamp function and submit the request (POST /public/v1/submit/import_private_key).

See also: stampImportPrivateKey.

Implementation

Future<TImportPrivateKeyResponse> importPrivateKey({
  required TImportPrivateKeyBody input,
}) async {
  final body = packActivityBody(
    bodyJson: input.toJson(),
    fallbackOrganizationId: input.organizationId ??
        config.organizationId ??
        (throw Exception(
            "Missing organization ID, please pass in a sub-organizationId or instantiate the client with one.")),
    activityType: 'ACTIVITY_TYPE_IMPORT_PRIVATE_KEY',
  );
  return await request<Map<String, dynamic>, TImportPrivateKeyResponse>(
      "/public/v1/submit/import_private_key",
      body,
      (json) => TImportPrivateKeyResponse.fromJson(
          transformActivityResponse(json, 'ImportPrivateKey')));
}