Skip to content

Commit

Permalink
add Prettify type helper locally (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 authored Sep 25, 2023
1 parent 44c5d50 commit 41b1671
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/nextjs/utils/scaffold-eth/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@ import {
} from "abitype";
import type { ExtractAbiFunctionNames } from "abitype";
import { Address, Log, TransactionReceipt } from "viem";
import { Prettify } from "viem/dist/types/types/utils";
import { UseContractEventConfig, UseContractReadConfig, UseContractWriteConfig } from "wagmi";
import contractsData from "~~/generated/deployedContracts";
import scaffoldConfig from "~~/scaffold.config";

/**
* @description Combines members of an intersection into a readable type.
* @example
* Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>
* => { a: string, b: string, c: number, d: bigint }
*/
type Prettify<T> = {
[K in keyof T]: T[K];
} & unknown;

export type GenericContractsDeclaration = {
[key: number]: readonly {
name: string;
Expand Down

0 comments on commit 41b1671

Please sign in to comment.