import type { UNWallet } from '../../types/shared/wallet.types';
import { UnitComponentsSDK } from '../../unitComponentsSdkManager/UnitComponentsSdkManager';

export const launchStartCardProvisioning = async (wallet: UNWallet | null) => {
  const pushProvisioningModule = UnitComponentsSDK.getPushProvisionModule();
  if (!pushProvisioningModule) return;

  try {
    const response = await pushProvisioningModule.launchStartCardProvisioning(
      JSON.stringify({
        walletCode: wallet?.code,
        walletName: wallet?.name,
      }));
    return response;
  } catch (error) {
    console.log('ERROR -pushProvisioningModule.launchStartCardProvisioning: ', error);
  }
};
