import { WriteDeployInfo } from "./types";
import { WalletTypes } from "locklift";

export class Logger {
  printDeployLog = (info: WriteDeployInfo) => {
    if (info.type === "Contract") {
      console.log(
        `Contract ${info.contractName} deployed, address: ${info.address}, deploymentName: ${info.deploymentName}`,
      );
    }
    if (info.type === "Account") {
      const walletType = info.createAccountParams?.type
        ? WalletTypes[info.createAccountParams.type]
        : "UnrecognizedWallet";

      console.log(
        `Account type ${walletType} deployed, address: ${info.address}, deploymentName: ${info.deploymentName}`,
      );
    }
  };

  printRetrievedLog = (info: { type: "Contract" | "Account"; address: string; deploymentName: string }) => {
    console.log(`${info.type} retrieved, address: ${info.address}, deploymentName: ${info.deploymentName}`);
  };
}
