import { Abi } from 'viem'; export type Prettify = { [K in keyof T]: T[K]; } & {}; export type GetFunctionName = Extract['name']; /** * Creates a new type by making the specified keys required while keeping the remaining keys optional. * * @template T - The original object type. * @template K - The keys in `T` that should be required in the resulting type. * * @example * type Original = { * a: number; * b: string; * c: boolean; * }; * * type RequiredAandB = RequireSome; * // Resulting type: * // { * // a: number; // Required * // b: string; // Required * // c?: boolean; // Optional * //} */ export type RequireSome = Prettify<{ [P in K]: T[P]; } & { [P in Exclude]?: T[P]; }>; /** * Creates a new type by excluding the specified keys from the original type. * * @template T - The original object type. * @template K - The keys in `T` that should be excluded from the resulting type. * * @example * type Original = { * a: number; * b: string; * c: boolean; * d: string; * }; * * type ExcludeD = ExcludeSome; * // Resulting type: * // { * // a: number; * // b: string; * // c: boolean; * //} */ export type ExcludeSome = Prettify<{ [P in Exclude]: T[P]; }>;