- 13d6426: feat: add support for typescript v5
- 083dea0: Fix clashes with built-in contract properties
- Updated dependencies [3469800]
- Updated dependencies [9107713]
- c4720b9: fix tuples in event signatures and also arrays of tuples in functions
- Updated dependencies [c4720b9]
- Updated dependencies [cd4bb0f]
- 3eb6ed6: Removes PromiseOrValue
- 15541e4: Support for
nodenext
style import paths with new CLI flag:--node16-modules
- Updated dependencies [15541e4]
- 5b0759d: Remove obsolete peer dependency
@ethersproject/bytes@^5.0.0
fromtarget-ethers-v5
- a036651: Fix for unused type in new ethers-v5 codegen
- 31e6957: Add const assertion for exported ABI
- Updated dependencies [bbc9656]
- 015abb2: Added support for inputs wrapped in promise for ethers-v5 target.
- Updated dependencies [63691c4]
-
3a8a99a: 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.
-
978490f: ## What's breaking:
We are not emitting
contractName
fields on contracts and factories anymore.contractName
breaks polymorphism for example: exact token implementation is not assignable to token interface.We are adding optional flag
--discriminate-types
to continue emittingcontractName
.
-
d86d048: The method overloads for:
getEvent getFunction decodeFunctionResult encodeFunctionData
follow these rules:
• If these entities are not overloaded in the contract ABI and
--always-generate-overloads
is off, just the entities' names are used (without the signature) • If the entities are overloaded, only signatures are used to disambiguate them • If--always-generate-overloads
is on, additional overloads are generated for functions that are not ambiguous • For the method and event names in the events and functions properties only signature names are used (that's according to the ethers API - they don't use shorthand naming). -
e447bfb: Added optional
config.inputDir
property and--input-dir
flag to control directory structure in generated types. If not set, it's inferred as lowest common path of all ABI files. -
a59ae6e: Prefer
import type
in generated files when possible -
47ab651: For every event, TypeChain now emits an interface with its named properties.
Before
export type ApprovalEvent = TypedEvent< [string, string, BigNumber], { owner: string; approved: string; tokenId: BigNumber } >
After
export interface ApprovalEventObject { owner: string approved: string tokenId: BigNumber } export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>
-
2395289: ContractFactory subclasses now use explicit "override" modifiers.
TypeScript version 4.3 or newer is now required.
-
975a9dc: Fix type generation for arrays of nested structs ex:
GovernanceMessage.Call[][] calldata _remoteCalls
.Fix structs parser in typechain package. Now only struct tuples are registered.
-
Updated dependencies [3a8a99a]
-
Updated dependencies [5b9a7fb]
-
Updated dependencies [e447bfb]
-
Updated dependencies [978490f]
-
Updated dependencies [a59ae6e]
-
Updated dependencies [975a9dc]
-
Updated dependencies [e1f832c]
- 92939ea: Structs will be namespaced using contract name when available
- c2b7c3c: Added support descrimnated unions to contracts generated by typechain
-
f22f962: Events with multiple positional parameters no longer get "undefined" as argument in
contract.filters
. -
d244e41: Fix event name generation for events with arrays
-
Updated dependencies [92939ea]
-
Updated dependencies [d244e41]
- 8f7144c: Constant size with length greater than 4 no longer emit as TypeScript tuples.
- a26ea50: Constant size struct arrays are now properly supported and don't cause malformed TS emit anymore.
- Updated dependencies [a26ea50]
- a0fba00: Ethers V5 target doesn't emit unused imports anymore.
- Updated dependencies [a0fba00]
- ba4c18a: Fix support for constructors with structs
- b989dff: Fix structs generated as arrays
- 5c217a6: Changed emitted event types — named events are now used in Contract methods.
- 0e555af: Generate types to
.ts
files instead of.d.ts
in Ethers v5 and Web3.js targets
-
95517e9: Add support for Solidity structs
// before function deposit(amount: { token: string; value: BigNumberish }): Promise<ContractTransaction> // after export type AmountStruct = { token: string; value: BigNumberish } function deposit(amount: AmountStruct): Promise<ContractTransaction>
- a0b3c4b: Custom generated factories do not require signers now
- aacdcb0: Export EventFilter type along with Event type
- Updated dependencies [0ac4921]
- Updated dependencies [95517e9]
- Updated dependencies [33ee803]
- ed871ca: Fix contract interface functions name for tuples
-
c93a1e7: Fixed generated contract factory constructors to accept 3 parameters when called from ContractFactory methods (
this.constructor(interface, bytecode, signer)
).Fixes dethcrypto#487
- e6bd016: Fix typing for
getContractAt
when using Hardhat
- 7f57ff8: Support typings for
getContractAt
when using Hardhat
- e4edd2c: Export typed events
- 46dcd66: Support nameless arguments in constructors
- 021e959: Expose ABI, bytecode, and contract interface in factories
- d590f88: Make filter parameters optional
- bc4539a: Generated types now extend new
BaseContract
notContract
from ethers. This removes all index signatures and makes calling a non-existing function a compile-time error. - Updated dependencies [d60a343]
- Updated dependencies [5a60d00]
- Updated dependencies [d60a343]
- 833b7ea: Avoid generating reexports for duplicated contracts
- 743a600: Fix code generation for events with tuples
- 8528c8f: Allow passing
from
as part of the overrides to contract call - 5a1cb26: Prefer imports from
ethers
namespace to avoid mixing incompatible versions
- ffc67f2: Fix "unused type parameter" ts error
- 9ab1929: Fix code generation for events without any args
-
cd73777: Improve typings for events. Generate types for
queryFilter
for events.Note: This is a breaking change as it requires using TypeScript >= 4.0.0 (previously 3.9 was fine.)
Example:
const filter = contract.filters.Transfer() // TypedEventFilter<> const result = await contract.queryFilter(filter) // TypedEvent<> result[0].args.from // type support for named event parameters result[0].args[0] // type support by index contract.on(filter, (from, to, value, event) => { from // string to // string value // BigNumber event // TypedEvent<> })
-
0d4b293: Changed return type of functions from a object with number indexes, to an array merged with object containing named outputs.
Before, solidity function like this:
function x() public pure returns (uint256)
Generated such method signature:
x(overrides?: CallOverrides): Promise<{0: BigNumber}>;
New output is:
x(overrides?: CallOverrides): Promise<[BigNumber]>;
The difference is that now you can use standard array destructuring while working with output types.
- db5baa5: Do not generate typings in contract type itself for reserved keywords that would collide with ethers internals