diff --git a/.changeset/ethers-v6-connect.md b/.changeset/ethers-v6-connect.md new file mode 100644 index 000000000..08dcf9562 --- /dev/null +++ b/.changeset/ethers-v6-connect.md @@ -0,0 +1,5 @@ +--- +"@typechain/ethers-v6": patch +--- + +🐛 fix contract connect type diff --git a/packages/target-ethers-v6-test/types/v0.6.4/DataTypesInput.ts b/packages/target-ethers-v6-test/types/v0.6.4/DataTypesInput.ts index 8d311d0e0..964f3c7ad 100644 --- a/packages/target-ethers-v6-test/types/v0.6.4/DataTypesInput.ts +++ b/packages/target-ethers-v6-test/types/v0.6.4/DataTypesInput.ts @@ -362,7 +362,7 @@ export interface DataTypesInputInterface extends Interface { } export interface DataTypesInput extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.6.4/DataTypesPure.ts b/packages/target-ethers-v6-test/types/v0.6.4/DataTypesPure.ts index 26d06f7a2..7b1a3b2f9 100644 --- a/packages/target-ethers-v6-test/types/v0.6.4/DataTypesPure.ts +++ b/packages/target-ethers-v6-test/types/v0.6.4/DataTypesPure.ts @@ -138,7 +138,7 @@ export interface DataTypesPureInterface extends Interface { } export interface DataTypesPure extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.6.4/DataTypesView.ts b/packages/target-ethers-v6-test/types/v0.6.4/DataTypesView.ts index 8d42440aa..cfa377a6a 100644 --- a/packages/target-ethers-v6-test/types/v0.6.4/DataTypesView.ts +++ b/packages/target-ethers-v6-test/types/v0.6.4/DataTypesView.ts @@ -138,7 +138,7 @@ export interface DataTypesViewInterface extends Interface { } export interface DataTypesView extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.6.4/Events.ts b/packages/target-ethers-v6-test/types/v0.6.4/Events.ts index 9a91a3d7c..ffe90da78 100644 --- a/packages/target-ethers-v6-test/types/v0.6.4/Events.ts +++ b/packages/target-ethers-v6-test/types/v0.6.4/Events.ts @@ -201,7 +201,7 @@ export namespace UpdateFrequencySetEvent { } export interface Events extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.6.4/Issue428_Reproduction/A.ts b/packages/target-ethers-v6-test/types/v0.6.4/Issue428_Reproduction/A.ts index 4aab55fdb..07aedd282 100644 --- a/packages/target-ethers-v6-test/types/v0.6.4/Issue428_Reproduction/A.ts +++ b/packages/target-ethers-v6-test/types/v0.6.4/Issue428_Reproduction/A.ts @@ -36,7 +36,7 @@ export namespace CommittedEvent { } export interface A extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.6.4/Issue428_Reproduction/B.ts b/packages/target-ethers-v6-test/types/v0.6.4/Issue428_Reproduction/B.ts index 87beae044..6ad85f323 100644 --- a/packages/target-ethers-v6-test/types/v0.6.4/Issue428_Reproduction/B.ts +++ b/packages/target-ethers-v6-test/types/v0.6.4/Issue428_Reproduction/B.ts @@ -51,7 +51,7 @@ export namespace Committed_address_array_Event { } export interface B extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.6.4/Library/Lib.ts b/packages/target-ethers-v6-test/types/v0.6.4/Library/Lib.ts index 5c9136dcb..81bf8ef33 100644 --- a/packages/target-ethers-v6-test/types/v0.6.4/Library/Lib.ts +++ b/packages/target-ethers-v6-test/types/v0.6.4/Library/Lib.ts @@ -30,7 +30,7 @@ export interface LibInterface extends Interface { } export interface Lib extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.6.4/LibraryConsumer.ts b/packages/target-ethers-v6-test/types/v0.6.4/LibraryConsumer.ts index 5efd51b49..2f58f6e96 100644 --- a/packages/target-ethers-v6-test/types/v0.6.4/LibraryConsumer.ts +++ b/packages/target-ethers-v6-test/types/v0.6.4/LibraryConsumer.ts @@ -33,7 +33,7 @@ export interface LibraryConsumerInterface extends Interface { } export interface LibraryConsumer extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.6.4/Name-Mangling/NAME12mangling.ts b/packages/target-ethers-v6-test/types/v0.6.4/Name-Mangling/NAME12mangling.ts index 92f013d83..d9469dd78 100644 --- a/packages/target-ethers-v6-test/types/v0.6.4/Name-Mangling/NAME12mangling.ts +++ b/packages/target-ethers-v6-test/types/v0.6.4/Name-Mangling/NAME12mangling.ts @@ -31,7 +31,7 @@ export interface NAME12manglingInterface extends Interface { } export interface NAME12mangling extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.6.4/Overloads.ts b/packages/target-ethers-v6-test/types/v0.6.4/Overloads.ts index 7e719b643..806065300 100644 --- a/packages/target-ethers-v6-test/types/v0.6.4/Overloads.ts +++ b/packages/target-ethers-v6-test/types/v0.6.4/Overloads.ts @@ -46,7 +46,7 @@ export interface OverloadsInterface extends Interface { } export interface Overloads extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.6.4/Payable/Payable.ts b/packages/target-ethers-v6-test/types/v0.6.4/Payable/Payable.ts index d2d83cf4f..35bc4896c 100644 --- a/packages/target-ethers-v6-test/types/v0.6.4/Payable/Payable.ts +++ b/packages/target-ethers-v6-test/types/v0.6.4/Payable/Payable.ts @@ -45,7 +45,7 @@ export interface PayableInterface extends Interface { } export interface Payable extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.6.4/Payable/PayableFactory.ts b/packages/target-ethers-v6-test/types/v0.6.4/Payable/PayableFactory.ts index 57e5921bb..446aeedc5 100644 --- a/packages/target-ethers-v6-test/types/v0.6.4/Payable/PayableFactory.ts +++ b/packages/target-ethers-v6-test/types/v0.6.4/Payable/PayableFactory.ts @@ -32,7 +32,7 @@ export interface PayableFactoryInterface extends Interface { } export interface PayableFactory extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/ISimpleToken.ts b/packages/target-ethers-v6-test/types/v0.8.9/ISimpleToken.ts index 1a97488f2..c402ecaec 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/ISimpleToken.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/ISimpleToken.ts @@ -33,7 +33,7 @@ export interface ISimpleTokenInterface extends Interface { } export interface ISimpleToken extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/Issue552_Reproduction.ts b/packages/target-ethers-v6-test/types/v0.8.9/Issue552_Reproduction.ts index c3d34da05..f56483110 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/Issue552_Reproduction.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/Issue552_Reproduction.ts @@ -72,7 +72,7 @@ export interface Issue552_ReproductionInterface extends Interface { } export interface Issue552_Reproduction extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/KingOfTheHill/KingOfTheHill.ts b/packages/target-ethers-v6-test/types/v0.8.9/KingOfTheHill/KingOfTheHill.ts index 73ac6ddc4..fb5f12f92 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/KingOfTheHill/KingOfTheHill.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/KingOfTheHill/KingOfTheHill.ts @@ -64,7 +64,7 @@ export namespace HighestBidIncreasedEvent { } export interface KingOfTheHill extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/KingOfTheHill/Withdrawable.ts b/packages/target-ethers-v6-test/types/v0.8.9/KingOfTheHill/Withdrawable.ts index 65974dfcf..f43a0ce79 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/KingOfTheHill/Withdrawable.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/KingOfTheHill/Withdrawable.ts @@ -29,7 +29,7 @@ export interface WithdrawableInterface extends Interface { } export interface Withdrawable extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/Rarity/ERC721.ts b/packages/target-ethers-v6-test/types/v0.8.9/Rarity/ERC721.ts index 11da60f71..76c857cd3 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/Rarity/ERC721.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/Rarity/ERC721.ts @@ -166,7 +166,7 @@ export namespace TransferEvent { } export interface ERC721 extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/Rarity/ERC721Enumerable.ts b/packages/target-ethers-v6-test/types/v0.8.9/Rarity/ERC721Enumerable.ts index 460da25e5..089186eb2 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/Rarity/ERC721Enumerable.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/Rarity/ERC721Enumerable.ts @@ -193,7 +193,7 @@ export namespace TransferEvent { } export interface ERC721Enumerable extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/Rarity/IERC721.ts b/packages/target-ethers-v6-test/types/v0.8.9/Rarity/IERC721.ts index df5d3e6da..10768da13 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/Rarity/IERC721.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/Rarity/IERC721.ts @@ -166,7 +166,7 @@ export namespace TransferEvent { } export interface IERC721 extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/Rarity/IERC721Enumerable.ts b/packages/target-ethers-v6-test/types/v0.8.9/Rarity/IERC721Enumerable.ts index 8313d2c75..7dcdf7cfd 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/Rarity/IERC721Enumerable.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/Rarity/IERC721Enumerable.ts @@ -193,7 +193,7 @@ export namespace TransferEvent { } export interface IERC721Enumerable extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/Rarity/IERC721Receiver.ts b/packages/target-ethers-v6-test/types/v0.8.9/Rarity/IERC721Receiver.ts index d2ab8bc2c..75ba947e9 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/Rarity/IERC721Receiver.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/Rarity/IERC721Receiver.ts @@ -36,7 +36,7 @@ export interface IERC721ReceiverInterface extends Interface { } export interface IERC721Receiver extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/Rarity/Rarity.ts b/packages/target-ethers-v6-test/types/v0.8.9/Rarity/Rarity.ts index 6adf0b94b..4637092e0 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/Rarity/Rarity.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/Rarity/Rarity.ts @@ -312,7 +312,7 @@ export namespace summonedEvent { } export interface Rarity extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/SimpleToken.ts b/packages/target-ethers-v6-test/types/v0.8.9/SimpleToken.ts index 78eb67e08..228e422b4 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/SimpleToken.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/SimpleToken.ts @@ -33,7 +33,7 @@ export interface SimpleTokenInterface extends Interface { } export interface SimpleToken extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/nested/a/NestedLibrary.ts b/packages/target-ethers-v6-test/types/v0.8.9/nested/a/NestedLibrary.ts index 042ef3c71..5ad1d23b9 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/nested/a/NestedLibrary.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/nested/a/NestedLibrary.ts @@ -29,7 +29,7 @@ export interface NestedLibraryInterface extends Interface { } export interface NestedLibrary extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6-test/types/v0.8.9/nested/b/NestedLibrary.ts b/packages/target-ethers-v6-test/types/v0.8.9/nested/b/NestedLibrary.ts index 042ef3c71..5ad1d23b9 100644 --- a/packages/target-ethers-v6-test/types/v0.8.9/nested/b/NestedLibrary.ts +++ b/packages/target-ethers-v6-test/types/v0.8.9/nested/b/NestedLibrary.ts @@ -29,7 +29,7 @@ export interface NestedLibraryInterface extends Interface { } export interface NestedLibrary extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise; diff --git a/packages/target-ethers-v6/src/codegen/index.ts b/packages/target-ethers-v6/src/codegen/index.ts index bb7209f37..9d2f5b614 100644 --- a/packages/target-ethers-v6/src/codegen/index.ts +++ b/packages/target-ethers-v6/src/codegen/index.ts @@ -66,7 +66,7 @@ export function codegenContractTypings(contract: Contract, codegenConfig: Codege export interface ${contract.name} extends BaseContract { ${codegenConfig.discriminateTypes ? `contractName: '${contract.name}';\n` : ``} - connect(runner?: ContractRunner | null): BaseContract; + connect(runner?: ContractRunner | null): this; attach(addressOrName: AddressLike): this; deployed(): Promise;