Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ethers-v6-runner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@typechain/ethers-v6": patch
---

fix import type ContractRunner
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type { Dai, DaiInterface } from "../Dai";

const _abi = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
DataTypesInput,
DataTypesInputInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
DataTypesPure,
DataTypesPureInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
DataTypesView,
DataTypesViewInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type { Events, EventsInterface } from "../../v0.6.4/Events";

const _abi = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type { A, AInterface } from "../../../v0.6.4/Issue428_Reproduction/A";

const _abi = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type { B, BInterface } from "../../../v0.6.4/Issue428_Reproduction/B";

const _abi = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type { Lib, LibInterface } from "../../../v0.6.4/Library/Lib";

const _abi = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
LibraryConsumer,
LibraryConsumerInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
NAME12mangling,
NAME12manglingInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type { Overloads, OverloadsInterface } from "../../v0.6.4/Overloads";

const _abi = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
PayableFactory,
PayableFactoryInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
Payable,
PayableInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
ISimpleToken,
ISimpleTokenInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
Issue552_Reproduction,
Issue552_ReproductionInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
KingOfTheHill,
KingOfTheHillInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
Withdrawable,
WithdrawableInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
ERC721Enumerable,
ERC721EnumerableInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type { ERC721, ERC721Interface } from "../../../v0.8.9/Rarity/ERC721";

const _abi = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
IERC721Enumerable,
IERC721EnumerableInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
IERC721Receiver,
IERC721ReceiverInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type { IERC721, IERC721Interface } from "../../../v0.8.9/Rarity/IERC721";

const _abi = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type { Rarity, RarityInterface } from "../../../v0.8.9/Rarity/Rarity";

const _abi = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
SimpleToken,
SimpleTokenInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
NestedLibrary,
NestedLibraryInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
import type {
NestedLibrary,
NestedLibraryInterface,
Expand Down
12 changes: 7 additions & 5 deletions packages/target-ethers-v6/src/codegen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function codegenContractTypings(contract: Contract, codegenConfig: Codege


getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;

${values(contract.functions)
.flatMap((v) => processDeclaration(v, alwaysGenerateOverloads, generateGetFunctionForContract))
.join('\n')}
Expand Down Expand Up @@ -188,14 +188,16 @@ export function codegenContractFactory(
createImportsForUsedIdentifiers(
{
ethers: [
'Signer',
'Contract',
'ContractFactory',
'ContractTransactionResponse',
'Interface',
],
'type ethers': [
'Signer',
'BytesLike',
'BigNumberish',
'Overrides',
'ContractTransactionResponse',
'Interface',
'AddressLike',
'ContractDeployTransaction',
'Provider',
Expand All @@ -214,7 +216,7 @@ export function codegenContractFactory(
export function codegenAbstractContractFactory(contract: Contract, abi: any): string {
const { body, header } = codegenCommonContractFactory(contract, abi)
return `
import { Contract, Interface, ContractRunner } from "ethers";
import { Contract, Interface, type ContractRunner } from "ethers";
${header}

export class ${contract.name}${FACTORY_POSTFIX} {
Expand Down