-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add nested library ABIs and copy them in compile-contracts * Preserve directory paths in abiParser::parse * Generate barrel files from paths * Generate types to nested directories * Stop emitting self-recursive import * Stop replacing underscores in generated identifiers * WIP: Multiple fixes * Change example target to @typechain/ethers-v5 * Remove ethers-v5 target from README * Remove ethers-v4 target * Fix reexports * Fix imports * Fix corrupt barrel reexport * Autofix * Run autofix * Fix input root detection with Hardhat * Run autofix * Add changeset * move path utils to `typechain` core package (#639) * Preserve paths web3 (#640) * Emit nested directory structures in Web3 v1 target * Update paths in web3-v1 tests * Fix case in import path * Remove merge conflict marker
- Loading branch information
Showing
150 changed files
with
1,161 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
'@typechain/hardhat': major | ||
'@typechain/ethers-v5': major | ||
'@typechain/web3-v1': major | ||
'typechain': major | ||
--- | ||
|
||
Directory tree in generated types now reflects the directory tree in the inputs. | ||
Also, only the main contract type is reexported from each file. | ||
|
||
This change solves a number of name clashing problems. | ||
All generated code can still be imported after updating the import path. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ | ||
{ | ||
"inputs": [], | ||
"name": "getValue", | ||
"outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], | ||
"stateMutability": "pure", | ||
"type": "function" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ | ||
{ | ||
"inputs": [], | ||
"name": "getValue", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "pure", | ||
"type": "function" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import { | ||
BaseContract, | ||
BigNumber, | ||
BytesLike, | ||
CallOverrides, | ||
ContractTransaction, | ||
Overrides, | ||
PopulatedTransaction, | ||
Signer, | ||
utils, | ||
} from 'ethers' | ||
import { FunctionFragment, Result, EventFragment } from '@ethersproject/abi' | ||
import { Listener, Provider } from '@ethersproject/providers' | ||
import { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from '../common' | ||
|
||
export interface CounterInterface extends utils.Interface { | ||
contractName: 'Counter' | ||
functions: { | ||
'countDown()': FunctionFragment | ||
'countUp()': FunctionFragment | ||
'getCount()': FunctionFragment | ||
} | ||
|
||
encodeFunctionData(functionFragment: 'countDown', values?: undefined): string | ||
encodeFunctionData(functionFragment: 'countUp', values?: undefined): string | ||
encodeFunctionData(functionFragment: 'getCount', values?: undefined): string | ||
|
||
decodeFunctionResult(functionFragment: 'countDown', data: BytesLike): Result | ||
decodeFunctionResult(functionFragment: 'countUp', data: BytesLike): Result | ||
decodeFunctionResult(functionFragment: 'getCount', data: BytesLike): Result | ||
|
||
events: { | ||
'CountedTo(uint256)': EventFragment | ||
} | ||
|
||
getEvent(nameOrSignatureOrTopic: 'CountedTo'): EventFragment | ||
} | ||
|
||
export type CountedToEvent = TypedEvent<[BigNumber], { number: BigNumber }> | ||
|
||
export type CountedToEventFilter = TypedEventFilter<CountedToEvent> | ||
|
||
export interface Counter extends BaseContract { | ||
contractName: 'Counter' | ||
connect(signerOrProvider: Signer | Provider | string): this | ||
attach(addressOrName: string): this | ||
deployed(): Promise<this> | ||
|
||
interface: CounterInterface | ||
|
||
queryFilter<TEvent extends TypedEvent>( | ||
event: TypedEventFilter<TEvent>, | ||
fromBlockOrBlockhash?: string | number | undefined, | ||
toBlock?: string | number | undefined, | ||
): Promise<Array<TEvent>> | ||
|
||
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>> | ||
listeners(eventName?: string): Array<Listener> | ||
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this | ||
removeAllListeners(eventName?: string): this | ||
off: OnEvent<this> | ||
on: OnEvent<this> | ||
once: OnEvent<this> | ||
removeListener: OnEvent<this> | ||
|
||
functions: { | ||
countDown(overrides?: Overrides & { from?: string | Promise<string> }): Promise<ContractTransaction> | ||
|
||
countUp(overrides?: Overrides & { from?: string | Promise<string> }): Promise<ContractTransaction> | ||
|
||
getCount(overrides?: CallOverrides): Promise<[BigNumber]> | ||
} | ||
|
||
countDown(overrides?: Overrides & { from?: string | Promise<string> }): Promise<ContractTransaction> | ||
|
||
countUp(overrides?: Overrides & { from?: string | Promise<string> }): Promise<ContractTransaction> | ||
|
||
getCount(overrides?: CallOverrides): Promise<BigNumber> | ||
|
||
callStatic: { | ||
countDown(overrides?: CallOverrides): Promise<BigNumber> | ||
|
||
countUp(overrides?: CallOverrides): Promise<BigNumber> | ||
|
||
getCount(overrides?: CallOverrides): Promise<BigNumber> | ||
} | ||
|
||
filters: { | ||
'CountedTo(uint256)'(number?: null): CountedToEventFilter | ||
CountedTo(number?: null): CountedToEventFilter | ||
} | ||
|
||
estimateGas: { | ||
countDown(overrides?: Overrides & { from?: string | Promise<string> }): Promise<BigNumber> | ||
|
||
countUp(overrides?: Overrides & { from?: string | Promise<string> }): Promise<BigNumber> | ||
|
||
getCount(overrides?: CallOverrides): Promise<BigNumber> | ||
} | ||
|
||
populateTransaction: { | ||
countDown(overrides?: Overrides & { from?: string | Promise<string> }): Promise<PopulatedTransaction> | ||
|
||
countUp(overrides?: Overrides & { from?: string | Promise<string> }): Promise<PopulatedTransaction> | ||
|
||
getCount(overrides?: CallOverrides): Promise<PopulatedTransaction> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export { Counter__factory } from "./Counter__factory"; | ||
export { Demo__factory } from "./Demo__factory"; | ||
export { StructsInConstructor__factory } from "./StructsInConstructor__factory"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...ardhat/test/fixture-projects/hardhat-project/typechain-types/artifacts/contracts/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import type * as lib from "./lib"; | ||
export type { lib }; | ||
export type { EdgeCases } from "./EdgeCases"; | ||
export type { TestContract } from "./TestContract"; | ||
export type { TestContract1 } from "./TestContract1"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...at/test/fixture-projects/hardhat-project/typechain-types/artifacts/contracts/lib/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export type { SafeMath } from "./SafeMath"; |
5 changes: 5 additions & 0 deletions
5
packages/hardhat/test/fixture-projects/hardhat-project/typechain-types/artifacts/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import type * as contracts from "./contracts"; | ||
export type { contracts }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
.../hardhat/test/fixture-projects/hardhat-project/typechain-types/externalArtifacts/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export type { ERC20 } from "./ERC20"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...t/fixture-projects/hardhat-project/typechain-types/factories/artifacts/contracts/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export * as lib from "./lib"; | ||
export { EdgeCases__factory } from "./EdgeCases__factory"; | ||
export { TestContract__factory } from "./TestContract__factory"; | ||
export { TestContract1__factory } from "./TestContract1__factory"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...xture-projects/hardhat-project/typechain-types/factories/artifacts/contracts/lib/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export { SafeMath__factory } from "./SafeMath__factory"; |
4 changes: 4 additions & 0 deletions
4
...ardhat/test/fixture-projects/hardhat-project/typechain-types/factories/artifacts/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export * as contracts from "./contracts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...est/fixture-projects/hardhat-project/typechain-types/factories/externalArtifacts/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export { ERC20__factory } from "./ERC20__factory"; |
5 changes: 5 additions & 0 deletions
5
packages/hardhat/test/fixture-projects/hardhat-project/typechain-types/factories/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export * as artifacts from "./artifacts"; | ||
export * as externalArtifacts from "./externalArtifacts"; |
Oops, something went wrong.