exportPrivateKey method

Future<TExportPrivateKeyResponse> exportPrivateKey({
  1. required TExportPrivateKeyBody input,
})

Export a private key.

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

See also: stampExportPrivateKey.

Implementation

Future<TExportPrivateKeyResponse> exportPrivateKey({
  required TExportPrivateKeyBody 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_EXPORT_PRIVATE_KEY',
  );
  return await request<Map<String, dynamic>, TExportPrivateKeyResponse>(
      "/public/v1/submit/export_private_key",
      body,
      (json) => TExportPrivateKeyResponse.fromJson(
          transformActivityResponse(json, 'ExportPrivateKey')));
}