import type { Abi } from 'viem';

/**
 * Helper function to ensure an imported ABI matches the viem Abi type at compile time
 * @param abi The ABI to validate
 * @returns The validated ABI
 */
export function validateAbi<T extends Abi>(abi: T): T {
  return abi;
}

/**
 * Helper function to ensure an imported contract ABI matches the viem Abi type at compile time
 * @param contract The contract with an abi property to validate
 * @returns The validated contract ABI
 */
export function validateContractAbi<T extends { abi: Abi }>(contract: T): T['abi'] {
  return contract.abi;
}
