Skip to content

Typed Contracts is a TypeScript type library, to create contract types based on ABI data, without any code generation.

License

Notifications You must be signed in to change notification settings

DeepDoge/typed-contracts

Repository files navigation

Typed Contracts

Typed Contracts is a TypeScript type library, to create contract types based on ABI data, without any code generation.

Supports: ethers6

Install

Install Instructions

Usage

import { TypedContract } from "typed-contracts/types/ethers6"
import { Contract } from "ethers"

export type ERC20Contract = TypedContract<typeof ERC20_abi> & {}
export const ERC20_connect = (address: string, runner: ContractRunner) =>
	new Contract(address, ERC20_abi, runner) as ERC20Contract

export const ERC20_abi = [
	// ...
] as const