Skip to content

Commit

Permalink
Merge pull request #8 from gnosisguild/feat-typed-attach
Browse files Browse the repository at this point in the history
feat: typed `attach` return value
  • Loading branch information
jfschwarz authored Oct 29, 2024
2 parents 1319aa6 + 7b1013f commit 9a04ecf
Show file tree
Hide file tree
Showing 43 changed files with 152 additions and 14 deletions.
7 changes: 7 additions & 0 deletions .changeset/nasty-years-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@gnosis-guild/typechain-hardhat-test": patch
"@gnosis-guild/typechain-hardhat": patch
"@gnosis-guild/typechain-ethers-v6-test": patch
---

feat: typed `attach` return value
2 changes: 2 additions & 0 deletions examples/ethers-v6-nodenext/types/ethers-contracts/Dai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
BytesLike,
Expand Down Expand Up @@ -230,6 +231,7 @@ export namespace TransferEvent {

export interface Dai extends BaseContract {
connect(runner?: ContractRunner | null): Dai;
attach(target: string | Addressable): Dai;
waitForDeployment(): Promise<this>;

interface: DaiInterface;
Expand Down
2 changes: 2 additions & 0 deletions examples/ethers-v6/types/ethers-contracts/Dai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
BytesLike,
Expand Down Expand Up @@ -230,6 +231,7 @@ export namespace TransferEvent {

export interface Dai extends BaseContract {
connect(runner?: ContractRunner | null): Dai;
attach(target: string | Addressable): Dai;
waitForDeployment(): Promise<this>;

interface: DaiInterface;
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@
"@types/node"
]
}
}
}
},
"packageManager": "[email protected]+sha512.5d4bf97b349faf1a51318aa1ba887e99d9c36e203dbcb55938a91fddd2454246cb00723d6642f54d463a0f52a2701dadf8de002a37fc613c9cdc94ed5675ddce"
}
2 changes: 2 additions & 0 deletions packages/hardhat-test/typechain-types/Counter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
BytesLike,
Expand Down Expand Up @@ -52,6 +53,7 @@ export namespace CountedToEvent {

export interface Counter extends BaseContract {
connect(runner?: ContractRunner | null): Counter;
attach(target: string | Addressable): Counter;
waitForDeployment(): Promise<this>;

interface: CounterInterface;
Expand Down
2 changes: 2 additions & 0 deletions packages/hardhat-test/typechain-types/Demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
FunctionFragment,
Expand Down Expand Up @@ -37,6 +38,7 @@ export interface DemoInterface extends Interface {}

export interface Demo extends BaseContract {
connect(runner?: ContractRunner | null): Demo;
attach(target: string | Addressable): Demo;
waitForDeployment(): Promise<this>;

interface: DemoInterface;
Expand Down
2 changes: 2 additions & 0 deletions packages/hardhat-test/typechain-types/Directory/Hello.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
FunctionFragment,
Interface,
Expand All @@ -20,6 +21,7 @@ export interface HelloInterface extends Interface {}

export interface Hello extends BaseContract {
connect(runner?: ContractRunner | null): Hello;
attach(target: string | Addressable): Hello;
waitForDeployment(): Promise<this>;

interface: HelloInterface;
Expand Down
2 changes: 2 additions & 0 deletions packages/hardhat-test/typechain-types/StructsInConstructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
FunctionFragment,
Expand All @@ -28,6 +29,7 @@ export interface StructsInConstructorInterface extends Interface {}

export interface StructsInConstructor extends BaseContract {
connect(runner?: ContractRunner | null): StructsInConstructor;
attach(target: string | Addressable): StructsInConstructor;
waitForDeployment(): Promise<this>;

interface: StructsInConstructorInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
FunctionFragment,
Interface,
Expand All @@ -20,6 +21,7 @@ export interface EdgeCasesInterface extends Interface {}

export interface EdgeCases extends BaseContract {
connect(runner?: ContractRunner | null): EdgeCases;
attach(target: string | Addressable): EdgeCases;
waitForDeployment(): Promise<this>;

interface: EdgeCasesInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
FunctionFragment,
Interface,
Expand All @@ -20,6 +21,7 @@ export interface TestContractInterface extends Interface {}

export interface TestContract extends BaseContract {
connect(runner?: ContractRunner | null): TestContract;
attach(target: string | Addressable): TestContract;
waitForDeployment(): Promise<this>;

interface: TestContractInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
FunctionFragment,
Interface,
Expand All @@ -20,6 +21,7 @@ export interface TestContract1Interface extends Interface {}

export interface TestContract1 extends BaseContract {
connect(runner?: ContractRunner | null): TestContract1;
attach(target: string | Addressable): TestContract1;
waitForDeployment(): Promise<this>;

interface: TestContract1Interface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
BytesLike,
Expand Down Expand Up @@ -48,6 +49,7 @@ export interface SafeMathInterface extends Interface {

export interface SafeMath extends BaseContract {
connect(runner?: ContractRunner | null): SafeMath;
attach(target: string | Addressable): SafeMath;
waitForDeployment(): Promise<this>;

interface: SafeMathInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
BytesLike,
Expand Down Expand Up @@ -140,6 +141,7 @@ export namespace TransferEvent {

export interface ERC20 extends BaseContract {
connect(runner?: ContractRunner | null): ERC20;
attach(target: string | Addressable): ERC20;
waitForDeployment(): Promise<this>;

interface: ERC20Interface;
Expand Down
2 changes: 1 addition & 1 deletion packages/target-ethers-v6-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"typechain": "workspace:^8.3.2"
},
"dependencies": {
"ethers": "6.1.0"
"ethers": "6.13.4"
}
}
2 changes: 2 additions & 0 deletions packages/target-ethers-v6-test/types/v0.6.4/DataTypesInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
BytesLike,
Expand Down Expand Up @@ -400,6 +401,7 @@ export namespace event_struct_2Event {

export interface DataTypesInput extends BaseContract {
connect(runner?: ContractRunner | null): DataTypesInput;
attach(target: string | Addressable): DataTypesInput;
waitForDeployment(): Promise<this>;

interface: DataTypesInputInterface;
Expand Down
2 changes: 2 additions & 0 deletions packages/target-ethers-v6-test/types/v0.6.4/DataTypesPure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
BytesLike,
Expand Down Expand Up @@ -138,6 +139,7 @@ export interface DataTypesPureInterface extends Interface {

export interface DataTypesPure extends BaseContract {
connect(runner?: ContractRunner | null): DataTypesPure;
attach(target: string | Addressable): DataTypesPure;
waitForDeployment(): Promise<this>;

interface: DataTypesPureInterface;
Expand Down
2 changes: 2 additions & 0 deletions packages/target-ethers-v6-test/types/v0.6.4/DataTypesView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
BytesLike,
Expand Down Expand Up @@ -138,6 +139,7 @@ export interface DataTypesViewInterface extends Interface {

export interface DataTypesView extends BaseContract {
connect(runner?: ContractRunner | null): DataTypesView;
attach(target: string | Addressable): DataTypesView;
waitForDeployment(): Promise<this>;

interface: DataTypesViewInterface;
Expand Down
2 changes: 2 additions & 0 deletions packages/target-ethers-v6-test/types/v0.6.4/Events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
BytesLike,
Expand Down Expand Up @@ -228,6 +229,7 @@ export namespace UpdateFrequencySetEvent {

export interface Events extends BaseContract {
connect(runner?: ContractRunner | null): Events;
attach(target: string | Addressable): Events;
waitForDeployment(): Promise<this>;

interface: EventsInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
FunctionFragment,
Interface,
Expand Down Expand Up @@ -37,6 +38,7 @@ export namespace CommittedEvent {

export interface A extends BaseContract {
connect(runner?: ContractRunner | null): A;
attach(target: string | Addressable): A;
waitForDeployment(): Promise<this>;

interface: AInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
FunctionFragment,
Expand Down Expand Up @@ -52,6 +53,7 @@ export namespace Committed_address_array_Event {

export interface B extends BaseContract {
connect(runner?: ContractRunner | null): B;
attach(target: string | Addressable): B;
waitForDeployment(): Promise<this>;

interface: BInterface;
Expand Down
2 changes: 2 additions & 0 deletions packages/target-ethers-v6-test/types/v0.6.4/Library/Lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
BytesLike,
Expand Down Expand Up @@ -30,6 +31,7 @@ export interface LibInterface extends Interface {

export interface Lib extends BaseContract {
connect(runner?: ContractRunner | null): Lib;
attach(target: string | Addressable): Lib;
waitForDeployment(): Promise<this>;

interface: LibInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
BytesLike,
Expand Down Expand Up @@ -33,6 +34,7 @@ export interface LibraryConsumerInterface extends Interface {

export interface LibraryConsumer extends BaseContract {
connect(runner?: ContractRunner | null): LibraryConsumer;
attach(target: string | Addressable): LibraryConsumer;
waitForDeployment(): Promise<this>;

interface: LibraryConsumerInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BytesLike,
FunctionFragment,
Expand Down Expand Up @@ -31,6 +32,7 @@ export interface NAME12manglingInterface extends Interface {

export interface NAME12mangling extends BaseContract {
connect(runner?: ContractRunner | null): NAME12mangling;
attach(target: string | Addressable): NAME12mangling;
waitForDeployment(): Promise<this>;

interface: NAME12manglingInterface;
Expand Down
2 changes: 2 additions & 0 deletions packages/target-ethers-v6-test/types/v0.6.4/Overloads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BigNumberish,
BytesLike,
Expand Down Expand Up @@ -46,6 +47,7 @@ export interface OverloadsInterface extends Interface {

export interface Overloads extends BaseContract {
connect(runner?: ContractRunner | null): Overloads;
attach(target: string | Addressable): Overloads;
waitForDeployment(): Promise<this>;

interface: OverloadsInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BytesLike,
FunctionFragment,
Expand Down Expand Up @@ -45,6 +46,7 @@ export interface PayableInterface extends Interface {

export interface Payable extends BaseContract {
connect(runner?: ContractRunner | null): Payable;
attach(target: string | Addressable): Payable;
waitForDeployment(): Promise<this>;

interface: PayableInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* tslint:disable */
/* eslint-disable */
import type {
Addressable,
BaseContract,
BytesLike,
FunctionFragment,
Expand Down Expand Up @@ -32,6 +33,7 @@ export interface PayableFactoryInterface extends Interface {

export interface PayableFactory extends BaseContract {
connect(runner?: ContractRunner | null): PayableFactory;
attach(target: string | Addressable): PayableFactory;
waitForDeployment(): Promise<this>;

interface: PayableFactoryInterface;
Expand Down
Loading

0 comments on commit 9a04ecf

Please sign in to comment.