importWallet method

Future<TImportWalletResponse> importWallet({
  1. required TImportWalletBody input,
})

Import a wallet.

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

See also: stampImportWallet.

Implementation

Future<TImportWalletResponse> importWallet({
  required TImportWalletBody 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_WALLET',
  );
  return await request<Map<String, dynamic>, TImportWalletResponse>(
      "/public/v1/submit/import_wallet",
      body,
      (json) => TImportWalletResponse.fromJson(
          transformActivityResponse(json, 'ImportWallet')));
}