diff --git a/packages/target-ethers-v6/README.md b/packages/target-ethers-v6/README.md index eec14c06c..2bf6e7bb1 100644 --- a/packages/target-ethers-v6/README.md +++ b/packages/target-ethers-v6/README.md @@ -3,7 +3,7 @@

TypeChain

TypeChain target Ethers-v6

-

🔌 TypeScript bindings for Ethers 5.x.x smartcontracts

+

🔌 TypeScript bindings for Ethers 6.x.x smartcontracts

Build Status @@ -17,8 +17,7 @@

-This package requires TypeScript >= 4.0. If you need support for earlier TS versions check out: 1.0 version of this -package. +This package requires TypeScript >= 4.7 and `moduleResolution` to be set as `node16` or `nodenext`. ## [TypeChain readme](https://github.com/ethereum-ts/TypeChain) @@ -27,10 +26,12 @@ package. The main files generated by this target are `.ts`. They declare typesafe interfaces for your contracts on top of ethers `Contract` instances: -- typed contract's methods, available both at `contract.someMethod(...)` and `contract.functions.someMethod(...)` +- typed contract's methods, available both at `contract.someMethod(...)`, `contract.someMethod.call(...)`, + `contract.someMethod.staticcall(...)` and `contract.someMethod.send(...)` - typed events in `contract.interface.events.AnEvent` and filters in `contract.filters.AnEvent` -- typed method gas estimates in `contract.estimateGas.someMethod` +- typed method gas estimates in `contract.someMethod.estimateGas(...)` - overrides for the event listener methods (`on`, `once`, etc) that return the same contract type. +- address argument types are `AddressLike`, meaning you can pass a signer or contract. Note: these are just _type declarations_ to help you call the blockchain properly, so they're not available at runtime, and all of the contracts are still instances of the same `Contract` class. @@ -53,7 +54,6 @@ so you can easily connect to a deployed instance without having to pass the ABI Suppose you have an `Erc20Token.sol` solidity interface and a `DummyToken.sol` contract implementing it. ```typescript -import { BigNumber } from 'ethers'; import { Wallet } from 'ethers'; import { DummyTokenFactory } from 'typechain-out-dir/DummyTokenFactory'; @@ -70,7 +70,7 @@ async function deployTestToken(ownerPK: string): Promise { // to call existing contracts, a factory for both the concrete contract and for the interface // can be used since the ABI is the same -async function getTokenBalance(walletAddress: string, tokenAddress: string): Promise { +async function getTokenBalance(walletAddress: string, tokenAddress: string): Promise { const token = Erc20TokenFactory.connect(tokenAddress, provider); return token.balanceOf(walletAddress); }